Repository navigation
fix: export-chat "Deselect all" no-op and dead download-disabled state (#2080) - #2140
Merged
Merged
Conversation
Contributor
Author
Desk Review — READY TO MERGE ✅Reviewed the fix for #2080 on branch CI & tests
Assessment by dimension
Adversarial passA skeptic agent tried 13 interaction sequences (deselect→toggle→select-all→deselect, async load races, stale-id size collisions, disabled-state inversions) and could not produce a wrong selection, counter, button state, or export. Verdict: READY TO MERGE. |
cursor
Bot
force-pushed
the
tale/xs764ehrzrdnft95849dd2x4j1898pm3
branch
from
July 3, 2026 20:42
de3396c to
1aa7120
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2080.
The export-chat dialog used an empty
Setas a sentinel meaning "default = all selected". As a result:setSelectedIds(new Set())instantly re-resolved toallIdson the next render.noneSelectedwas therefore alwaysfalse, making thedisabled={noneSelected}guards on both download buttons dead code.Fix
Replaced the overloaded empty-set sentinel with an explicit discriminated selection model:
selectionis either the'all'sentinel (default, selects every message including ones that load later) or an explicitSet<string>. An explicit empty set now genuinely means "nothing selected", so:selection = new Set()→ counter reads0 of N, toggle flips to Select all, both download buttons disable.Tests
Added two regression tests in
export-chat-dialog.test.tsx:0 of N, no checkboxes checked, both downloads disabled.All 5 UI tests pass;
tsc --noEmitandoxlint --type-awareare clean on the changed files.