Repository navigation
Closed
Labels
Description
Problem
A layout block can hide only when a field is empty (hideWhenEmpty). It can't follow what a field says, such as a calendar widget's phase (later, soon, now, live):
- On the bar, a meeting widget can't show the start time while the meeting is later, "in 8 min" before it starts and "8 min left" while it runs, or a dot in place of the calendar symbol while it's live.
- In a popup, it can't show "Starts in 8 min" or "Live · 8 min left", or a Calendar access button only when
fields.accessisn'tgranted. - A list row can't change with one of its fields, such as fading the events that have ended.
- A provider widget can't hide when the calendar has no meetings (
phaseisnone) and still showNo calendar access:hideWhenEmpty: "title"hides both.
Proposal
showWhen and hideWhen on any layout block: a widget's layout, hoverLayout and overlay, popups and list rows.
- Each takes a condition as a rule's
whendoes,{ "field": "phase", "equals": "live" }or{ "value": "remaining", "below": 0.2 }, or a list of them, any of which matches. showWhenshows the block only while it matches;hideWhenhides it while it matches.- In a list row, fields come from the row, as for
hideWhenEmpty. - A hidden block takes no space, like one hidden by
hideWhenEmpty, and a script or provider widget whose blocks are all hidden is hidden (A widget with no visible output yet shows an empty pill, or only a red dot when its script fails #379).
{ "type": "symbol", "name": "calendar", "hideWhen": { "field": "phase", "equals": "live" } },
{ "type": "symbol", "name": "circle.fill", "showWhen": { "field": "phase", "equals": "live" } },
{
"type": "row",
"showWhen": [{ "field": "phase", "equals": "soon" }, { "field": "phase", "equals": "now" }],
"children": [{ "type": "text", "text": "in" }, { "type": "field", "field": "minutes" }, { "type": "text", "text": "min" }]
}The keys are new, so existing configurations don't change.
Possible today
Partly, and only on the bar: rules set a data state from phase, and a block's style.states.<state> with width: 0 and opacity: 0 hides it. A row's spacing still shows around the hidden block, popups don't take data states (docs/styling.md, Presentation roles), and list rows have none.
Related
- A widget with no visible output yet shows an empty pill, or only a red dot when its script fails #379 hides a widget whose blocks all hide with
hideWhenEmpty. - Add each agenda event's phase, the meeting link's service and today's date to the calendar provider #721 adds the calendar fields a meeting widget would match on: each agenda row's
phaseandcurrent. - Open PR feat: draw open rings and dots, set controls natively, add Wi-Fi and popup views #707 also adds keys to
PopupBlock(view,selectOutputDeviceField).
Triaged by Claude Code (Claude Opus 5.5).
Activity
feat: show or hide layout blocks by a field's value (stablebox#723)
chore(release): 0.18.0 [skip ci]
stablebar-releases commentedon Nov 20, 2026
🎉 This issue has been resolved in version 0.18.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀