refactor(web): composer suggestion lists are built by useComposerMenuItems#22722
Continues the ChatComposer split.
ChatComposer built the @, /, $ and # suggestion lists inline: the path search, the pull request list and exact-number lookups with their debounces, and roughly 150 lines of item mapping. All of that, plus the loading and empty-state text, moves into the useComposerMenuItems hook. ChatComposer still owns the trigger, the highlighted item, and keyboard handling. It now gets back { items, isLoading, emptyState }. Behavior is unchanged.
| before | this PR | |
|---|---|---|
| ChatComposer.tsx lines | 6,640 | 6,365 |
| useComposerMenuItems.ts lines | n/a | 344 |
| Renders, 20 typed chars | 352 | 352 |
Renders measured with the shared fiber counter (rc-init.js) on a seeded dev server: typing 20 characters into an existing thread's composer, median of 3 runs. This layer is for readability; it does not change renders. I checked by hand that / and @src still list commands and files.
Tests run: vp lint and vp fmt --check on the changed files, tsc-rs --noEmit for apps/web, and reactCompilerCoverage.test.ts for the changed files (0 bailouts).
🤖 Generated with Claude Code
Checks
- SuccessfulCodeRabbitGitHub
Review completed
- Successful
Skipped - Not affected
- Skipped
- Skipped
- Skipped
- SuccessfulRemove preview downloadGitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulLabel PR 22722GitHub
- Successful
- Successful
- Successful
- Successful
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulCheckGitHub
- SuccessfulNative fingerprint diffGitHub
- SkippedRustGitHub
- Skipped
- SkippedRelease SmokeGitHub
- SuccessfulTest WebGitHub
- SuccessfulTestGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulLabel PR 22722GitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SkippedDeploy web previewGitHub
- SkippedEAS PreviewGitHub
- SuccessfulNative fingerprint diffGitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulLintGitHub
- SuccessfulChangesGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
Added 1 commit
- refactor(web): composer suggestion lists are built by useComposerMenuItems80a98a0
Approvability
Verdict: Approved at 80a98a0
Macroscope's review found this PR approvable — This refactor moves the existing composer suggestion-list logic into a dedicated hook while preserving its searches, filtering, loading states, and empty states. It changes organization without introducing a new user-facing capability or product default.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
a7c9bfb5-4956-4429-89f7-7fdc0a45122f
📥 Commits
Reviewing files that changed from the base of the PR and between eb67900ea5954f10f1a98adeac3f7c12716a099a and 80a98a086e34a13af01787d2c2501b8b681957fc.
📒 Files selected for processing: 2
apps/web/src/components/chat/ChatComposer.tsxapps/web/src/components/chat/useComposerMenuItems.ts
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
ChatComposer now delegates composer menu searches, suggestion generation, loading state, and empty-state messages to the new
useComposerMenuItemshook. The hook handles path, slash-command, skill, and pull-request suggestions.Changes: Composer menu flow
Layer / File(s) Summary Search state and lookups
apps/web/src/components/chat/useComposerMenuItems.tsThe hook accepts composer context and coordinates path, thread-shell, and pull-request searches. Suggestion results and menu states
apps/web/src/components/chat/useComposerMenuItems.tsThe hook builds slash-command, skill, and pull-request suggestions. It also returns loading state and trigger-specific empty messages. ChatComposer integration
apps/web/src/components/chat/ChatComposer.tsxChatComposer passes composer context to the hook and removes its inline menu searches and state derivation. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Suggested reviewers:
t3dotgg
Merge Risk: ⚪ Minimal · up to 80a98
The composer menu extraction appears mergeable after normal checks; no actionable behavior change was identified.
Pre-merge checks: Passed 3 · Failed 1
Failed Failed checks: 1 warning
Check name Status Explanation Resolution Description check Warning The description explains the refactor and includes focused verification results, but it omits the required Problem, Change, Scope and approval, and Verification sections. It also provides no triaged i… Rewrite the description using the required template. Add the problem and expected behavior, describe the change, provide a linked issue or explicit maintainer approval with its approval comment, and retain the detailed verification results.… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly and concisely describes the main refactor: moving composer suggestion-list construction into useComposerMenuItems. Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description explains the refactor and includes focused verification results, but it omits the required Problem, Change, Scope and approval, and Verification sections. It also provides no triaged issue, maintainer approval, or explicit exemption rationale.
Resolution
Rewrite the description using the required template. Add the problem and expected behavior, describe the change, provide a linked issue or explicit maintainer approval with its approval comment, and retain the detailed verification results. State whether UI screenshots are not applicable because behavior and visuals are unchanged, or provide the required before/after evidence.
✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 2
- Charged: $0.50
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Comment @coderabbitai help to get the list of available commands.