Commit graph

722 commits

Author SHA1 Message Date
Codex Review Integration
078933ad9a Merge remote-tracking branch 'origin/dev' into feat/ab/sh-336-dashboard 2026-09-17 02:21:15 -03:00
Codex Review Integration
824001dc5e fix(work-orders): make service picker search placeholder type-neutral 2026-09-17 01:40:58 -03:00
Codex Review Integration
c0f7bb26eb fix(team-members): keep legacy roles and colors editable in the detail drawer
Members created before the SH-326 model can carry data the current
backend contract rejects (PUT team-members accepts only the
Dispatcher/Scheduler/Admin roles and the ten palette colors), which made
them impossible to edit.

- Legacy roles (e.g. Manager) now show as "<role> (legacy)" in the edit
  form with helper copy asking to choose Dispatcher, Scheduler, or Admin;
  save stays blocked until one is chosen and the legacy value is never
  sent. View mode marks the stored role as legacy too.
- Stored colors outside the current palette are canonicalized when they
  only differ by casing; otherwise the nearest palette color (RGB
  distance, first as fallback) is preselected with a notice naming the
  replaced value, so saving never fails on an untouched legacy color.
- Role/color options move to team-member-form-options.ts with unit tests
  for canonicalization, nearest-color matching, and replacement notices.
2026-09-17 01:06:03 -03:00
Codex Review Integration
7cef338e34 Merge remote-tracking branch 'origin/dev' into feat/ab/sh-324-team-members-list
# Conflicts:
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-add.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-detail.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-edit.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-empty.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-error.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-filter.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-inactive.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-list.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-mobile-navigation.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-detail.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-empty.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-error.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-filters.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-list.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-new.png
2026-09-17 00:49:09 -03:00
Codex Review Integration
7679c28682 refactor(dashboard): extract dispatcher tables into a section component
Move the two paged dispatcher cards and their paging view-model derivation out
of DashboardPage into DispatcherTablesSection (a fragment, so both cards remain
direct children of the dashboard grid). This keeps DashboardPage under the
project complexity threshold after the pager additions, with no change to the
rendered layout or behaviour.
2026-09-17 00:46:39 -03:00
Codex Review Integration
0279cfac64 feat(dashboard): paginate dispatcher tables and fix Aveta drilldown
Workload and Performance page server-side at 10 rows and now return Page,
PageSize, and TotalDispatchers on dev (backend#126/#127), so wire the pager
that SH-346 and SH-347 require: getWorkload/getPerformance send a 1-based
`page` and parse the paging envelope, the hooks and query keys carry the page,
and each dispatcher table renders a 10-row pager. Page state is per-table and
resets on a range change so switching range never lands on an out-of-range
empty page that reads as a false "no dispatchers" state.

Drop `docs=No` from the Aveta Pending drilldown. `docs` filters on
completion-document status, not the Aveta clearance document the tile counts
(SH-294 / backend#138), so it narrowed to the wrong rows. The board has no
missing-Aveta-document filter, so the drilldown is now the Aveta-required work
in the two-day open window — a deliberate superset of the count.
2026-09-17 00:36:55 -03:00
Codex Review Integration
dd1b029124 style(uplifts): apply prettier to the uplift detail modal 2026-09-17 00:18:32 -03:00
Codex Review Integration
4bffdac175 fix(uplifts): restrict revoke to admins and quiet permission failures (SH-207)
- Gate the Revoke action on the approved queue row and the detail modal
  to admin users; non-admins get a disabled button with a plain
  'Only admins can revoke uplifts' tooltip and the dialog cannot open.
- Stop nesting an h2 inside DialogTitle in the uplift detail modal
  (hydration error) by rendering the title text as a non-heading.
- Handle work-order detail/uplift query 403s quietly in the detail
  modal: sections fall back to 'Unavailable' and the queries suppress
  the global error toast (QueryCache now honors suppressErrorToast).
- Extract UpliftDecisionDialogs and openUpliftEvidence from the page to
  meet the changed-file maintainability gate (complexity 23 -> pass).
2026-09-17 00:13:54 -03:00
Codex Review Integration
16a2ab5511 Merge remote-tracking branch 'origin/dev' into feat/ab/sh-325-add-team-member 2026-09-17 00:06:18 -03:00
Codex Review Integration
1207df6ed8 Merge remote-tracking branch 'origin/dev' into feat/ab/sh-325-add-team-member
# Conflicts:
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-add.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-detail.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-edit.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-empty.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-error.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-filter.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-inactive.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-list.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-mobile-navigation.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-detail.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-empty.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-error.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-filters.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-list.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-new.png
2026-09-17 00:04:46 -03:00
Codex Review Integration
6ded458af0 Merge remote-tracking branch 'origin/dev' into feat/ab/sh-326-team-member
# Conflicts:
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-add.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-detail.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-edit.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-empty.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-error.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-filter.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-inactive.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-list.png
#	e2e/__screenshots__/vendors/vendors.visual.spec.ts/vendor-mobile-navigation.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-detail.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-empty.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-error.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-filters.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-list.png
#	e2e/__screenshots__/work-orders/work-orders.visual.spec.ts/wo-new.png
2026-09-16 23:59:24 -03:00
Alexandre Brandizzi
bc40c17285
Merge branch 'dev' into fix/ab/sh-359-wo-board-column-order 2026-09-16 23:44:07 -03:00
Codex Review Integration
633fcdc52c fix(team-members): preserve detail and load states (SH-326) 2026-09-16 23:28:41 -03:00
Codex Review Integration
0ac8c4473e fix(team-members): harden team member flows (SH-325) 2026-09-16 23:14:51 -03:00
Codex Review Integration
ae255f59a6 fix(team-members): destructure load error prop (SH-324) 2026-09-16 22:58:46 -03:00
Codex Review Integration
6a2b9eb80c test(uplifts): cover detail evidence callback (SH-209) 2026-09-16 22:50:40 -03:00
Codex Review Integration
5aed31392c fix(uplifts): complete approval queue review fixes (SH-208) 2026-09-16 22:44:37 -03:00
Codex Review Integration
6f8b502116 fix(uplifts): align approval queue contracts (SH-207) 2026-09-16 22:40:48 -03:00
Codex Review Integration
1df3e5d292 fix(team-members): render load failures distinctly (SH-324) 2026-09-16 22:38:53 -03:00
Codex Review Integration
d1b36ed1c0 style(work-orders): apply prettier to day-view hook 2026-09-16 22:21:17 -03:00
Codex Review Integration
58fc323ea2 fix(work-orders): use local calendar day for Past Due and stabilize slow suites
computeIsPastDue and the day view's todayKey derived today from
toISOString() (UTC). West of UTC that rolls over hours early, so work
scheduled for today showed as Past Due every evening. Both now use the
local todayIso() helper the board already uses; regression tests pin
23:30 and 00:30 in America/Sao_Paulo with fake Date.

Test stability:
- adv-search page sync: scope pagination queries with within() instead of
  scanning ~330 buttons / 3000 nodes on every waitFor poll
- pm-schedules-list-actions: static import of the edit page so module
  transform does not count against the 5s test budget
- vendor create modal / detail drawer: userEvent.setup({ delay: null });
  15s describe budget for full MUI dialog renders under parallel load
2026-09-16 22:06:33 -03:00
Alexandre Brandizzi
e6f5199da9
Merge branch 'dev' into fix/ab/sh-320-inline-sh-prefix-wo-number 2026-09-16 21:56:20 -03:00
Codex Review Integration
2d54ff12f8 fix(work-orders): show fixed copy for edit conflict toasts (SH-375) 2026-09-16 21:22:07 -03:00
Codex Review Integration
afc98a9daa fix(work-orders): normalize partial-save and generic edit error toasts (SH-375) 2026-09-16 21:20:16 -03:00
Codex Review Integration
fc25d8f7c7 fix(work-orders): show generic copy for unknown edit errors (SH-375) 2026-09-16 21:14:25 -03:00
Codex Review Integration
0d95a32071 feat(uplifts): refresh work-order views after decisions (SH-214) 2026-09-16 21:12:22 -03:00
Codex Review Integration
111b813e9e fix(uplifts): show scheduled work order date (SH-209) 2026-09-16 21:02:21 -03:00
Alexandre Brandizzi
440a3d0112
Merge branch 'dev' into feat/ab/sh-222-create-error-copy 2026-09-16 20:56:26 -03:00
Codex Review Integration
85024b40f3 fix(uplifts): use admin revoke contract (SH-212) 2026-09-16 20:54:33 -03:00
Alexandre Brandizzi
c0d3300ab1
Merge branch 'dev' into fix/ab/sh-320-inline-sh-prefix-wo-number 2026-09-16 20:48:14 -03:00
Codex Review Integration
3f98ac380f feat(uplifts): deliver approval queue experience (SH-207) 2026-09-16 20:43:12 -03:00
Codex Review Integration
c7388ba2d9 fix(dashboard): map breakdown type keys and open performance drill-downs
The Work Order Breakdown object from the backend serializes its keys
without JsonPropertyName, so they arrive lowercase (pm/emergency/reactive/
overdue/other). The mapper copied them straight into `status`, which the
card uses as both label and the `types` drill-down id, and
`workOrderTypeDrilldownSearch` only accepts canonical WOType values — so
every breakdown row rendered lowercase and was inert (SH-354). Route both
mapping branches through a normalizer that maps type keys back to their
canonical labels case-insensitively; `other` is not a WOType, so it stays a
labelled, non-drillable "Other" row, and unknown values (legacy array-shape
lifecycle labels) pass through unchanged.

Dispatcher Performance gated its drill-down on `completionRate > 0`, so a
dispatcher with assigned work but no completions yet was inert here while
drillable from Workload. The drill-down filters by dispatcher + range and
never uses the rate, so gate on identity instead.

Also mock useDashboardTrend in the dashboard page test so it no longer
issues a real request that failed quietly in jsdom.
2026-09-16 20:40:33 -03:00
Alexandre Brandizzi
6682fcd7c2
Merge branch 'dev' into fix/ab/sh-320-inline-sh-prefix-wo-number 2026-09-16 20:30:17 -03:00
Alexandre Brandizzi
5d5581209a
Merge branch 'dev' into fix/ab/sh-369-completion-doc-service-gate 2026-09-16 20:30:14 -03:00
Codex Review Integration
e323b0b2ce feat(team-members): add member detail drawer (SH-326) 2026-09-16 20:27:05 -03:00
Alexandre Brandizzi
fc21321148
Merge branch 'dev' into feat/ab/sh-278-vendor-service-area 2026-09-16 20:16:18 -03:00
Alexandre Brandizzi
7aa964aa0f
Merge branch 'dev' into fix/ab/sh-320-inline-sh-prefix-wo-number 2026-09-16 20:16:15 -03:00
Alexandre Brandizzi
20662b57c1
Merge branch 'dev' into fix/ab/sh-369-completion-doc-service-gate 2026-09-16 20:16:13 -03:00
Codex Review Integration
9722805300 Merge remote-tracking branch 'origin/dev' into fix/ab/sh-369-completion-doc-service-gate
# Conflicts:
#	src/app/(protected)/workorders/_components/detail/tabs/slide-over-completion-tab.tsx
2026-09-16 20:03:04 -03:00
Alexandre Brandizzi
bbc955e6fe
Merge branch 'dev' into feat/ab/sh-195-date-header-tooltips 2026-09-16 20:00:20 -03:00
Alexandre Brandizzi
e272cabe34
Merge branch 'dev' into feat/ab/sh-278-vendor-service-area 2026-09-16 20:00:16 -03:00
Alexandre Brandizzi
85a6dad0f9
Merge branch 'dev' into fix/ab/sh-320-inline-sh-prefix-wo-number 2026-09-16 20:00:13 -03:00
Codex Review Integration
b6f4590bfa feat(team-members): add member creation form (SH-325) 2026-09-16 19:49:27 -03:00
Alexandre Brandizzi
12d4a0c4b8
Merge branch 'dev' into fix/ab/sh-341-generate-completes-work-order 2026-09-16 19:46:33 -03:00
Alexandre Brandizzi
c6ed6072ff
Merge branch 'dev' into feat/ab/sh-195-date-header-tooltips 2026-09-16 19:46:30 -03:00
Alexandre Brandizzi
1c1c6b5670
Merge branch 'dev' into feat/ab/sh-278-vendor-service-area 2026-09-16 19:46:26 -03:00
Alexandre Brandizzi
ace66f52e5
Merge branch 'dev' into fix/ab/sh-320-inline-sh-prefix-wo-number 2026-09-16 19:46:22 -03:00
Codex Review Integration
1b17cbec01 feat(dashboard): build dashboard experience (SH-336) 2026-09-16 19:37:15 -03:00
Alexandre Brandizzi
ef199e19b6
Merge branch 'dev' into fix/ab/sh-320-inline-sh-prefix-wo-number 2026-09-16 19:34:20 -03:00
Codex Review Integration
71756ca3a5 fix(work-orders): clear registry service when WO type changes
Selecting a work-order type on wizard step 1 only patched type and
severity, leaving pm, serviceId, extraServices, and the vendor filtered
by that service in the draft. Switching type (e.g. PM -> Reactive) then
submitted a serviceId that is not in the new type's registry list, which
backend ResolveServiceAsync (SH-187/#131) rejects as ServiceInvalid and
the create toast renders as the generic "Unable to create the work
order". Clear the service and its vendor whenever the type actually
changes; re-selecting the same type leaves the selection untouched.
2026-09-16 19:33:08 -03:00