[pull] main from TryGhost:main - #1432
Merged
Merged
Conversation
ref https://linear.app/ghost/issue/PLA-254/fatal-boot-errors-are-lost-from-elasticsearch-no-logging-flush-before - bump framework deps to pull in logging flush fix - wire up log flush to exit points
ref 8be837e We're checking for gift analytics, but didn't update the spec title.
ref https://linear.app/ghost/issue/ONC-1954 - add preStopTasks array for tasks that should run prior to server drain - wire up email batch shutdown to preStop - fix error handling in cleanup tasks - prevent batch email send retries after shutdown
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.
ref https://linear.app/ghost/issue/NY-1504 Automations investigations need session context even when no error occurs. Once a sampled app load enters an Automations route, record a full session replay for the rest of that load while preserving error-triggered replay buffering everywhere else. This follows Sentry's documented approach for recording replays on specific URLs: https://docs.sentry.io/platforms/javascript/session-replay/understanding-sessions/#record-session-replays-on-specific-urls Currently i have sampling set to 1.0 for automations, meaning that anyone who enters an automations route will start a session replay. i think this makes sense 1) to make sure it works and 2) while the feature's in beta, because we won't get too many hits to these routes. we can always lower the rate if it's recording too many. I also set it to mask _any_ text on these routes. That's certainly more than we need to mask but i wanted the setup to be as simple as possible. if we find we need to read non-sensitive data like certain labels and such, we can tweak later. It'll look like this in the sentry dashboard: <img width="1399" height="1054" alt="Screenshot 2026-08-20 at 10 39 28 AM" src="https://github.com/user-attachments/assets/640e06dd-c5ab-437e-ae3b-7c71d2abfabf" />
closes https://linear.app/ghost/issue/NY-1541 Adding the automation analytics columns restored display: table-row at desktop. Safari does not use a positioned table row as the containing block for the absolutely positioned link overlay, so the last row's overlay covered the preceding rows. Removed the pseudo-element and kept the native table layout and column sizing. Pointer clicks elsewhere in a row delegate to the existing Link in its row header, while the Link remains the only semantic focus target. This preserves valid table markup, native Tab and Enter behavior, and screen-reader header associations without turning <tr> into a fake link. The link's :focus-visible state draws a WebKit-compatible outline around the row. gif shows it working correctly on safari now. hover state still works right, and you can still click anywhere in the row to go to the correct page, and the table still works right on mobile (notwithstanding other UI improvements we're planning to make there). <img width="1646" height="822" alt="safari-fix" src="https://github.com/user-attachments/assets/557edf93-20d6-4edd-abcf-3aee3e8d4f71" /> I also double-checked chrome still works correctly, and that things still work correctly with the flag off. Worth noting that keyboard navigation also still works, but safari doesn't honor the outline styles (that was true before as well) References: MDN <tr> content model: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tr MDN native link keyboard behavior: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )