Skip to content

feat: neuroglancer view (3/6): file-browser multi-select - #424

Draft
allison-truhlar wants to merge 5 commits into
ngviews-02-apifrom
ngviews-03-multiselect
Draft

feat: neuroglancer view (3/6): file-browser multi-select#424
allison-truhlar wants to merge 5 commits into
ngviews-02-apifrom
ngviews-03-multiselect

Conversation

@allison-truhlar

Copy link
Copy Markdown
Collaborator

Neuroglancer Views — PR 3 of 6 (stacked)

File-browser multi-select, stacked on #423 (PR 2). Frontend-only; the
foundation the floating selection bar and Layer Cart (PR 5) build on.

Base: merge #423 first — this PR targets ngviews-02-api.

What's in this PR

  • FileBrowserContext — a new, purely additive checkedPaths: Set<string>
    (keyed on file path) plus a derived checkedFiles, with actions
    toggleChecked / checkPaths / clearChecked. The set resets per-directory
    (wired into the existing navigation effect).
  • FileTable — a leading checkbox column: a per-row checkbox and a
    "Select all" header checkbox, using the house FgCheckbox.

The design (why it's non-breaking)

Two independent selection concepts:

  • Row-body click → the existing single "focused" file (propertiesTarget) —
    drives the Properties drawer, the Delete/Rename/Permissions/Convert dialogs,
    and data-links. Untouched by this PR.
  • Checkbox → the new bulk-selection set (checkedPaths) — will drive PR 5's
    selection bar and cart.

Row checkbox clicks stopPropagation, so ticking a box never disturbs the
focused file / Properties target. Single-select and all 14 of its downstream
consumers are byte-unchanged.

Testing

pixi run test-frontend306 passed (38 files), no regressions.
node-check + node-eslint-check clean for this diff.

  • A context probe test exercises the set logic (add → toggle-off → union →
    idempotent union → clear).
  • A FileTable test renders the real Browse page and asserts the "Select all"
    header checkbox round-trips unchecked → checked → unchecked through real
    context state.

Notes for PR 5

  • Optional: an indeterminate tri-state on the select-all header (partial
    selection) — deferred.
  • checkedFiles derives from the full listing; select-all uses the rendered
    (dot-file-filtered) data. Benign today (checkboxes exist only on rendered
    rows); flag if the cart should ever include hidden files.

Stack

  1. feat: neuroglancer view (1/6): data model — views + view_layers tables #422 — data model · 2. feat: neuroglancer view (2/6): API — CRUD, read link, delete guard #423 — API · 3. This PR — multi-select
  2. Views page · 5. Browser entry points · 6. Read-only embedded viewer

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