Skip to content

refactor(tui): migrate Extension Panel to quadraui TreeView (#476) - #482

Merged
JDonaghy merged 1 commit into
developfrom
issue-476-ext-panel-tree-view
May 19, 2026
Merged

refactor(tui): migrate Extension Panel to quadraui TreeView (#476)#482
JDonaghy merged 1 commit into
developfrom
issue-476-ext-panel-tree-view

Conversation

@JDonaghy

Copy link
Copy Markdown
Owner

Summary

  • New render::ext_panel_to_tree_view() adapts ExtPanelData into quadraui::TreeView (section headers + indented items + chevrons + combined badges/action labels).
  • TUI render_ext_panel() rewired: chrome via quadraui::tui::draw_settings_chrome, body via Backend::draw_tree. Manual scrollbar + scroll-surface registration kept (TreeView doesn't paint scrollbars yet); help-popup overlay unchanged.
  • build_ext_panel_data() now resolves engine.ext_panel_tree_expanded overrides into the cloned item.expanded so the builder stays engine-free, matching the ext_sidebar_to_tree_view() pattern.

Net: panels.rs −252 / +101, render.rs +154 (builder + 2 unit tests).

Known visual difference

Separator rows (item.is_separator) render as a single glyph instead of the full-width rule the legacy renderer drew — the TreeView primitive has no Decoration::Separator. No shipping plugin uses separators today; if we want the full rule back, file a quadraui gap for the primitive.

Pre-existing bugs surfaced during smoke testing (not introduced by this PR)

mouse.rs is unchanged by this PR. Three behaviors flagged during smoke test that are byte-for-byte identical to develop:

  1. / activates search input but typing doesn't filter — engine fires panel_input to the plugin; filtering is the plugin's job.
  2. Click on a section header doesn't toggle expand (Enter does) — click handler calls the same handle_ext_panel_key(\"Return\", ...) Enter does. Likely an Alacritty Down/Up quirk similar to TUI: right-click on explorer does nothing (engine state opens but menu doesn't render or dispatch) #451.
  3. Scroll wheel doesn't work though scrollbar drag does — registration + dispatch identical to develop.

Filed as separate follow-ups.

Test plan

  • cargo build --no-default-features
  • cargo test --no-default-features (43 binaries, 0 failures, 2 new render tests covering tree shape + focus state)
  • cargo clippy --no-default-features -- -D warnings
  • cargo fmt
  • Smoke test against git_insights plugin: title renders, chrome shows search row when active, j/k navigates, Enter expands sections, scrollbar thumb tracks, help popup unaffected
  • Need a plugin with separators to confirm the visual approximation looks acceptable (none in tree today)

Closes #476.

🤖 Generated with Claude Code

`render::ext_panel_to_tree_view()` adapts `ExtPanelData` into a
`quadraui::TreeView`: section headers become `Decoration::Header`
rows with `is_expanded: Some(section.expanded)`; items map indent
+ `ExtPanelStyle` → `Decoration` (Accent uses a `StyledSpan` with
`theme.keyword` since the primitive has no first-class accent);
badges + action labels + hint combine into one right-aligned
`Badge`; expandable items carry `is_expanded: Some(item.expanded)`
so the primitive draws the chevron.

`build_ext_panel_data()` resolves `engine.ext_panel_tree_expanded`
overrides into the cloned `item.expanded` so the builder stays
engine-free (matches the `ext_sidebar_to_tree_view()` pattern).

The TUI `render_ext_panel()` now takes `(backend, frame, area,
engine, theme)`: chrome routes through `quadraui::tui::draw_settings_chrome`
(1 row when input hidden, 2 rows when visible — matching the
legacy conditional), body routes through `Backend::draw_tree`
inside `enter_frame_scope`. Scrollbar drawing + scroll-surface
registration stay manual (TreeView primitive doesn't paint a
scrollbar yet) and the help-popup overlay is unchanged.

Net: `panels.rs −252 / +101`, `render.rs +154` (builder + two
unit tests covering tree shape, selection mapping, focus state).

Separator rows (`item.is_separator`) render as a `Decoration::Muted`
row with a single `─` glyph rather than the full-width rule the
legacy renderer drew. The primitive has no `Decoration::Separator`;
acceptable for now since no shipping plugin uses separators.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JDonaghy

Copy link
Copy Markdown
Owner Author

Coordinator review — approve

Clean migration. −252 lines of manual cell-painting replaced by ext_panel_to_tree_view() builder + draw_tree call. Key things verified:

Ready to merge. Smoke test needed on Desktop A (GTK) to confirm no regression on that backend — this PR only changed TUI + render.rs, but the render.rs builder is shared.

@JDonaghy
JDonaghy merged commit c040024 into develop May 19, 2026
JDonaghy added a commit that referenced this pull request May 19, 2026
Logs the parallel agent stream that ran alongside session 388: TUI
convergence backlog (#474#475-#481 + quadraui#218), Extension
Panel → TreeView (#476 / PR #482), and 3 pre-existing ext-panel
bugs filed during smoke testing (#483, #484, #485).

Bumps the SESSION_HISTORY pointer in PROJECT_STATE to "Sessions 388
and earlier" now that 389 lives there.

Co-Authored-By: Claude Opus 4.7 (1M context) <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.

1 participant