Wave 2: form cleanups from the site comments, plus localization, project switcher and global search
Site comments (8/3) - BIM card: LOD removed, IFF # added next to the coordination status, and required once that status is "Signed off (IFF)" — an unnumbered sign-off isn't traceable. A LOD already stored on a package is preserved and shown as legacy, not blanked. - The blue "from SOP types" subtext under a field is now a SOP chip on the label with the detail in a tooltip. The chip stays visible rather than hover-only: field tablets have no hover, and "this came from the SOP" is the part that matters. The hint elements stay in the DOM (hidden) so the code writing to them keeps working; an observer mirrors their text into the tooltip. - Specification Section is no longer typed per package. Each WP type carries a spec section on the SOP; the field is read-only in the Creator and follows the type, with the SOP's spec folder linked underneath. This reads both spec comments as one intent — stop typing it, derive it. - Assignees and Distribution are multi-selects over the SOP project team, showing each person's job function, with the CM pre-added to Distribution (removable per package) and a free-text option for people with no account. The stored display strings are unchanged so print/export/dashboard keep working; account ids ride alongside for the notification work in wave 3. Localization + time - Per-user locale/timezone (Language & time in the user menu), an app-wide default in the admin console, then the browser. Timezones are validated against the server's zoneinfo and the picker is fed from it. Calendar dates are formatted from their parts so a due date never reads a day early in another zone. - Every displayed timestamp now goes through the shared helpers. Top-bar chrome - Project switcher beside the logo and a centered global search, injected into either generation of top bar; skipped in an iframe so the embedded Creator doesn't get a second one. Ctrl/Cmd-K focuses search. - GET /api/search covers work packages, projects and SOPs, scoped to the caller's projects, hiding archived packages, with LIKE wildcards escaped. Fixed along the way: showForm() cleared every card's inline display, which undid applyKind() — so the Package Type and BIM cards reappeared on an install-only project. Split out applyKindVisibility() and re-apply it there. Verified: 100 API checks on a fresh database (44 permissions + 22 password reset + 34 search/localization), 24 driven UI checks against the real Creator page in headless Chrome (SOP chips, both people pickers, spec auto-fill, critical tags, BIM suppression), and the chrome harness on both bar styles. Screenshots reviewed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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=<id>`; 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
|
||||
|
||||
Reference in New Issue
Block a user