Skip to content

refactor(chat): move the turn and work rows out of ChatView.tsx - #4889

Merged
devswha merged 4 commits into
mainfrom
refactor/chatview-top-split
Nov 27, 2026
Merged

devswha merged 4 commits into
mainfrom
refactor/chatview-top-split

Conversation

@devswha

@devswha devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner

What

Move-only split of the top of src/components/ChatView.tsx (2,636 lines). The small components above the ChatView body move unchanged into two files; the ChatView body itself (about 1,350 lines), ChatFallback and the terminal fallback stay where they are.

New file Moved
ChatWork.tsx the tool and work rows: WorkBlockView, WorkRow, ToolInputView, ToolOutputText, TodoList, PatchView, EditDiff, the image thumbnails (ImageGallery, LineImages, ...), PendingWorkHead, turnWork, and the four row contexts they read (ChatPaneContext, ChatHistoryContext, ImageViewerContext, ToolPathRootContext)
ChatTurn.tsx the turn rows: Turn, UserMessage, OutcomeRow, OutcomeChip, TaskResultRow, TeammateMessageRow, GoalWaitRow, FailedRequests, CopyButton, userText

ChatWork.tsx imports nothing from the other two, ChatTurn.tsx imports only ChatWork.tsx, and ChatView.tsx imports both: no import cycle. The existing ChatTurn.test.ts now sits next to the file it tests.

Lines that are not moves

  • export on the moved names that ChatView.tsx or ChatTurn.tsx use (Turn and PendingWorkHead were already used by the body; the contexts are provided by ChatView and read by the rows).
  • Imports split per file.
  • Tests and notes that name the old file: Turn is imported from ChatTurn.tsx in four tests, PART_FILES.chat in src/lib/i18n.test.ts and the chat dictionary headers list the new files, Visualization.test.tsx's "only a chat answer's Markdown asks for references" check names ChatTurn.tsx, THIRD_PARTY_NOTICES.md (the user message fold credit follows UserMessage), docs/chat-skill-activity.md.

Verification

  • git diff --color-moved --color-moved-ws=allow-indentation-change origin/main...HEAD: a line-multiset comparison of removed and added lines leaves only the export keywords and the imports.
  • bun run check fast: green (typecheck, build, 29,194 unit tests).
  • In the CI runner image (herdr-ci-runner:local), the chat browser scripts: 27/27 passed on the first attempt (no retries): every chat script bun scripts/browser-checks.ts maps to these files (chat-fallback-browser-qa, chat-virtual-browser-qa, copilot-chat-browser-qa, chat-selection-copy-regression, chat-history-browser-qa, chat-gjc-streaming-browser-qa, devin-chat-browser-regression, grok-chat-browser-qa, chat-tool-paths-demo-regression, agy-chat-browser-qa, chat-quote-selection-end-regression, chat-outcome-note-browser-qa, chat-local-send-follow-demo-regression, chat-working-line-demo-regression, chat-selection-turn-end-demo-regression, chat-select-quote-demo-regression, chat-request-details-demo-regression, chat-visualization-browser-qa, chat-greeting-demo-regression, chat-no-rewind-demo-regression, chat-reading-position-demo-regression, chat-math-demo-regression, omo-chat-browser-qa, chat-markdown-images-browser-qa, chat-svg-figures-demo-regression, chat-list-markers-demo-regression, chat-scroll-padding-regression).

Move-only split of the top of ChatView.tsx (2,636 lines): the tool and work rows
(ToolInputView, WorkRow, WorkBlockView and their helpers, with the four row contexts)
move unchanged into ChatWork.tsx, and the turn rows (Turn, OutcomeRow, OutcomeChip,
UserMessage, CopyButton and their helpers) into ChatTurn.tsx. The ChatView body,
ChatFallback and the terminal fallback stay.

Not moves: the moved names ChatView or ChatTurn use gain export, the imports are
split per file, and the tests and notes that name the old file now name the new one
(Turn's test imports, the chat i18n part list, the Visualization caller check,
THIRD_PARTY_NOTICES, docs/chat-skill-activity.md).
@devswha

devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Move-only PR: every removed line of the top of ChatView.tsx reappears unchanged in ChatWork.tsx or ChatTurn.tsx (checked with git diff --color-moved --color-moved-ws=allow-indentation-change and a removed/added line-multiset comparison: only export keywords, the per-file imports and the file names in tests/notes differ, all listed in the description). The ChatView body is untouched. No behavior, wording, style or contract change, so under the move-only rule it merges on the omo gate and CI without a CodeRabbit review.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Refactor
    • Chat conversations continue to show user and agent messages, images, skill activity, goals, work progress, tool results, and previews.
    • Message actions—including copying answers or text, dismissing recorded results, and available follow-up actions—remain part of the conversation experience.
    • Work details and tool outputs retain their expandable, searchable, and status displays.

Chat work and turn rendering move from ChatView.tsx into ChatWork.tsx and ChatTurn.tsx. ChatView.tsx retains the conversation view and uses the extracted components. Tests, documentation, notices, and localization coverage references are updated.

Changes: Chat rendering

Layer / File(s) Summary
Tool and work rendering
src/components/ChatWork.tsx
Adds tool input and output rendering, image galleries, todo groups, work rows, and work-block rendering.
Turn rendering
src/components/ChatTurn.tsx, src/components/ChatTurn.test.ts, src/components/ChatView.*.test.tsx, src/components/Visualization.test.tsx
Adds rendering for user and agent turns, outcomes, task results, notices, and goal waits. Tests import Turn from ChatTurn.tsx and update the visualization assertion.
View wiring and references
src/components/ChatView.tsx, src/lib/i18n/*, docs/chat-skill-activity.md, THIRD_PARTY_NOTICES.md
ChatView.tsx imports the extracted components and removes inline rendering code. Documentation, notices, and localization coverage references are updated.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor

Suggested reviewers: liumoon, jpcarranza94

Merge Risk: Minimal · previous review b49ff

This refactor moves chat turn and work rendering into separate files without changing behavior. No merge-blocking risk was found, and the reported checks and moved-code comparison support that.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: moving the turn and work rows out of ChatView.tsx. The raw summary confirms ChatWork.tsx and ChatTurn.tsx were added and ChatView.tsx lost about 960 lines of inline…
Description check Passed The description follows the template's Change and Validation sections. The Change section explains the problem and resulting behavior: a move-only split of ChatView.tsx, with a table of moved symbols,…
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: Title check

Explanation

The title names the primary change: moving the turn and work rows out of ChatView.tsx. The raw summary confirms ChatWork.tsx and ChatTurn.tsx were added and ChatView.tsx lost about 960 lines of inline components. The title uses the conventional refactor(chat) prefix and is 63 characters long.

Full details: Description check

Explanation

The description follows the template's Change and Validation sections. The Change section explains the problem and resulting behavior: a move-only split of ChatView.tsx, with a table of moved symbols, the import structure, and the non-move edits. The Validation section lists the commands run (bun run check fast) with results and the browser script outcomes. The template asks for a linked issue for features only, and this is a refactor, so none is required. The description does not name the exact checks skipped, and it does not state whether contract tests were relevant, which is a minor gap.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 12e9a21 and b49ff47.

Files selected for processing: 14

  • THIRD_PARTY_NOTICES.md
  • docs/chat-skill-activity.md
  • src/components/ChatTurn.test.ts
  • src/components/ChatTurn.tsx
  • src/components/ChatView.copy.test.tsx
  • src/components/ChatView.goalWait.test.tsx
  • src/components/ChatView.stopped.test.tsx
  • src/components/ChatView.tsx
  • src/components/ChatWork.tsx
  • src/components/Visualization.test.tsx
  • src/lib/i18n.test.ts
  • src/lib/i18n/chat.ja.ts
  • src/lib/i18n/chat.ko.ts
  • src/lib/i18n/chat.zh.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@devswha
devswha merged commit 1f8bd32 into main Nov 27, 2026
15 checks passed
@devswha

devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 51cd215e8. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.

main had moved since the checks of acf6c27cb: pr-merge --update merged it in (5df29318b), and every required check was green at this head.

It waited in the merge queue behind #4886, whose change overlaps it, before it was updated.

Move-only split (description lists every non-move line). Reviews: omo gate CLEAR at acf6c27 (dori review); CodeRabbit skipped under the move-only rule, on the owner's word for lane refactor-top3 (Fable refactor review: all recommendations go). Runner-image chat browser 27/27 first attempt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant