Fix post analytics member filter back navigation#28252
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
e854a6f to
f5ac3d0
Compare
fixes https://linear.app/ghost/issue/BER-3534/issue-when-navigating-back-to-post-analytics-from-filtered-member-view The Growth member drilldown was marked as a cross-app navigation even though the members route is handled by the same admin router, causing URL normalization to add an extra history entry before returning to analytics.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f73612805
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const {appSettings} = useAppContext(); | ||
| const navigate = useNavigate(); | ||
| const navigateToMembers = (filter: string) => navigate(buildMembersUrl({filter}), {crossApp: true}); | ||
| const navigateToMembers = (filter: string) => navigate(buildMembersUrl({filter})); |
There was a problem hiding this comment.
Restore cross-app navigation for standalone posts app
When this Growth view is rendered through the @tryghost/posts AdminXApp, it uses the package-local router from apps/posts/src/app.tsx; that route table in apps/posts/src/routes.tsx does not define /members, only post analytics/tags/comments/automations plus a catch-all. Dropping crossApp makes useNavigate handle /members?... inside that local router, so clicking “View members” from Growth in the standalone/Ember-loaded posts app lands on the error route instead of delegating the members URL to the outer admin router.
Useful? React with 👍 / 👎.
Summary
crossAppnavigation flag from the Growth analytics member drilldown links.Context
The post analytics Growth view and members list are both handled by the admin router. Marking the drilldown as
crossAppcaused the members URL to be normalized into an extra browser history entry, so the first Back press only changed the filter encoding and the second Back press returned to post analytics.fixes https://linear.app/ghost/issue/BER-3534/issue-when-navigating-back-to-post-analytics-from-filtered-member-view
Testing
pnpm --dir 'apps/posts' exec eslint --cache -- 'src/views/PostAnalytics/Growth/growth.tsx'.COREPACK_ENABLE_PROJECT_SPEC=0 pnpm --filter @tryghost/posts lint; current localnode_modulescould not resolve@typescript-eslint/eslint-plugin.