Skip to content

TUI: Add ext_panel_to_tree_view() builder and migrate Extension Panel to TreeView #476

Description

@JDonaghy

Tier: Ready now (no quadraui gap — render.rs builder + TreeView primitive both exist)

Summary

render_ext_panel() in src/tui_main/panels.rs:1173–1525 (~326 lines, 70+ `set_cell` calls per row) hand-rolls flat-list construction, row rendering, section expansion, color dispatch by hint marker, icon padding, badge rendering, action labels, and a manual scrollbar. The shared ext_sidebar_to_tree_view() builder in render.rs:7331 is the right shape but operates on ExtSidebarData, not the distinct ExtPanelData type (render.rs:1639).

What exists

What to do

  1. Add render::ext_panel_to_tree_view(panel: &ExtPanelData, theme: &Theme) -> quadraui::TreeView (or MultiSectionView if sections-with-headers are needed) modeled on the existing ExtSidebar builder.
  2. Map ExtPanel-specific concepts (sections, chevrons, badges, action labels, ExtPanelStyle) into TreeView nodes + the controller's badge/action node fields. If anything doesn't fit, file a quadraui gap.
  3. Replace render_ext_panel() body with: build via the new fn, render via Backend::draw_tree_view() (or equivalent), route hit-tests through the layout's hit_test().
  4. Move scroll/expansion state ownership to the engine (the sidebar version already uses ext_panel_tree_expanded — generalize if needed).

Files

  • src/render.rs — add new builder.
  • src/tui_main/panels.rs — delete most of render_ext_panel() body (~326 lines down to ~30–50 lines of wiring).
  • Likely also src/gtk/draw.rs — switch GTK to the same builder for symmetry (the GTK path is out of scope for the issue body but the builder will be shared).

Dependencies

None — both render.rs builder and quadraui::TreeView are existing infrastructure. Sibling to GTK's same migration.

Notes

Part of the TUI convergence backlog (#474). The biggest single dedup in panels.rs. Confirm whether ExtPanel data needs TreeView or MultiSectionView — the sidebar uses both flavors (#293 introduced the multi-section variant).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuiUI/rendering

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions