Skip to content

fix(dashboard): keep rows ticked while a bulk action is in flight - #29772

Merged
RohanK6 merged 1 commit into
mainfrom
crew/conductor/r110-knowledge-bulk-sel
Nov 4, 2026
Merged

RohanK6 merged 1 commit into
mainfrom
crew/conductor/r110-knowledge-bulk-sel

Conversation

@RohanK6

@RohanK6 RohanK6 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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

  • Changing what a failed action does to the selection.
  • Locking the checkboxes while an action runs.
  • The memory records editor: its apply runs inside a modal that covers the list, so no row can be ticked meanwhile.

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: bulkArchiveMutation and bulkDeleteMutation take the ids as mutation variables ({ status, ids } and { ids }), use them for the requests and the optimistic hide, and on success call a new onActed(ids) instead of onDone(). The parent removes just those ids. onDone stays for the Clear button.
  • aws-control/AwsControlPage.tsx: registerM onSuccess removes the registered names from checked instead 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.tsx Delete: the later pick is still selected when the action lands and the same for Archive
  • AwsControlPage.test.tsx a box ticked while a register is in flight stays ticked when it lands

All 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 new mutate({ 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project Apache-2.0 license.

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.
@RohanK6
RohanK6 requested review from a team and KiroCrewCaptain as code owners November 4, 2026 17:03
@RohanK6
RohanK6 requested a review from dodgeblaster November 4, 2026 17:03
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of a580e812d2e2ce70085ecd9ffb385fb62f9aaf37 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of a580e812d2e2ce70085ecd9ffb385fb62f9aaf37 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of a580e812d2e2ce70085ecd9ffb385fb62f9aaf37 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • Item 3 — symptom-level: the stated sweep was "git grep -n -A8 onSuccess … filtered for a selection reset to new Set()". That grep misses two more handlers with the same bug: pages/system/SessionStorageScreen.tsx:149 (trashMut.onSuccess → invalidate() → setSelected(new Set()), with checkboxes still enabled while the request runs), and pages/SchedulePage.tsx:887 (the batch-move onMove runs setSelectedIds(new Set()) after an awaited Promise.allSettled, in a dropdown rather than a modal). Count: 2 unfixed siblings, found by grepping set\w*\(new Set\(\)\) in website/src and reading each match. Subtraction: replace each whole-selection reset with a drop of the ids that action carried, or defer them under a bulk action that lands clears rows ticked while it ran (Knowledge, AWS Control) #29766.

What this change ships

Inventory (3 items) — 2 justified

Intent: a person who lines up their next pick while a bulk action runs keeps that pick when the action finishes. This is a FIX.

  1. Knowledge bulk Delete: a row ticked while the delete runs stays ticked when it lands — justified
  2. Knowledge bulk Archive: a row ticked while the archive runs stays ticked when it lands — justified
  3. AWS Control Add accounts: a box ticked while the register runs stays ticked — symptom-level, the same bug in 2 other handlers is left unfixed

[FIRST-PRINCIPLES-REVIEWED] a580e81

Description read

[DESCRIPTION-READ] bd35c3fba8033a4328a8bdf2e863518c41ca1b02802415e2858686704ae9de6a

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed a580e812d2e2ce70085ecd9ffb385fb62f9aaf37 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] a580e81

Verdict parsed from the review's SHA-scoped output markers for commit a580e812d2e2ce70085ecd9ffb385fb62f9aaf37.

False positive or not applicable? A repository writer can comment:
/ai-review override fable a580e812d2e2ce70085ecd9ffb385fb62f9aaf37 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of a580e812d2e2ce70085ecd9ffb385fb62f9aaf37 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] a580e81

False positive or not applicable? A repository writer can comment:
/ai-review override gpt a580e812d2e2ce70085ecd9ffb385fb62f9aaf37 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 4, 2026
@RohanK6
RohanK6 enabled auto-merge (squash) November 4, 2026 18:39

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@RohanK6
RohanK6 merged commit 8e3673f into main Nov 4, 2026
151 of 154 checks passed
@RohanK6
RohanK6 deleted the crew/conductor/r110-knowledge-bulk-sel branch November 4, 2026 19:07
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a bulk action that lands clears rows ticked while it ran (Knowledge, AWS Control)

2 participants