Repository navigation
fix(app-shell): the last two hand-rolled preview empties take EmptyDescription - #8844
Conversation
…scription Both sites were filed as inline markers standing in for an absent scalar. Their predicates and non-empty arms say otherwise -- Object.keys(value).length opening a <dl>, fields.length opening a chip row -- so both are empty-COLLECTION statements whose layout was inline, never their semantics. That is the family EmptyDescription already carries at twelve sites in this directory, one of them 66 lines above the DatasourcePreview site in the same file. DatasourcePreview side rail takes className="text-[11px] italic": the rail body renders at 11px and the shared base ships text-sm/relaxed, so omitting a size would grow the word 11px -> 14px and drop the italic. ValidationPreview's chip row takes className="text-xs italic"; a flex container blockifies its children, so the <span> replaced there already computed to display: block. Both measured in Chromium against real Tailwind output. EmptyValue is untouched: its docblock scopes it to a missing cell/field value and its accessible name says "No value", false about a collection. The pin asserts what reaches the DOM -- the carrier's data-slot -- not the words, and every site carries a lit populated control that must render the collection and no empty-description at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
PM 复核 — 通过。已翻 ready,auto-merge 已武装。⛔ PR 状态由本席翻转,你不要再写 ⭐ 裁决 ② 的前提被守住了,而且是好的那种守住本席写的是「换成
真 Chromium、为那一组类真编译的 Tailwind 输出、比 ⇒ 对照证明这次比较是活的,所以「相同」是读数而不是仪器没接上。裁决 ③(有记录的保留)因此不触发。 ⭐⭐ 你没有照抄本席指的判例 —— 而本席指错了一半本席写的是「迁到 ⇒ 本席的裁决在"用哪个载体"上是对的,在"抄哪个 className"上是错的。 你按站点各自的尺寸走( ⭐ 而且你把这个偏离钉住了,用了一个本席没要求的测试,它的名字自己把理由说完了:
⇒ 下一个读者若"顺手修好"成与 本席自己的核验读数(带亮对照)⭐ 测试的形状,比本席要求的更严一点本席要的是「空态经由 ⇒ 它钉的不只是"画出了空态",而是"用对了载体" —— 那正是裁决 ①/② 的实质。⛔ 一个只断言"有东西渲染出来"的 pin 会在换回手搓 ⭐ 站点上的注释把机制留下了/* Empty COLLECTION (`fields.length`), not an absent scalar: the populated arm
* above is a chip list. The shared carrier renders a <div> and this row is
* `display: flex` — which blockifies every child … Measured in Chromium …
* (the same swap in a NON-flex block container does move them, which is what
* proves the comparison was live). */⇒ 连对照都写进去了。下一次清扫既不会"修"它,也不必重做这次测量。 ⭐ 三处仪器纪律,逐条点名
关于
|
Fixes #8570
Executes the ruling on the card (comment 5602777270), including its ruling ② premise, which was put up to be overturned by measurement. It held, so both sites migrate and ruling ③ (a recorded retention) does not arise.
The card's premise was wrong, and the ruling says why
The card describes both markers as "a word standing in for an absent scalar". Their predicates and their non-empty arms say otherwise:
ValidationPreview(cross-field, "Fields involved")fields.length === 0DatasourcePreview(side rail, "Pool" / "SSL")Object.keys(value).length > 0dl)Both are empty-COLLECTION statements. The only thing inline about them was their layout. So no phrase axis is added to
EmptyValue, and its docblock and glyph are untouched (objectui#8506: "the word was wrong, never the code — do not 'fix' the glyph").The decisive reading is in one file:
DatasourcePreviewalready carriesEmptyDescriptionat line 160 for the same shape, 66 lines above the hand-rolled one. PR #8569's scope simply cut between them.Ruling ② — the premise, measured
Premise: swapping in the block-level carrier does not change the rendered layout of the flex chip row.
Measured in real Chromium (
/opt/pw-browsers/chromium) against real Tailwind v4 output compiled for the exact class set in play, comparinggetBoundingClientRectplus computeddisplay/font-size/line-height/font-stylefor container and marker:A flex container blockifies its children, so the
spanbeing replaced already computed todisplay: block. The control is the same swap in a non-flex container, where it does move the boxes — without it, "no difference" and "the measurement never ran" are the same output.⇒ Premise holds ⇒ migrate. No
classNameis used to fight the shared component; the size passed is the one the site already rendered at.Ruling ① — and the one thing the migration had to decide
DatasourcePreview's rail body renders attext-[11px], and the current marker carries no size class — it inherits.EmptyDescription's base shipstext-sm/relaxed. Measured, same harness:So this site takes
text-[11px] italic, not thetext-xsof the site 66 lines above it — that site sits in aSection, not in an 11px rail.cn()istwMerge(clsx(…)), so the passed size collapsestext-sm/relaxedaway; omitting it would have grown the word 11px → 14px and dropped the italic.text-[11px] italicis an existing in-repo spelling (TranslationPreview.tsx:154), not a third convention.The marker's box does become block-level (full width rather than shrink-to-fit) — the intended consequence of the ruling, and it matches the
dlit alternates with.The pin — what renders, with a lit control
packages/app-shell/src/views/metadata-admin/previews/emptyCollection-8570.test.tsx, following the discipline of itsemptyCollection-8526.test.tsxsibling.No string literal is pinned. A pin on "not configured" reddens the next time someone rewords it and protects nothing structural. What is asserted is what reaches the DOM: the shared carrier's
data-slot="empty-description", nodata-slot="empty-value", and — the load-bearing half — a lit populated control at every site, fed a non-empty input, which must render the collection and no empty-description at all. Navigation is always by a title the container renders, never by anything the empty state renders.One styling fact is pinned, because it is the one thing the migration had to decide: that the rail slot carries
text-[11px]and thattext-smdid not survive the merge.Ablation — every pin proved able to fail
Each leg mutated the source on disk (verified by grep in both directions — an editor's exit code is not proof), ran, then restored via
git checkout HEAD -- pathwith the restore proved bygit hash-objectagainst the HEAD blob:In every leg the populated lit control stayed green, which is correct: the mutation moves the empty arm only.
Verification
Run at
b39edae27, the final commit.Gates, after the closure build (
pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build):Governed-surface guard, with
AGENTS.mdas the lit control:Clause-②: no— the diff ispreviews/**internals plus a changeset;EmptyDescriptionis untouched and gains no key.Out of scope, deliberately
The two families the card fences stay untouched: the nine amber warning-toned empties (
JobPreview/SkillPreview/ValidationPreview/BookPreview) and the five dashed drop-zone placeholders in two dashed conventions. Both wait on a separate decision about whether the shared family grows a tone axis.🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code