Skip to content

fix(vc-data-table): make cross-page "select all" banner opt-in#244

Open
maksimzinchuk wants to merge 1 commit into
mainfrom
fix/vc-data-table-select-all-opt-in
Open

fix(vc-data-table): make cross-page "select all" banner opt-in#244
maksimzinchuk wants to merge 1 commit into
mainfrom
fix/vc-data-table-select-all-opt-in

Conversation

@maksimzinchuk

Copy link
Copy Markdown
Collaborator

Problem

The "Select all N items" banner appeared whenever totalCount exceeded the visible page and all visible rows were selected. Because totalCount is also required just to render the pagination counter ("1–20 of 52"), any multi-select table surfaced the cross-page select-all banner — even when the consumer never opted into that feature. Clicking the banner then did nothing useful (no handler loads the non-visible IDs).

This is what surfaced in the News module list: selecting the page showed a "Select all 52 items" banner that the app never wired up.

Fix

Gate the banner on the consumer actually opting into the feature:

  • selectAllActive now defaults to undefined (was false).
  • The banner (showSelectAllChoice) is shown only when selectAllActive is bound — v-model:selectAllActive or a one-way :selectAllActive.
  • Tables that pass totalCount purely for pagination no longer show the banner. No app-side change required.

The default-undefined pattern lets the component distinguish "prop not passed" from "passed false" without inspecting the component instance.

Scope / compatibility

  • The documented across-pages example (binding v-model:select-all-active) keeps working.
  • Legacy VcTableAdapter does not forward selectAllActive, so legacy tables are unaffected.

Tests

  • useTableSelectionV2: new cases asserting showSelectAllChoice is gated by selectAllEnabled.
  • useDataTableOrchestrator: new cases asserting the banner stays hidden when selectAllActive is unbound and appears when bound.
  • Full vc-data-table suite: 554 tests green. Typecheck + lint clean.

The "Select all N items" banner appeared whenever `totalCount` exceeded the
visible page and all visible rows were selected. Since `totalCount` is also
required for the pagination counter, any multi-select table surfaced the
banner even when the consumer never wired up cross-page selection — clicking
it did nothing useful.

Gate the banner on the consumer opting into the feature: `selectAllActive`
now defaults to `undefined`, and the banner shows only when it is bound
(`v-model:selectAllActive` or one-way). Tables that pass `totalCount` purely
for pagination no longer show it.
@github-actions

Copy link
Copy Markdown

📦 Preview published for commit 2b4e603

Install the preview with dist-tag:

npm install @vc-shell/framework@pr-244

Or pin to the exact commit:

npm install @vc-shell/framework@2.0.10-pr244.2b4e603

Published packages (dist-tag pr-244, version 2.0.10-pr244.2b4e603):

  • @vc-shell/framework
  • @vc-shell/api-client-generator
  • @vc-shell/create-vc-app
  • @vc-shell/config-generator
  • @vc-shell/migrate
  • @vc-shell/ts-config
  • @vc-shell/mf-config
  • @vc-shell/mf-host
  • @vc-shell/mf-module
  • @vc-shell/vc-app-skill

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