Skip to content

#480: TUI: Migrate Source Control panel (commit row, branch picker, help dialog) to shared primitives - #597

Merged
JDonaghy merged 3 commits into
developfrom
issue-480-tui-migrate-source-control-panel-commit
Jul 21, 2026
Merged

#480: TUI: Migrate Source Control panel (commit row, branch picker, help dialog) to shared primitives#597
JDonaghy merged 3 commits into
developfrom
issue-480-tui-migrate-source-control-panel-commit

Conversation

@JDonaghy

Copy link
Copy Markdown
Owner

Closes #480

Automated merge from the coordinator for assignment 61c175dfa74e on issue #480.

Worker branch: issue-480-tui-migrate-source-control-panel-commitdevelop.

JDonaghy and others added 3 commits July 21, 2026 15:01
…imitives

Migrates the three remaining hand-rolled SC panel chunks (commit input,
branch picker, help dialog) to quadraui primitives that landed since the
issue was filed (TextInput #222, dual-mode Palette #224, Dialog+DialogTable
#225) — the button-row chunk was already migrated to Toolbar in #505.

- render.rs: new backend-agnostic adapters (sc_header_text/status_bar,
  sc_commit_input_row_count/box_height, sc_commit_message_to_text_input,
  sc_branch_picker_to_palette, sc_help_dialog[_layout]). All render-only —
  the engine's handle_sc_commit_input_key / handle_sc_branch_picker_key /
  handle_sc_branch_create_key remain the sole owners of edit/selection
  logic, so this doesn't adopt DualModePaletteController's own competing
  state machine.
- tui_main/panels.rs: replaces ~280 lines of hand-rolled `set_cell` popups
  with calls through TextInput/Palette/Dialog.
- tui_main/mouse.rs: click hit-test math updated for the TextInput
  primitive's added border rows, still sourced from the same
  sc_commit_input_box_height single-source-of-truth as the paint code.
- gtk/mod.rs: PANEL_GIT was silently skipping the header row and commit
  input entirely under ShellApp (dead code comment said "deferred") —
  now paints both, plus the branch picker and help dialog, through the
  same shared adapters TUI uses. Mouse-click routing for this panel is
  still unwired (a separate, broader gap tracked by #449) — this is a
  render-only fix.
- gtk/draw.rs: deletes the dead draw_source_control_panel (335 lines,
  zero live callers since the #493 ShellApp migration).

Net: -651/+404 lines. cargo build/clippy -D warnings/test all clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…gration

No automated coverage existed for render_source_control before or after
the primitive migration in the prior commit -- adds vimcode's own
equivalent of quadraui's TuiDriver harness (ratatui::Terminal<TestBackend>,
matching the pattern already established in tui_main/render_impl.rs's test
module) driven directly against render_source_control, exercising the
migrated TextInput (placeholder/typed/multiline), dual-mode Palette
(branch list + create), and Dialog+DialogTable (help keybindings) paint
paths end-to-end plus a minimum-size no-panic guard.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ding

#480 shipped this session (quadraui#223/#224/#225 all closed, TUI+GTK both
migrated) -- the "Blocked on quadraui" table is now empty. Scoping that
work surfaced two follow-on architecture questions, filed and recorded
here so they don't get lost:

- vimcode#595: TUI -> quadraui::ShellApp + run_with_shell, mirroring
  GTK's landed #493 migration. Closes the largest remaining GTK/TUI
  architectural divergence.
- quadraui#465: macOS backend needs ShellApp + run_with_shell
  composition support (chrome primitives already exist there; only the
  runner/composition wiring is missing). This, not #595, is the actual
  gate on "macOS port is a thin wrapper."

GOALS.md gets the north-star-level tracking entries; PLAN.md gets a
resume-pointer section for #595 since it's exactly the kind of
multi-session feature that doc exists to make resumable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@JDonaghy
JDonaghy merged commit 1b3b9cb into develop Jul 21, 2026
JDonaghy added a commit that referenced this pull request Aug 27, 2026
The critical-path tables were dated 2026-07-21 and had gone fully stale: every
issue in "Ready now" (#512, #449, #454, #459, #477, #478, #133, #479, #481,
#493, #508, #515, #480) is closed, and the doc still named #512 as the next
pick. GOALS.md is read at the top of every vimcode session, so a stale table
does not just go unused — it actively points agents at 13 closed issues.

What changed:

- Record that both structural migrations are DONE. #448 (GTK event dispatch
  -> ShellApp::handle) and #595 (TUI -> run_with_shell) both closed 2026-08-26;
  `fn event_loop` no longer exists in src/.
- Note quadraui milestone #9 is cleared (0 open / 5 closed), so nothing on the
  supply side gates #7 except quadraui#596/#597 for #658.
- Replace "Ready now" / "Blocked on quadraui" with the three groups that are
  actually left: the orphaned GTK paint path (#592, now staged as
  #669/#670/#671/#672), the dedup sweep (#621/#659/#660/#536), and the
  residual per-backend surface that is not yet issue-shaped.
- Carry forward two traps rather than leaving them in issue bodies only:
  #660's inverted SplitDirection (rotates every split 90 degrees and compiles),
  and #657's recorded false blocker ("vimcode needs a GTK acceptance driver
  first" is wrong).
- State plainly that #657 is the trust gate under all of it, citing #553 as
  the in-repo proof that a self-authored oracle can stay green with the bug
  reinstated.

Doc-only; no code change. Committed directly to develop per CLAUDE.md's
documentation-only carve-out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JDonaghy added a commit that referenced this pull request Sep 2, 2026
Takes the quadraui git dependency to the rev containing #597, which ports
vimcode's own preview-tab policy onto WorkspaceController so this repo can
adopt the shared implementation instead of paralleling it. Code changes that
consume the new API land in the next commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
JDonaghy added a commit that referenced this pull request Sep 2, 2026
Replace vimcode's hand-rolled preview promotion logic with calls into
quadraui's WorkspaceController preview tier (#597), so the two apps stop
carrying separate implementations of the same six-trigger policy.

- Engine gains a private `preview_tab: WorkspaceController` field, keyed by
  `BufferId::to_string()` (new `Display` impl on BufferId). It is the single
  source of truth for which buffer, if any, is the preview.
- `open_file_with_mode(Preview)` and `open_file_preview` now call
  `preview_tab.open_preview(...)` and react to the `WorkspaceEvent::Closed`
  it returns to unload the displaced preview buffer, instead of hand-rolling
  the find-existing-else-replace branch.
- `promote_preview` is gone; every one of the six promotion call sites
  (double-click re-open, goto_tab select, edit, save) now calls the new
  private `preview_tab_promote`, a thin wrapper around
  `preview_tab.promote()` that's a no-op unless the buffer is in fact the
  preview.
- `delete_buffer` calls `preview_tab.close()` so a deleted buffer's doc
  entry never lingers, instead of hand-checking `preview_buffer_id`.
- `preview_buffer_id` stays as a public field — the six protected preview
  tests (test_open_file_preview_creates_preview_tab,
  test_double_click_promotes_preview,
  test_open_file_preview_double_click_promotes, test_edit_promotes_preview,
  test_save_promotes_preview, test_behavior_goto_tab_promotes_preview)
  assert on it by name and the issue calls for keeping them green
  unchanged — but it is now a cached mirror refreshed by the new
  `sync_preview_buffer_id` after every `preview_tab` mutation, rather than
  hand-assigned state. `state.preview: bool` on BufferState is untouched for
  the same reason (it feeds `[Preview]` in :ls and the italic tab render).

All 19 preview tests (core::engine::tests + render::tests) and the six
protected assertions pass unchanged. No behaviour change: all six promotion
triggers, including promote-on-select (goto_tab), are preserved verbatim.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

TUI: Migrate Source Control panel (commit row, branch picker, help dialog) to shared primitives

1 participant