Quest bugs: household-local overdue clock and the panel Complete no-op #254

Member

Task fa7475ba (UI Bugs).

Item 1 (panel showed a star instead of the chosen icon) is delivered by feature e0855415 on dev bdf6d0a; no change here.

Item 2 (premature OVERDUE): the API host ran 13:21 UTC (TZ unset) so build_snapshot compared a UTC wall clock to household due times, and the snapshot routes passed default settings. Adds a timezone IANA setting (validated, stored, exposed via admin settings GET/PATCH, empty = host local for back-compat) and threads it into every API clock read (panel/admin snapshots, completion on-time stamp, missed-sweep scheduler, history); snapshot routes now load stored settings. Boundary tests pin 09:59:59 / 10:00:00 / 10:00:01 local. Note: the owner must set the zone once (e.g. PATCH {"timezone":"America/New_York"}); default empty preserves old behaviour. This also fixes a rollover that fired 4h early.

Item 3 (Complete does nothing): root cause was TypeScript ES2022 useDefineForClassFields emitting native class fields that shadow Lit's reactive property accessors, so setting _confirm never re-rendered; fix is "useDefineForClassFields": false in frontend/tsconfig.json + rebuilt bundle. After the fix the panel opens the confirm dialog and calls nestquest.complete_quest with the correct actor payload.

Evidence at 64aa8e9: TZ=UTC uv run pytest -q = 2012 passed; tests/test_api_household_clock.py = 20 passed; frontend build ok.

Task fa7475ba (UI Bugs). Item 1 (panel showed a star instead of the chosen icon) is delivered by feature e0855415 on dev bdf6d0a; no change here. Item 2 (premature OVERDUE): the API host ran 13:21 UTC (TZ unset) so build_snapshot compared a UTC wall clock to household due times, and the snapshot routes passed default settings. Adds a `timezone` IANA setting (validated, stored, exposed via admin settings GET/PATCH, empty = host local for back-compat) and threads it into every API clock read (panel/admin snapshots, completion on-time stamp, missed-sweep scheduler, history); snapshot routes now load stored settings. Boundary tests pin 09:59:59 / 10:00:00 / 10:00:01 local. Note: the owner must set the zone once (e.g. PATCH {"timezone":"America/New_York"}); default empty preserves old behaviour. This also fixes a rollover that fired 4h early. Item 3 (Complete does nothing): root cause was TypeScript ES2022 `useDefineForClassFields` emitting native class fields that shadow Lit's reactive property accessors, so setting _confirm never re-rendered; fix is "useDefineForClassFields": false in frontend/tsconfig.json + rebuilt bundle. After the fix the panel opens the confirm dialog and calls nestquest.complete_quest with the correct actor payload. Evidence at 64aa8e9: TZ=UTC uv run pytest -q = 2012 passed; tests/test_api_household_clock.py = 20 passed; frontend build ok.
dev_agent added 1 commit 2026-09-26 09:34:35 -04:00
Overdue: the API read the host clock (the deployed container runs UTC,
the household is US Eastern), so every morning quest turned overdue
from ~04:00 local, and the snapshot routes built a default settings
object instead of the stored one. Add an additive `timezone` setting
(IANA name; "" keeps the host-local behaviour), validated through the
shared settings field table and exposed on the admin settings GET/PATCH.
Every API clock read (panel/admin routes, the missed-sweep scheduler)
now re-expresses the one host read in that zone, and the snapshot
routes load the persisted settings.

Complete: with target ES2022, TypeScript's useDefineForClassFields
default emitted the cards' reactive fields as native class fields that
shadow Lit's accessors, so setting `_confirm` never re-rendered and the
confirm dialog never opened. Set useDefineForClassFields to false (Lit's
documented TypeScript setting) and rebuild the bundle.

Tests pin the clock at the due-time boundary for both snapshot shapes,
cover the scheduler and on-time stamp, and drive the built bundle's
Complete tap through to the complete_quest service call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-5.6-terra review completed for this exact commit.

Independent Codex gpt-5.6-terra review completed for this exact commit.
dev_agent merged commit 744d80e645 into feature/916210e7-8736-48da-9136-424731156f8c-ui-bugs 2026-09-26 09:37:02 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#254