diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 2fc137d..84c25ee 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -346,6 +346,38 @@ hides the BIM/VDC section and every project is install-only (IWP). A SOP that already has BIM enabled keeps its data — it just stops being offered — so turning the flag off never deletes BIM types, gates, or sequence steps. +## Localization (dates, times, numbers) + +Three levels, most specific first — resolved in `html/wp-format.js`: + +1. **the user's own preference** — *Language & time* in the top-right menu + (`users.locale` / `users.timezone`, via `POST /api/auth/preferences`) +2. **the app default** — Admin console → Features → *Localization defaults* + (`default_locale` / `default_timezone`) +3. **the browser**, as before + +Timezone names are validated against the server's own `zoneinfo` database, and the +picker is fed from `GET /api/timezones` so it can only offer what will be accepted. +Calendar dates (a due date, a kitting date) are formatted from their parts and are +**never** shifted by a timezone — only real instants (MIMO windows, history, +notifications) are converted. Use the shared helpers (`wpFormatDate`, +`wpFormatDateTime`, `wpFormatTime`, `wpFormatNumber`) rather than +`toLocaleString()`, or a page will quietly ignore the preference. + +## Top-bar chrome (project switcher + search) + +`html/wp-chrome.js` + `wp-chrome.css` inject a project switcher and a centered +global search into whichever top bar a page has — the dark `.wp-appbar` or the +older `.header`. It is skipped inside an iframe, so the embedded WP creator does +not get a second bar. + +- Switching project reloads the current page with `?project=`; every page + already resolves its project from that parameter. +- Search calls `GET /api/search?q=`, which is **scoped to the caller's projects** + (`scope_to_access`) and hides archived work packages. LIKE wildcards in the query + are escaped, so searching `100%` matches a literal `100%`. Two-character minimum. +- Ctrl/Cmd-K focuses the field from anywhere. + ## Schema migrations (Alembic) Schema is managed by **Alembic** (`server/alembic/`). The API container runs diff --git a/html/admin.html b/html/admin.html index db918e7..ab0f2e3 100644 --- a/html/admin.html +++ b/html/admin.html @@ -9,6 +9,7 @@ +