Skip to content

fix(studio): the list-view panel does not ask /layers for the fallback default view id - #36787

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-gtzq47
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-gtzq47

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #36750

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:在 Studio 打开一个还没有默认列表视图的对象时,浏览器不再记一条服务器 404 报错;面板显示和保存都不变。
  • 属于 Studio 评审 9 张卡中的一张(列表视图的多余请求),替开发者清掉控制台里的假报错。
  • 出错时最坏是面板对一个真实存在的默认视图显示「尚未创建」;只在元数据已加载完成时才跳过请求,可直接撤回这个 PR。
  • 无。

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: new isFallbackListView(target, views) and a targetIsFallback field on the hook's result. The target is the fallback when it is the default target and no key of the object's merged listViews (every served view item, by qualified name, via mergeViewsIntoObjects) 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 AND getTypeStatus('object') === 'ready' (the registry composed with the /meta/view list). 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. useServedOverride takes item.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.
  • Other layered-read callers checked: authoredDraft.ts runs only on a served draft; ViewConfigPanel and the runtime use real tab ids (the runtime fallback tab is all, not this id).

Tests

  • New ObjectListViewInspector.fallbackNoLayers-36750.test.tsx (real hook over a real MetadataClient, in-memory server): fallback id sends no /layers and reads "not created yet"; CONTROLS: a flagged published default still reads its layer; a view held under bare default unflagged still reads it; while objects are loading the layer is read, then not again once ready; a context without getTypeStatus reads as before; useServedOverride with unpublished skips 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.
  • Both suites import @objectstack/lint at module top (check:test-source-alias).

Acceptance notes

  • Ablation (committed fix first, 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 the unpublished early return turns 1 red.
  • Existing fixtures across the list-view suites serve a published OBJECT.default their object definition does not list. They use hand-rolled contexts without getTypeStatus, so they keep the old read; none was edited.
  • Not checked: whether the runtime ViewConfigPanel on the all fallback tab issues its own /layers 404 (different id, runtime surface).

Verification

Local runs on 31dfa88 (fix on e4a8007)

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

…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
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

Studio 里打开一个还没有默认视图的新对象,不再去请求一个不存在的视图(以前每次都在浏览器里报一次 404)。用户看到的界面不变。
要你做的:无(普通改动,席位自动合并)。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head 31dfa887 · 2026-11-23T22:49Z

  • Shape: Fixes #36750. studio-design/ObjectListViewInspector.tsx (a new isFallbackListView, a targetIsFallback on the hook), studio-design/StudioCustomizeControls.tsx (an unpublished item answers the 404's result, shipped: 'none', without the layered read; the pair's draft is still read first), a 3-line call-site change in StudioDesignSurface.tsx, a new test file, a docblock and lint-import change in ObjectListViewInspector.layersUnsaved-11799.test.tsx, a changeset. Clause-②: no (none of these is exported from the package index). Metadata-protocol: none. This is the real file surface; the claim's line is amended by this record.
  • Read: the skip applies only when the view drafts have answered and getTypeStatus('object') is ready; while either is loading or refetching, or in a context that reports no status, the layer is read as before, so no existing fixture changed.
  • Tests: the thread reports 38 files and 222 tests green, and both reverse runs red then restored.
  • Gates: 39 success, 13 expected skip, 0 failed on 31dfa887; mergeable_state clean.
  • Landing: the seat readies the PR and arms auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio 列表视图:对象没有默认视图时不要去读 <object>.default 的分层(每个新对象都报一次 404)

2 participants