Repository navigation
Removed unused post analytics view - #30135
Conversation
no ref Newsletter analytics has rendered directly since it was promoted from alpha. The later dead-code cleanup deleted the component's sole importer but left this file behind.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe pull request deletes Possibly related PRs
Merge Risk: ⚪ Minimal · up to This removes an unused analytics component without changing live behavior, and the supplied checks pass; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ 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 |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 7m 4s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin |
✅ Succeeded | 2m 26s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | <1s | View ↗ |
nx run-many -t lint -p @tryghost/admin,ghost-mo... |
✅ Succeeded | 2s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 4s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-08-20 07:26:28 UTC

no refs
Evidence that the component is unused
PostAnalyticsViewis not exported by the private Admin package, and repository-wide searches for both its symbol and module path find no importer. Admin-only Knip reportedapps/admin/src/posts/analytics/components/post-analytics-view.tsxas an unused file before this removal and stopped reporting it afterward. The Admin build uses explicit routes and entry points; no dynamic import or glob references this path.History and intentionality
Documented facts:
withFeatureFlagwrapper. Fixed Post Analytics > Newsletter tab premature redirect #23270 documents that the wrapper prevented the Newsletter tab from redirecting before the alpha setting had loaded, and explicitly called the duplication temporary.trafficAnalyticsselected beta users, whiletrafficAnalyticsAlphaselected features still under development for that beta.Newsletterroute and made the sidebar links unconditional; Moved Newsletter tab out of alpha for Stats and Posts #23294 states that purpose directly. Production therefore stopped reaching the wrapper, and consequentlyPostAnalyticsView, on May 12, 2025. Given the documented flag semantics, this was an intentional promotion to the analytics beta rather than an accidental bypass.Inference: leaving
PostAnalyticsViewbehind in that last cleanup was an incomplete leaf cleanup. No historical source explicitly describes the omission, but the dead-code PR's stated intent, the current zero-reference result, and Knip's independent unused-file report support that conclusion.Removal
Deleted the 33-line orphaned component. It had no dedicated tests, export, dependency, configuration, or documentation to remove. Its
EmptyStatViewandPostAnalyticsContentdependencies remain used by live analytics screens.Verification
pnpm exec knip --workspace @tryghost/admin --include files --reporter compact --no-progress(the removed file is absent; four pre-existing acceptance setup/config entries remain)pnpm --dir apps/admin lintpnpm --dir apps/admin typecheckpnpm --dir apps/admin test:unit(135 files, 1,604 tests)pnpm nx run @tryghost/admin:buildpnpm nx run-many -t test --exclude @tryghost/e2e --exclude ghost-admin --exclude @tryghost/koenig-lexical(35 projects, including 8,000 Ghost tests)pnpm checkcompleted repository-wide lint and documentation checks, but its aggregate test phase could not run Koenig Lexical's browser suite in this environment: Chromium was denied Mach port registration and the configured Firefox executable is absent. The broader test run above excludes only that environment-blocked package and passed.