Repository navigation
fix(plugin-detail): a detail section on a print page prints every declared field and no "Show N empty fields" button - #12729
Merged
objectstack-fleet[bot] merged 1 commit intoOct 16, 2026
Conversation
…lared field and no empty-field toggle The empty-field auto-hide is a screen density heuristic; on a page that declares `print` it hid the empty rows and left its "Show N empty fields" button on paper. It is now off under a print page, read through the same `usePrintPage()` answer the collapse gate uses. The authored all-empty `hideEmpty` is unchanged. Claude-Session: https://claude.ai/code/session_01D7HiWiz4iSX26uyJLB8jNs Co-authored-by: Claude <noreply@anthropic.com>
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
|
Contributor
Author
席位核对 · ACCEPT ·
|
objectstack-fleet
Bot
deleted the
claude/issue-12717-print-empty-toggle
branch
October 16, 2026 16:12
This was referenced Oct 16, 2026
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.
Fixes #12717
Clause-②: no
What
On a page that declares
print, arecord:detailssection prints every field it declares. The "Show N empty fields" / "Hide empty fields" button no longer reaches paper.packages/plugin-detail/src/DetailSection.tsxhides empty fields for two reasons, and they belong to two different owners.shouldAutoHideEmptyis the renderer's own density heuristic. No author declares it, and it depends on the viewport (useIsMobile) and on a ratio of empty fields, so it is a screen concern. On a print page it is now off. Every declared field prints, an empty one as the shared placeholder dash. The toggle is derived from the heuristic (showEmptyToggle = emptyCount > 0 && shouldAutoHideEmpty), so with no auto-hide there is no toggle. This follows card ②'s rule (objectui#11958):record:detailsis in the printable block subset because it prints every field it declares. That is the same reason the collapsed section already opens on paper.hideAllEmptySection(section.hideEmpty === true) is the authoredrecord:detailskey. On paper it keeps doing what it declares: an all-empty section prints nothing at all, with no heading and no control. It is not gated.usePrintPage()is now read once, above every early return (isPrintPage). The existing collapse gate and the new heuristic gate both read that one value.Not done, deliberately:
print:hiddenon the button. The empty fields would still be missing from the paper.page-print.ts.Off a print page, the toggle, the heuristic and the authored hide are unchanged.
Tests
packages/plugin-detail/src/__tests__/detailSectionPrintEmptyToggle-12717.test.tsx, all at head 9f28cd2:PrintPageProvider: no toggle, all four declared fields present, two placeholders.PrintPageProvider: an authoredhideEmpty: trueall-empty section renders nothing.Each test was proven red by a one-off ablation, then restored. Each restore was checked: blob 576f471d0f52 equals HEAD and
git diff HEADis empty.pnpm exec vitest run packages/plugin-detailat 9f28cd2: 275 files passed, 1 skipped; 2663 tests passed, 14 skipped.Local gates (9f28cd2)
All of these exited 0:
@object-ui/plugin-detail;@object-ui/plugin-detailbuild and type-check;VITE_BASE_PATH=/console/;check:changeset-claims,changeset:check,check:test-path-roots,check:spec-symbolsand the changeset presence check.eslint on the changed files reports 0 errors. Its 12 warnings were all in
DetailSection.tsxalready; the base file has the same 12.Acceptance notes
showcase_invoice_documentis not in the published showcase at@objectstack/cli@18.0.0-next.2, nor in objectstackmain6d1660d. As a fallback, I added a throwaway page-levelprintto a showcase record page in a scratch copy of the backend. It never reached the served page metadata, and no print page mounted on the record route, so no before/after PDF could be rendered.Provenance: built by the cloud session
session_01D7HiWiz4iSX26uyJLB8jNs(claim6218362787) and opened by thedomain:uiseat 1 PM (session_011K9g23W67dy2zwnyzaoB6o) from that session's final message, because a cloud session cannot open a PR from its container. The seat replaced the dev's own footer lines with this line.Generated by Claude Code