feat: dashboard period stepping with URL state, data boundaries, and totals audit#607
Conversation
…yboard navigation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4774412256
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const prev = shiftWindow(-1); | ||
| if (!prev) return true; | ||
| return prev.from.isBefore(minBound); |
There was a problem hiding this comment.
Allow stepping into boundary-overlapping periods
The arrow-disable logic blocks navigation one step too early at data edges: disableStepPrev uses prev.from.isBefore(minBound) and disableStepNext uses next.to.isAfter(maxBound), so for week/month windows a tenant with data starting/ending mid-period cannot open the first/last period that still contains data. For example, if the first record is on May 20, the May window is unreachable because it starts on May 1. This prevents users from seeing valid edge-period data.
Useful? React with 👍 / 👎.
| /// aggregated across AgroOperations, CostRecords and Sales. | ||
| /// </summary> | ||
| [HttpGet("data-boundaries")] | ||
| [ResponseCache(Duration = 3600, Location = ResponseCacheLocation.Client)] |
There was a problem hiding this comment.
Vary cached tenant boundaries by tenant context
Applying [ResponseCache(Duration = 3600, Location = ResponseCacheLocation.Client)] on a tenant-scoped endpoint caches by URL but the tenant is selected via X-Tenant-Id; without a Vary header on tenant/auth context, a browser can reuse the previous farm’s /api/tenant/data-boundaries response after a farm switch in the same session. That yields incorrect min/max boundaries for the active tenant and can expose another tenant’s boundary dates in a shared browser profile.
Useful? React with 👍 / 👎.
Phase 1A - Backend: Tenant data boundaries with caching, 1-hour ResponseCache, sequential queries. Phase 1B - Frontend: URL-state period stepping, keyboard navigation, boundary-aware arrows, seasons endpoint. Phase P.6 - Totals: TotalCard component, economics/sales migration, Playwright audit test.