Repository navigation
Moved Newsletter tab out of alpha for Stats and Posts - #23294
Conversation
no ref Removed feature flag for listing these tabs in the Stats and Posts apps.
WalkthroughThe changes across multiple files remove feature flag checks that previously controlled the visibility and access to "Newsletter" or "Newsletters" analytics features. Code responsible for importing and using feature flag logic, such as higher-order components and conditional rendering based on the Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
apps/posts/src/views/PostAnalytics/components/Sidebar.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-react-hooks". (The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "/apps/posts".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-react-hooks" was referenced from the config file in "apps/posts/.eslintrc.cjs". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. apps/stats/src/routes.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-react-hooks". (The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "/apps/stats".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-react-hooks" was referenced from the config file in "apps/stats/.eslintrc.cjs". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. apps/posts/src/routes.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-react-hooks". (The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "/apps/posts".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-react-hooks" was referenced from the config file in "apps/posts/.eslintrc.cjs". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (4)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
no refs ## Evidence that the component is unused `PostAnalyticsView` is not exported by the private Admin package, and repository-wide searches for both its symbol and module path find no importer. Admin-only Knip reported `apps/admin/src/posts/analytics/components/post-analytics-view.tsx` as 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: - ad52284 introduced the component as the loading/empty/content wrapper in the first React post-analytics skeleton. #22978 explains that the work began a better breakdown of post statistics, initially focused on web analytics for one post. - 54d993b replaced that static wrapper in the main page with real post and traffic data. #22986 says this made the previously static skeleton usable for beta users. - 26de9ed later reused the component only as the loading screen for a duplicated `withFeatureFlag` wrapper. #23270 documents that the wrapper prevented the Newsletter tab from redirecting before the alpha setting had loaded, and explicitly called the duplication temporary. - #23029 documents the rollout model: `trafficAnalytics` selected beta users, while `trafficAnalyticsAlpha` selected features still under development for that beta. - f0a33b8 intentionally moved Newsletter analytics out of alpha. Its diff replaced the protected route with the direct `Newsletter` route and made the sidebar links unconditional; #23294 states that purpose directly. Production therefore stopped reaching the wrapper, and consequently `PostAnalyticsView`, on May 12, 2025. Given the documented flag semantics, this was an intentional promotion to the analytics beta rather than an accidental bypass. - fb0790b later restored the alpha flag for other design work but did not restore Newsletter's route guard, corroborating that Newsletter's promotion was deliberate. - 566f8a9 removed the now-unreachable wrapper and its tests. #29686 identifies those files as duplicated dead code with no live importers. That deletion removed the component's last source or test importer on July 30, 2026. Inference: leaving `PostAnalyticsView` behind 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 `EmptyStatView` and `PostAnalyticsContent` dependencies 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 lint` - `pnpm --dir apps/admin typecheck` - `pnpm --dir apps/admin test:unit` (135 files, 1,604 tests) - `pnpm nx run @tryghost/admin:build` - `pnpm nx run-many -t test --exclude @tryghost/e2e --exclude ghost-admin --exclude @tryghost/koenig-lexical` (35 projects, including 8,000 Ghost tests) `pnpm check` completed 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.
no ref
Removed feature flag for listing these tabs in the Stats and Posts apps.