feat(preferences): user & organisation preferences UI (IFC-2720)

Merged
PA
4mo ago
+0-0

Depends on #9871

What

The user & organisation preferences UI:

  • Typed GraphQL API for the three read scopes (effective / user / global) and the user + global writes.
  • An FSD domain layer — date-format and timezone models, rules, and use-cases.
  • UI — a personal preferences card on the Profile tab, and a permission-gated Organisation defaults tab.
  • The shared DetailRow display and ComboboxField form control the preference forms build on.

Why / stack

This is the third of a 3-PR split of the original #9776, opened to make review easier. It builds on the reusable layout primitive and the global-permission plumbing extracted into the two PRs below:

  1. #9870 — refactor(layout): DetailsColumns primitive
  2. #9871 — feat(permission): frontend global-permission checks
  3. this PR — the preferences feature

Supersedes #9776 (the un-split PR), which is kept open for now for review-thread continuity and will be closed once this stack is approved.

Test

  • biome ci clean; 66 tests pass across preferences / permission / user-profile / display; tsc introduces no new errors.

🤖 Generated with Claude Code


Summary by cubic

Adds user date-format and timezone preferences, plus an admin Organisation defaults editor. Adds a Preferences card on Profile and a permission-gated tab at /profile/organisation-defaults, powered by typed GraphQL and React Query, per IFC-2720.

  • New Features

    • Data: typed GraphQL for effective/global reads and user/global writes; React Query hooks with targeted invalidation.
    • UI: UserPreferencesCard on Profile; /profile/organisation-defaults gated by MANAGE_GLOBAL_PREFERENCES via RequireGlobalPermission.
    • Forms: reusable PreferencesForm with ComboboxField, TimezoneField, and DetailRow; date-format uses semantic keys with live examples and re-select to clear; searchable IANA timezone list that always includes UTC; tooltips show value source (user/global/browser).
  • Refactors

    • Account menu now uses shared DropdownMenu for clearer, accessible navigation.
    • Failed saves keep the form dirty with errors via toasts; unknown PreferenceSource logs instead of defaulting to browser.