Skip to content

Conversation

@johnleider
Copy link
Member

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: johnleider/knowledge#163

@johnleider johnleider added this to the v0.1.0 milestone Jan 6, 2026
@johnleider johnleider added the enhancement New feature or request label Jan 6, 2026
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
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 14, 2026

Open in StackBlitz

commit: fa62ecf

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
@johnleider johnleider changed the title feat(useNested): add POC for hierarchical tree management composable feat(createNested): add add new composable Jan 15, 2026
@johnleider johnleider marked this pull request as ready for review January 15, 2026 15:22
- 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
@johnleider johnleider merged commit 9826276 into master Jan 15, 2026
12 of 13 checks passed
@johnleider johnleider deleted the feat/use-nested branch January 15, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant