This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(plugin-detail): DetailSection shares ONE definition of emptiness, and it trims - #8396
Merged
os-justin merged 1 commit intoSep 7, 2026
Merged
Conversation
… and it trims `DetailSection` decided "is this field empty?" three times — the row filter behind `emptyCount` / the "Show N empty fields" toggle / the auto-hide heuristic, the branch that draws the em-dash `No value` affordance, and `canCopy` — each with its own raw `null | undefined | ''` test. None trimmed, while `@object-ui/core`'s `recordDisplayValueAt` (the page H1's definition, and since objectui#8350 the `record:details` dedupe ladder's) does. A whitespace-only value was therefore FILLED here and EMPTY everywhere else in the same render path: the row painted a visually blank cell instead of the affordance, it escaped the counter so the toggle read one too low and revealing the empty rows did not reveal it, and because `shouldAutoHideEmpty` needs only `filledCount > 0` a single such value suppressed the all-empty skeleton and hid every genuinely empty row in its section. The three reads now share one function whose SCALAR answer is the authority's rather than a fourth hand-written test. The object half deliberately does not delegate: `recordDisplayValueAt` answers "does this resolve to a NAME", so an object runs through the Salesforce-style display chain and is empty when that yields nothing — right for a title, wrong for a cell, where an object value is handed to a type-aware cell renderer (coordinates, a formatted postal address, option badges, JSON). Delegating it would have replaced populated cells with `No value` and let auto-hide bury them. Measured and pinned, not assumed. 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. 📦 Bundle Size Report
Size Limits
|
os-justin
marked this pull request as ready for review
September 7, 2026 16:21
os-justin
enabled auto-merge
September 7, 2026 16:22
os-justin
deleted the
claude/issue-8376-detailsection-emptiness-authority
branch
September 7, 2026 16:46
This was referenced Sep 7, 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 #8376
DetailSectiondecided "is this field empty?" three times — the row filter behindemptyCount/ the "Show N empty fields" toggle / the auto-hide heuristic, the branch that draws the em-dashNo valueaffordance, andcanCopy— each with its own rawnull | undefined | ''test. None trimmed, while@object-ui/core'srecordDisplayValueAt(the page H1's definition, and since #8375 therecord:detailsdedupe ladder's) does. All three now read one function,hasCellValue, whose scalar answer is the authority's.canCopywas not in the card's scope but is folded in deliberately: it is the same raw spelling in the same function, and fixing only the affordance would have left a row that saysNo valuesitting next to a copy button that copies three spaces. Before this change the invariant "em-dash implies no copy affordance" held by coincidence; converging it is what keeps it holding.Session:
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S— written here as prose because a PATCH of this body degrades the attribution footer's session URL to the bare form (AGENTS.md, GitHub-rewrites-your-bytes, item 2), and this body has been PATCHed once to correct an ablation hash.The card and the dispatch both prescribed converging on
recordDisplayValueAtwholesale, on the grounds that "delegating is strictly more than a trim — an expanded reference object resolves throughdisplayNameOfEmbeddedObjectand is EMPTY when that chain yields nothing." That reasoning is correct for #8375's site and measurably wrong here, so this PR delegates the scalar half only.recordDisplayValueAtanswers does this resolve to a NAME. On this surface an object value is not a title — it is handed to a type-aware cell renderer that knows how to draw it, and none of those shapes carries a name-ish key:recordDisplayValueAtsays{ latitude, longitude }30.2741, 120.1551(LocationCellRenderer){ street, city, … }AddressCellRenderer, #4037)['alpha','beta']SelectCellRenderer)JsonCellRenderer)A wholesale delegation would have replaced those populated cells with
No value, dropped them out offilledCount, and let auto-hide bury them. That is not an argument — it is ablation leg C below, which reddens exactly one case and prints the DOM textDetailsoffice_location—tags—industryManufacturing: two populated cells turned into em-dashes.So: one definition serves both consumers (measured — see next section), and that definition is the authority for scalars plus the status quo for objects. The only values whose classification moves are strings containing nothing but whitespace.
Do the two consumers want the same answer? Measured: yes, and they must
The card asked whether the counter/auto-hide read and the affordance read deserve different answers. They do not, and the coupling is stated in the code, not assumed:
No valuemust not offer to copy it.Three readers, one question, one function.
The three pins, plus the ones that keep them honest
packages/plugin-detail/src/__tests__/DetailSection.emptinessAuthority-8376.test.tsx— all assert the RENDERED outcome, never the predicate.No valueaffordance in its own row, and the raw spaces do not reach the DOM as a rendered valueShow 2 empty fields, the row is hidden because it was counted, and clicking the toggle reveals it with its affordance' 'keeps its all-empty skeleton: all four labels, four affordances, no toggle0andfalseare values; exactly one field is counted emptyrecordDisplayValueAtactually answers for each of those values — the reading behind the split, in-repo rather than citedEvery case asserts the section heading plus a filled row by value, because "the affordance is absent" is trivially true of a document that rendered nothing. Presence is read through
screen.queryByTextandexpect(…, message)rather thangetByText, becausegetByTextthrows beforeexpectruns and its CI summary line readsUnable to find an element with the text: stageand carries none of the reason — measured on this file's own first ablation, then rewritten.Ablation — three legs, each restored by state
Run from the committed implementation,
trap … EXIT INT TERMwith absolute paths, restore viagit checkout HEAD -- PATH(never a baregit checkout --, which would take the mutation back out of the index and exit 0). Mutation-reached-disk proven bygit hash-objectdiffering fromgit rev-parse HEAD:PATH; restore proven bygit diff HEADempty and the hash equal again — never by an exit code. All three restores verified.HEAD blob of
packages/plugin-detail/src/DetailSection.tsx:c8f72e5ed19be9a96796949fadeaffcaa8c2ea9b.Leg A — the bug restored (
return value !== null && value !== undefined && value !== '';), mutated blob68c2d1251d102bc24fa60cf2bfe36ed460f21640: 4 failed / 3 passed.Leg B — an implementation strictly worse than the bug (⚠️ Worth reading: AMPLIFICATION passes under leg B — an all-empty section is exactly what "empty for everything" produces. The ⭐ pin alone does not distinguish the fix from deleting the feature; the non-regression cases are what do.
return false;— EMPTY for everything, i.e. deleting the feature), mutated blob09e2e3ffb459388dc833fc16fdcd9fd539d4bff9: 5 failed / 2 passed. Both NON-REGRESSION cases and every control fire.Leg C — the wholesale delegation the dispatch prescribed (
return recordDisplayValueAt({ value }, 'value') !== undefined;), mutated blobdf10431884cd97ad9340b37c92f85ffafdd25353: 1 failed / 6 passed — every whitespace case is green and only the object non-regression reddens.Interaction with #8375's landed pin
record-details.dedupeEmptinessTrims-8350.test.tsxdeliberately keeps every fixture at 3 or fewer rendered rows so auto-hide cannot fire and confound it. These fixtures do the opposite on purpose (two of them run 4-row sections to driveshouldAutoHideEmpty), which is why they are a separate file.Checked, not assumed. That file's largest fixture is⚠️ It would not be below the mobile minimum of 3, where 2/3 empty clears the 0.2 ratio and both
ACTIVITY_FIELDS— 4 entries, one of which the dedupe drops, soDetailSectionreceives 3. Two of those three are whitespace-only and become empty under this change, but 3 is below the desktopAUTO_HIDE_MIN_FIELDSof 4, so nothing hides.HALF 2rows would vanish — that file relies on happy-dom's desktopwindow.innerWidth. The new file pinsinnerWidth = 1280explicitly for the same reason. All 6 cases of that pin are green; measured by running it, not by reading it.Changeset
minoron@object-ui/plugin-detailonly, argued against #8375'sminoronplugin-detail+core: same family (a rendered-behaviour change onrecord:details), one package rather than two because nothing in@object-ui/coremoves — this consumes the export #8375 added rather than adding one.majoris forbidden repo-wide.check-changeset-presenceverdict, quoted:check-changeset-no-major:✅ No changeset declares a major bump.Theskip-changesetlabel is a phantom in this repo and is not used here.Verification, at
b6ed5cdafpnpm exec vitest run packages/plugin-detail/Test Files 137 passed (137) · Tests 1231 passed (1231)pnpm --filter @object-ui/plugin-detail type-check(tsc --noEmit && tsc -p tsconfig.test.json)--listFilesconfirms the new.test.tsxis in the test program (1 hit) and not the src program (0 hits)pnpm exec eslint .inpackages/plugin-detail901 problems (0 errors, 901 warnings)— 188 files linted; the new test file 0/0,DetailSection.tsx0 errors / 12 warnings, all pre-existing classescheck:control-bytes,check:i18n-keys,check:i18n-dead-keys,check:unreferenced-sourcescheck-governed-queue-guard --teston the 3 changed paths✅ NOT GOVERNED(control:AGENTS.mdreturns⛔ GOVERNED, exit 3)Declared narrowing.
turbo ls --affectednames 11 packages; onlyplugin-detailwas run locally. The blast radius outside it was measured rather than assumed: no source or test in any other affected package asserts onNo value,empty fieldsorshowEmptyFields(3 hits, all unrelated — adesigner.field.noValuesstring, a prose comment, an error message), and no downstream fixture feeds a whitespace-only value into a detail row. The remaining suites are declared to CI.Findings filed (out of scope here)
HeaderHighlight.tsx:171,DetailView.tsx:979,RecordMetaFooter.tsx:82,HistoryTimeline.tsx:134). The first two sit directly under/beside the same page H1, so on one screen the H1 and the body grid now agree and the highlight strip between them still does not.[object Object]to the clipboard for every object-valued cell (address, geolocation, JSON, attachment) #8395 —handleCopyFieldwrites[object Object]to the clipboard for every object-valued cell. Pre-existing and untouched by this change;canCopyclassifies objects exactly as it did before.🤖 Generated with Claude Code
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S