Repository navigation
fix(studio): the list-view panel does not ask /layers for the fallback default view id - #36787
Merged
Merged
Conversation
…k default view id Fixes the 404 every open of an object with no default list view logged: the buffer and the Customize served-override read skip the layered read for OBJECT.default when no view is held under it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWBvGf6TP6P9XT1tuo
…ew layer suites Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWBvGf6TP6P9XT1tuo
Contributor
Author
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读Studio 里打开一个还没有默认视图的新对象,不再去请求一个不存在的视图(以前每次都在浏览器里报一次 404)。用户看到的界面不变。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
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.
Requested by Warren · project thread
Fixes #36750
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
With no view of an object flagged default, the Studio list-view buffer edits the fallback id
OBJECT.default(listViewTargetOf). Nothing is published under it until the panel's first edit creates it, yet the buffer read its published layer on every open and the server answered 404 (the client maps that to an empty envelope, but the browser logs the failed request). The draft-only guard (objectui#12508) no longer covers this since a new object is published at once.ObjectListViewInspector.tsx: newisFallbackListView(target, views)and atargetIsFallbackfield on the hook's result. The target is the fallback when it is the default target and no key of the object's mergedlistViews(every served view item, by qualified name, viamergeViewsIntoObjects) nor of the package's drafted list views resolves to its id. The layered read is skipped for it when there is no draft. It is read only off an answer that can say so: the package's view drafts have answered ANDgetTypeStatus('object') === 'ready'(the registry composed with the/meta/viewlist). While loading, refetching after a publish, or under a context that reports no status, the layer is read as before. The flag is a load-effect dependency, so a view that appears once metadata lands is re-read.StudioCustomizeControls.tsx+StudioDesignSurface.tsx: the other caller of the layered read for the same id, the Customize served-override read on a read-only base.useServedOverridetakesitem.unpublished; it still reads the pair's draft first, then answers{ declaration: null, state: null, shipped: 'none' }without the layered read, exactly what the 404 envelope produced.authoredDraft.tsruns only on a served draft;ViewConfigPaneland the runtime use real tab ids (the runtime fallback tab isall, not this id).Tests
ObjectListViewInspector.fallbackNoLayers-36750.test.tsx(real hook over a realMetadataClient, in-memory server): fallback id sends no/layersand reads "not created yet"; CONTROLS: a flagged published default still reads its layer; a view held under baredefaultunflagged still reads it; while objects areloadingthe layer is read, then not again onceready; a context withoutgetTypeStatusreads as before;useServedOverridewithunpublishedskips the layered read after the pair draft read, and without it still reads.ObjectListViewInspector.layersUnsaved-11799.test.tsx: docblock updated to say its 404 case holds because its context reports no status.@objectstack/lintat module top (check:test-source-alias).Acceptance notes
scripts/ablation-replace.mjs, restored to HEAD blob each time): dropping(!draft && targetIsFallback)from the layered-read guard turns 2 of 7 new cases red; deleting theunpublishedearly return turns 1 red.OBJECT.defaulttheir object definition does not list. They use hand-rolled contexts withoutgetTypeStatus, so they keep the old read; none was edited.allfallback tab issues its own/layers404 (different id, runtime surface).Verification
Local runs on 31dfa88 (fix on e4a8007)
vitest runObjectListViewInspector*, StudioDesignSurface.listView*, InterfacesPillar* : Test Files 38 passed (38), Tests 222 passed (222) (verify-lock VERDICT command-exit 0).pnpm --filter @object-ui/app-shell run type-check: VERDICT command-exit 0.dispatch-gates.mjs --commandsderived 38 commands: all exit 0 (check:test-source-aliasfirst failed on the two touched suites, fixed, re-run exit 0).overlap-check.mjs: VERDICT clean (origin/main, fix(studio): the hook designer and a nav-opened action draw refusals and texts from their served rows #36774, fix(studio): 流程页头信息条按顺序逐个让位,不再整排缩成单字 (#36745) #36781, feat(studio): design an object's public forms in Studio's Form tab #36784).Two-minute check: open Studio, Interfaces, pick an object that has no list view flagged default; the Network tab shows no
GET …/meta/view/OBJECT.default/layers, and the panel shows the default view to create as before.Generated by Claude Code