Repository navigation
Description
Amendment (2026-09-23, owner): this issue is split. #940 ships presets of
7 and 14 days with custom ranges capped at 14 and one bar per day; the 30-day
preset, longer custom ranges and the weekly collapse move to #941. See
the amendment comment.
Component plan: build this from the components named in
docs/designs/822-mui-revamp.md. The rule is "reused, never rebuilt" — composing MUI primitives into a screen wrapper is expected; reimplementing behaviour a shared component already has is not. Say in the PR which row of that table covers this screen.
Slice of #674, Phase 3 follow-up to #906/#912. Owner request, 2026-09-19.
What
The Dashboard's Lay Rate card is fixed at the last 14 days. Add a range switcher:
- Presets: Last 7 days, Last 15 days, Last 30 days.
- A custom range as two plain date fields (the same fields Daily Entry uses), no new dependency. The MUI date range picker is a separate, paid package and is out of scope unless the owner decides otherwise.
- The hen-day KPI compares the chosen window against the window of the same length before it, and its subtitle says so in all three locales ("last 7 days against the 7 before" becomes dynamic).
- The choice is remembered per device (local storage) so the Dashboard does not reset on every visit.
Hard constraint: the strip must stay readable
The owner's concern is that a long range makes the graph too big to display. The day strip renders one slot per day; #912 settles 22px slots on phones for 14 days (owner decision, option C). So:
- Beyond 14 days on a phone, and beyond what the card width can hold at 22px per day on desktop, bars collapse to one bar per week (7-day buckets, the last bucket may be short and is labelled as such). The tooltip and accessible name of a week bar carry the week's dates and totals.
- A custom range longer than 90 days is rejected in the form with a message, not silently truncated.
- No horizontal scroll inside the card; no change to the 44px width exception recorded on feat(dashboard): redesign the Operations Desk and show order grade names #912.
Already there
The production report endpoint takes optional from/to (see the Production handler in ReportEndpoints.cs), so the presets and the custom range need no backend change. The Dashboard already fetches two windows and joins them (Dashboard.tsx, the two getProductionReport calls); dayStrip in web/src/lib/dashboard.ts takes any number of days.
Must survive
Missing, partial and complete day states and their hatching; the one-tab-stop arrow-key strip (#654/#777/#780); the reserved readout row; farm-local dates; independent panel degradation; the Playwright dashboard specs; three locales.
Deliverables
- Unit tests for the window arithmetic (preset to
from/to, previous window, week bucketing including a short last bucket) with literal expected values. - Help page and glossary updated in the same PR.
- Captures per AGENTS.md at 1280 and 390, light and dark, at 7, 30 and a custom 60-day range.
Sequenced after #912 merges.
Activity
mforce commentedon Sep 23, 2026
Amendment — what #940 ships, and what moved to #941
Owner decision, 2026-09-23. This issue's scope is split; the body above stays
as written for history.
Shipping in #940 (this issue's close-out):
finished days, or a Custom range… of two plain date fields with
Apply.
with a translated message in en, es and tl, never silently shortened.
at each seven-day boundary.
length before it, both fetched in one request and split client-side.
this build can no longer draw falls back to the default.
specs/product/GLOSSARY.mdupdated in allthree locales.
Moved to #941 (not built here):
7-day bucket with a possibly-short last bucket, and the readout wording that
went with it. It was built, reviewed and then deleted rather than left
unreachable behind a 14-day cap, so web: expand the Lay rate chart into a centred overview + scrollable daily view for ranges beyond 14 days #941 starts from a clean slate and can
choose its own display.
Acceptance criteria this issue states that #940 deliberately does not meet:
the
Last 15 daysandLast 30 dayspresets, the 90-day custom cap, and theweekly collapse. Those are #941's, not abandoned.