0033: One status pill for every notice
Status: Accepted (owner, 2026-11-24). Proposed (my call, 2026-11-18, from the owner's "we should have a single strategy to 'notify and indicate'": the overlay's toasts, the "On the TV" marker and the shell's own notes were three answers to one question)
Context
A notice today is one of three things: a GTK overlay per toast (docker exec
couchdogs-overlay, about 60 ms and a new process each time, ADR 0019), the
"On the TV" pill the server blends into one guest's stream (marker.cpp), or an
in-page card in the shell. They look different, are animated differently, and
nothing shows a hold in progress. The owner asked for one indicator, a visible
progress while Guide is held, the join ring folded into it, and some animation.
Decision
One pill, top left at the marker's 12 px margin (1080p; a join's pill, the
server's in a stream and the viewer's on the TV, one row lower at 96 px, because
the picture under it is a screen whose own pill uses the first row), with four states:
toast (text), prompt (text and key chips), badge (the join ring alone) and
progress (a hold filling up). stack/images/screen/pill.py is the one art
module: geometry, colours, glyphs, words, and the Pillow renderer for the PNGs
the server bakes and the viewer shows. The screen overlay draws the same shapes
with cairo from that module.
The screen's drawer is a long-running couchdogs-overlay daemon in the screen
container, started beside couchdogs-input (ADR 0028). Notices are JSON
datagrams on couchdogs-overlay.sock in the screen's run directory, which the
runner already reaches (the TV through the tv-run volume, a device screen
through couchdogs-screens), so a notice costs one datagram, not a process.
The runner has one notify API for it (one screen), and its toasts go through
it. The shell's transient
news goes through it too; its interactive cards (PIN, sign-in code) stay.
The server's stream drawer keeps the "On the TV" words, adds "On another screen", shows the join ring for as long as a device watches any other screen, and draws a hold as the ring growing into "Leave" with its meter, from 30 baked frames the art module generates. A hold is one start message and one cancel, animated by whichever drawer the person is looking at: the screen's overlay for Home on a device's own screen, the server's stream for Leave while it watches another (padd tells each directly; the source poll is once a second and a hold is one second). A lost cancel never sticks: the overlay drops a progress at its end, the stream a second after it. Guide on a "short" front (Home on release however early) shows no progress: a bar left half full would say the release cancels Home. A lone Back is held back there too, so it keeps its bar. A screen already showing its own home and watching no other shows no bar at all: Home would change nothing there. Animation is opacity and transform only, the overlay draws only while the pill moves and unmaps its window when idle, so Gamescope is never left drawing.
Consequences
- ADR 0019's one-shot overlay is superseded as the notice path (its window recipe is kept); the M6c marker's two states are superseded by the pill.
- The pill daemon is one more process in every screen, so it has its own small respawn loop and no per-notice cost; a screen without it only loses notices.
- Notices stay courtesies: never raising, never blocking a join, and the holder of the device's stream is told by padd, not by the runner, for the one thing that has to arrive in under a second.
- The screen overlay's words use the system sans (the screen image carries no Quicksand); the geometry, colours and words are the art module's either way.
- One Controls row in Settings explains the gestures, and the first app that opens on a screen shows a short hint through the pill, once per screen.
- One pill per screen, so two pads holding at once share one bar: the first release takes it away while the other still holds. Accepted (2026-11-19): each pad's Home still goes at its own second, and a bar per pad would need a hold id carried through padd, the runner, the overlay and the stream's baked frames.
Amendment (2026-11-19): the words fade into the ring
The owner asked for some animation on the pill and the rest of the UI. The stream
pill's words now crossfade into the join ring in their last 320 ms, in 8 steps
(marker_fade_step, an opacity on the blend), and the TV's viewer crossfades
its two overlays in the same steps (view.py), instead of both jumping. Steps,
not frames: a still picture is re-marked 8 times, then never again. The shell's
pages fade and rise in once on a change (0.2 s, CSS only). No other motion was
added: anything that moves while idle would keep Gamescope and the encoder busy.
Amendment (2026-11-19): a keyboard's lone Escape
The owner streams to a Mac with only a keyboard and a trackpad and asked what the go home button is there: nothing, since Guide and a lone Back are pad gestures. A lone Escape held for 1 s on a streamed device's keyboard now does exactly what that device's lone Back held does: Home on its own screen, ending a join if it watches another screen, with the same pill (Home, or Leave while joined and the 150 ms before it shows). The same rules as a lone Back: Escape is held back from the app while it is alone; let go before the second, the app gets an Escape tap (down at the release, up 50 ms later, so an app polling once a frame still sees it); another key while it is held sends Escape on at once and then that key, so Escape is an ordinary key and there is no Home; the release after Home is swallowed; key repeat neither restarts nor breaks the hold; a key already down (Ctrl, Alt, Shift, Cmd) means it is not lone.
Who decides what: the server's control channel owns the key and its timing,
because it is the one that has to hold the key back and swallow the release
(src/key_hold.{hpp,cpp}), and padd owns what Home means. The server tells padd
hold_start, hold_cancel or hold_home on the padd socket its pads already
use, and padd runs the router's existing hold: the same label, the same screen,
the same progress notice, the same runner Home. So Home or Leave and the pill are
still decided in one place, and the server has no second copy of them. A padd
that is down loses that Home, exactly as it loses a pad's lone Back (and a
device's pads are gone with it).
Not chosen: the server deciding Home itself and drawing its own progress (two places deciding Home and two pills).
Amendment (2026-11-20): the joined screen's toast speaks, the ring stays
The owner saw two pills on a join: the joined screen's own "kMarkerQuiet), the ring fading in over their last 320 ms,
then the ring alone at the top left margin, the corner the joined screen's own
pill uses once its toast is gone. A hold still grows the ring into "Leave",
also during the quiet time. The words PNGs and the one-row-lower offset are
gone; the art module keeps the glyphs the overlay uses.
Amendment (2026-11-21): no join toast, the joiner's pill speaks
The joined screen's "
Amendment (2026-11-21): join toasts are back
ADR 0036 keeps every screen's notices out of the picture it shares, so the
joined screen toasts "
Amendment (2026-11-21): the pill lives in the logo block
The owner asked for the pill to line up with the shell's logo block, the join
ring centred in the block's space left of the dog mark, and a notice to take
the whole block's shape while it shows, opaque, so the logo under it no longer
shows through its words. Every drawer now places the art from the screen's top
left (no margin): the badge is a 72 px circle at the centre of that space
(57.6, 64.8 at 1080p), and a words pill (toast, prompt, "On the TV", a hold's
"Leave") is the block's shape, flush with the left edge, 86.4 px tall from
21.6, at least as wide as the widest block, its words where the dog mark
starts. A hold grows the badge into that shape (pill.progress_shape, shared
by the baked frames and the overlay). The background is the page's charcoal at
full opacity. The shell's block padding is calc(32vh / 3) (6vw at 16:9), so
the space scales with height like the art. A device's own notice is drawn after
the join ring and covers it while it shows.
Amendment (2026-11-21): exactly the block, no prompt
The owner saw notices wider than the logo block, and a prompt with key chips
that was taller. Now the block is one fixed width on every page (shell.css
#where, 68vh: the longest name, Settings, fits) and every words pill is
exactly that box, 734.4 by 86.4 at 1080p. Words too long for it are set
smaller, down to 28 px, then cut with an ellipsis (pill.fit, which each
drawer measures with its own font). The prompt state is gone: nothing sent
one since ADR 0027 removed the ask, and a question with answers is the shell's
centred card, not a pill. The pill has three states: toast, badge, progress.
Amendment (2026-11-21): one radius, an opaque track
The owner saw the hold's unfilled meter as fully transparent, so it looked odd
over the logo, and the logo block's right end rounder than every other box in
the shell. The track is now one opaque colour, warm white at 0.30 flattened
over the pill's charcoal (pill.TRACK, alpha 255), in both drawers, and while
the words and meter fade in it is blended toward that charcoal as a solid
colour rather than drawn with a lower alpha (pill.track_color). The block's
right end is 1.5vh, the radius of the app tiles, the store buttons and the
cards (pill.LOGO_R, 16.2 px at 1080p), which every words pill and the server's
baked art take; the left end stays square against the screen's edge, and the
badge stays a circle, a hold interpolating from that circle's radius to the
block's. The shell's #where block carries the same 1.5vh, so the block and a
notice over it read as one of the shell's own boxes.
Amendment (2026-11-21): app switches fade, glyphs centred, fresh device screens
The hint's icon sat high because one glyph was drawn high: screen now spans
15..49 of its box, centred like the others, and a test holds every glyph to it.
Gamescope's --fade-out-duration cannot fade our app switches: with -e
(steam mode, which screen/entry.sh needs) no window has an appID, so
win_has_game_id is false (steamcompmgr.cpp 5803, 3995, 5474), and
paint_pipewire paints one window at full opacity, once per commit (2969).
So app switches still cut. A device opening its screen with an older image
than its tag, no app on it, and nobody streaming or watching it (the rename's
rule for free, so a keepalive never blacks out a live stream) now gets the
screen and shell made again.
Amendment (2026-11-21): a smaller ring that dims
The owner: the "we are on another screen" indicator is a bit too big and should fade out a bit after a while. The joiner's words now show for 3 s (was 5), the badge is a 48 px ring (was 72, its glyph 37 px so the ring keeps its share of the circle), and 10 s after the ring appears it fades down to 40% of its opacity in the crossfade's 8 steps and stays there. A hold is drawn at full opacity, and its cancel starts the 10 s again. Both drawers do it: the server's stream marker and the TV's viewer.
Gamescope sends a frame only when its screen changes, so a still picture needs
a fresh frame for each step: the server's pacer repeats the last frame and the
stream re-marks it when the opacity steps, and the viewer's pipewiresrc
resends its last frame every 40 ms (keepalive-time, view.py's step tick),
which also lets the words' crossfade show on a still screen.
Amendment (2026-11-21): leaving a joined app
The owner: "there's a gap here. it's the same action to leave apps and leave
screens. what if I'm on another screen and want to leave an app?" and "I don't
think we need new screens? we have the center modal for that". A Leave on a
screen a home joined still lands on that home, as it did. Every home has this
card, the TV's included: the TV is one screen among devices (the owner). When
the Leave ended a join to a screen with an app in front (not that screen's
shell), the runner notes it once for that home and the home opens the usual
centred card: "
Not chosen: a menu drawn over the joined picture (a screen's notices stay out of the picture it shares, ADR 0036, and the people there did not ask), and a new page for it.
Amendment (2026-11-24): the join ring is a menu
The owner: the joined "icon" could be a menu to leave a session, "Don't reinvent
the wheel... expand on the notification pill at least lookswise", and a joiner may
close the app. A tap or left click on the ring of a device that is joined opens a
fourth pill state, menu: the logo block with the ring glyph and one chip per
item, Leave and, when the joined screen has an app in front, Close
The device's own overlay draws it (overlay.py, op menu, the same block, font,
radius and track as every other state) and writes the chips' boxes into its frame
file (ADR 0036, frame v2); the server only matches a tap to a box and tells the
runner (POST /screens/<device>/menu), it draws nothing. A tap that opens or
picks is eaten with its release; with no menu up nothing is eaten. Pads and the
TV keep Back held: no pointer there.
Amendment (2026-11-24): the leave card becomes a toast
The owner, reviewing the home: the card asked a question the Join page already
answers. Leaving a joined screen now only toasts the leaver's home: "/left and the page's card are gone.
What the card offered stays one step away: the Join page row joins again, and
the home tile's "On