docs(vc-data-table): expand URL query state guidance and add a Storybook story#250
Merged
Merged
Conversation
|
📦 Preview published for commit Install the preview with dist-tag: npm install @vc-shell/framework@pr-250Or pin to the exact commit: npm install @vc-shell/[email protected]Published packages (dist-tag
|
…ook story - docs: complete the URL query persistence example (full reload watcher set), add the required page-reset-on-search with a warning explaining the empty-page-on-reload pitfall, a tip for composable-owned pagination, and a new "Common Mistake" for not resetting the page on search. - stories: add WithUrlStatePersistence — provides an in-memory stand-in for the per-blade query service so the stateKey round-trip (sort/search/page) and restore-on-remount are visible without the full blade/router stack.
0f0004f to
118d88b
Compare
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
Follows up #249 with user-facing documentation for the table URL-query state feature.
Docs (
vc-data-table.docs.md)[sortExpression, searchValue, () => pagination.skip]), not just sort.watch(searchValue, () => pagination.setPage(1))with a warning explaining the pitfall it prevents: searching from a later page leaves a stale_pagein the URL, so a reload requests a page beyond the filtered result set and renders an empty "nothing found" state.stateKeythrough; seed the initial load frompagination.skip).Storybook (
vc-data-table.stories.ts)WithUrlStatePersistencestory. The per-blade query service is normally provided by the blade layer; the story provides an in-memory stand-in (provide(TableQueryStateKey, ...)) so thestateKeyround-trip is visible: a live query string updates as you sort/search/page, and a Remount table button proves the state restores exactly as a page reload would from the URL. Includes the page-reset-on-search watcher.Test plan
yarn typecheck— clean.yarn docs:lint— 0 errors.eslinton the story — clean.