Skip to content

feat(vc-data-table): single-load restore for list views#242

Open
maksimzinchuk wants to merge 1 commit into
mainfrom
feat/vc-data-table-single-load-restore
Open

feat(vc-data-table): single-load restore for list views#242
maksimzinchuk wants to merge 1 commit into
mainfrom
feat/vc-data-table-single-load-restore

Conversation

@maksimzinchuk

@maksimzinchuk maksimzinchuk commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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.

  • useTableQueryPersistence no longer emits restore events on init. It keeps the URL write-back and only seeds the table's search box for display.
  • New useTableQueryState(stateKey).read() — a page reads its own sort/search/page in setup and loads once. Exposed publicly without leaking the internal service key/factory.
  • useDataTablePagination.setPage(n) — set the page without firing onPageChange (for restore seeding).

The create-vc-app list 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
  • Manual: reload a list blade with sort+search+page in the URL → one search request, row order matches the indicator

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

📦 Preview published for commit bfb451e

Install the preview with dist-tag:

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

Or pin to the exact commit:

npm install @vc-shell/framework@2.0.10-pr242.bfb451e

Published packages (dist-tag pr-242, version 2.0.10-pr242.bfb451e):

  • @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

@maksimzinchuk maksimzinchuk force-pushed the feat/vc-data-table-single-load-restore branch from 7d8e7c3 to 2e7f6b3 Compare June 18, 2026 13:27
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.
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