fix(settings): keep 'Back to app' working after switching environment tabs#2636
Merged
Merged
Conversation
Switching between the Local and Cloud tabs in environment settings pushed a new router history entry each time. "Back to app" calls history.back(), so it stepped back through the visited tabs instead of leaving settings. Switch the tab navigation to replace: true, matching how the settings sidebar already navigates between categories, so a single history.back() exits settings. Generated-By: PostHog Code Task-Id: faa3de4d-5e63-492e-8023-2bb7815b2af5
|
React Doctor could not complete this scan.
Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "fix(settings): don't pile up history whe..." | Re-trigger Greptile |
charlesvien
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In settings → Environments, tapping the Local/Cloud tabs and then "Back to app" doesn't return you to the app — it walks back through the tab history you visited, one
history.back()at a time.Each tab switch pushed a new router history entry, while "Back to app" is just a single
history.back(). The settings sidebar already avoids this by navigating withreplace: true; the environment tabs didn't.Changes
Switch the Local/Cloud tab navigation in
EnvironmentsSettingsto usereplace: true, matching the settings sidebar. Now switching tabs no longer accumulates history entries, so "Back to app" leaves settings in one step.How did you test this?
Not tested locally —
node_modulesisn't installed in this environment so typecheck/tests couldn't run. The change uses the existing, already-typedoptionsparameter onnavigateToSettings.Automatic notifications
Created with PostHog Code from a Slack thread