Refactor/db panel split - #16
Merged
Merged
Conversation
Extracted pure formatting helpers, agent-select controls, comment bubble, and branch/PR sidebar lists out of the 2078-line ReviewPanel.ts into their own files, following the same options-bag/callback pattern already used by the Tasks panel split. ReviewPanel.ts drops to 1571 lines. Diff rendering, data loading, and the AI-review trigger stay inline for now (higher risk, thin existing test coverage).
…m ReviewPanel Split the remaining high-coupling pieces out of ReviewPanel.ts: diff rendering (unified+split, file list/tree, filters), git/gh data loading (loadDiff/loadPrInfo/selectBranch/submitReview), and the AI-review orchestration. Each got a characterization test written against its pre-extraction behavior before the move, covering race guards, guard clauses, and the multi-agent synthesis path. ReviewPanel.ts now sits at 612 lines, down from the original 2078.
Broke the single 1398-line index.html (CSS + JS all inline) into two
panels plus a shared bridge, matching the terminals/tech-review split
the daemon already exposes: shared.{js,css}, terminal.{js,css}, and
review.{js,css}. index.html now holds only markup plus the
link/script tags that wire them back together. Added unauthenticated
static-asset routes in mod.rs for the new files (the HTML has no
server-side templating to carry the auth token into a script src, and
the content itself is non-sensitive UI code); /, /api/*, and /ws/*
keep their existing token check untouched. Added Rust tests asserting
index.html references the split files and that each file contains
its expected functions.
- ReviewPanel.ts: import ReviewChangeFile from reviewFormat instead of redefining it; dropped two getters (getAllBranches/getLastFiles) passed to the data loader but never read there. - ReviewDiffView.ts: extracted createLineRangeSelector, shared by the unified and split-diff renderers instead of each defining its own copy of the drag-to-select machinery. - ReviewCommentBubble.ts / ReviewDiffView.ts: extracted buildCommentInputRow for the textarea+actions-row shape repeated across the edit, reply, inline-line, and file-comment forms. - reviewFormat.ts: added renderReviewPrStateBadge, used by both ReviewSidebarLists.ts and reviewDataLoader.ts instead of each rebuilding the same badge span. - daemon web split: moved the terminal-list CSS rules (.tb, .tb-ico, etc.) out of shared.css into terminal.css, the only place they're used — a pre-existing mislabeling from the original monolith that the split was a natural point to fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…bDetect Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…odules Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… DbPanel Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…split modules Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…he core layer Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… into core Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ryActions Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…eduped it Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…g it Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Moved git.rs's 61 commands and their helpers out of a single 2871-line file into worktree, branches, status, backup, commit, log, pr, sync, rebase, recommend, and edit submodules, plus a shared test_support fixture module. mod.rs keeps only the cross-cutting private helpers (git_output, is_safe_branch, resolve_git_dir, etc.) that every submodule needs. main.rs's invoke_handler list now references each command through its owning submodule path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Moved docker.rs's container/compose/devcontainer commands and their helpers out of a single 2296-line file into compose_yaml, port_probe, subnet, isolate, and devcontainer submodules, plus a shared test_support fixture module. mod.rs keeps the shared plumbing (login_shell_output, docker_bin, docker_output, LogStreams) and the small container-lifecycle commands. main.rs's invoke_handler list now references the moved commands through their owning submodule path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…lit attempt An earlier session hit its usage limit mid-refactor after staging docker.rs at docker_tmp/mod.rs; the retry moved on to docker/mod.rs without cleaning up the now-orphaned, unreferenced duplicate. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Moved db.rs's shared connection/output plumbing into db/mod.rs and split the four independent database-engine domains (mysql, mongo, postgres, redis) into their own files. postgres.rs reuses mysql.rs's tabular-output parser (parse_table) for its row/query commands via an explicit pub(super) import. main.rs's invoke_handler list now references each command through its owning submodule path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…nning from aiChat.ts isCapacityError and the review follow-up history trimming logic were the only genuinely pure, non-trivial pieces inside aiChat.ts's createAiChat closure. Moved them to core/ai/capacityError.ts and core/ai/chatHistory.ts respectively, with unit tests. The rest of the file (send/sendToAgent/ streamReply/runWithTools) is DOM+fetch orchestration tightly coupled to mutable closure state, same shape as TasksPanelRuntime.ts — left as is. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.