feat(desktop): split model switch and session summary - #96034
Conversation
The mid-session model switch dialog carried three jobs: the cache cost, the model change, and handing work to another agent. Writing a handoff summary took about 35 seconds, and while it ran the dialog disabled both buttons, refused to close, and showed its progress in a card behind the modal. The dialog now states one decision. The summary is its own task action with its own panel above the composer, which reports progress, offers copy and dismiss, and clears itself. Generated-By: PostHog Desktop Task-Id: 26078657-9de2-461d-acbf-931d591f92f6
…h-and-session-summary
|
😎 Merged successfully - details. |
|
React Doctor found 3 issues in 2 files · 3 warnings. 3 warnings
Reviewed by React Doctor for commit |
🤖 CI report✅ Trunk lane — non-backend lane (
|
HostHog preview —
|
There was a problem hiding this comment.
Approved.
Contained desktop UI refactor by an owning-team author with no touches to auth, billing, data models, public APIs, or CI/build tooling; tests were updated/added for the new components and no unresolved review concerns exist.
- Author wrote 66% of the modified lines and has 49 merged PRs in these paths (familiarity MODERATE).
- 14 of the 14 changed files are governed by
products/desktop/AGENT_APPROVALS.md.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 684L, 11F substantive, 838L/14F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (838L, 14F, single-area, feat) |
| stamphog 2.0.0b4 | .stamphog/policy.yml @ a6bd604 · reviewed head a6bd604 |
|
/trunk merge |
Problem
A person who changes the model mid-session can get stuck in the dialog. Pressing "Copy summary" starts an AI turn that takes about 35 seconds, and while it runs the dialog disables Cancel and Switch now, and ignores Esc.
Changes
The before shot is a Storybook render of the dialog on master. The after shot is the running app.
Note
The dialog no longer says that a switch keeps the same environment, files and permissions. That line was reviewed and cut as clutter, so the belief that a model switch restarts a task stays uncorrected in the product.
Mechanical: the side-question store gains a
kind, alabeland anaskedAt, so one store can back two surfaces.SideQuestionCarddrops its Radix imports. The panel splits into a container and a view, which is what makes the view storyable.How did you test this code?
The person driving this work ran the desktop app and exercised the dialog and the panel. This agent did not run the app.
Automated, by this agent:
SessionSummaryPanel.test.tsxis new. It catches a panel that renders for a prior task run, and a dismiss that leaves the entry in the store.SideQuestionCard.test.tsxgains one case: a summary entry must render nothing in the/btwcard. Without it, both surfaces would show the same answer.ModelSwitchCacheDialog.test.tsxloses the task-cost cases with the feature, and follows the renamed button.Not checked: every desktop suite outside
features/sessions, and the e2e suite. CI reports those.Automatic notifications
Docs update
None. No documented workflow changes.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code (Opus 5) in PostHog Desktop, directed step by step over one session.
Skills invoked:
/writing-tests,/writing-pr-descriptions,/writing-user-facing-copy,/writing-code-comments,posthog:building-html-canvases,posthog:validating-and-publishing-canvases.Decisions across the session:
Badgeis a 10px scale, which made the model names the smallest text in the dialog, and the one-line version wrapped and stranded the price at the real dialog width.sessionSupportsSideQuestionfor finished cloud runs. It touches no file in this PR, and the new menu item consumes that same guard.Public artifact: this work started from a report of one person's session. No part of that material reaches this PR. The screenshots show the agent's own test session, the sample summary in the Storybook story is invented, and no customer data, ticket or log is quoted.