feat(site/src/pages/AgentsPage/components): allow disengaging plan mode from Planning badge#24651
feat(site/src/pages/AgentsPage/components): allow disengaging plan mode from Planning badge#24651
Conversation
…de from Planning badge Add an inline "X" dismiss button to the Planning pill in the agent chat input so users can exit plan mode without reopening the "+" menu. Reuses the same visual pattern as the workspace and MCP badge dismiss buttons. - Extract BadgeDismissButton for the three dismiss-button sites (workspace, MCP, planning) now that the pattern repeats three times. - Add stories covering the new control and the no-toggle-handler case. Change authored by an agent on behalf of david-fraley.
… X via dedicated handler Per reviewer feedback, decouple the badge dismiss button from the toggle handler. The badge-pill X button is only rendered while plan mode is on, so it should always disable, not toggle. Using handlePlanModeToggle worked only because of the enclosing render gate; a dedicated handleDisablePlanMode decouples the semantics from that gate.
david-fraley
left a comment
There was a problem hiding this comment.
Deep review complete. Kicked off 7 parallel reviewers (Test Auditor, Edge Case Analyst, Contract Auditor, Frontend Reviewer, Duplication Checker, React Modernization, Style Reviewer) against this PR.
One P2 surfaced across Frontend Reviewer, Contract Auditor, and Edge Case Analyst: the badge dismiss handler was reusing handlePlanModeToggle, which only did the right thing by virtue of the render gate. Applied the fix in a898b81 before posting. One nit carried forward.
1 P2 (applied), 1 Nit across 2 inline comments. Full reviewer outputs in /tmp/deep-review/1776906843/.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a898b81253
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Adds an inline
Xbutton to the "Planning" indicator so users can disengage plan mode directly from the chat input, without reopening the+menu. Reuses the same pattern that already ships on the attached-workspace and MCP-server badges.onPlanModeToggleis provided and plan mode is on, the pill renders a dismissXnext to the label; clicking it callsonPlanModeToggle(false).Xrenders (matches the other badges).BadgeDismissButtoninsideAgentChatInput.tsxnow that the dismiss pattern lives in three places, collapsing ~24 lines of duplicated markup.PlanningIndicator, newDisablePlanModeFromBadge(click firesonPlanModeToggle(false)), newPlanningIndicatorWithoutToggle(no handler, noX).Demo
Higher-quality MP4 also available.
Implementation plan
Red / Green / Refactor
AgentChatInput.stories.tsxto assert theXbutton exists in the Planning pill, clicking it firesonPlanModeToggle(false), and noXrenders whenonPlanModeToggleis absent. Two stories failed as expected.<button aria-label="Disable plan mode">withXIconto the Planning pill, gated ononPlanModeToggle, reusing the existinghandlePlanModeTogglehandler. All 35 stories pass.BadgeDismissButtonwithonClick+ariaLabelprops and replaced all three copies. Stories still pass.Design notes
aria-labelis"Disable plan mode"(mode toggle, not item removal) rather than"Remove planning"which would be misleading.badgeContainerRefoverflow container by design so it never collapses into the+Npopover.Plan firstmenu item in the+popover or its behavior.This PR was opened by a Coder agent on behalf of @david-fraley.