Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

feat(createModel): add selection state layer between registry and selection#148

Open
johnleider wants to merge 1 commit intomasterfrom
feat/create-model
Open

feat(createModel): add selection state layer between registry and selection#148
johnleider wants to merge 1 commit intomasterfrom
feat/create-model

Conversation

@johnleider
Copy link
Member

Summary

  • Introduces createModel as the shared selection state foundation between createRegistry and createSelection/createSlider
  • Refactors createSelection to extend createModel instead of reimplementing selection logic (~90 lines removed)
  • Generalizes useProxyModel with a structural ProxyModelTarget interface, removing hard dependency on SelectionContext
  • Adds full documentation page with architecture diagram, reactivity table, and live examples

Architecture

createRegistry → createModel → createSelection → createSingle/createGroup/createStep
                             → createSlider (on feat/slider-component)

createModel provides: selectedIds, select/unselect/toggle, mandatory enforcement, disabled guards, apply bridge for v-model sync, and reset.

Files Changed

File Change
composables/createModel/index.ts New composable
composables/createSelection/index.ts Refactored to extend createModel
composables/useProxyModel/index.ts Generalized with ProxyModelTarget
composables/index.ts Added barrel export
docs/pages/composables/selection/create-model.md New docs page
docs/examples/composables/create-model/ 4 example files
docs/pages/composables/index.md Added to Selection table
docs/pages/composables/selection/create-selection.md Updated architecture diagram

Test plan

  • All 3005 existing tests pass (no regressions)
  • Typecheck clean
  • Lint clean
  • Verify docs page renders correctly in dev server
  • Verify live examples work (color swatch selection)

…ection

Introduce createModel as the shared selection state foundation that both
createSelection and createSlider extend. Refactors createSelection to
extend createModel instead of reimplementing selection logic, and
generalizes useProxyModel with a structural ProxyModelTarget interface.

- Add createModel composable with selectedIds, select/unselect/toggle,
  mandatory enforcement, and apply bridge for v-model sync
- Refactor createSelection to extend createModel (~90 lines removed)
- Generalize useProxyModel to accept any ProxyModelTarget
- Add documentation page with architecture diagram and live examples
- Export createModel from composables barrel
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 6, 2026

Open in StackBlitz

commit: b1d34c3

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