Skip to content

Fix post analytics member filter back navigation#28252

Merged
jonatansberg merged 1 commit into
mainfrom
codex/ber-3534-post-analytics-members-back
May 29, 2026
Merged

Fix post analytics member filter back navigation#28252
jonatansberg merged 1 commit into
mainfrom
codex/ber-3534-post-analytics-members-back

Conversation

@jonatansberg
Copy link
Copy Markdown
Member

Summary

  • Removed the crossApp navigation flag from the Growth analytics member drilldown links.
  • Kept the existing members filter URL builder, but lets the admin router handle this as a normal in-app navigation.

Context

The post analytics Growth view and members list are both handled by the admin router. Marking the drilldown as crossApp caused 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

  • Pre-commit hook ran pnpm --dir 'apps/posts' exec eslint --cache -- 'src/views/PostAnalytics/Growth/growth.tsx'.
  • Seeded local member attribution data and verified the Growth -> filtered members -> Back flow locally.
  • Attempted COREPACK_ENABLE_PROJECT_SPEC=0 pnpm --filter @tryghost/posts lint; current local node_modules could not resolve @typescript-eslint/eslint-plugin.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 74b68e46-526d-4ce5-888c-a020a5339acc

📥 Commits

Reviewing files that changed from the base of the PR and between e854a6f and 3f73612.

📒 Files selected for processing (1)
  • apps/posts/src/views/PostAnalytics/Growth/growth.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/posts/src/views/PostAnalytics/Growth/growth.tsx

Walkthrough

The navigateToMembers helper in the Growth analytics view was changed to call navigate(buildMembersUrl({filter})) without supplying the {crossApp: true} option, allowing the router to use default navigation behavior when opening the members route.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing the crossApp navigation flag to fix back navigation in post analytics member filtering.
Description check ✅ Passed The description is directly related to the changeset, explaining the context, reason for the change, and testing performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ber-3534-post-analytics-members-back

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jonatansberg jonatansberg marked this pull request as ready for review May 29, 2026 13:02
@jonatansberg jonatansberg force-pushed the codex/ber-3534-post-analytics-members-back branch from e854a6f to f5ac3d0 Compare May 29, 2026 13:03
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.
@jonatansberg jonatansberg reopened this May 29, 2026
@jonatansberg jonatansberg marked this pull request as draft May 29, 2026 13:08
@jonatansberg jonatansberg changed the title [codex] Fix post analytics member filter back navigation Fix post analytics member filter back navigation May 29, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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}));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@jonatansberg jonatansberg marked this pull request as ready for review May 29, 2026 13:11
@jonatansberg jonatansberg enabled auto-merge (squash) May 29, 2026 13:12
@jonatansberg jonatansberg merged commit be593a3 into main May 29, 2026
48 checks passed
@jonatansberg jonatansberg deleted the codex/ber-3534-post-analytics-members-back branch May 29, 2026 13:30
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.

1 participant