feat(preferences): personal date & time preferences (Profile tab)

Merged
PA
4mo ago
+1105-2

Depends on #9870

What

The user-facing preferences slice: a personal Preferences card on the account Profile tab where each user picks their own date format (curated presets) and timezone (searchable IANA list); an unset field inherits the organisation default (or the browser default when none is set). Includes the shared DetailRow display and the label-searchable, auto-focusing ComboboxField the form is built on, plus the typed effective-preferences read + the user's own upsert.

Stack

Re-split from the original #9776 along vertical slices so each PR is self-contained and passes CI's knip (unused-code) gate. Replaces the earlier layer-split (#9872 was auto-closed by GitHub during the restack — all its Cubic review fixes are carried here).

  1. #9870 — DetailsColumns layout primitive
  2. this PR — personal preferences (Profile tab)
  3. #9871 — organisation defaults + global-permission gating (stacks on this)

Test

biome ci, knip, tsc clean; preferences/user-profile/display tests pass.

🤖 Generated with Claude Code


Summary by cubic

Adds a personal Preferences card on the Profile tab so users can set their date format (with a live example) and timezone (searchable IANA list). Unset fields inherit the organisation default, or the browser default when none is set, meeting IFC-2720.

  • New Features

    • Preferences card with date-format presets + inline example, and a timezone select using a shared Combobox built from @infrahub/ui Autocomplete + ListBox (virtualized); re-selecting a value clears the override.
    • DateFormatField/TimezoneField with a simple SourceInfo tooltip; messages show if a value comes from your preference, the org default (date format shows a live example), or the browser.
    • Save only when the form is dirty; the Save button shows a pending spinner; success toast on save; effective preferences cache is invalidated on success.
    • Typed effective-preferences query and a USER-scope upsert; thin API layer with the use-case asserting ok.
    • Shared UI: DetailRow and a generic Combobox; composed alongside account details via DetailsLayout. Docs updated for CRUD hook names, GraphQL client defaults, and comment style.
  • Bug Fixes

    • Restore the account “details” document title; type the upsert dateFormat param as the generated DateFormat enum.
    • Error UX: effective-preferences failure shows an error screen; the form resets on submit; error toast on save failure.
    • Drop dangling aria-describedby on the date-format field when no example is shown.