Admin app: explicit manual timezone picker (task ade35bd5) #283

Merged
approver_agent merged 1 commits from task/admin-manual-timezone_ade35bd5-ec58-45a9-aa74-7c14631f94ec into dev 2026-09-30 07:45:09 -04:00
Owner

Maestro task ade35bd5-ec58-45a9-aa74-7c14631f94ec (feature: Manual application timezone control).

Done-condition: the admin Preferences Timezone control is the clear, manual way to set and adjust the application timezone. The saved value is the source of local time, and nothing sets it automatically.

Changes

  • admin/src/settings/SettingsScreen.tsx: the free-text box and its suggestion list are replaced with a <select> that offers:
    • API host local time (no zone set), which saves ""
    • the curated COMMON_TIMEZONES list: UTC, every US zone, and major world zones
    • Other IANA zone…, which opens an "Other timezone" text entry
    • A saved zone outside the list opens in that entry on load.
    • Helper text (aria-describedby) says this is the application timezone and the source of local time for the panel, the scheduler and the admin app.
    • Save is still the explicit Save preferences button. It patches only changed fields, so a timezone-only change sends exactly {"timezone": …}. Nothing is written on load, there is no auto-save, and the browser zone is never read.
  • SettingsScreen.css: adds a .settings-hint style for the helper text.
  • SettingsScreen.test.tsx:
    • existing timezone tests updated to use the picker and the other-zone entry
    • new manual timezone control suite: the picker's contents, the helper text, a picked zone saving and surviving a full remount, a typed other zone saving and surviving a remount, a non-list zone showing on load, clearing to host-local persisting, picking and then un-picking a zone sending nothing, and no timezone_configured ever being sent
  • tests/test_api_admin_settings.py:
    • invalid timezone values (Mars/Olympus_Mons, America/New York, 5) return 422 and leave stored settings unchanged
    • a non-admin timezone PATCH returns 403 and writes nothing
    • a lone {"timezone": …} PATCH (a zone or "") persists on a fresh database

No schema change. The panel card bundle is untouched.

Verification

  • cd admin && npm test: 321 passed
  • cd admin && npm run build: OK
  • TZ=UTC uv run pytest -q: 2179 passed (after frontend npm ci for the jsdom harness)
  • Against the base SettingsScreen.tsx (2db780e), 13 of the new or updated UI tests fail. That covers all 8 in the manual-control suite, plus the other-zone invalid and 422 cases.

🤖 Generated with Claude Code

Maestro task `ade35bd5-ec58-45a9-aa74-7c14631f94ec` (feature: Manual application timezone control). **Done-condition:** the admin Preferences **Timezone** control is the clear, manual way to set and adjust the application timezone. The saved value is the source of local time, and nothing sets it automatically. ## Changes - `admin/src/settings/SettingsScreen.tsx`: the free-text box and its suggestion list are replaced with a `<select>` that offers: - **API host local time (no zone set)**, which saves `""` - the curated `COMMON_TIMEZONES` list: UTC, every US zone, and major world zones - **Other IANA zone…**, which opens an "Other timezone" text entry - A saved zone outside the list opens in that entry on load. - Helper text (`aria-describedby`) says this is the application timezone and the source of local time for the panel, the scheduler and the admin app. - Save is still the explicit **Save preferences** button. It patches only changed fields, so a timezone-only change sends exactly `{"timezone": …}`. Nothing is written on load, there is no auto-save, and the browser zone is never read. - `SettingsScreen.css`: adds a `.settings-hint` style for the helper text. - `SettingsScreen.test.tsx`: - existing timezone tests updated to use the picker and the other-zone entry - new `manual timezone control` suite: the picker's contents, the helper text, a picked zone saving and surviving a full remount, a typed other zone saving and surviving a remount, a non-list zone showing on load, clearing to host-local persisting, picking and then un-picking a zone sending nothing, and no `timezone_configured` ever being sent - `tests/test_api_admin_settings.py`: - invalid timezone values (`Mars/Olympus_Mons`, `America/New York`, `5`) return 422 and leave stored settings unchanged - a non-admin timezone PATCH returns 403 and writes nothing - a lone `{"timezone": …}` PATCH (a zone or `""`) persists on a fresh database No schema change. The panel card bundle is untouched. ## Verification - `cd admin && npm test`: 321 passed - `cd admin && npm run build`: OK - `TZ=UTC uv run pytest -q`: 2179 passed (after `frontend npm ci` for the jsdom harness) - Against the base `SettingsScreen.tsx` (`2db780e`), 13 of the new or updated UI tests fail. That covers all 8 in the manual-control suite, plus the other-zone invalid and 422 cases. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
overseer added 1 commit 2026-09-30 07:30:12 -04:00
Replace the free-text Timezone box with a select of curated IANA zones,
an "API host local time" choice that clears the zone, and an "Other IANA
zone…" choice that opens a text entry for any other zone. A saved zone
outside the list opens in that entry on load. Helper text states this is
the application timezone and the source of local time for the panel,
scheduler and admin app. Saving still patches only changed fields, so a
timezone change sends exactly {"timezone": ...}; nothing is written on
load and the browser zone is never read.

API tests add invalid-zone 422 cases, a non-admin timezone PATCH refusal,
and a lone timezone PATCH sticking on a fresh database.

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.
approver_agent merged commit 69db92b7b8 into dev 2026-09-30 07:45:09 -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#283