feat(studio): multi-hop relationship fields in the dataset designer (ADR-0071 P2)#1979
Merged
Conversation
…ADR-0071 P2) Generalizes the dataset designer's field catalog + Included-relationships picker from single-hop to multi-hop relationship paths, matching the framework's ADR-0071 join support (framework #2296). - useDatasetFields: add `resolvePath` (walk a dotted path through fetched objects, collecting hop labels); `buildFieldOptions` resolves multi-hop `path.field` options under a chained heading; `useDatasetFieldCatalog` walks each included path hop-by-hop, fetching every object in the chain, and offers deeper include paths (drill `account` → `account.owner`, 3-hop cap). - DatasetDefaultInspector: `missingRelationship` flags the full relationship path (`account.owner`), not just the first segment. - Single-hop unchanged; 6 new catalog tests; inspectors sweep 170 green; app-shell type-check clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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
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.
Summary
ADR-0071 P2 (objectui side). The framework now supports multi-hop dataset joins (framework#2296, merged); this brings the Studio dataset designer along so an author can actually build them — pick a field two or three to-one relationships deep (
account.owner.region) and declare the path.Changes
useDatasetFields.tsresolvePath(base, path, objectsByName)— walks a dotted relationship path through the already-fetched objects, returning the end object + each hop's label (orundefinedif a hop can't resolve).buildFieldOptionsnow resolves multi-hoppath.fieldoptions, grouped under a chained heading (Account → Owner → User). Single-hop output is unchanged.useDatasetFieldCatalogwalks each included path hop-by-hop, fetching every object along the chain (memoized by name — hops can't be parallelized), and offers deeper include paths in the relationship combo (drillaccount→account.owner), capped at the 3-hop ADR-0071 limit.DatasetDefaultInspector.tsx—missingRelationshipflags the full relationship path (account.owner) instead of just the first segment, so the author-time "not in Included" warning + one-click "Add it" works for deep fields.Tests
buildFieldOptionsheading + not-fully-loaded skip).useDatasetFields24/24; metadata-admin inspectors sweep 170/170; app-shelltype-checkclean.Single-hop datasets are byte-for-byte unchanged. Pairs with the framework ADR-0071 join support already merged.
🤖 Generated with Claude Code