Skip to content

fix(settings): use replace navigation to skip settings route when viewing usage#3240

Merged
MattPua merged 1 commit into
mainfrom
posthog-code/fix-usage-and-pricing-navigation-issue
Jul 7, 2026
Merged

fix(settings): use replace navigation to skip settings route when viewing usage#3240
MattPua merged 1 commit into
mainfrom
posthog-code/fix-usage-and-pricing-navigation-issue

Conversation

@MattPua

@MattPua MattPua commented Jul 7, 2026

Copy link
Copy Markdown
Member

Problem

Clicking "View usage & spend analysis" in settings dumped you on the new-task chat input instead of the usage page.

The button called closeSettings() (async history.back()) then navigateToUsage(). The back-navigation won the race and landed on the previous route.

Changes

  • navigateToUsage() takes an optional replace flag.
  • Button now resets the settings store and navigates to /usage with replace: true, so back from /usage still skips settings, with no racing history.back().

How did you test this?

  • pnpm --filter @posthog/ui typecheck + biome lint pass.

Automatic notifications

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

Created with PostHog Code

@trunk-io

trunk-io Bot commented Jul 7, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 5903846.

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(settings): use replace navigation to..." | Re-trigger Greptile

@MattPua MattPua added the Stamphog This will request an autostamp by stamphog on small changes label Jul 7, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial navigation fix — adds an optional replace flag to avoid leaving the settings route in history. No business logic, data model, or API changes.

@MattPua MattPua enabled auto-merge (squash) July 7, 2026 16:39
@MattPua MattPua merged commit d666152 into main Jul 7, 2026
24 checks passed
@MattPua MattPua deleted the posthog-code/fix-usage-and-pricing-navigation-issue branch July 7, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant