refactor(web): ChatView's subagent, goal, background-work and branch banners are built in ThreadActivityBanners#22725

merged1
refactor/chatview-system-banners
refactor/chatview-activity-banners
opened6d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 6d ago

ChatView built four composer banner items inline: subagents waiting on the user, the provider goal, pending background work, and the branch-changed notice. Together they were about 160 lines of JSX in the middle of the component.

chat/ThreadActivityBanners.tsx now builds them. It follows the existing feedbackBannerItem and usageLimitRecoveryBannerItem builders: plain functions that take values and callbacks and return a ComposerBannerStackItem.

The items still go to ChatComposer as data, so this layer moves code only and doesn't change render boundaries. ChatComposer.tsx is being split separately, so I left its API alone.

The branch banner set compact: true, which isn't a ComposerBannerStackItem field and wasn't read anywhere. The old array cast hid that, and the builder drops it.

previous layerthis layer
ChatView.tsx lines7,6657,533

Tests: vp test run src/reactCompilerCoverage.test.ts for ChatView and every new file (0 bailouts), tsc-rs --noEmit for apps/web, and oxlint on the changed files.

🤖 Generated with Claude Code

Checks

24 successful · 9 skipped
All checks passed
08ca07f

Added 1 commit

  • refactor(web): ChatView's subagent, goal, background-work and branch banners are built in ThreadActivityBanners08ca07f
Synced from GitHub

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 08ca07f.

This comment will update automatically after the next completed run.

Synced from GitHub

Approvability

Verdict: Approved at 08ca07f

Macroscope's review found this PR approvable — This is a localized refactor that extracts existing ChatView banner construction into ThreadActivityBanners without changing the banner behavior, state flow, or external contracts. The production impact is limited to organization of the existing web chat UI.

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: 56b55a42-35b3-4c45-a76d-021760717f93
📥 Commits

Reviewing files that changed from the base of the PR and between 7de6e9a6fca9d5acba44242a5a102749d4878e08 and 08ca07f2b1229c4de2131e514c73b38577e9f3eb.

📒 Files selected for processing: 2
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/chat/ThreadActivityBanners.tsx

Limit details: You’ve used all 10 included reviews currently available.

📝 Walkthrough

ChatView now uses four helper functions to build child-input, goal, background-work, and branch-mismatch banners. The helpers define each banner’s display conditions and actions.

Changes: Thread activity banners

Layer / File(s)Summary
Banner helper behavior
apps/web/src/components/chat/ThreadActivityBanners.tsx
Added helpers to build four activity banner types. They provide the described display conditions, details, and actions.
ChatView integration
apps/web/src/components/ChatView.tsx
Replaced inline banner construction with the helpers and updated banner aggregation. Removed unused imports.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to 08ca0

No actionable issue was found in the banner extraction; it is ready for normal merge checks.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description explains the code change and lists focused verification, but it does not provide the required Problem section or Scope and approval information. It also does not state whether UI evide…Add the required Problem section with the underlying problem and expected behavior. Add Scope and approval with the linked issue or explicit maintainer approval, or explain why this focused refactor qualifies for an exemption. Clarify wheth…
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely identifies the main refactor: moving ChatView banner construction into ThreadActivityBanners.
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 code change and lists focused verification, but it does not provide the required Problem section or Scope and approval information. It also does not state whether UI evidence is unnecessary because behavior is unchanged.

Resolution

Add the required Problem section with the underlying problem and expected behavior. Add Scope and approval with the linked issue or explicit maintainer approval, or explain why this focused refactor qualifies for an exemption. Clarify whether before/after UI evidence is not applicable because render behavior is unchanged.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 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.