Repository navigation
fix(studio): 流程页头信息条按顺序逐个让位,不再整排缩成单字 (#36745) - #36781
Merged
Merged
Conversation
The Studio flow header's meta row (Trigger, Status, Run as, version, On error) shrank every item at once, to one character each, when the row was short of room (property panel open). Items now keep their whole text and drop from the end; the row's hover text names the dropped items; Trigger + Status are the floor, below which the row hides. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXxhLfnaEFoHNkAeGh
check:test-source-alias: the source under test reaches a dynamic import of @objectstack/lint; a module-top side-effect import pays that load during collection, outside any clocked case. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXxhLfnaEFoHNkAeGh
Contributor
Author
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读Studio 流程页头的信息条,空间不够时不再整排缩成单字:「触发」和「状态」始终完整,放不下时从后往前依次收起「出错时」「版本」「运行身份」,收起的内容鼠标悬停可见;连前两项都放不下时整条隐藏。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
Nenzyz
pushed a commit
to Nenzyz/objectstack
that referenced
this pull request
Dec 1, 2026
…k default view id (objectstack-ai#36787) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8UNMg9RsSwRntqJjhmPv5uR)_ Fixes objectstack-ai#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 <details><summary>Local runs on 31dfa88 (fix on e4a8007)</summary> - `vitest run` ObjectListViewInspector*, StudioDesignSurface.listView*, InterfacesPillar* : Test Files 38 passed (38), Tests 222 passed (222) (verify-lock VERDICT command-exit 0). - Two touched suites after the lint import: Test Files 2 passed, Tests 11 passed. - `pnpm --filter @object-ui/app-shell run type-check`: VERDICT command-exit 0. - `dispatch-gates.mjs --commands` derived 38 commands: all exit 0 (`check:test-source-alias` first failed on the two touched suites, fixed, re-run exit 0). - `overlap-check.mjs`: VERDICT clean (origin/main, objectstack-ai#36774, objectstack-ai#36781, objectstack-ai#36784). </details> 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](https://claude.ai/code/session_01JQwxbWBvGf6TP6P9XT1tuo)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
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 #36745
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
FlowMetaPills' header variant laid its items on a one-row grid whose columns could all shrink to zero (objectui#13135), so a short meta slot (about 80 px with the property panel open) shrank every item at once, to one character each.ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.tsxFlowMetaHeaderRow: every item is laid out whole (shrink-0,whitespace-nowrap), each after its·separator, in a row that takes the slot's width and clips. After each render and on resize (ResizeObserveron the row) it measures each item's width and the row's, keeps the first N whole items, and makes the restinvisible+aria-hidden(still laid out, so still measured: they come back when the row widens). The row'stitlenames each hidden item's wholeLabel: value, one per line, in row order; with nothing hidden there is notitle.fitFlowMetaItems(widths, available, floor = 2): as many whole items from the front as fit (half-pixel slack). Fewer than the floor (Trigger + Status) ⇒ 0: the row shows nothing.Pillno longer truncates (min-w-0 truncate→whitespace-nowrap), and the per-pill cut measurement (useCutText, objectui#13135) is removed: nothing in the header can be cut any more. A shown pill keeps its own hover text (Status: the run status's reason; Trigger: the object's API name).variant="bar") is unchanged.ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx: theauto-flow-metawrapper goesinline-flex→flex(plus a comment line), so the row reads the meta slot's whole width rather than its own content width.FlowPreview.headerMetaTruncate-13135.test.tsxis deleted (it pinned thetruncateclass this card replaces);FlowPreview.headerMetaGiveWay-36745.test.tsxis added.@object-ui/app-shellpatch.fitFlowMetaItemsis a module export, not on the package index.Reading taken on the card: "Keep Status and Trigger whole … hide the slot when not even one item fits". The card names On error, version and Run as as the items that drop, so Trigger + Status are read as the floor: when those two do not both fit whole, the row hides. (The other reading, dropping Status and then Trigger one by one, would drop an item the card says stays.)
Tests
FlowPreview.headerMetaGiveWay-36745.test.tsx, 11 tests, widths stubbed per element (each item 120/110/80/30/60 px):v3+On error: …;aria-hidden, title names all five;truncate;barvariant has no give-way row;fitFlowMetaItemsat the boundaries (399/400, 229/230) and fractional widths.fitFlowMetaItemsreturning every item regardless of width): 6 of 11 red; restored,git diff HEADempty.@objectstack/lintat module top (check:test-source-alias: the source under test reaches its dynamic import; the load is paid at collection, not inside a clocked case).AutomationsPillar.tabs-12454.test.tsx,StudioItemHeader.statusPlace-12524.test.tsx(they readauto-flow-meta): 20/20 with the new file.pnpm --filter @object-ui/app-shell type-check: exit 0.Acceptance notes
Browser run on the showcase app (Studio › Automations › "Notify on Task Completed", zh-CN, 1440×900 unless named; its meta has four items, no On error). Shots are attached on the project thread (GitHub image upload is browser-only). Readings are the row's own
data-shown, item widths andtitle:v1No frame shows a cut or single-character item. Native
titletooltips do not render headless, so the hover text is evidenced by the attribute.Verification
Local gates
node scripts/pm/dispatch-gates.mjs --commands: 38 derived families, all run; 37 exit 0 at9f6fc4fa.check:test-source-aliasexited 1 there (the module-top lint import above), fixed and re-run atd37f9470: exit 0.--ranreconciliation:38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3). Results: project fileissue-36745/gate-results-d37f9470.tsv.node scripts/pm/overlap-check.mjsatd37f9470:VERDICT clean exit 0againstorigin/main, fix(studio): the hook designer and a nav-opened action draw refusals and texts from their served rows #36774 and feat(studio): design an object's public forms in Studio's Form tab #36784 (both shareStudioDesignSurface.tsx, merge cleanly).Generated by Claude Code