3.4 KiB
3.4 KiB
type, title, description, tags, timestamp
| type | title | description | tags | timestamp | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| guide | Event LED Color Mapping | Single source of truth mapping each event window state to the themed background color painted on the authenticated shell's status LED. |
|
2026-07-22T09:35:00Z |
Purpose
The 10×10 status dot in the authenticated shell LED
([data-testid="shell-led"] in
ShellHeaderComponent) reflects the
current event window state. Its background color is driven by a single pure
helper so the dot is never transparent and the active theme token always
resolves at runtime.
Mapping
Defined in
frontend/src/app/core/services/event-status.pure.ts and re-exported via
frontend/src/app/core/services/event-status.store.ts:
EventState |
ledBackgroundColor(state) |
Theme CSS variable |
|---|---|---|
countdown |
var(--color-warning) |
--color-warning |
running |
var(--color-success) |
--color-success |
stopped |
var(--color-danger) |
--color-danger |
unconfigured |
var(--color-secondary) |
--color-secondary |
Backing constant: LED_COLOR_BY_STATE: Readonly<Record<EventState, string>>.
The accessor function ledBackgroundColor(state) returns the same string for
each state.
How it reaches the DOM
HomeComponentforwards thestatesignal fromEventStatusStoretoShellHeaderComponentvia itseventStateinput.ShellHeaderComponent.ledColoris acomputedsignal defined ascomputed(() => ledBackgroundColor(this.eventState())).- The template binds it directly:
[style.background-color]="ledColor()". - The LED's base
.ledrule is shape-only (inline-block, 10×10, circular,vertical-align: middle); notransparentfallback is applied, so the author background color is always visible. - The legacy
.led-running,.led-countdown,.led-stopped,.led-unconfiguredCSS selectors remain on the element and continue to be useful hooks for selectors and tests, but they no longer declare the color.
Examples
Programmatic lookup
import { ledBackgroundColor, LED_COLOR_BY_STATE } from
'./frontend/src/app/core/services/event-status.pure';
ledBackgroundColor('running'); // 'var(--color-success)'
ledBackgroundColor('stopped'); // 'var(--color-danger)'
LED_COLOR_BY_STATE.unconfigured; // 'var(--color-secondary)'
Verifying in the DOM
const dot = document.querySelector('[data-testid="shell-led"]') as HTMLElement;
dot.style.backgroundColor; // resolves to the current theme token, never empty
dot.getAttribute('aria-label'); // 'Event status: running'
Tester checklist
- The LED is visible in every state (no transparent or missing dot).
- The LED color matches the mapping table when the event window is forced into each state via the event window settings.
- Switching states live updates both the dot color and the
aria-label="Event status: <state>"attribute. - The four
led-<state>classes are still applied to the element.