fix(vc-data-table): make cross-page "select all" banner opt-in#244
Open
maksimzinchuk wants to merge 1 commit into
Open
fix(vc-data-table): make cross-page "select all" banner opt-in#244maksimzinchuk wants to merge 1 commit into
maksimzinchuk wants to merge 1 commit into
Conversation
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.
|
📦 Preview published for commit Install the preview with dist-tag: npm install @vc-shell/framework@pr-244Or pin to the exact commit: npm install @vc-shell/framework@2.0.10-pr244.2b4e603Published packages (dist-tag
|
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.
Problem
The "Select all N items" banner appeared whenever
totalCountexceeded the visible page and all visible rows were selected. BecausetotalCountis 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:
selectAllActivenow defaults toundefined(wasfalse).showSelectAllChoice) is shown only whenselectAllActiveis bound —v-model:selectAllActiveor a one-way:selectAllActive.totalCountpurely for pagination no longer show the banner. No app-side change required.The default-
undefinedpattern lets the component distinguish "prop not passed" from "passedfalse" without inspecting the component instance.Scope / compatibility
v-model:select-all-active) keeps working.VcTableAdapterdoes not forwardselectAllActive, so legacy tables are unaffected.Tests
useTableSelectionV2: new cases assertingshowSelectAllChoiceis gated byselectAllEnabled.useDataTableOrchestrator: new cases asserting the banner stays hidden whenselectAllActiveis unbound and appears when bound.vc-data-tablesuite: 554 tests green. Typecheck + lint clean.