Skip to content

fix(FR-2919): add reversible BAIDeleteConfirmModal variant, fix title overflow, and downgrade reversible confirm flows#7480

Open
ironAiken2 wants to merge 1 commit into
mainfrom
fix/FR-2919-reversible-confirm-modal
Open

fix(FR-2919): add reversible BAIDeleteConfirmModal variant, fix title overflow, and downgrade reversible confirm flows#7480
ironAiken2 wants to merge 1 commit into
mainfrom
fix/FR-2919-reversible-confirm-modal

Conversation

@ironAiken2
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 commented May 19, 2026

Resolves #7476(FR-2919)

Background

PR #7370 (FR-2819, merged 2026-05-18) deleted BAIConfirmModalWithInput and consolidated every confirm flow onto the typed-input BAIDeleteConfirmModal. It applied the wrong criterion ("deletes a DB record") and regressed FR-2804, which had previously downgraded reversible RBAC flows to a lightweight confirm.

Changes

1. BAIDeleteConfirmModal — new reversible variant (design unification)

  • Adds reversible?: boolean. Keeps the exact same header/footer/body chrome but never renders the typed-confirmation input (even for multi-item or with requireConfirmInput) and omits the "This action cannot be undone." warning. Satisfies FR-2919 scope item 3.

2. BAIDeleteConfirmModalplainItems prop + long-title overflow fix

  • plainItems?: boolean: drops the default surface (background / border / padding / scroll) around the item list, so a self-contained item label (e.g. a table) does not get a redundant double border.
  • Long-title overflow fix (shared bug, all call sites): long unbreakable titles (e.g. a full container image ref) now wrap inside the header (width:100% + overflowWrap:'anywhere').

3. Reversible flows downgraded to reversible

  • RoleAssignmentTab — Revoke User: drop typed-input props → reversible (reverts FR-2804 regression).
  • RolePermissionTab — Remove Permission: drop typed-input props + target, set description={t('rbac.ConfirmDeletePermissionWithDetail')} (reverts FR-2804 regression).
  • AutoScalingRuleList — Delete rule: → reversible; title fixed to autoScalingRule.DeleteAutoScalingRule instead of the raw metric name; description uses a dedicated placeholder-free autoScalingRule.DeleteConfirmation (avoids the mis-localized generic dialog.ask.* key — the metric name is already shown in the item list).

4. RolePermissionTab — permission shown as a read-only table

  • Was {entityType} - {operation} ({scopeType}) (scope type only, no target name).
  • Now a read-only BAITable (1 row, no row actions) mirroring the main permissions table columns: 적용 범위 / 적용 대상 / 권한 타입 / 동작 (rbac.ScopeType / rbac.ScopeId / rbac.EntityType / rbac.Operation), same Tag styling, combined with plainItems (no double border).
  • Extracted scope-name resolution into a shared resolveScopeName helper used by both the ScopeId column and the modal so they never drift.

5. i18n

  • Re-add rbac.ConfirmDeletePermissionWithDetail; add autoScalingRule.DeleteAutoScalingRule and autoScalingRule.DeleteConfirmation (placeholder-free). All translated into 20 locales.

6. Storybook

  • Added Reversible, ReversibleMultipleItems, LongTitle, PlainItems stories.

BAIDeleteConfirmModal call sites (31 total) — at-a-glance

The shared BAIDeleteConfirmModal is used in the components below. Only the 3 marked 🟢 use the new lightweight (reversible) version — everything else keeps the typed-confirmation modal (genuinely irreversible delete/purge/terminate), so reviewers can focus on the 🟢 + ⏸ rows.

Status Call site Action
🟢 reversible RoleAssignmentTab Revoke user from role
🟢 reversible RolePermissionTab Remove permission from role (now a read-only table)
🟢 reversible AutoScalingRuleList Delete auto-scaling rule
⏸ deferred (kept typed) AIAgentPage (Reset to default) Legacy dead-path pre-v26.4.8-rc.3 — separate ticket
⏸ deferred (kept typed) AutoScalingRuleListLegacy Legacy /serving twin — left unchanged
⚪ unchanged (typed) VFolderNodes, DeleteForeverVFolderModalV2, DeleteSelectedItemsModal VFolder / file permanent delete
⚪ unchanged (typed) DeploymentList, DeploymentConfigurationSection, ProjectAdminDeploymentsPage, EndpointList, AdminDeploymentPresetListPage, PrometheusPresetTab, AdminModelCardListPage (×2) Model-serving deletes
⚪ unchanged (typed) ContainerRegistryList, CustomizedImageList Registry / image delete
⚪ unchanged (typed) ProjectResourcePolicyList, KeypairResourcePolicyList, UserResourcePolicyList, ResourcePresetList, ResourceGroupList Resource policy/preset/group delete
⚪ unchanged (typed) MyKeypairManagementModal, UserCredentialList, PurgeUsersModal, DeploymentAccessTokensTab Credential / user / token delete
⚪ unchanged (typed) BAIProjectTable, RBACManagementPage, ShellScriptEditModal, AIAgentPage (Delete agent) Project purge / role purge / script / agent delete

All 31 were re-audited against .claude/rules/destructive-confirmation.md ("recoverable in <30s without support?"). Only the 🟢 three are reversible; the rest correctly stay typed-confirm.

Verification

bash scripts/verify.sh: Relay / Lint / Format PASS. TypeScript reports the pre-existing project-wide baseline failure (Card/Select.Option/ErrorBoundary "cannot be used as a JSX component", widespread implicit-any) across many untouched files — zero errors in touched files.

🤖 Generated with Claude Code

@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization size:L 100~500 LoC labels May 19, 2026
Copy link
Copy Markdown
Contributor Author


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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)

Status Category Percentage Covered / Total
🔵 Lines 8.01% 362 / 4518
🔵 Statements 7.15% 411 / 5741
🔵 Functions 8.92% 94 / 1053
🔵 Branches 6.34% 362 / 5708
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/backend.ai-ui/src/components/BAIDeleteConfirmModal.tsx 0% 0% 0% 0% 9-177
Generated in workflow #856 for commit 3556e4b by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.52% 1785 / 27371
🔵 Statements 5.36% 1980 / 36887
🔵 Functions 5.24% 296 / 5640
🔵 Branches 3.74% 1293 / 34546
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/AutoScalingRuleList.tsx 0% 0% 0% 0% 60-438
react/src/components/RoleAssignmentTab.tsx 0% 0% 0% 0% 46-451
react/src/components/RolePermissionTab.tsx 0% 0% 0% 0% 70-231
Generated in workflow #856 for commit 3556e4b by the Vitest Coverage Report Action

@ironAiken2 ironAiken2 force-pushed the fix/FR-2919-reversible-confirm-modal branch from 0fa1875 to 9d9c0ae Compare May 19, 2026 04:48
@ironAiken2 ironAiken2 marked this pull request as ready for review May 19, 2026 04:49
Copilot AI review requested due to automatic review settings May 19, 2026 04:49
@ironAiken2 ironAiken2 changed the title fix(FR-2919): add reversible variant to BAIDeleteConfirmModal and revert RBAC regression fix(FR-2919): add reversible BAIDeleteConfirmModal variant, fix title overflow, and downgrade reversible confirm flows May 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a reversible confirmation path to BAIDeleteConfirmModal so recoverable RBAC/autoscaling actions can share the delete modal chrome without typed confirmation, while also adding related localization and Storybook coverage.

Changes:

  • Added reversible behavior and long-title wrapping to BAIDeleteConfirmModal.
  • Updated RBAC revoke/remove and autoscaling rule delete flows to use the reversible modal variant.
  • Added i18n keys and Storybook examples for reversible and long-title scenarios.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/backend.ai-ui/src/components/BAIDeleteConfirmModal.tsx Adds reversible modal behavior and title wrapping.
packages/backend.ai-ui/src/components/BAIDeleteConfirmModal.stories.tsx Adds reversible and long-title Storybook cases.
react/src/components/AutoScalingRuleList.tsx Switches autoscaling rule deletion to reversible confirm copy.
react/src/components/RoleAssignmentTab.tsx Removes typed confirmation for reversible user revocation.
react/src/components/RolePermissionTab.tsx Removes typed confirmation and adds permission-removal detail copy.
resources/i18n/de.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/el.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/en.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/es.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/fi.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/fr.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/id.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/it.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/ja.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/ko.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/mn.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/ms.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/pl.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/pt-BR.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/pt.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/ru.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/th.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/tr.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/vi.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/zh-CN.json Adds autoscaling delete and RBAC permission removal translations.
resources/i18n/zh-TW.json Adds autoscaling delete and RBAC permission removal translations.

Comment thread react/src/components/AutoScalingRuleList.tsx Outdated
@ironAiken2 ironAiken2 force-pushed the fix/FR-2919-reversible-confirm-modal branch 3 times, most recently from a8fed74 to 8ece8b6 Compare May 19, 2026 05:28
…ert RBAC regression

PR #7370 (FR-2819) consolidated all confirm flows onto the typed-input
BAIDeleteConfirmModal, regressing FR-2804 which had downgraded reversible
RBAC flows to a lightweight confirm.

- BAIDeleteConfirmModal: add `reversible` prop — keeps the same header/
  footer/body chrome but suppresses the typed-confirmation input (even
  for multi-item) and the "cannot be undone" warning.
- Fix long-title overflow: long unbreakable titles (e.g. full image
  refs) now wrap inside the modal header instead of escaping it.
- RoleAssignmentTab (Revoke User) & RolePermissionTab (Remove
  Permission): switch to `reversible`, drop typed-input props.
- AutoScalingRuleList (Delete rule): switch to `reversible`; fix title
  ('Delete Auto Scaling Rule' instead of the metric name) and drop the
  misleading 'permanently delete' target copy.
- Re-add rbac.ConfirmDeletePermissionWithDetail; add
  autoScalingRule.DeleteAutoScalingRule; translations for 20 locales.
- Storybook: add Reversible, ReversibleMultipleItems, LongTitle cases.

Deferred (kept as-is, re-audited): AI Agent Reset (legacy dead-path
pre-v26.4.8-rc.3), AutoScalingRuleListLegacy.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ironAiken2 ironAiken2 force-pushed the fix/FR-2919-reversible-confirm-modal branch from 8ece8b6 to 3556e4b Compare May 19, 2026 05:45
@github-actions github-actions Bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels May 19, 2026
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. quick-capture size:XL 500~ LoC UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confirm modal UX: PR #7370 regressed reversible-action handling (FR-2804) and needs design unification

2 participants