-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat(createNested): add add new composable #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Adds useNested composable extending useGroup with: - Parent-child relationship tracking (children/parents Maps) - Open/close state management with pluggable strategies - Tree traversal utilities (getPath, getDescendants, getAncestors) - Computed roots/leaves collections - Cascade unregister option Ref: leider-labs/knowledge#163
- Add NestedRegistration type with children property for inline tree definition - Implement cascading selection: selecting parent selects all descendants - Add mixed/indeterminate state for parents with partially selected children - Override select/unselect/toggle to handle cascading and ancestor updates - Add 47 tests including 7 for cascading selection behavior - Add documentation page with interactive navigation example
50fb08e to
2f85fea
Compare
|
commit: |
Aligns with naming convention used by other selection composables (createGroup, createSelection, createSingle, etc.). The context consumer function remains useNested() as expected.
- Clear openedIds for orphaned children in non-cascade unregister - Add readonly modifiers to children/parents/openedIds in interfaces - Remove redundant type casts in computed collections - Fix JSDoc inheritance chain description - Add context trinity tests (createNestedContext, useNested)
…method - Add `open` option: 'single' | 'multiple' for accordion vs tree behavior - Add `selection` option: 'cascade' | 'independent' | 'leaf' for selection modes - Rename `toggleOpen` to `flip` for clearer single-word API - Add comprehensive benchmark suite (48 benchmarks across 9 categories) - Update docs with new options and selection mode documentation
- Add useNavNested composable using createNested for hierarchical nav state - Implement expand/collapse animation with CSS grid (respects reduced motion) - Add isSettled phase to useHydration for animation gating post-hydration - Auto-expand sections containing active route via nested.reveal() - Scroll active link into view on page load (after sections expand) - Scroll expanded section header into view when near bottom of nav
- Add collapsibleNav setting to toggle expandable nav sections - Add Navigation settings panel in Settings Sheet - Support ?features=createContext,Atom URL param for filtered docs - Case-insensitive feature matching for components and composables - Show banner when URL filtering is active - Extract buildApiSection to reduce generateNav complexity
- Add reveal(), unfold(), expand() for granular open state control - Add isAncestorOf(), hasAncestor() for relationship checks - Add siblings(), position() for sibling navigation (aria-posinset) - Add openAll and reveal options for auto-expansion behavior - Fix genId -> useId rename from master merge
- Store features in sessionStorage when URL param detected - Remove ?features from URL after storing (keeps URLs clean) - Filter persists across navigation until "Show all docs" clicked - Supports switching between projects with different feature sets
- Show "Active page" when current page filtered out by features - DocsNavigator prev/next respects filtered nav list - Allow collapsible sections with feature filtering
- Add clear() that resets children, parents, openedIds, and group state - Preserve open state across nav rebuilds in useNavNested - Fix duplicate divider when combining skill and feature filters
4899a60 to
62efa61
Compare
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.
Adds useNested composable extending useGroup with:
Ref: johnleider/knowledge#163