sparkles:ui-app — Open issues
Companion to the feature requirements and the delivery plan. The normative decisions stay in those pages; this one records deferred decisions, the constraints behind them, and the measurements the plan is calibrated against. Close an entry only after the change lands, the affected requirement statuses are reconciled, and the closing commit is recorded.
UIAPP-O1 — One point size for every application
Status: open (decision taken and shipped in code, release notes outstanding). Requirements: CLI3.
The two applications shipped different default point sizes — 13 in apps/terminal, 14 in apps/hue — and the shared vocabulary (CLI1) can only have one. The decision is one shared default, defaultFontSizePoints (18 pt); both applications' defaults change.
The decision was first forced by the argument parser: it default-constructs the parameter struct internally, and while the fields were mixed into each application's struct, an application could not seed one. Applications now embed GuiOptions with @Flatten, and the parse starts from the struct's initial value, so a default given in the field's initializer holds until the user types the flag (CLI3). hue and the terminal keep the shared default (defaultFontSizePoints); an application whose content needs another size, such as the text lab's specimen, sets it there.
Close this entry when both applications ship the unified default and the change is noted in their release notes — a default point size is user-visible.
Two related user-visible consequences of CLI1, tracked here because they land with the same change: hue gains --font-dir and --font-codepoint-map (today internal to its Android path), and both applications' --help flag ordering changes.
UIAPP-O2 — Version propagation is proven
Status: closed — the spike ran and the assumption holds. Requirements:APP4, APP5.
The host's backend arms are conditionally compiled behind a version identifier that a dub configuration sets. Its public entry point is a template, so those arms are resolved during the consumer's compilation, and the design assumes dub propagates a dependency's version identifiers to its dependents.
A two-package spike settles it. The library declares two configurations, one of which sets a version identifier; the consumer selects between them with subConfiguration and calls both a template with a version-gated arm (its body analysed at the instantiation, in the consumer's compilation) and a non-template (resolved in the library's own):
Consumer's subConfiguration | Template arm | Non-template arm |
|---|---|---|
| the version-setting one | gated arm | gated arm |
| the plain one | plain arm | plain arm |
| none declared | plain arm | plain arm |
So a dependency's configuration versions do reach the dependent's compilation, and a version-gated template arm resolves the way the selected configuration says. APP3's three configurations are viable as specified; the package-split fallback is not needed.
Two things the spike also pins down, both worth knowing before the manifests are written: a consumer that declares no subConfiguration gets the library's first configuration, so the order of the blocks is load-bearing — the default must be listed first; and the propagation is not special to templates, which means a non-template helper behind the same gate behaves consistently rather than silently taking the other arm.
Closed by the P1.0 spike.
UIAPP-O3 — Non-interactive backends have no runtime shape yet
Status: open. Requirements: BKD1, BKD5.
Backend names four members, but the host only drives two. The HTML and ANSI members exist so that one vocabulary describes every sink an application can choose (BKD1), and the loop is specified to report them as non-interactive rather than attempt to open them.
What is not settled is whether the host should eventually own those sinks too — the toolkit already has an HTML interpreter, and a non-interactive ANSI render is a legitimate third target. Until an application asks for it, reporting is enough.
Close this entry when either the host grows the two sinks or the requirement is narrowed to two members with the static sinks documented as application-owned.
UIAPP-O4 — Coverage baseline and the excluded surface
Status: open. Requirements: TST4.
Nothing in the repository measures coverage today, and the three largest interactive modules are invisible to any measurement that might exist, because they are excluded from their unittest builds:
| Module | Lines | Why excluded |
|---|---|---|
apps/hue/src/gui.d | 2536 | links the GPU backend |
apps/hue/src/app.d | 934 | holds main |
apps/terminal/src/app.d | 1340 | holds main, links the GPU backend |
| Total | 4810 |
Counted 2026-08-06, before any migration work.
Re-counted 2026-08-09: gui.d 3162, hue app.d 1325, terminal app.d114 (the terminal-view extraction landed its target); total 4601. The hue modules grew while they waited — the audit trail the P2.B targets now carry.
P0.1 adds the measurement; phase 2 sets the per-module targets. This entry holds the numbers so the delta is auditable rather than remembered, and records the per-package coverage baseline once it is first measured.
Close this entry when the phase-2 targets are met or the shortfall is explained here.
UIAPP-O5 — Terminal-emulator rendering stays outside the display list
Status: open by design — the embedding mechanism is now decided. Requirements: HST3, HST10.
apps/terminal migrates onto the host but keeps its own renderer, reached through the host's direct-canvas level. Its paint loop walks a terminal screen cell by cell and is benchmarked; expressing it as a display list would mean rebuilding a hot path whose performance is a hard acceptance gate.
That is a legitimate use of the third render level rather than a shortcoming — but it does mean one of the host's three consumers exercises the widget and display-list levels only for its chrome. Revisit if the display list ever becomes cheap enough that the distinction stops mattering; the measurement, not the aesthetics, decides.
How the two levels compose (decided with HST10, built with libs/terminal-view): the terminal core becomes a component whose view emits a keyed widget for its pane — Widget.key plus keyedRects(tree, frames) already report a keyed node's laid-out rect, so layout sizes and positions the pane like any other widget while the per-cell renderer paints into that rect through the backend canvas, clipped. No new widget kind is needed and the closed sum (PRN12) stands. The missing piece is when that paint runs: on the GPU arm, canvas calls are only valid inside the frame bracket (beginFrame/endFrame), which the loop owns — so the arms need a post-layout paint hook in their draw phase. That hook is deliberately designed in the libs/terminal-view PR, against the real consumer, under the no-regression gate — not speculated here. Until it lands, runApp (HST10) is widget-level only.
UIAPP-O6 — Host canvas is not always an lvalue
Status: open (workaround shipped). Requirements: HST3, HST13.
Both live hosts expose the third render level as a factory method that returns a by-value handle each call:
// GuiHost
RaylibCanvas canvas() => RaylibCanvas(&session.fonts, &drawScratch, cellW, cellH);
// TuiHost
auto canvas() => GridCanvas(&session.grid, pageBg);That is convenient for the arms: the canvas is a cheap view over session state (fonts / grid / current cell metrics), so reconstructing it picks up a fontSize change, starts with an empty clip stack, and needs no long-lived object on the host. The recorder, by contrast, keeps RecordingCanvas as a field — it owns the captured ops, so mutations must hit that field.
The asymmetry is load-bearing at the call site. The immediate interpreter's paint used to take plain ref Canvas; a live temporary could not bind, and auto c = h.canvas; paint(c, ops) discarded the recorder's capture. The shipped workaround is auto ref on paint (libs/ui/interp/immediate.d), so .paint(h.canvas, ops) is correct on every host: lvalue by reference, rvalue by value. That is an interpreter patch for a host-contract gap, not a claim that by-value is a canvas property.
The right shape is still undecided:
- Stable lvalue on every host — a field (or
refreturn) refreshed at the start of the frame bracket, sopaintcan go back to plainrefand every consumer writes.paint(h.canvas, ops)without thinking about binding. - Leave the factory methods and keep
auto refas the permanent answer — document that live canvases are ephemeral handles and that the recorder is the one host whose canvas is owned state.
(1) tightens the host concept; (2) accepts the split. Either way the application must not branch on canvas type (diagram briefly did; that path is gone).
Close this entry when the host contract states one rule for canvas (lvalue everywhere, or "handle by value, recorder is the exception") and the live arms, the recorder, and paint's parameter match that rule with no auto ref needed only as a compatibility shim — or when (2) is chosen and the DDoc on paint / HST3 records the exception as intentional.
UIAPP-O7 — The client frame's icons follow the desktop's icon theme
Status: open (scouted). Requirements: F13, RES45.
The client frame (ClientFrame) draws its minimize, maximize, restore and close icons itself, from fills measured on one desktop. That desktop's icon theme was Yaru, not GNOME's default Adwaita, and the two differ:
| Icon | Adwaita 49 | Yaru |
|---|---|---|
| strokes | 2 units on the 16-unit grid | 1 unit |
window-restore-symbolic | one 6 × 6 square, centred (looks like maximize, smaller) | a 6 × 6 square at (4, 6) and, at opacity=".5", the top and right edges of one 2 units up and right |
The built-in icons follow Yaru today: the 1-unit stroke ("GTK 4.20 draws these icons' strokes a pixel wide") was measured beside a GTK header bar under Yaru, and restore copies Yaru's two windows. On a stock GNOME desktop both are wrong. A GTK header bar is right on both because it does not draw the icons: it names them.
What GTK does. GtkWindowControls asks the icon theme for window-minimize-symbolic, window-maximize-symbolic or window-restore-symbolic (by the window's maximized state) and window-close-symbolic (gtk/gtkwindowcontrols.c, GTK 4.20). The theme is the gtk-icon-theme-name setting, which on GNOME is org.gnome.desktop.interface icon-theme. A symbolic SVG is recoloured as it loads: every rect, circle and path fills with the foreground, .warning/.error/.success with the state colours, and opacity is kept (make_stylesheet, gtk/gdktextureutils.c). GTK 4.20 parses simple symbolic SVGs into paths itself (gsk_render_node_new_from_bytes_symbolic) and falls back to librsvg.
What following the theme needs:
- The setting, live.
org.freedesktop.portal.Settings.ReadOne("org.gnome.desktop.interface", "icon-theme"), and theSettingChangedsignal for changes. This is the same D-Bus client the colour scheme, accent and contrast need (RES45); without a portal the theme isAdwaita. - The lookup of the Icon Theme Specification:
- search
$XDG_DATA_HOME/icons,~/.iconsand each$XDG_DATA_DIRS/*/icons(Yaru was found through~/.nix-profile/share/iconsonXDG_DATA_DIRS); - parse
index.theme:Inherits(Yaru inheritsHumanity,hicolor) and each directory'sSize,Scale,Type(Fixed,Scalable,Threshold),MinSize/MaxSizeandThreshold; - pick the closest match for 16 px at the window's scale, walking
Inheritsand thenhicolor. Yaru keeps these icons inscalable/ui.
- search
- Rendering a symbolic SVG. The repository has no SVG rasteriser (
sparkles:imagereads PNG). The icons are a few filled paths (M,m,h,v,z, sometimes curves), atransformand anopacity. A D reader for that subset, whose coverage the canvas fills, mirrors GTK's own fast path; librsvg over ImportC would bring Rust and cairo. An icon outside the subset falls back to the built-in drawing. - Recolouring as GTK does: fills to the frame's foreground, opacity kept.
- The pixel grid. The SVG drawn at 16 px per CSS pixel and the window's scale, its centre on the disc's (
ui_app.client_frame.everyIconIsCentredOnItsDisc). - A change while running re-reads the theme and redraws the frame, as equivalent to a cold start as
RES45asks.
Until then the built-in icons should match the default theme, Adwaita: 2-unit strokes and its single-square restore.
Close this entry when the frame draws the desktop's theme icons, with the built-in drawing as the fallback, and a test renders window-restore-symbolic from Adwaita and from Yaru.