feat(app-shell): view-ref widget — pick sourceView from a dropdown (ADR-0047)#1721
Merged
Merged
Conversation
…DR-0047) Adds a `view-ref` metadata-form widget so interfaceConfig.sourceView renders as a dropdown of the source object's views instead of a free-text name the author could mistype. Views come from a new WidgetContext.objectViews, loaded by ResourceEditPage for the page's source object. Out-of-catalog values survive; "None" omits the field (= object default). Mirrors the field-ref picker. Pairs with @objectstack/spec setting widget:'view-ref' + dependsOn:'source' on the page form's sourceView field. 4 unit tests; tsc clean. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Follow-up to the page-config-panel audit. The interface page's
sourceViewwas a free-text input — an author could type a view name that doesn't exist. This adds aview-refpicker so they choose from the source object's real views.What
view-refwidget (widgets.tsx) — a single-view dropdown modelled on the existingfield-refpicker. Options come fromcontext.objectViews; a value not in the catalog is still shown (stale/custom names survive); clearing to None omits the field, which the protocol treats as the object's default view.WidgetContext.objectViews— new context slot;ResourceEditPageloads the source object's views (client.list('view')filtered byobjectName/object) for the page's source (interfaceConfig.source/object), alongside the existingobjectFieldsloader.'view-ref'in theWIDGETSmap.Pairs with framework#1836, which sets
widget: 'view-ref'+dependsOn: 'source'on the page form'ssourceViewfield. Order-independent: without the spec hint the widget is simply unused; without the widget the spec field degrades to a text input.Verification
ViewRefWidget.test.tsx): registry wiring, renders a combobox with views, degrades with no views, survives an out-of-catalog value. + existing widget tests green (10 total).tsc --noEmiton@object-ui/app-shell→ 0 errors.field-ref, which was verified live in the browser during the panel audit (renders a working object-field dropdown).🤖 Generated with Claude Code