openspec/specs/ had been empty since the project started: all three changes were left active and unsynced, so there was no consolidated statement of how the card is meant to behave. Synced in dependency order -- perfectdraft-card, then card-layouts-and-imagery, then auto-detect-gap-closure -- so the MODIFIED and REMOVED operations in the last one had the base requirements they refer to. Result is 10 capability specs holding 57 requirements, all validating. Fixed a contradiction the merge exposed: card-layouts still required a beer selection dialog reachable from every layout, which auto-detect-gap-closure had removed. Its interaction scenario now covers the glass dialog only, plus a scenario tying beer display to the keg-auto-detection rules. Note the archived tasks.md files retain their unchecked items -- the three hardware verification tasks in auto-detect-gap-closure, and pre-existing incomplete tasks in the two older changes. Co-authored-by: Cursor <cursoragent@cursor.com>
2.6 KiB
2.6 KiB
freshness-warning Specification
Purpose
TBD - created by archiving change perfectdraft-card. Update Purpose after archive.
Requirements
Requirement: Tiered freshness warning system
The card SHALL display escalating visual warnings based on the keg freshness sensor value, using four severity tiers.
Scenario: Fresh keg (more than 14 days remaining)
- WHEN the
keg_freshnesssensor reports a value greater than 14 - THEN the card SHALL display no freshness warning indicators
- THEN the card SHALL use its normal color scheme and no animation
Scenario: Warning tier (7-14 days remaining)
- WHEN the
keg_freshnesssensor reports a value between 7 and 14 (inclusive) - THEN the card SHALL display a subtle amber-tinted border
- THEN a freshness text indicator SHALL appear showing the days remaining (e.g., "⏳ 12d fresh")
Scenario: Urgent tier (3-6 days remaining)
- WHEN the
keg_freshnesssensor reports a value between 3 and 6 (inclusive) - THEN the card SHALL display an orange pulsing border via CSS
@keyframesanimation - THEN a warning message SHALL appear (e.g., "⚠ 5 days left — drink up!")
Scenario: Critical tier (1-2 days remaining)
- WHEN the
keg_freshnesssensor reports a value between 1 and 2 (inclusive) - THEN the card SHALL display an aggressive red pulsing border via CSS
@keyframesanimation - THEN an urgent message SHALL appear (e.g., "🚨 2 days left!")
Scenario: Expired (0 days remaining)
- WHEN the
keg_freshnesssensor reports 0 - THEN the card SHALL display a persistent red overlay or border (no pulsing — static danger state)
- THEN an expired message SHALL appear (e.g., "Keg expired")
Requirement: CSS-only animation implementation
All freshness warning animations SHALL be implemented using CSS only, with no JavaScript animation loops.
Scenario: Animation technique
- WHEN a freshness tier requires pulsing or fading animation
- THEN the animation SHALL be implemented via CSS
@keyframesandanimationproperties - THEN the card's JavaScript SHALL only set CSS custom properties or CSS classes based on the freshness value
- THEN no
requestAnimationFrame,setInterval, orsetTimeoutSHALL be used for animation
Requirement: Freshness sensor unavailable handling
The card SHALL handle the keg freshness sensor being unavailable gracefully.
Scenario: Freshness sensor unavailable
- WHEN the
keg_freshnesssensor has stateunavailableorunknown - THEN the card SHALL display no freshness warning indicators
- THEN the card SHALL use its normal color scheme (same as >14 days)