Skip to content

refactor(site): address plan-mode frontend review feedback - #24426

Merged
ibetitsmike merged 6 commits into
mainfrom
mike/refactor-plan-mode-frontend-review
Apr 16, 2026
Merged

ibetitsmike merged 6 commits into
mainfrom
mike/refactor-plan-mode-frontend-review

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

This PR was authored by Mux on behalf of Mike.

Address all 8 frontend review comments from DanielleMaywood on #24236.

Changes

Low-risk cleanups:

  • Inlined module-level toolBadgeClassName in AgentChatInput.tsx
  • Inlined planModeInvisibleCharWarning variable in PlanModeInstructionsSettings.tsx
  • Replaced loose nilUUID and clearPlanMode sentinels in chats.ts with a toChatPlanModePayload() helper and inline nil UUID. Page-level mutation callers now pass undefined to clear plan mode instead of "".

Tool state management:

  • Replaced manual isSubmitting/setIsSubmitting in ProposePlanTool.tsx with useMutation
  • Overhauled AskUserQuestionTool.tsx: replaced cloneAnswer with structuredClone, replaced setIsSubmitting with useMutation, extracted QuestionStep, QuestionOption, OtherQuestionOption, and AnsweredQuestionText components

Timeline complexity reduction:

  • Extracted deriveMessageDisplayState() into messageHelpers.ts (pure, testable)
  • Extracted user-message rendering into UserMessageContent.tsx
  • Reduced ConversationTimeline.tsx by ~285 lines

Validation

  • TypeScript: pass
  • Lint (Biome + ESLint): pass
  • React Compiler: 247 functions, 0 diagnostics
  • Storybook tests: 42/42 pass (ProposePlanTool 9, ConversationTimeline 22, AskUserQuestionTool 11)

@ibetitsmike
ibetitsmike marked this pull request as ready for review April 16, 2026 13:02
@ibetitsmike
ibetitsmike merged commit 6bb4444 into main Apr 16, 2026
32 of 34 checks passed
@ibetitsmike
ibetitsmike deleted the mike/refactor-plan-mode-frontend-review branch April 16, 2026 13:16
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants