Skip to content

fix(settings): keep 'Back to app' working after switching environment tabs#2636

Merged
charlesvien merged 1 commit into
mainfrom
posthog-code/settings-back-to-app-tab-history
Jun 12, 2026
Merged

fix(settings): keep 'Back to app' working after switching environment tabs#2636
charlesvien merged 1 commit into
mainfrom
posthog-code/settings-back-to-app-tab-history

Conversation

@mayteio

@mayteio mayteio commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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 with replace: true; the environment tabs didn't.

Changes

Switch the Local/Cloud tab navigation in EnvironmentsSettings to use replace: 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_modules isn't installed in this environment so typecheck/tests couldn't run. The change uses the existing, already-typed options parameter on navigateToSettings.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code from a Slack thread

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
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

React Doctor could not complete this scan.

No React dependency found in /tmp/react-doctor-baseline-COr2tH/package.json. Add "react" to dependencies (or peerDependencies) and re-run.

Reviewed by React Doctor for commit af33658.

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(settings): don't pile up history whe..." | Re-trigger Greptile

@mayteio mayteio requested a review from a team June 12, 2026 12:27
@mayteio mayteio marked this pull request as ready for review June 12, 2026 12:39
@charlesvien charlesvien merged commit 3cf447a into main Jun 12, 2026
24 checks passed
@charlesvien charlesvien deleted the posthog-code/settings-back-to-app-tab-history branch June 12, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants