This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(components): make Empty's base classes override-friendly and drop its inert border-dashed - #8552
Merged
os-justin merged 1 commit intoSep 8, 2026
Conversation
… its inert border-dashed The shared `Empty` container carried `p-6 … md:p-12`. A caller's unprefixed padding override sits in a different tailwind-merge variant from `md:p-12`, so `cn()` kept both and the `md:` rule won the cascade from 768px up: the three app-shell sites that wrote a tighter panel got the full 48px back on desktop. The responsive default now travels in `--empty-padding` (spacing 6, and 12 from `md`) read by one unprefixed `p-(--empty-padding)`, so any plain padding a caller passes wins at every viewport while a site with no override renders exactly as before. `border-dashed` set only border-style; preflight keeps border-width at 0 and no call site or ancestor supplies one, so it drew nothing at any of the 44 sites (measured on the console build). Removed; no width is added. Pinned by a cascade evaluator over the CSS the workspace Tailwind emits for the real component's class list, with a control on the old shape. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Contributor
❌ 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. Which half objected:
📦 Bundle Size Report
Size Limits
|
os-justin
marked this pull request as ready for review
September 8, 2026 10:57
os-justin
deleted the
claude/issue-8525-empty-container-override-friendly
branch
September 8, 2026 11:14
This was referenced Sep 8, 2026
Merged
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #8525
What changed
packages/components/src/custom/empty.tsx— theEmptycontainer's base classes, one string, two halves per the ruling on the card:md:p-12— repaired. The responsive default (24px, 48px frommd) now travels in a custom property,--empty-padding, set by[--empty-padding:--spacing(6)]andmd:[--empty-padding:--spacing(12)], and read by ONE unprefixed utility,p-(--empty-padding). A caller's plainpx-3 py-8,py-10orp-4therefore wins at every viewport: thepaddingshorthand sorts beforepadding-inline/padding-blockin Tailwind's output, andtailwind-merge3.6.0 putsp-(--var)in thepgroup, so a caller'sp-4replaces it outright. A site with no override renders exactly as before.border-dashed— removed, no width added. Inertness verified below, not taken from the card.Plus a pin test,
packages/components/src/__tests__/empty-base-classes-override-friendly-8525.test.tsx, and apatchchangeset for@object-ui/components(a shared component with 44 call sites: the default is unchanged at every one of them, the override contract callers already wrote against now holds, no API moved — a fix, gradedpatch).Visible consequence: the three console sites that already wrote a tighter panel get it on desktop now —
ConversationsSidebar(px-3 py-8) and the twoAuditPanelstates (py-10). No source change at those sites; they now get what they wrote.Measurements — all from ONE place
Every CSS compile below ran with cwd = repo root and
basepinned toapps/console, through this workspace's@tailwindcss/postcssonapps/console/src/index.css(445,063 bytes / 3,239 rules parsed before; 445,387 bytes after — the delta is exactly the three new rules, which also settles that the real scanner extracts the new spellings). The pin test compiles no sources at all: explicit candidates on the shipped@theme,base= repo root, so it is not exposed to the cwd sensitivity the card warns about.Chromium (Playwright,
/opt/pw-browsers/chromium), the real component rendered throughreact-dom/server, computed padding T/R/B/L, 215px columnpx-3 py-8(ConversationsSidebar)py-10(AuditPanel, twice)p-4Border on every case at every width:
0px dashedbefore →0px solidafter. Zero pixels of border drawn either way. Note thep-4row: before this change even a full unprefixedp-4lost on desktop (tailwind-merge droppedp-6for it, andmd:p-12survived), which is wider than the two sites the card names.Inertness of
border-dashed— the ruling's premise, measured*, ::after, ::before, ::backdrop, ::file-selector-button { border: 0 solid }..border-dashedemits--tw-border-style: dashed; border-style: dashedand no width;.borderis what carriesborder-width: 1px.bordershorthand: 51 rules — 29 single-class selectors (apply only to an element carrying the class), 22 other shapes. Of the 22, all but one family require the element itself to behr/tr/input/pre/table/th/td/img, to carrydata-topbar-group, or to carry the class under an ancestor condition (group-data-*,prose-*). The one family that can reach a plain div from an ancestor isdivide-x/divide-y(:where(.divide-y > :not(:last-child))).divide-*: 30 users underpackages/*/srcandapps/*/src; every one maps array rows intotr/li/div/NavRow/DiffRowchildren, or slots two divs (SourcePageEditor). The five inside files that also renderEmptyare alltbody.divide-yblocks withtrchildren. Three components returnEmptyas their root element (RelatedPanel,ReferencesPaneltwice); both are rendered inside a plaindiv.flex-1.min-h-0.overflow-auto.p-4. So noEmptyis adivide-*child.Emptyopeners in 32 files (a DOTALL regex over whole files, so a multi-line opener would count — there are none; control: 84EmptyValueopeners, which the same regex excludes). Only 3 carry aclassName, the three on the card; none carries aborder*token. No rule in the compiled CSS namesdata-slot=empty. The SDUIemptyrenderer goes throughDataEmptyState, notEmpty, so metadataclassNamecannot reach this string.The pin, and the legs that were run — not predicted
The test reads the class attribute off the REAL component, builds the CSS the workspace Tailwind emits for exactly those classes, and walks it with a small cascade evaluator (single-class selectors in one layer: source order is the whole cascade) at 12 widths — every default breakpoint, one pixel either side, plus 320 and 1920. A control shows the evaluator reproduces the defect on the old shape, so a green reading is a measurement and not an inert instrument. The test imports the component SOURCE, so no
dist/is involved in any reading here.Every leg: mutate → prove on disk (injected text count ≥ 1, removed text count 0, then
git diff --stat) → run → restore by state (git checkout HEAD -- PATH, thengit diff HEADempty ANDgit hash-objectequal to the HEAD blob for all three paths), trap onEXIT INT TERM, absolute paths, implementation committed first. All four restores readRESTORE OK.p-6no override at 768px— the labelled non-regression axis — andpy-10 at 768px(inline axis expected 12, got 6)p-6 md:p-12; the three call sites patched withmd:px-3 md:py-8/md:py-10px-3 py-8 at 768px,py-10 at 768px,p-4 at 768px, and the mechanism pinexpected [ 'md:p-12' ] to deeply equal []px-6 py-6 md:px-12 md:py-12[ 'md:px-12', 'md:py-12' ][padding:var(--empty-padding)]instead ofp-(--empty-padding)L4 did not discriminate, and that is reported rather than reshaped: Tailwind sorts the arbitrary property before
p-4, so the cascade is the same under both instruments. The only difference is thattailwind-mergedoes not classify it as padding, so a caller'sp-4would leave the dead utility in the DOM; thep-(--var)spelling is preferred for that hygiene, not for any measured behaviour. Each discriminating assertion ran in the leg it was written for: the ladder loops report their first failing width (768px, after 320–767 passed), and the mechanism pin is its ownit.Verification, at
102e9fb5cpnpm exec vitest run packages/components/src/__tests__/empty-base-classes-override-friendly-8525.test.tsx→Tests 12 passed (12), VERDICT command-exit 0pnpm exec vitest run packages/components/→Test Files 243 passed (243),Tests 2248 passed (2248), VERDICT command-exit 0ConversationsSidebar.test.tsx,AuditPanel.emptyPlaceholderAffordance-8504,AuditPanel.loadFailure,AuditPanel.lockState) →Test Files 4 passed (4),Tests 21 passed (21)pnpm --filter @object-ui/components type-check, after building the dependency closure → exit 0pnpm exec eslinton the two changed source files, from the repo root, no--no-inline-config→ exit 0node scripts/check-changeset-presence.mjs→ declares 1 changeset;check-changeset-no-major→ OK;check:control-bytes→ OK over 6756 files;check:phantom-deps→ OK;check:comment-mask-corpus→ report-only, within the residue it holds open;check:unreferenced-sources→ OKDeclared narrowing.
turbo ls --affectedlists 31 packages — everything downstream of@object-ui/components. Locally this ran the components package in full plus the four test files that exercise the three call sites; the rest is CI's. The checkable reason: no test file or snapshot outside the new test queriesdata-slot="empty"or assertsp-6/md:p-12/border-dashedon it (git grepover*.test.*and*.snap, zero hits; control: 18 test files mentiondata-slot="empty-value"), so no downstream test reads the string this PR changes.The measurement harness (console compile, border census, SSR render, Playwright reader, the ablation driver) lives in the session scratchpad and is not committed; the committed instrument is the pin test.
Not in this PR
🤖 Generated with Claude Code
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Generated by Claude Code