feat(vc-data-table): single-load restore for list views#242
Open
maksimzinchuk wants to merge 1 commit into
Open
feat(vc-data-table): single-load restore for list views#242maksimzinchuk wants to merge 1 commit into
maksimzinchuk wants to merge 1 commit into
Conversation
|
📦 Preview published for commit Install the preview with dist-tag: npm install @vc-shell/framework@pr-242Or pin to the exact commit: npm install @vc-shell/framework@2.0.10-pr242.bfb451ePublished packages (dist-tag
|
7d8e7c3 to
2e7f6b3
Compare
Restoring sort/search/page from the URL used to trigger several loads at once, so the data could disagree with the indicators after a reload. Move restore from push to pull: - useTableQueryPersistence no longer emits restore events on init; it keeps the URL write-back and only seeds the table's search box for display. - Add useTableQueryState(stateKey).read() so a page seeds its own sort/search/page refs in setup and loads once. - Add useDataTablePagination.setPage(n): set the page without firing onPageChange. Update the create-vc-app list templates and the table docs to the single-loader pattern. Unit tests cover read(), setPage, and the removed restore push.
2e7f6b3 to
bfb451e
Compare
4 tasks
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.
Summary
Restoring sort/search/page from the URL used to trigger several loads at once, so the data could disagree with the sort/search/page indicators after a reload. This moves restore from push to pull.
useTableQueryPersistenceno longer emits restore events on init. It keeps the URL write-back and only seeds the table's search box for display.useTableQueryState(stateKey).read()— a page reads its own sort/search/page insetupand loads once. Exposed publicly without leaking the internal service key/factory.useDataTablePagination.setPage(n)— set the page without firingonPageChange(for restore seeding).The
create-vc-applist templates and the table docs are updated to the single-loader pattern.Test Plan
yarn check(lint / format / stylelint / typecheck / locales / circular / layers)vitest— vc-data-table / table-query-state suites pass, incl. new unit tests