feat(profile): Bunyip identity strip + local Preferences (theme, time format, week start) #82
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psa-systems/mokosh-apps!82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/profile-bunyip-identity-preferences"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR #82 introduced
/profile, but the identity card on it was sourced from mokosh-server's/auth/mepayload, and the only customisable thing on the page was the editable mokosh user row. The user reasonably expects (a) identity to be visibly owned by Bunyip and (b) more knobs to customise their local experience.Three sections now, layered by ownership:
Identity strip (top). Pulls full name, email, and role from
AuthContextinstead of mokosh-server's/auth/me.AuthContextis hydrated from the OIDC id_token at sign-in and then refreshed periodically against bunyip's/v1/auth/me(hooks::auth::refresh_user_from_me), so Bunyip is the authoritative source. Renders an initials disc, the name, email, role, and a prominent "Account Settings (Bunyip)" link with a short caption explaining which fields live where.Personal info (middle). The existing mokosh
users-row editable form (first / last name, title, phone, mobile, timezone). Kept editable because a user can go by different names per tenant.Preferences (bottom). Local-only settings persisted to
localStorageviautils::prefs. First cut:hooks::thememodule wires the choice to the<html class="dark">Tailwind variant the SPA already uses everywhere.Theme::Systemwatchesprefers-color-scheme: darkand re-applies on OS-level changes. Theme application is mounted at the App root viause_apply_theme().Both new prefs read back via
prefs::get_str/set_str(added in this PR) and are designed to be consumed by date / time renderers in the rest of the SPA in follow-up changes. The values land inlocalStorageimmediately so a future date formatter just reads the key; no wiring blocks shipping the controls today.web-sys features: added
Element,DomTokenList,MediaQueryListfor the theme module's<html>class toggle andprefers-color-schemelistener.