feat(logs): explain-changes pivot from the logs view - #69712
Conversation
🤖 CI report✅ Bundle size — 🟢 -6.98 MiB (-10.0%)Uncompressed size of every built Total: 63.04 MiB · 🟢 -6.98 MiB (-10.0%)
Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report ✅ Eager graph — within budgetHow much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy
🟢 Largest files eagerly shipped from
|
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 668 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 278.6 KiB | ../node_modules/.pnpm/posthog-js@1.399.2/node_modules/posthog-js/dist/rrweb.js |
| 266.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.37.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 234.9 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 221.5 KiB | ../node_modules/.pnpm/posthog-js@1.399.2/node_modules/posthog-js/dist/module.js |
| 164.0 KiB | src/queries/validators.js |
| 154.3 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 105.9 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 90.6 KiB | ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Dist folder size — 🟢 -171.28 MiB (-11.9%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1267.12 MiB · 🟢 -171.28 MiB (-11.9%)
ℹ️ MCP UI apps size — 31 app(s), 15651.9 KB JS
Built size of each MCP UI app (main.js + styles.css).
| App | JS | CSS |
|---|---|---|
| debug | 577.8 KB | 177.2 KB |
| action | 429.2 KB | 177.2 KB |
| action-list | 542.6 KB | 177.2 KB |
| cohort | 428.2 KB | 177.2 KB |
| cohort-list | 541.6 KB | 177.2 KB |
| email-template | 428.1 KB | 177.2 KB |
| error-details | 443.9 KB | 177.2 KB |
| error-issue | 428.9 KB | 177.2 KB |
| error-issue-list | 542.5 KB | 177.2 KB |
| experiment | 539.9 KB | 177.2 KB |
| experiment-list | 543.4 KB | 177.2 KB |
| experiment-results | 541.6 KB | 177.2 KB |
| feature-flag | 545.4 KB | 177.2 KB |
| feature-flag-list | 549.1 KB | 177.2 KB |
| feature-flag-testing | 432.1 KB | 177.2 KB |
| insight-actors | 540.6 KB | 177.2 KB |
| invite-email-preview | 427.5 KB | 177.2 KB |
| llm-costs | 537.9 KB | 177.2 KB |
| session-recording | 429.9 KB | 177.2 KB |
| session-summary | 435.3 KB | 177.2 KB |
| survey | 429.7 KB | 177.2 KB |
| survey-global-stats | 540.7 KB | 177.2 KB |
| survey-list | 543.3 KB | 177.2 KB |
| survey-stats | 540.6 KB | 177.2 KB |
| trace-span | 428.6 KB | 177.2 KB |
| trace-span-list | 542.6 KB | 177.2 KB |
| workflow | 428.6 KB | 177.2 KB |
| workflow-list | 542.0 KB | 177.2 KB |
| query-results | 723.5 KB | 177.2 KB |
| render-ui | 613.8 KB | 177.2 KB |
| visual-review-snapshots | 433.0 KB | 177.2 KB |
|
Reviews (1): Last reviewed commit: "chore: update OpenAPI generated types" | Re-trigger Greptile |
165d6fd to
48bb2d8
Compare
🦔 Hogbox preview · ✅ ready▶ Open the preview
commit |
Add an "Explain changes" button to the Logs display bar that opens the Patterns view in compare mode against the preceding period — one click from a spike (drag-selecting on the sparkline already zooms the window) to the classified diff that explains it. Compare state moves from logsPatternsLogic to logsViewerConfigLogic so other views can arm the comparison before the patterns logic mounts, and the choice survives lens switches; an atomic openPatternsComparison action sets view mode, compare, and baseline together, and the patterns logic loads the diff on mount when compare arrives pre-armed. The diff MCP prompt gains the matching one-call spike-explain recipe. Generated-By: PostHog Code Task-Id: 8876f5bb-d599-44f1-9cce-0f5cf383d1b8
Split the shared patternsError reducer into mineError and diffError and derive the displayed error from the active mode. The two loaders run independently — toggling compare off fires a plain mine without cancelling an in-flight diff — so a stale diff failure could otherwise clobber a successful plain-mine table's empty state. Generated-By: PostHog Code Task-Id: bbaad670-e0f4-4f03-9c83-ac0831b1eca8
6944936 to
43d8f82
Compare
There was a problem hiding this comment.
Frontend-only feature (logs patterns UI + MCP prompt/schema docs) outside risky territory, authored by a strong-familiarity owning-team member; the sole substantive review concern (shared error state) was fixed and resolved with a bot 👍, and no holds or in-flight reviews are present.
- Author wrote 100% of the modified lines and has 132 merged PRs in these paths (familiarity STRONG).
- 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 99L, 5F substantive, 136L/7F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (136L, 7F, two-areas, feat) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ c9df32f · reviewed head 43d8f82 |
Problem
The compare mode (previous PR in this stack) answers "what changed" — but only if you already know to open the Patterns view and flip the toggle. The natural moment for that question is while looking at a spike on the Logs view's volume chart, and there's no path from there.
Changes
Stacked on the compare-mode PR. The design leans on two things that already exist: drag-selecting on the sparkline already zooms the date range to the selection, and the alert detail scene embeds the full LogsViewer — so one button in the display bar covers both entry points named in the plan, with no new popover container and no backend changes.
logsPatternsLogictologsViewerConfigLogic(whereviewModelives). The patterns logic is unmounted while in Logs view, so the button couldn't reach state living there; the move also means the compare choice now survives Logs↔Patterns lens switches instead of silently resetting. The patterns logic connects to the moved values/actions, so its public interface (and the compare-mode UI) is unchanged.openPatternsComparison(mode)action sets view mode + compare + baseline in one dispatch, so callers in other views can't half-configure the pivot.logsPatternsLogic'safterMountnow checks for pre-armed compare and loads the diff instead of the plain mine.How did you test this code?
openPatternsComparisondispatched before the patterns logic mounts arms compare so mounting loads the diff, not the plain mine — that armed-before-mount handoff is the entire feature's wiring and nothing else exercises it. The 11 existing tests passing unchanged is itself the evidence the state move preserved the logic's interface.Automatic notifications
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Built with Claude Code (PostHog Code task) using the /writing-kea-logics and /writing-tests skills. Decisions: rejected a popover-on-sparkline-selection design after exploring the viewer — selection already zooms synchronously (no interception point without changing that behavior), the product has no chart-popover pattern to follow, and reusing the compare table avoids duplicating diff rendering in a second container; chose the display bar over the sparkline itself so the affordance works even without a selection (explains the whole current window) and is inherited by the alert scene's embedded viewer.
Created with PostHog Code