Modify inspector balance widget for capacity planning

Objective

  • Evolve the Inspector Balance widget so ops can do capacity planning in large markets: visible total capacity, clearer per-inspector totals, and less friction when focusing a subset of inspectors.

Background

  • Daily view is called out as already shipped; remaining widget asks include a gray total-capacity bar, more prominent total available counts, and team filter UX that does not dominate the layout.
  • Duplicate reports note truncation, overlap, and resize glitches on narrow widths—tooltips or hover detail may help.
  • Today, GET dashboard/balance in attik-backend/src/routes/dashboard.ts returns per-inspector totalAvailable, usedSlots, and percentFilled using synthetic/historic slots (createSyntheticSlotArrayForDateRange, calcAvailableSlots, calcFilledSlots under attik-backend/src/util/functions/slots/). Used slots currently treat both inspections and charge-backed events as filling a slot (calcFilledSlots.ts); available is counted per slot with no grouping. There is no company-level mode switch, per-inspector slot grouping, or inspector-level denominator override on inspectorSchema yet.
  • Inspector settings UI: attik-frontend/src/app/tools/settings/inspectors/[id]/ (InspectorForm). Widget: attik-frontend/src/components/dashboard/inspectorBalance/ (InspectorWorkBreakdown.tsx, InspWorkBar.tsx), mounted from attik-frontend/src/app/tools/page.tsx.

Repro / UX context

Screen Recording 2026-05-08 at 8.07.33 AM.mov

Screen Recording 2026-05-08 at 8.08.18 AM.mov

  • In narrow layouts, Inspector Balance values truncate or overlap; hover/tooltip for full numbers was suggested.

Scope

Frontend (widget UX — existing)

  • attik-frontend/src/components/dashboard/inspectorBalance/ (InspectorWorkBreakdown.tsx, InspWorkBar.tsx): gray capacity bar, visible totals, team filter priority, responsive/tooltip improvements per original request.
  • Parent dashboard layout on attik-frontend/src/app/tools/page.tsx as needed for filter ordering and breakpoints.

Frontend (configuration — additional, same PRs)

  • Company-wide settings UI for balance numerator/denominator mode: inspections only | events only | blended (inspections + inspection events).
  • Per-inspector configuration for grouping multiple time slots into one availability window (inspector settings, not company-default only).
  • Inspector settings (attik-frontend/src/app/tools/settings/inspectors/[id]/, InspectorForm): manual denominator override; when set, dashboard should reflect that the override replaces computed capacity (not added to it).

Backend (aggregation — additional, same PRs)

  • Extend GET dashboard/balance in attik-backend/src/routes/dashboard.ts to apply company mode, per-inspector slot grouping, and inspector denominator override before returning totalAvailable, usedSlots, and percentFilled.
  • Slot helpers: attik-backend/src/util/functions/slots/createSyntheticSlotArrayForDateRange.ts, calcAvailableSlots.ts, calcFilledSlots.ts.
  • Persist company-wide balance mode on the company document (or existing company settings pattern — decision needed on exact field location).
  • Persist per-inspector slot-grouping preference and denominator override on attik-backend/src/models/inspectorSchema.ts and inspector update routes.

Decisions left to implementation

  • Exact rules for which slots merge into one window per inspector (contiguity, same day, gap tolerance, etc.).
  • How events only vs inspections only maps onto calcFilledSlots event filters (charge-backed events vs blocks, etc.).

References


Original description

Requested changes to the inspector balance widget to better support capacity planning, especially in larger markets:

  • Add a gray bar showing total available capacity and fill in the scheduled portion so availability is visible even when nothing is scheduled in the selected date range.
  • Add a daily view option. (done - last release)
  • Show the total available count next to the inspector name or in a more visible manner (see notes below)
  • Lower the team dropdown priority so a specific group of inspectors can be viewed instead of all inspectors at once.

Additional related context from duplicate reports:

  • In narrow layouts, the Inspector Balance widget values become truncated or hard to read, and even after widening the window they may not fully re-render until the layout is much wider.
  • At small sizes, text elements in the widget can overlap.
  • A hover state or tooltip showing the full numeric value was suggested as a possible improvement.

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board
🏠

Main App

Date

24 days ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.