Skip to content

CL-6423: Files adopts the shared selection system - #170

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-6423-files-selection
Aug 20, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-6423-files-selection

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Makes the Files/Library page the reference adopter of @corbits/react-ui's selection system.

Linear: https://linear.app/abklabs/issue/CL-6423

What changed

  • Hover-reveal checkbox column using SelectionCheckbox, with an indeterminate select-all header checkbox.
  • useListSelection wires selection state: shift-click range selection anchored on the last plain toggle, cmd/ctrl-click toggle, select-all/clear, stale-id reconciliation against the visible (filtered/sorted) list.
  • BulkActionBar appears once anything is selected and offers only the operation the artifacts surface actually supports today: Copy link(s) — the canonical /files/a/:id deep links. The hub artifacts routes (packages/artifacts-hub/src/routes.ts) expose list/get/upload/counts/preview only; delete/move/rename/download have no backend, so no dead buttons for them.
  • Context-menu parity: the shell context menu gains an artifact target whose item set is driven off the same LIBRARY_BULK_OPERATION_IDS constant the bulk bar renders from; right-clicking inside a multi-select acts on the whole selection. A test asserts operation-set equality.
  • Page actions (Upload, All) already lived in the StageTopBar action slot; a test now pins that contract.

Notes

  • bun run check is green for everything this PR touches; workflows/assistant's scenario tests fail identically on origin/main (zero diff in that package here) — pre-existing, unrelated.

Cover single, shift-range, and select-all/indeterminate selection on the
Files table, the bulk action bar's appearance and Escape-clear, parity
between the bulk action bar's and the shell context menu's operation sets,
and that page actions live in the StageTopBar slot rather than the body.
The Files table becomes the reference adopter of @corbits/react-ui's
selection system: a hover-reveal SelectionCheckbox column with an
indeterminate select-all header, useListSelection for shift-click range
and cmd/ctrl-click toggle selection, and a BulkActionBar carrying the one
operation the artifacts surface actually supports today — copying files'
canonical /files/a/:id links. The shell context menu gains an artifact
target driven off the same operation constant, so a right-click on a row
(or inside a multi-select) offers exactly the bulk bar's operation set.
- Additive multi-select is cmd-click on Mac (ctrl-click stays the
  context-menu gesture there); ctrl-click still adds on other platforms,
  via a shared isAdditiveSelectClick helper.
- Bulk copy-link and the context menu's selected-ids now emit in visible
  row order, so a bottom-up selection no longer copies links out of order.
- Switching between rows and grid views clears the selection, so the bulk
  bar can't float over a view with no checkboxes.
- The copy-link action label is one count-aware helper shared by the bulk
  bar and the context menu.
@TheGreatAxios
TheGreatAxios force-pushed the cl-6423-files-selection branch from 8daf7a1 to 2dab493 Compare August 20, 2026 23:56
@TheGreatAxios
TheGreatAxios merged commit aeca851 into main Aug 20, 2026
0 of 2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-6423-files-selection branch August 25, 2026 15:29
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.

1 participant