Skip to content

feat(react): path-map and { paths, where } intercept sugar (#143) - #149

Merged
timkindberg merged 7 commits into
mainfrom
feat/143-intercept-sugar
Aug 16, 2026
Merged

feat(react): path-map and { paths, where } intercept sugar (#143)#149
timkindberg merged 7 commits into
mainfrom
feat/143-intercept-sugar

Conversation

@timkindberg

@timkindberg timkindberg commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #143 (child of #141). Stack: #149#150#151#152.

intercept now takes a path map or { paths, where } bag, not just the function. Exact path beats where, unmatched nodes keep defaults. Handlers stay mounted components with parts.

Bag vs path-map is by value shape so a field actually named paths or where isn't misread as a bag. Function floor is unchanged. useRenderNodeRules still exported; recipes/gallery move off it in later layers.

Agent did the grind.

Test plan

  • <SchemaFields intercept={{ email: EmailHint }} /> hijacks that field only
  • { paths, where } — exact path wins over where
  • { where: Handler } for a field named where is a path map, not a bag
  • Hoisted map (new object, same handler refs) does not remount inputs
  • Function intercept still works
  • CI green

Stack created with GitHub Stacks CLI

timkindberg and others added 2 commits August 14, 2026 18:32
…ere (#143)

Co-authored-by: Cursor <cursoragent@cursor.com>
@timkindberg timkindberg changed the title feat/143 intercept sugar feat(react): path-map and { paths, where } intercept sugar (#143) Aug 14, 2026
…tRules (#143)

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/react/src/intercept.test.tsx Outdated
Comment thread packages/react/src/intercept.test.tsx
Comment thread packages/react/src/renderNodeRules.tsx Outdated
timkindberg and others added 4 commits August 15, 2026 14:42
Co-authored-by: Cursor <cursoragent@cursor.com>
The floor props union is not a supertype of path-narrowed FieldProps
(parts bags differ), so maps of annotated gallery handlers were not
assignable to intercept. Also format the useInterceptRules stability tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@timkindberg
timkindberg merged commit 170634f into main Aug 16, 2026
2 checks passed
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.

Intercept sugar: dotted-path map and { paths, where } bag

1 participant