Commit Graph

5 Commits

Author SHA1 Message Date
Mystica Venatus
6336b0ce10 feat(face): complete widget set (phone batt, sleep, omens)
Phone battery via navigator.getBattery(), honest "--" when unavailable.
Sleep widget enabled with M marker. Omens derived from weather condition:
fog/rain/snow/thunder produce advisory text; clear shows empty.
All 11 widget types rendered; layout enables all by default.

Refs: DESIGN.md §5 widget set complete.
2026-09-14 06:02:21 -04:00
Mystica Venatus
917fdfa2f5 feat(face): idle-task sync, weather, health widgets, battery estimator v2
AppMessage transport (face ↔ pkjs ↔ mock Task API) validated end-to-end:
- GameSnapshot full-field inbox handler (13 protocol keys)
- serverDown signaling; oxblood "!" indicator on task strip, gated by
  strip visibility (ASCII placeholder; PDC later)
- requestSync watch→phone wake on launch (deferred 300ms send)
- inbox_dropped/outbox_failed diagnostics; 256-byte inbox
- pkjs: timeout-guarded single-callback XHR; dictionary cache with
  version compare; last-good weather resend (fail-dead-silent)

Widgets:
- W_HEART: 1-min avg BPM, state-colored H marker (green=reading,
  oxblood=no signal), HealthServiceTimeScope API per SDK 4.33
- S/D placeholders for steps/distance; WB battery with PDC-pending icon
- Weather: NWS primary / Open-Meteo fallback, CONUS geo auto-switch,
  cond/temp/hi-lo packet, ASCII condition glyph. Wire unit °F;
  metric toggle deferred to settings (render-time conversion, DESIGN §5)
- Battery estimator: hours-based regression, 5% power-save floor,
  ~Nd / ~Nh under 24h display; DEV_BATT_TEST sample injection

Layout: LAYOUT_VERSION 3 (W_HEART appended; version-gated regeneration).
Known: emoji in FROZEN strip replaced with plain dash; battery modes
(BAT_PERCENT/DAYS/BOTH) parsed but renderer honors BAT_BOTH only.

Refs: PROTOCOL.md v3.0 §9 build order items 2-4; DESIGN.md Laws 5/6.
2026-09-13 22:51:42 -04:00
Mystica Venatus
4cab1ca438 Battery remianing and HRM implemented 2026-09-13 22:11:38 -04:00
Mystica Venatus
55480b3fc6 feat(face): integrate Idle Task Protocol v1.0 end-to-end
Watchface now syncs with the Nine Hazes idle task system via its own
pkjs client — the three-artifact architecture is operational.

Wire side:
- pkjs fetches GET /v1/queue on launch, applies clock offset, converts
  epoch-ms to seconds for AppMessage, resolves task name from the
  cached dictionary (refetch on version drift)
- GameSnapshot persisted at key 0x30 (protocol-specified); task name
  at 0x32 (face-local nicety)
- AppMessage inbox widened to 256 bytes to carry the full snapshot
  dictionary in a single logical message

Display side:
- Task strip renders two lines: countdown-to-completion + used/36 +
  task count, then task name with "(+)" pending-rewards cue
- Status states render distinctly: FROZEN / ABORTED(code) / LOCKED /
  No hero yet (EMPTY)
- serverDown sentinel key: oxblood "!" icon on failed check; absence
  on successful sync clears it; volatile — never persisted
- Countdown math is server-clock corrected (clock_off), computed
  locally from bound_sec — zero radio to stay fresh

Also:
- ES5-normalized pkjs for SDK webpack 1.15/acorn parser
- Replaced face_packet.{h,c} with snapshot.{h,c} (PACKET_KEY 101
  retired; old blob orphaned harmlessly)
- Mock Task API server seeded with 3-task queue (in-memory)

Verified: seeded queue renders "0:xx 16/36 seg 3 tasks / Gather (+)";
server kill → cached strip + offline icon, no error surface.
2026-09-13 10:18:34 -04:00
Mystica Venatus
9c45250f4c watchface: first rendering baseline (canvas renderer, widget table, layout persist) 2026-09-11 15:50:29 -04:00