fix: children($var) domain compilation and resolver support

- Add children branch in convertDomain() alongside descendants —
  children() now correctly maps to parentVar: '$parent'
  instead of falling through to the default branch which reversed
  the parentVar/selector mapping.
- SelectorDomainResolver now handles parentVar domains with no
  CSS selector filter (children domain collects all registered
  subject IDs, then filters by parent via ancestor index).
- All 1072 tests pass across 14 packages.
This commit is contained in:
John Dvorak
2026-05-21 20:13:57 -07:00
parent 35c5dbd153
commit b4ae8e9134
2 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -938,7 +938,7 @@ function convertDomain(domain: DslDomainRef): DomainRef {
// Descendant domains use the first argument as parent and second as filter:
// descendants($card, '.title') => parentVar: '$card', selector: '.title'
if (domain.kind === 'descendants') {
if (domain.kind === 'descendants' || domain.kind === 'children') {
const parentVar = selectorFromVar ?? domain.selector
const selector = extraArgFromVar ?? (domain as any).extraArg
return {