Multi-select rows with bulk delete and set-property actions in Table - #1240
Draft
joepio wants to merge 2 commits into
Draft
Multi-select rows with bulk delete and set-property actions in Table#1240joepio wants to merge 2 commits into
joepio wants to merge 2 commits into
Conversation
Co-authored-by: Joep Meindertsma <joep@ontola.io>
Co-authored-by: Joep Meindertsma <joep@ontola.io>
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.
Related Issues
Adds a multi-edit mode with bulk actions to the Table view.
What this adds
collection.getAllMembers()), and renders indeterminate when only some rows are selected.InputSwitcher), then write it to every selected row.Selection is keyed by subject (not grid index) so it survives sorting, filtering, paging and deletion, and it is cleared when the query (filter/sort/view) changes. Session/new (
_new:) rows are not selectable. Both bulk operations push undo entries onto the table history stack.Implementation notes
TableEditor) stays feature-agnostic:FancyTablegained optionalrenderRowSelector/headerSelectorslots,IndexCellrenders an optionalselector, andTableHeaderrenders an optional header selector. The index column only widens (viauseCellSizes) when selection is enabled, so read-only/other tables are unaffected.chunks/TablePage/:useRowSelection.ts(selection state),RowSelectCheckbox.tsx(per-row checkbox that resolves its own subject),TableBulkActionsBar.tsx, andTableSetPropertyDialog.tsx.resource.set+save,resource.destroy) and reuseConfirmationDialog.Verification
browser/e2e/tests/table-bulk-actions.spec.ts(both pass locally, 2/2):select individual rows and bulk delete— selects two rows via their checkboxes, deletes them via the bulk bar + confirmation, asserts they're gone and the untouched row remains.select all and bulk set a property— uses the header select-all, sets thenameproperty to "Done" across all rows, asserts all rows updated.data-testids (row-select-checkbox,select-all-checkbox,table-bulk-actions,bulk-set-property-button,bulk-delete-button,bulk-clear-button,bulk-set-property-select) so the tests don't depend on i18n-wrapped label text.pnpm --filter @tomic/data-browser typecheck/@tomic/e2e typecheck— no new errors (only a pre-existingpairing.test.tsnode-types error unrelated to this change).lintpasses (warnings only), formatting clean.name→ "Done" on 2 rows, toast "Updated 2 rows"), Select all from the header (5 rows selected), and bulk Delete with confirmation (toast "Deleted 5 rows", empty table). No errors.table_bulk_actions_demo.mp4
Row selection + select-all + bulk bar (rows 1–2 already set to "Done"):
Bulk selection and set property
Bulk delete confirmation:
Bulk delete confirmation
Note: localization catalogs (
src/locales/*.po) were intentionally not regenerated in this PR to avoid committing unrelated extraction churn; new English strings render via source fallback and are picked up by the project's normalwuchaleextraction step (run during the build), which is how the demo labels above were produced. The e2e tests select bydata-testid, so they pass regardless of extraction state.Checklist
To show artifacts inline, enable in settings.