Skip to content

GTK: the VS Code-style Command Center (nav arrows + search box) was dropped by the #540 Relm4→ShellApp cutover and never re-wired #676

Description

@JDonaghy

Summary

The GTK backend has silently lost its VS Code–style Command Center — the ◀ ▶ nav arrows
plus the centered 🔍 <project> search box in the title-bar row (quadraui's CommandCenter
primitive, landed for both backends in #310 / b5fdd7d). Clicking the search box is the
discoverable entry point to the unified picker with prefix routing (> commands, @ symbols,
: line, # …).

It is collateral damage from the Relm4 → ShellApp cutover, commit c35aea4
("feat(#540): flip GTK main loop from Relm4 to ShellApp runner (#448-C)", 2026-06-28).
That commit deleted impl SimpleComponent for App (~3,059 lines). Inside the deleted Relm4
view! scaffolding lived the titlebar DrawingArea draw closure that called
quadraui::gtk::draw_command_center(...) and stashed the result in engine.command_center_layout,
plus the sibling click handler that hit-tested it. The replacement
impl quadraui::ShellApp for App::render_content never ported either half.

This is the same bug family as the other #540 fallout already fixed one at a time — #546
(dialog / context menu never painted), #547 (nerd fonts), #552 (window controls / CSD), #555
(breadcrumb bar), #556 (dock icon), #557 (extension panels), #587 (picker + panel accelerators),
#544 (sidebar panel clicks). The command center is simply the one nobody re-listed.

Expected

On GTK, the title-bar row shows ◀ ▶ nav arrows and a centered 🔍 <project-name> search box
between the menu labels (File / Edit / View …) and the inline window controls (min / max / close).
Clicking / navigates tab history; clicking the search box opens the unified picker
(Engine::open_command_center()).

Actual

Nothing is painted in that region and nothing is clickable there. The band from the end of the
menu labels to the right window edge is claimed end-to-end by the window-controls status bar.

Repro

  1. cargo run --features gui (GTK build).
  2. Look at the title-bar row: File / Edit / View … on the left, min/max/close on the right,
    empty band in between — no arrows, no search box.
  3. Click anywhere in that empty band → nothing happens.
  4. Compare with the TUI (cargo run in vscode-mode, or Alt to reveal the menu bar): the arrows
    and search box are present and clickable.

Evidence — current state of the tree

Paint Click Status
TUI src/tui_main/shell_app.rs:1359-1377 (ported by #635, Stage 6b item A) src/tui_main/mouse.rs:1978-1995 intact
GTK ❌ nothing in src/gtk/** calls draw_command_center or build_command_center_view ❌ no command_center_layout hit-test anywhere in src/gtk/ gone

Corroborating details:

  • The real estate is being painted over. src/gtk/mod.rs:8255-8276 computes
    controls_rect = menu_end → right window edge, and src/gtk/mod.rs:8884 paints
    render::window_controls_status_bar across all of it. quadraui::gtk::draw_status_bar
    background-fills its entire rect (quadraui/src/gtk/status_bar.rs:73-80), so even the gap is
    claimed.
  • engine.command_center_layout is permanently None on GTK — never written by the ShellApp
    path, so any hit-test would fail even if one existed.
  • menu_bar_da is a dead husk. Declared src/gtk/mod.rs:509, initialised to None at
    :1544, and never assigned Some — four dead reads remain at :2134, :5452, :5460,
    :7532. That is the orphaned handle to the old Relm4 titlebar drawing area.
  • src/gtk/draw.rs never had it — the legacy Cairo path (already dead under ShellApp) has no
    command-center code, so there is no second call site to revive. The only one was in mod.rs's
    deleted view! block.
  • Docs are stale: PROJECT_STATE.md:92 still claims Command center (nav arrows + search box) | CommandCenter | ✅ | ✅.

What still works on GTK: :CommandCenter (src/core/engine/execute.rs:1999) and Ctrl+Shift+P
(accelerators restored in #587) both open the picker correctly. It is purely the bar — the
visible entry point and its arrows — that is missing.

Nothing was deleted from quadraui

The whole API surface is live and already exported, so this is wiring, not a rebuild:

  • quadraui::{CommandCenter, CommandCenterHit, CommandCenterLayout, CommandCenterMeasure}
    (quadraui/src/lib.rs:159, primitive at quadraui/src/primitives/command_center.rs)
  • Backend::draw_command_center (quadraui/src/backend.rs:1157) and
    Backend::command_center_layout (:1160) — trait methods, available to GTK today
  • quadraui::gtk::draw_command_center (quadraui/src/gtk/command_center.rs:50) — the GTK
    rasteriser, still implemented and still wired into the GTK backend at
    quadraui/src/gtk/backend.rs:2882
  • render::build_command_center_view (src/render.rs:4065) — backend-agnostic, already shared

Proposed fix

  1. Narrow controls_rect. In render_content (src/gtk/mod.rs:8255-8276), measure the three
    window-control buttons with backend.status_bar_layout(...) and shrink the controls rect to
    just that right-aligned width, instead of handing them the entire menu_end → right edge band.
  2. Paint the command center in the freed gap, using render::build_command_center_view( engine.tab_nav_can_go_back(), engine.tab_nav_can_go_forward(), &title) and
    backend.draw_command_center(gap_rect, &cc).
    Ordering is load-bearing: it must be painted after menu_system.borrow().render(...)
    (src/gtk/mod.rs:8788), which repaints draw_menu_bar across the full menu_row_rect band.
    Painting before it reproduces the #448-E: GTK window chrome lost after ShellApp flip — WM titlebar returns, menu bar + inline min/max buttons gone #552 round-2/3 "buttons render blank" regression verbatim.
  3. Cache the layout into engine.command_center_layout (and clear it to None when
    menu_bar_visible is false), mirroring src/tui_main/shell_app.rs:1377 / :1381.
  4. Hit-test on click in handle_mouse_click_msg (src/gtk/mod.rs:3698):
    Back → tab_nav_back(), Forward → tab_nav_forward(), SearchBox → open_command_center()
    — mirroring src/tui_main/mouse.rs:1983-1993. Must run before the window-controls
    hit-test so it isn't swallowed.
  5. Delete the dead menu_bar_da field and its four dead reads.
  6. Fix PROJECT_STATE.md:92 to reflect reality once the fix lands.

Design note — deliberate GTK/TUI divergence

GTK forces menu_bar_visible = true at startup (src/gtk/mod.rs:8171), whereas the TUI shows the
menu row only in vscode-mode or on Alt. So on GTK the command center returns permanently
visible
— which is both the pre-#540 behaviour and the VS Code behaviour this was modelled on.
Gate the GTK paint on engine.menu_bar_visible anyway (same condition as TUI) so the two
backends stay structurally identical; the flag just happens to always be true on GTK.

Black-box test

Per CLAUDE.md this is behaviour-changing and needs a black-box test. Use the GTK headless
pixel-probe harness in src/gtk/testing.rs and follow the pattern established by #555
("test(#555): assert the breadcrumb dropdown paints via pixels, not painted text", 755d732) —
assert on painted pixels, not on painted text, since these are icon glyphs. Cover:

Files

  • src/gtk/mod.rs
  • src/gtk/testing.rs
  • PROJECT_STATE.md

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

    bugSomething isn't workingcoordTracked by coord-tui pipelinestatus:readyRefined and ready to enter the work pipelineuiUI/rendering

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions