refactor(web): composer suggestion lists are built by useComposerMenuItems#22722

merged1
refactor/chat-composer-stable-controls
refactor/chat-composer-menu-items
opened4d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

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.

beforethis PR
ChatComposer.tsx lines6,6406,365
useComposerMenuItems.ts linesn/a344
Renders, 20 typed chars352352

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

All checks passed

Added 1 commit

  • refactor(web): composer suggestion lists are built by useComposerMenuItems80a98a0
Synced from GitHub

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.

Synced from GitHub

Review in Change Stack →

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.tsx
  • apps/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 useComposerMenuItems hook. 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.ts
The hook accepts composer context and coordinates path, thread-shell, and pull-request searches.
Suggestion results and menu states
apps/web/src/components/chat/useComposerMenuItems.ts
The 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.tsx
ChatComposer 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 nameStatusExplanationResolution
Description checkWarningThe 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 nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main refactor: moving composer suggestion-list construction into useComposerMenuItems.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck 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

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.