Skip to content

feat(FR-3075): paginate scheduling-history modals#7794

Open
agatha197 wants to merge 1 commit into
graphite-base/7794from
fr-3075-paginate-scheduling-history
Open

feat(FR-3075): paginate scheduling-history modals#7794
agatha197 wants to merge 1 commit into
graphite-base/7794from
fr-3075-paginate-scheduling-history

Conversation

@agatha197

@agatha197 agatha197 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Resolves #7793 (FR-3075)

Stacked on #7650 (FR-3008). Review/merge that PR first.

Summary

The scheduling-history modals (session, deployment, route) added in #7650 fetched the entire scheduling history in a single query with no pagination arguments and fetchPolicy: 'network-only', eagerly loading every row's subSteps. For sessions/deployments/routes that went through many scheduling cycles (retries, rescheduling), this produced a large server-side aggregation and re-fetched the whole thing on every modal open — making these modals noticeably slower than the rest of the app.

This adds offset (page-number) pagination to all three modals.

Changes

  • SessionSchedulingHistoryModal (self-contained useLazyLoadQuery): add $limit/$offset to the query, select count, wire useBAIPaginationOptionState with deferred limit/offset, and pass the table pagination config.
  • DeploymentSchedulingHistoryModal / RouteSchedulingHistoryModal (preloaded-query pattern): add $limit/$offset + count to the query; the modal owns page state and calls the existing onReload with new limit/offset on page change. Their openers (DeploymentConfigurationSection, DeploymentReplicasTab) seed the initial loadQuery with limit: 10, offset: 0.
  • Changing filter or order resets to page 1 (offset: 0).
  • Uses limit + offset only — the three *ScopedSchedulingHistories are Strawberry V2 connections that reject mixed first+offset at runtime (see .claude/rules/graphql-pagination.md).

Behavior note

With pagination, the FR-3008 "expand errors only" default auto-expands non-success rows on the current page only, not across the whole history. This is the expected trade-off for paginated tables.

Verification

bash scripts/verify.sh → Relay / Lint / Format / TypeScript all pass (the Relay step only flags the regenerated __generated__ artifacts as needing commit, which are included in this PR).

🤖 Generated with Claude Code

The session/deployment/route scheduling-history modals fetched the entire
history in one query with no pagination and fetchPolicy network-only, eagerly
loading every row's subSteps. For entities with many scheduling cycles this
produced a large server-side aggregation and re-fetched everything on each
open, making these modals noticeably slower than the rest of the app.

Add offset/table pagination to all three modals using useBAIPaginationOptionState
(limit + offset only, per the V2-connection pagination rule), select the
connection count for the total, and reset to page 1 on filter/order change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

agatha197 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@agatha197 agatha197 marked this pull request as ready for review June 9, 2026 09:46
Copilot AI review requested due to automatic review settings June 9, 2026 09:46
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.42% 1798 / 27985
🔵 Statements 5.22% 1994 / 38193
🔵 Functions 5.34% 300 / 5613
🔵 Branches 3.65% 1305 / 35745
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/DeploymentConfigurationSection.tsx 0% 0% 0% 0% 83-396
react/src/components/DeploymentReplicasTab.tsx 0% 0% 0% 0% 60-559
react/src/components/DeploymentSchedulingHistoryModal.tsx 0% 0% 0% 0% 31-111
react/src/components/RouteSchedulingHistoryModal.tsx 0% 0% 0% 0% 31-111
react/src/components/SessionSchedulingHistoryModal.tsx 0% 0% 0% 0% 30-102
Generated in workflow #1743 for commit 8ae2890 by the Vitest Coverage Report Action

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds offset (page-number) pagination to the three scheduling-history modals (session / deployment / route) to avoid fetching and rendering an entire history (including per-row subSteps) on every modal open, improving responsiveness for long-running entities.

Changes:

  • Added $limit / $offset + count to the session/deployment/route scheduling-history queries and wired table pagination (total: count).
  • Session modal now uses useBAIPaginationOptionState directly with deferred limit/offset in useLazyLoadQuery.
  • Deployment/route modals (preloaded-query pattern) now own page state and refetch via existing onReload; openers seed initial loadQuery with { limit: 10, offset: 0 }. Filter/order changes reset to page 1.

Reviewed changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
react/src/components/SessionSchedulingHistoryModal.tsx Adds limit/offset pagination args to the query and wires useBAIPaginationOptionState + BAITable pagination with count.
react/src/components/RouteSchedulingHistoryModal.tsx Adds limit/offset/count to the preloaded query and refetches on page change via onReload, resetting offset on filter/order changes.
react/src/components/DeploymentSchedulingHistoryModal.tsx Same as route modal: adds limit/offset/count and table pagination-driven refetch behavior.
react/src/components/DeploymentReplicasTab.tsx Seeds initial route history modal query variables with { limit: 10, offset: 0 } when opening.
react/src/components/DeploymentConfigurationSection.tsx Seeds initial deployment history modal query variables with { limit: 10, offset: 0 } when opening.
react/src/generated/SessionSchedulingHistoryModalQuery.graphql.ts Relay artifact updated for new pagination variables and count selection.
react/src/generated/RouteSchedulingHistoryModalQuery.graphql.ts Relay artifact updated for new pagination variables and count selection.
react/src/generated/DeploymentSchedulingHistoryModalQuery.graphql.ts Relay artifact updated for new pagination variables and count selection.
Files not reviewed (3)
  • react/src/generated/DeploymentSchedulingHistoryModalQuery.graphql.ts: Language not supported
  • react/src/generated/RouteSchedulingHistoryModalQuery.graphql.ts: Language not supported
  • react/src/generated/SessionSchedulingHistoryModalQuery.graphql.ts: Language not supported

@nowgnuesLee nowgnuesLee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@agatha197 agatha197 changed the base branch from fr-3008-scheduling-history-expand-toggle to graphite-base/7794 June 10, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants