Skip to content

feat(#10638): change a card's resource group and range from its header for a moment - #10639

Merged
agatha197 merged 15 commits into
feat/gh-10620-card-detail-linksfrom
feat/gh-10638-card-header-overrides
Oct 28, 2026
Merged

agatha197 merged 15 commits into
feat/gh-10620-card-detail-linksfrom
feat/gh-10638-card-header-overrides

Conversation

@agatha197

@agatha197 agatha197 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #10638

Summary

A card whose settings include a resource group or a time range now shows that value as a compact control by its title, like the old dashboard's "My resources in " select. A value picked there is a temporary view; the edit-mode card settings stay the saved default, and the settings modal now says so.

  • panelSettingOverrides.ts: a jotai atom of header picks keyed by board id and panel id (card ids repeat across boards), plus the pure resolution: effective = header pick ?? saved setting ?? card default.
  • useDashboardBoard: every card gets its effective settings through the same panel / vars / detail-link inputs it already reads, so no card component changed how it reads them. Edit and save paths keep using the saved panel.
  • PanelSettingsHeaderControls + PanelHeaderSettingsContext: the resource group select (BAIScopedResourceGroupSelect, same resourceGroupScopeOf as the settings modal, moved to dashboardScope.ts) and the range select (RANGE_PRESETS), size="sm". PanelFrame renders them right after the title and its help glyph; the row's end keeps the card's own actions and the detail link. The total-resources card draws the select where its resource group name was.
  • useResetOnLeavingPath: the "reset when the path changes, not on a same-path remount" rule the board already used for edit mode and the temporary table sort, now a hook that also clears the header picks.
  • Settings modal and sider: "Default settings: {name}", "Default resource groups", "Default time range", a help line, and the sider button "Default card settings".

Behaviour

Event Header value
Pick a value in the header the card reads it at once; the control turns to the secondary variant and a reset button (tooltip "Back to the saved setting (...)") appears
Auto refresh or the refresh button kept
Pick the saved value again, or press reset back to the saved setting, modified state off
Page reload, or leaving the page path dropped; the saved setting shows
Save the card settings in edit mode the new default is saved and that card's header pick is cleared
Another board tab its own picks (keyed by board)

Resource groups: the header picks one group, or clears to the card default (the current resource group, or all groups on a custom panel), the same resourceGroups shape the settings use. A saved choice of several groups is shown as the joined names until a single group is picked.

Cards that got a control: My Total Resource Usage, Resource Presets, Total Resources in Resource Group, Pending Sessions and Reasons, Resource Groups and Capacity, Top Projects by Usage, Fair Share and custom table panels whose source supports a resource group (resource group); My Activity, Audit Log, Long-running Sessions, Scheduling Failures, Failures by Entity Type, Keypairs and Logins (range).

New i18n keys in all 21 locales: dashboard.settings.BackToSavedSetting, DefaultSettingsOf, DefaultCardSettings, DefaultResourceGroups, DefaultTimeRange, DefaultSettingsHelp; CardSettings, CardSettingsOf and ResourceGroups are replaced and removed.

Verification

  • VERIFY_BASE=origin/main VERIFY_TESTS=1 bash scripts/verify.sh: === ALL PASS ===.
  • Unit tests: panelSettingOverrides.test.ts (effective-value resolution, modified flags, override merge, board keying) and useResetOnLeavingPath.test.ts (resets on a path change, not on a same-path remount).
  • On the review server (sujin backend):
    • Superadmin /admin/dashboard: Total Resources picked sftp (CPU 11 → 15 Core); kept after the refresh button and after a 30 s auto refresh; back to default after reload. Scheduling Failures picked "Last 7 days" (failures 666/669 → 7,270/7,281); back to "Last 24 hours" after reload.
    • Project admin /project/default/admin/dashboard: Long-running Sessions "Last 1 hour", Pending Sessions sftp; both back to the default after leaving and returning.
    • Member /project/default/dashboard as a plain user: My Total Resource Usage picked sftp (13 → 17 Core); kept after refresh; back to default after reload. The select lists the project's resource groups from scopedResourceGroups.

Where to look: any card with a resource group or time range on the three dashboard pages; the select sits right after the card title.

Changes after the ready-gate review

  • Total Resources in Resource Group: the card title is the plain card name ("자원 그룹별 총자원" in Korean, which the TotalResourcesInResourceGroup key now reads), with the header picker and one Used/Free switch beside it like on other cards. Every resource group section, the first included, is labelled with its own group name, so two saved default groups no longer show "a, b" over group a's numbers.

🤖 Generated with Claude Code

agatha197 and others added 7 commits October 27, 2026 06:21
…r for a moment

Cards whose settings include a resource group or a time range now show
the value they read as a compact control in the card header. A pick there
is kept in a jotai atom keyed by board and panel id, like the temporary
table sort: auto refresh keeps it, leaving or reloading the page drops it,
and saving the card settings in edit mode clears it. The board hands every
card its effective settings (header pick, else saved, else default), so
the cards' data, vars and detail links follow the pick without changes.
A changed control turns to the secondary variant and a reset button
returns to the saved setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
That card draws its own per-group header, so the first group's header
carries the card's controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The controls sat at the end of the header row, apart from what they
change. They now follow the title and its help glyph, and the total
resources card draws its resource group picker where the group name was,
as the old dashboard did. The row's end keeps the card's own actions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the header able to change a value for a moment, the edit-mode
settings are the default the board opens with. The modal title, field
labels and settings button now say so, and a line under the title says
the header can change it for a moment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@agatha197
agatha197 added this pull request to stack #10591 October 27, 2026 06:52
@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization size:XL 500~ LoC labels Oct 27, 2026
@agatha197 agatha197 changed the title feat/gh 10638 card header overrides feat(#10638): change a card's resource group and range from its header for a moment Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 22.38% 9145 / 40856
🔵 Statements 18.73% 11343 / 60534
🔵 Functions 21.46% 1580 / 7361
🔵 Branches 13.91% 7877 / 56628
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/TotalResourceWithinResourceGroup.tsx 4.46% 1.69% 0% 5.81% 97-158, 179-184, 198-137
react/src/components/DashboardPanels/DashboardEditSider.tsx 0% 0% 0% 0% 52-278
react/src/components/DashboardPanels/DashboardPanelBoard.tsx 0% 0% 0% 0% 49-147
react/src/components/DashboardPanels/PanelFrame.tsx 2.27% 0% 0% 4.34% 34-60
react/src/components/DashboardPanels/PanelSettingsHeaderControls.tsx 4.16% 0% 0% 6.45% 44-78
react/src/components/DashboardPanels/PanelSettingsModal.tsx 74.54% 45% 66.66% 96.96% 68, 73, 74, 90, 94, 95, 101, 103, 128, 137-143, 144, 145, 146
react/src/components/DashboardPanels/dashboardScope.ts 77.77% 50% 50% 75% 48-52
react/src/components/DashboardPanels/panelSettingOverrides.ts 100% 96.66% 100% 100%
react/src/components/DashboardPanels/useDashboardBoard.tsx 0% 0% 0% 0% 76-377
react/src/components/DashboardPanels/useResetOnLeavingPath.ts 100% 100% 100% 100%
react/src/components/DashboardPanels/memberCards/ResourceGroupTotalPanel.tsx 1.85% 0% 0% 3.63% 31-59, 71-82
Generated in workflow #2477 for commit 7ef0f11 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

agatha197 and others added 2 commits October 27, 2026 13:23
…d-header-overrides

# Conflicts:
#	react/src/components/DashboardPanels/PanelFrame.tsx
#	react/src/components/DashboardPanels/PanelSettingsModal.tsx
…d plainly and label every group

With several saved default groups the header picker stood in for the
first group's name, so it read 'a, b' over group a's numbers. The card
now has one header (the plain title, its help, the picker beside it and
one Used/Free switch) and each resource group section carries its own
name, the first included. The Korean title reads '자원 그룹별 총자원'.

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

Copy link
Copy Markdown
Contributor Author

Ready-gate agent review (Opus) - blocking issues only

# File:line Finding Outcome
O1 ResourceGroupTotalPanel.tsx:86, PanelSettingsHeaderControls.tsx:88-92 With several default resource groups, the first section's title showed "a, b" over group a's numbers Fixed in 7ef0f1110c: plain card title with the picker beside it, every section labelled with its own group (decided by the author)

Copilot: unavailable (insufficient remaining quota) - this review gated the PR alone. The fixes above landed after the review and were not re-reviewed; verified by VERIFY_TESTS=1 scripts/verify.sh ALL PASS on the stack top 8a250e2ad2 and on the review server.

@agatha197
agatha197 marked this pull request as ready for review October 27, 2026 13:41
@agatha197
agatha197 merged commit 8a250e2 into main Oct 28, 2026
20 checks passed
@agatha197
agatha197 deleted the feat/gh-10638-card-header-overrides branch October 28, 2026 07:41
@agatha197

Copy link
Copy Markdown
Contributor Author

This PR shows as merged only because its base branch (feat/gh-10620-card-detail-links) was fast-forwarded to the stack top while folding it into #10627; nothing reached main. Review and merge happen on #10627, which resolves #10638.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let a card's resource group and time range be changed for a moment from its header

2 participants