refactor(app): extract prompt-input action bar to action-bar.tsx - #1099
Conversation
Move the composer's bottom action bar (attach button, model control, workspace chip, context-usage, send/stop button) out of prompt-input.tsx into a new PromptActionBar component in prompt-input/action-bar.tsx. The button-reveal spring, its motion style helper, the buttons memo, and the send/stop tooltip move with it since they serve only the action bar. Pure extraction: no behavior, DOM, aria, copy, or storage-key change. prompt-input.tsx drops from 572 to 496 lines.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughPromptInput's bottom action bar is extracted into a new PromptActionBar component. The existing spring-animated inline implementation is removed, including animation setup, styling helpers, and layout logic. The parent component now delegates to PromptActionBar with state and callback wiring, reducing code duplication and centralizing action bar concerns. ChangesAction Bar Component Extraction
Possibly Related PRs
Poem
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/app/src/components/prompt-input.tsx, packages/app/src/components/prompt-input/action-bar.tsx)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
What
Slice 4 of the serial slimming of
packages/app/src/components/prompt-input.tsx. Moves the composer's bottom action bar JSX out ofprompt-input.tsxinto a newPromptActionBarcomponent inprompt-input/action-bar.tsx.The new component owns the controls it renders:
IconButton,PromptModelControl, home-modeWorkspaceChipSessionContextUsage+ send/stopTooltip/SendButtonThe button-reveal spring (
useSpringdriven bymode), itsmotionstyle helper, thebuttonsmemo, and the send/stoptip()helper move with it, since they are used only by the action bar. The action bar<div>is always mounted (no<Show>gates it), so relocating the spring into the child preserves its lifetime and animation behavior.Why
Continue extracting cohesive units so
prompt-input.tsxstays small and grep-friendly.prompt-input.tsxdrops from 572 to 496 lines.Change boundary
Pure extraction — no behavior, DOM, aria, copy, or storage-key change. The only seam edits are reading injected props (
props.mode,props.actionReady(),props.language, …) in place of the parent's locals.modeis passed as a value prop (mode={store.mode}), kept reactive by Solid's compiled prop getter, so the spring target still tracksstore.mode.Two files touched:
prompt-input.tsx(−91): drop the action bar JSX, the spring/motion/buttonstrio,tip(), and 8 now-unused imports; add thePromptActionBarimport + element.prompt-input/action-bar.tsx(new, +125).Verification
bun run typecheck— 8 successful, 8 totalbun test src/components/prompt-input/— 406 pass, 0 failbunx eslinton both files — cleanbun run snap prompt-placeholder— action bar renders identically across en/zh × 1440/768/768+rightpanel (attach+, model control, home-mode workspace chip, orange send button, correct left/right layout)Risk
Low. Bounded JSX extraction with identical output; no test mounts the full
PromptInput, so coverage is the unchanged unit tests of the moved components plus the visual snap.Summary by CodeRabbit