feat(FR-3008): auto-expand non-success rows and add expand/collapse-all toggle in scheduling history#7650
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
There was a problem hiding this comment.
Pull request overview
Adds a shared expand/collapse controller for scheduling history tables so that non-success rows auto-expand by default, and users get an expand-all / collapse-all master toggle in the expand-column header (session, deployment, and route history modals).
Changes:
- Added
useSchedulingHistoryExpandablehook to controlexpandedRowKeys, default expansion behavior, and header toggle rendering. - Wired the hook into the three scheduling history table fragments (session/deployment/route).
- Added
comp:BAITable.ExpandAll/comp:BAITable.CollapseAlltranslations across backend.ai-ui locales.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backend.ai-ui/src/components/fragments/useSchedulingHistoryExpandable.tsx | New shared hook that computes default expanded rows (non-success) and provides a header expand/collapse-all toggle. |
| packages/backend.ai-ui/src/components/fragments/BAISchedulingHistoryNodes.tsx | Uses the shared hook to control expandable state for session scheduling history table. |
| packages/backend.ai-ui/src/components/fragments/BAIDeploymentSchedulingHistoryNodes.tsx | Uses the shared hook to control expandable state for deployment scheduling history table. |
| packages/backend.ai-ui/src/components/fragments/BAIRouteSchedulingHistoryNodeTable.tsx | Uses the shared hook to control expandable state for route scheduling history table. |
| packages/backend.ai-ui/src/locale/en.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/ko.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/ja.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/zh-CN.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/zh-TW.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/de.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/el.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/es.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/fi.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/fr.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/id.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/it.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/mn.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/ms.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/pl.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/pt.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/pt-BR.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/ru.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/th.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/tr.json | Adds BAITable “Expand all” / “Collapse all” strings. |
| packages/backend.ai-ui/src/locale/vi.json | Adds BAITable “Expand all” / “Collapse all” strings. |
c768640 to
bdb6bcd
Compare
eb0d0a4 to
a5854c4
Compare
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
a5854c4 to
a3f2659
Compare
a3f2659 to
b9e1558
Compare
nowgnuesLee
left a comment
There was a problem hiding this comment.
please clean up useless comments.
d5232d0 to
ac5d9e5
Compare
nowgnuesLee
left a comment
There was a problem hiding this comment.
Please clean up the useless comments.
ac5d9e5 to
93f1677
Compare
93f1677 to
81c649b
Compare
c733632 to
27dc5db
Compare
It will handed in a separated issue
Merge activity
|
…ll toggle in scheduling history (#7650) Resolves #7649 (FR-3008) ## Summary Scheduling-history tables — **session**, **deployment**, and **route** — make scheduling problems easy to scan. A kebab (⋮) menu in the expand-column header offers three view actions — **expand all / collapse all / expand errors only** — with the chosen mode persisted per user (default **expand errors only**). In errors-only mode, non-success rows auto-expand and their nested sub-step table is filtered to just the failing / retried steps. Originates from a Teams thread in devops/Frontend (auto-expand non-success scheduling entries). Supersedes FR-2958 / FR-2959, which were closed as *Not Planned* because they targeted the wrong surface (validation / check-result views). ## Behavior - **Header kebab menu (⋮):** a vertical-ellipsis hover menu in the expand-column header with three actions — **Expand all**, **Collapse all**, **Expand errors only**. It reads as an action menu, not a stateful toggle: no per-item icons and no "active" highlight. - **Persisted mode:** the selected mode is stored per user via `useBAISettingUserState('schedulingHistoryExpandMode')` and reused as the default on subsequent opens. Initial default is **expand errors only**. - **Expand errors only:** rows whose `result !== 'SUCCESS'` are expanded; `SUCCESS` rows stay collapsed. The expanded row's **nested sub-step table hides `SUCCESS` sub-steps**, surfacing only the failing / retried steps. - **Per-row expand icons** use Ant Design's default `+` / `−` (full expand / collapse). Individual rows remain manually expandable. - **Result column** shows the result badge only (the previous hover info-icon/tooltip was removed). - **On refetch:** the current mode is re-applied. ## Table presentation - History tables use BAITable's default muted header style, which renders correctly in **both light and dark mode** (token-based, dark-mode aware). The status transition is shown as two **flat** columns — **From Status** / **To Status** — reusing the same labels as the property filter for those fields (no grouped two-level header, no cell borders). - **Resizable** columns, **drag-to-reorder**, and **column show/hide** via `tableSettings`, with the per-column overrides persisted per user (`table_column_overrides.*`). - **Nested sub-step table:** `Error Code` column now precedes `Message`. ## Implementation - `useSchedulingHistoryExpandable(dataSource, { mode, onModeChange })` owns `expandedRowKeys` / `onExpandedRowsChange`, exposes the effective `mode`, and renders the kebab header menu. Reused across all three tables. - Feature lives in dedicated wrappers — `BAISchedulingHistoryTable`, `BAIDeploymentSchedulingHistoryTable`, `BAIRouteSchedulingHistoryTable` — each owning a fragment that spreads the corresponding `*NodesFragment`, runs the hook, and supplies the `expandable` config; the base `*Nodes` components stay pure fragment tables. - `BAISubStepNodes` gains an `errorsOnly` prop that filters out `SUCCESS` sub-steps. - The three host modals (`SessionSchedulingHistoryModal`, `DeploymentSchedulingHistoryModal`, `RouteSchedulingHistoryModal`) wire the persisted expand-mode and column-override settings. - The expanded-row background in `BAITable` is token-based (`colorFillSecondary`, dark-mode aware). - i18n: `comp:BAITable.ExpandAll` / `CollapseAll` / `ExpandErrorsOnly` / `ExpandOptions` across all languages. ## Verification `bash scripts/verify.sh` → **ALL PASS** (Relay, Lint, Format, TypeScript). ## Screenshots Captured (light mode) against mock scheduling-history data — a `NEED_RETRY` and a `FAILURE` row, each with sub-steps mixing `SUCCESS` / `FAILURE` / `NEED_RETRY`, plus `SUCCESS` rows. ### Default — "expand errors only" Non-success rows (`NEED_RETRY`, `FAILURE`) auto-expanded, `SUCCESS` rows collapsed. The nested sub-step tables show only non-success steps (the `FIFOSequencer` / `PrepareContainer` `SUCCESS` sub-steps are filtered out). Flat **From Status** / **To Status** columns, default muted header, no cell borders, `Error Code` before `Message`, result badge only, kebab (⋮) in the header.  ### Header kebab menu The ⋮ hover menu with the three plain-text actions — no icons, no active highlight.  ### Expand all  🤖 Generated with [Claude Code](https://claude.com/claude-code)
27dc5db to
fd05a5b
Compare
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](https://claude.com/claude-code)

Resolves #7649 (FR-3008)
Summary
Scheduling-history tables — session, deployment, and route — make scheduling problems easy to scan. A kebab (⋮) menu in the expand-column header offers three view actions — expand all / collapse all / expand errors only — with the chosen mode persisted per user (default expand errors only). In errors-only mode, non-success rows auto-expand and their nested sub-step table is filtered to just the failing / retried steps.
Originates from a Teams thread in devops/Frontend (auto-expand non-success scheduling entries). Supersedes FR-2958 / FR-2959, which were closed as Not Planned because they targeted the wrong surface (validation / check-result views).
Behavior
useBAISettingUserState('schedulingHistoryExpandMode')and reused as the default on subsequent opens. Initial default is expand errors only.result !== 'SUCCESS'are expanded;SUCCESSrows stay collapsed. The expanded row's nested sub-step table hidesSUCCESSsub-steps, surfacing only the failing / retried steps.+/−(full expand / collapse). Individual rows remain manually expandable.Table presentation
tableSettings, with the per-column overrides persisted per user (table_column_overrides.*).Error Codecolumn now precedesMessage.Implementation
useSchedulingHistoryExpandable(dataSource, { mode, onModeChange })ownsexpandedRowKeys/onExpandedRowsChange, exposes the effectivemode, and renders the kebab header menu. Reused across all three tables.BAISchedulingHistoryTable,BAIDeploymentSchedulingHistoryTable,BAIRouteSchedulingHistoryTable— each owning a fragment that spreads the corresponding*NodesFragment, runs the hook, and supplies theexpandableconfig; the base*Nodescomponents stay pure fragment tables.BAISubStepNodesgains anerrorsOnlyprop that filters outSUCCESSsub-steps.SessionSchedulingHistoryModal,DeploymentSchedulingHistoryModal,RouteSchedulingHistoryModal) wire the persisted expand-mode and column-override settings.BAITableis token-based (colorFillSecondary, dark-mode aware).comp:BAITable.ExpandAll/CollapseAll/ExpandErrorsOnly/ExpandOptionsacross all languages.Verification
bash scripts/verify.sh→ ALL PASS (Relay, Lint, Format, TypeScript).Screenshots
Captured (light mode) against mock scheduling-history data — a
NEED_RETRYand aFAILURErow, each with sub-steps mixingSUCCESS/FAILURE/NEED_RETRY, plusSUCCESSrows.Default — "expand errors only"
Non-success rows (
NEED_RETRY,FAILURE) auto-expanded,SUCCESSrows collapsed. The nested sub-step tables show only non-success steps (theFIFOSequencer/PrepareContainerSUCCESSsub-steps are filtered out). Flat From Status / To Status columns, default muted header, no cell borders,Error CodebeforeMessage, result badge only, kebab (⋮) in the header.Header kebab menu
The ⋮ hover menu with the three plain-text actions — no icons, no active highlight.
Expand all
🤖 Generated with Claude Code