Skip to content

hue tab view — Feature Requirements (interactive component) ​

Status: planned · Date: 2026-07-23 · Scope: a reusable tab view component — a tab bar + a single visible panel, with an active-tab state machine — a sparkles:ui widget on GUI / TUI / HTML. Initial use cases: open files as tabs and code groups (the VitePress markdown extension).

NOTE

Forward-looking — every row is not started. It reuses the same widget/state pattern as the tree/DAG view. Status legend and IDs: see the overview.

Design & rationale ​

The tab view is a level-3 widget in the UI component library (ui-architecture.md WGT): one view(state) → Widget across all three targets, with its parts on the library's levels — an active-tab state machine (level 1, STM), a tab-bar + panel layout (level 2, LAY), and per-backend rendering. It is the shared component for tabs inside content — inline code groups in the markdown preview and the PR session (see TBU). The viewer's open-file tabs are not inline content: they are dock panes through the workspace adapter it shares with the editor (DCK16), so hue and the editor have one tab, split and persistence model.

Its HTML rendering is pure CSS (radio inputs + :checked, no JS) — which is exactly how VitePress's own code-group renders, and matches hue's established no-JS doctrine (folding FLD10, notifier, twoslash HTML).

Tab view component (TAB) ​

IDRequirementStatusTraces to
TAB1A tab view must render a tab bar (each tab a label + optional icon and close affordance) plus a single visible content panel; the active tab selects the panel.not startedproposed sparkles:ui tab widget
TAB2The active-tab selection must be a presentation-free state machine (the ui-architecture STM level), consumed identically by GUI/TUI/HTML.not startedSTM
TAB3Interaction — click a tab to activate (GUI/TUI SGR mouse); keyboard next/prev + direct select ([/], Ctrl-Tab, number keys); a close affordance where the adapter enables it.not startedgui.d/previewer.d input; TIN
TAB4Overflow — when tabs exceed the available width, the bar must scroll or provide an overflow affordance (not wrap chaotically); the active tab stays visible.not startedproposed tab-bar overflow
TAB5Per-tab decorations must be data-driven — label, icon, modified/close badge — supplied by the use-case adapter (TBU), not hardcoded.not startedadapter-supplied tab view
TAB6Degradation — an empty tab set renders nothing; a single tab may render its panel without a bar (an adapter choice); never a crash.not startedtotality

Per-backend rendering (TBB) ​

IDRequirementStatusTraces to
TBB1GUI — the tab bar draws on the canvas (labels + active underline/fill), panels swap; mouse hit-test + keys.not startedgui.md; TGT1
TBB2TUI — the tab bar in cells (labels + separators + active highlight, box-drawing), SGR-mouse click + keys.not startedtui.md; TGT2
TBB3HTML — pure-CSS tabs (radio inputs + :checked sibling selectors, no JS — the VitePress code-group idiom), default first tab.not startedapp.d HTML branch; FLD10

Use cases (TBU) ​

Each use case is a thin adapter supplying the tabs (labels + panels + which have a close button) and consuming the shared component.

IDUse caseAdapterStatusTraces to
TBU1Open files as tabsopen files are dock panes through the shared workspace adapter (DCK16–DCK18), the one the editor uses: a tabbed group per dock group (DCK4), a close and modified badge per tab, documents identified by DocumentId so a file opened twice is one document, and splits. Opening a file via navigation LNK3 adds or activates its pane. This use case does not consume the inline tab view (TAB1–TAB6), which stays for content that is not a pane (TBU2, TBU3).plannednavigation.md LNK3; multi-doc session
TBU2Code group (VitePress)the ::: code-group container of labeled fences (```js [label]) becomes an inline tabbed code block in the preview — a block reserving rows (like a media block MDB1 / code block) with a tab bar; first tab default. Requires the markdown model to parse the container + fence [label].not startedsparkles:syntax md/model.d (code-group parse); gui.md COD
TBU3PR-session tabsa PR/MR session (DPR2) surfaces as tabs — description (markdown preview) · changed files (the diff session) · later checks; and the diff session's changed files feed the open-files tabs (TBU1).not starteddiff-view.md DPR2/DVS4; TBU1

Milestones ​

MilestoneScopeStatusRequirements
B0Tab component (bar + active-tab state + panel swap) — GUI + TUInot startedTAB1–TAB3, TBB1/2
B1Open-files tabs through the shared dock workspace (editor milestone M-d)plannedTBU1; DCK16–DCK18
B2Code-group markdown parsing + inline tabbed code blocknot startedTBU2
B3HTML pure-CSS tabsnot startedTBB3

Relationship to existing specs ​

PieceRole
ui-architecture.md WGT/STM/LAYthe widget/state/layout levels this component instantiates
tree-view.mdsibling sparkles:ui widget (same pattern)
navigation.md LNK3opening files feeds the open-files tabs (TBU1)
viewer.md COD; sparkles:syntax MdDoccode-block rendering + the code-group parse (TBU2)
media.md MDB1the "block reserving rows in the preview" analog for TBU2

→ UI architecture · Tree / DAG view · Navigation · Overview