Skip to content

feat: dashboard period stepping with URL state, data boundaries, and totals audit#607

Merged
barach6662001-bit merged 6 commits intomainfrom
chore/pr607-dashboard-anchor-totals
Apr 23, 2026
Merged

feat: dashboard period stepping with URL state, data boundaries, and totals audit#607
barach6662001-bit merged 6 commits intomainfrom
chore/pr607-dashboard-anchor-totals

Conversation

@barach6662001-bit
Copy link
Copy Markdown
Owner

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +180 to +182
const prev = shiftWindow(-1);
if (!prev) return true;
return prev.from.isBefore(minBound);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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)]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@barach6662001-bit barach6662001-bit merged commit f075c19 into main Apr 23, 2026
3 checks passed
@barach6662001-bit barach6662001-bit deleted the chore/pr607-dashboard-anchor-totals branch April 23, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant