← board

feature: Eliah pane header — labelled collapse strip + chevron

Goal

Give every pane a small header (title + collapse chevron ▾/▸) so a pane can be collapsed/restored by clicking its own header — Lazarus/VS Code tool-window style — instead of only through the View menu.

Why

Split out of feature-eliah-pane-collapse (closed done 2026-07-05): the underlying collapse/restore/ratio-memory mechanics (TPaned.Collapse et al.) shipped and are menu-driven today. The labelled clickable strip was deferred because PCL had no stacking container to build a header row with; that container (TBox, lib/pcl/extctrls.pas) now exists and is smoke-tested.

Scope

Acceptance

Each pane shows a header with a chevron; clicking it collapses to a thin labelled strip; clicking again restores the previous ratio. gui_suite + apps/ide/test.sh green; Xvfb screenshot shows one collapsed strip + the rest of the layout intact.

Log

Done 2026-07-05

Shipped with a simpler header widget than originally scoped: a full-width TButton per pane (caption = chevron char + title, e.g. v Project / > Project) instead of a separate label+chevron pair — reuses the exact button+OnClick pattern already used by every other control in this file, no new event wiring needed. Chevron flips v/> on toggle to show open/closed state (plain ASCII, not the unicode ▾/▸ glyphs originally proposed — simpler and avoids any font/encoding risk in the .lfm text format).

TBox gained the packing rule this needed: first child packed into a TBox keeps its natural size (the header), every child packed after it expands/fills the remaining space (lib/pcl/gtk3widgets.pas SetParent, using gtk_container_get_children/g_list_length — both added to gtk3_c.h — to detect "is this the first child"). This is a general TBox rule, not Eliah-specific, so future TBox users get header-then-content layout for free.

Wired in apps/ide/eliah/eliah.lfm: leftBox/rightBox/outputBox (TBox, Vertical) each wrap a header TButton + the pre-existing pane content (colLeft, colRight, Output) — the existing named objects are untouched, just nested one level deeper; name-based .lfm streaming binds through the extra nesting with no changes needed to the binder. Header OnClick reuses the existing OnToggleLeft/OnToggleRight/OnToggleOutput handlers verbatim — no new collapse mechanics, exactly as scoped.

Fixed one bug caught before commit: OnToggleOutput read colCenter.CollapsedPane unguarded after the existing if colCenter <> nil check on the line above it — unreachable in practice (colCenter is always bound by the time a click can fire) but inconsistent; added the same nil guard.

Verified: apps/ide/build.sh clean, apps/ide/test.sh 162/162, tools/gui_suite.sh all green (eliah_ide included), Xvfb screenshot (tools/gui_shot.sh) confirms all three header strips render full-width with correct chevron/title and content still filling the remaining space correctly.