Repository navigation
fix(plugin-detail): empty related lists fold into one line; record:path terminal stages share the rail - #26414
Conversation
…inal width (red) Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
…; terminal path stages share the rail Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
…nt exports; add changeset Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
…ySectionsFold Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
…lated-empty-path-terminal
…wned name Member Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
维护者速读改了什么:记录页「相关」页签里没有记录的相关列表不再各占一整行,而是在有记录的列表之后合成一行,列出它们的名字,每个保留「新建」;阶段条(record:path)上的终止阶段(已取消 / 客户未到、成交 / 失败)与其它阶段等宽分配,标签换行而不是挤成一格。 席位核对seat 2 · 2026-10-27T04:17Z · head
|
Fixes #25895
Clause-②: no
Metadata-protocol: none
维护者速读
改了什么:记录页「相关」页签里没有记录的相关列表不再各占一整行,而是在有记录的列表之后合成一行,列出它们的名字,每个保留「新建」;阶段条(record:path)上的终止阶段(已取消 / 客户未到、成交 / 失败)与其它阶段等宽分配,标签换行而不是挤成一格。
为什么改:HotCRM 客户页「客户 0 · 暂无相关记录」夹在有数据的列表之间;活动页的「× 已取消 客户未到」挤在右端一个窄格里(#25895 两张截图)。
风险与回滚:只改显示,不加不删任何元数据键;全空的栈、单个列表、带「添加」选择器或工具栏动作的列表保持原样;有新记录时折叠的列表自动回到原位。回滚 = revert 本 PR。
先看:
ui/packages/plugin-detail/src/RelatedListEmptyFold.tsx(规则与折叠行)→renderers/record-related-list.tsx(接入)→renderers/record-path.tsx(等分宽度)。两分钟验证:
cd ui && pnpm exec vitest run packages/plugin-detail/src/renderers/__tests__/record-related-list.emptyFold-25895.test.tsx packages/plugin-detail/src/renderers/__tests__/record-path.terminalWidth-25895.test.tsx,预期 12 个测试全过。需要你做的:无,绿了即可落地;新文案的语言包键是后续工作(见下文)。
What
Item 1 — empty related lists fold into one line. On a record's Related tab, the lists with zero records leave their place once every list of the stack has answered, and the last list of the stack draws one line after itself: the empty-state text, then each folded list's title with its own New (same handler, same
createDisabledverdict). A folded list stays mounted (hidden), so when it gains a record it answers "not empty" and returns to its place. Unchanged by design: a stack whose lists are all empty, a list on its own, and an empty list that offers more than New (anaddpicker, child toolbar actions, an authoring notice) draw exactly as before.Item 2 — terminal stages get legible width. On the desktop rail both stage groups now start from zero and grow by the number of stages they hold, and every stage fills its share, so a terminal stage is exactly as wide as any other. A terminal stage's label (the won terminus and the separated lost group) wraps instead of being truncated or held on one line. Ordinary forward stages keep their one truncated line; the mobile row (horizontal scroll) is unchanged.
Which seam, and why (item 1)
Who stacks the lists:
buildDefaultTabs(synth/buildDefaultPageSchema.ts) only emits the Related tab'srecord:related_listchildren;page:tabs(PageTabsRendererin@object-ui/components) draws them as plain siblings throughrenderChildren;RecordDetailViewonly handsrelatedto the synthesizer. None of the three knows how many rows a list has — each list learns that from its own read — and an authored page can stack lists in any container.So the seam is the block itself:
record:related_listlists that share a DOM container coordinate through a small store keyed by that container (ui/packages/plugin-detail/src/RelatedListEmptyFold.tsx).RelatedListgains one optional callback,onEmptyChange(empty), reporting its settled answer (nullwhile a read is in flight); the block keeps the last answer during a refetch so a write elsewhere does not unfold and refold the stack. This reaches synthesized and authored pages alike, adds no node type and no spec key, and leaves the synthesizer, app-shell and components untouched.RelatedList.tsxand the newRelatedListEmptyFold.tsxare outside the claim's listed file surface (one optional prop plus one effect, and the new module); both sit in the same package beside the claimed files.Strings and locale packs
No new translation key is introduced. The fold line reuses
detail.noRelatedRecordsanddetail.new, both already in every pack; each folded entry is arole="group"named by the list's title, so each New is announced inside its list's name. A dedicated phrase such as 「其他 2 个为空:客户、线索」 needs a new key in the locale packs, which this PR does not touch (that line is busy); it is a follow-up once the i18n line drains. Note for that follow-up:check:i18n-keysrefuses at()key absent from theenpack and its baseline is empty, so an inlinedefaultValuealone would not pass CI — the key has to land in the packs.Tests
ui/packages/plugin-detail/src/renderers/__tests__/record-related-list.emptyFold-25895.test.tsx(6 tests) andui/packages/plugin-detail/src/renderers/__tests__/record-path.terminalWidth-25895.test.tsx(6 tests), committed red first (aba3b5ca).f02e6443in the tree (markersonEmptyChange/shareOfcounted 0): 9 failed / 3 passed — the three that pass are CONTROL legs that hold before and after (all-empty stack, single list, ordinary forward stage). Restore proven by blob hashes equal to HEAD. Green leg: 12/12.pnpm exec vitest run packages/plugin-detail --maxWorkers=2(fromui/, at5cf6e03e): 306 files passed, 1 failed —spec-symbol-batch7.test.tsnames every props type inrenderers/that is not spelled…RendererProps; the fold module was moved out ofrenderers/tosrc/(besideEmptySectionsFold.tsx) in47121545, and the post-merge run below covers that file.record:related_listunderapp-shell,apps/consoleandcomponents, plus theRecordDetailViewrelated-list files: 34/34 files, 293/293 tests.pnpm --filter @object-ui/plugin-detail type-check: exit 0.sdui.manifest.json: regenerated under the lock before the merge, byte-unchanged (106 components, sha2561f6e1ccb925a…); no record is committed (the sources records were retired onmain).node scripts/check-sdui-manifest.mjs: exit 0.After merging
origin/main(merge8271adf9, which retiredscripts/sdui-manifest.sources/; no plugin-detail or lockfile overlap), at head8271adf9:pnpm --filter @objectstack/spec build(main moved spec), thenspec-symbol-batch7.test.tsplus everyrecord-path*,record-related-list*,recordComponentAria*andRelatedList*test in plugin-detail: 59/59 files, 396/396 tests.pnpm --filter @object-ui/plugin-detail type-check: exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 35 derived families, all run, each exit 0 (check-sdui-manifest.mjsamong them);--ranreconciled 35/35 with exit codes recorded, 0 NOT-MEASURED.Acceptance notes
RelatedListonly logs the error; with this change such a list is also folded as empty. That is unchanged behaviour of the read path, noted, not filed here.Generated by Claude Code