Repository navigation
fix(dashboard): keep rows ticked while a bulk action is in flight - #29772
Conversation
Knowledge's bulk Archive and Delete, and AWS Control's Add accounts register, cleared the whole selection when they returned. A row ticked while the request ran was unticked too. Each action now carries the ids it started on and drops only those from the selection.
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The diff adds or changes no control, label or string. It only keeps a row ticked during a bulk action when the user ticked it while the action was running, so no screenshot is needed. [UX-REVIEWED] a580e81 Description read[DESCRIPTION-READ] 3b7eb3271d916dff48cfd6a327ca7b30d946c2f05d0d83bbc841c4a9b13c08cd That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: each action now drops only the ids it started on, which fixes the cause, and success handling is unchanged when nothing new is ticked mid-action. [DESIGN-REVIEWED] a580e81 Description read[DESCRIPTION-READ] 42227e96dd97f6d508e3350d10525855e95a31dd941af8a8e41ccb2977baf449 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The fix reaches the cause, which is a success handler that emptied the whole selection instead of dropping the ids it acted on. Two sibling handlers with the same bug are left unfixed. Notes
What this change shipsInventory (3 items) — 2 justifiedIntent: a person who lines up their next pick while a bulk action runs keeps that pick when the action finishes. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] a580e81 Description read[DESCRIPTION-READ] bd35c3fba8033a4328a8bdf2e863518c41ca1b02802415e2858686704ae9de6a That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: fix: a landed bulk action (Knowledge archive/delete, AWS Control register) now drops only the ids it acted on from the selection instead of clearing it, with race tests for both pages.
Problem / Motivation
Goal: A row you tick while a Knowledge bulk Archive or Delete, or an AWS Control Add accounts register, is still running stays ticked when it finishes.
Both actions clear the whole selection when they return, whatever is ticked by then. Tick a row, start the action, tick another row while the request runs: when it lands, that second row is unticked.
Why it matters
Bulk actions send one request per row and can take a moment. Lining up the next batch meanwhile is the natural move, and the page silently throws that pick away.
Not a goal
What changed (motivation → approach → change)
Symptom: a row ticked during a bulk action is unticked when it lands. Root cause: each success handler emptied the selection instead of removing the rows it acted on. Change: each action now carries the ids it started on and drops only those.
knowledge/index.tsx:bulkArchiveMutationandbulkDeleteMutationtake the ids as mutation variables ({ status, ids }and{ ids }), use them for the requests and the optimistic hide, and on success call a newonActed(ids)instead ofonDone(). The parent removes just those ids.onDonestays for the Clear button.aws-control/AwsControlPage.tsx:registerMonSuccessremoves the registered names fromcheckedinstead of resetting it.Backwards compatibility
Compatible: when nothing is ticked during the action the end state is the same, an empty selection; the requests go to the same rows as before.
Removes nothing: no control, route or state is taken away.
Tests
KnowledgeBulkSelectionRace.test.tsxDelete: the later pick is still selected when the action landsand the same forArchiveAwsControlPage.test.tsxa box ticked while a register is in flight stays ticked when it landsAll three fail on main and pass here. The Knowledge and AWS Control suites pass: 676 tests. tsc, eslint and the i18n check are clean.
Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
N/A — unit coverage sufficient: each test drives the real page through a held request, ticks a second row while it runs, then lands the request.
Screenshots / video
Why no screenshot: nothing renders differently; the change only keeps a tick the user already sees on screen when the action returns.
Related Issues
Fixes #29766
Overlap: #21276 also edits the bulk Delete button in
knowledge/index.tsx(it swaps the native confirm). It already conflicts with main; on rebase it keeps the newmutate({ ids })argument.Sibling sweep
Swept: git grep -n -A8 onSuccess -- website/src and filtered for a selection reset to new Set(), clearSelection() or an empty array
Sibling: website/src/pages/knowledge/index.tsx -- changed here
Sibling: website/src/apps/aws-control/AwsControlPage.tsx -- changed here
Sibling: website/src/pages/overview/MemoryRecordsEditor.tsx -- not affected -- apply runs inside a modal that covers the list
Pattern harvest
Rule candidate: review-prompt
Pattern: a bulk mutation onSuccess that empties the whole selection instead of removing the ids it acted on
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project Apache-2.0 license.