Fix: files selection bar no longer leaks into non-file views (#788) #791

Merged
Cordy merged 3 commits from feat-788 into main 2026-09-28 02:03:32 +00:00
Owner

Closes #788.

Reproduced first on the v0.6.294 Bao dogfood: Recents → select all → Spaces left body[data-sel="on"], "11 selected", #selbar displayed over the overview.

Root cause: setView() closed the details pane for non-file views but never dropped the file selection. Files→files transitions were fine only because renderRows clears SEL; non-file views never render rows, so data-sel stayed on and the CSS kept the bar up (and #fileactions hidden).

Fix (one line, existing mechanism): in setView's existing if (!files) branch, if (SEL.size) { SEL.clear(); applySel(); } — applySel stays the single writer of body[data-sel] (pinned). No TDZ risk: SEL is declared after setView but only deferred handlers reference it before, and boot() runs at the end. Verified the mechanism against the exact live leaked state before pushing (data-sel → off, bar hidden, toolbar back).

Reverse path checked: spovSel is re-created on every openSpacesView() render and its bar lives inside #listpane, which setView hides for file views — nothing leaks the other way. #787 will re-verify once the spaces bar moves into the toolbar slot.

Verified locally: RED → splice → 272/272 green; runner one-shot repeated it.

Closes #788. **Reproduced first** on the v0.6.294 Bao dogfood: Recents → select all → Spaces left `body[data-sel="on"]`, "11 selected", `#selbar` displayed over the overview. **Root cause:** `setView()` closed the details pane for non-file views but never dropped the file selection. Files→files transitions were fine only because `renderRows` clears `SEL`; non-file views never render rows, so `data-sel` stayed on and the CSS kept the bar up (and `#fileactions` hidden). **Fix (one line, existing mechanism):** in `setView`'s existing `if (!files)` branch, `if (SEL.size) { SEL.clear(); applySel(); }` — `applySel` stays the single writer of `body[data-sel]` (pinned). No TDZ risk: `SEL` is declared after `setView` but only deferred handlers reference it before, and `boot()` runs at the end. Verified the mechanism against the exact live leaked state before pushing (`data-sel` → off, bar hidden, toolbar back). Reverse path checked: `spovSel` is re-created on every `openSpacesView()` render and its bar lives inside `#listpane`, which `setView` hides for file views — nothing leaks the other way. #787 will re-verify once the spaces bar moves into the toolbar slot. Verified locally: RED → splice → 272/272 green; runner one-shot repeated it.
test: #788 RED - selection bar leak
All checks were successful
fix-788 / fix (push) Successful in 13s
c321b9df86
Closes #788
docs: changelog for v0.6.295 (#788)
All checks were successful
ci / test-and-build (pull_request) Successful in 1m31s
9fb0660b7d
Cordy merged commit cc9ef3f56c into main 2026-09-28 02:03:32 +00:00
Cordy deleted branch feat-788 2026-09-28 02:03:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#791
No description provided.