refactor: chat module. - #150
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are a mechanical modularization with preserved control flow and clear integration points, and I did not find functional regressions in the updated wiring.
Pull request overview
Refactors the chat drawer implementation by extracting request execution, proposal apply/undo logic, message rendering, and DOM event wiring into dedicated modules, keeping drawer.js focused on orchestration and state.
Changes:
- Extracted chat request streaming + fallback logic into
createChatRequestRunner. - Extracted proposal resolution/apply/undo and per-tab undo tracking into
createChatProposalActions. - Extracted message list rendering (including apply buttons + undo UI) and event listener setup/teardown into
createChatMessageRendererandcreateChatDrawerEvents.
File summaries
| File | Description |
|---|---|
| src/modules/chat/request-runner.js | New module encapsulating chat request lifecycle (streaming + fallback) and error handling hooks. |
| src/modules/chat/proposal-actions.js | New module encapsulating proposal resolution, tab application, and undo state management. |
| src/modules/chat/message-renderer.js | New module handling message DOM rendering, apply-button rendering, and undo actions UI. |
| src/modules/chat/drawer-events.js | New module wiring drawer UI event handlers with a dispose lifecycle. |
| src/modules/chat/drawer.js | Simplified to orchestrate state and compose the extracted modules. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.