Repository navigation
test(plugin-detail): state the desktop viewport in the 15 test files that depend on it (objectui#8444) - #8781
Merged
Conversation
…depend on it (objectui#8444)
Re-measured on `c03d03bb2` with the card's own ablation — `MOBILE_BREAKPOINT`
768 -> 999999 in `packages/components/src/hooks/use-mobile.tsx`, then
`pnpm exec vitest run packages/plugin-detail/`:
unmutated 151 passed (151) 1372 passed (1372)
mutated 27 failed | 124 passed 112 failed | 1260 passed
The card's 21-of-137 was measured at R46; the package is 151 files today and
27 of them depend on the desktop branch. 12 of those 27 already state a
viewport (the mutation is stronger than a pin — it defeats a pinned 1280 too),
so the files that inherit the branch rather than choosing it are the other 15.
Each is judged, not stamped. All 14 `RelatedList.*` files read the embedded
`data-table` — headers, cells, sort, row actions, pagination — and below the
breakpoint `RelatedList` renders an `object-gallery` card layout instead, with
no table at all. `declaredActionIds.twoRenderers-7182` compares two toolbars
that `action-bar` only draws flat above the breakpoint; on the mobile branch
its header control reads ['Convert Lead', 'More actions'] and the file's
equality precondition fails. Two files (`sortabilitySignal`,
`unmaterializedSort`) carry a second describe over `type='list'`, which the
mobile carve-out never touches — the pin states their branch without changing
it, and the docblocks say so.
Spelling is objectui#8399's, unchanged: a file-level `beforeAll` doing
`Object.defineProperty(window, 'innerWidth', { configurable: true, value: 1280 })`,
which is what the 16 files in this package that already pin one do. No second
way of declaring a viewport was introduced, and nothing else in these tests
was touched.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
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
|
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 #8444.
Fifteen
packages/plugin-detailtest files now state the viewport they assertagainst instead of inheriting happy-dom's ambient 1024. No assertion was changed and
nothing outside
__tests__/was touched.The card's numbers were re-measured, and both moved
Everything below is measured on
c03d03bb2(this branch's base), not carried over fromthe card's R46 reading.
c03d03bb2)The 15 in the last row are this PR. ⛔ Neither number is reconciled toward the card's:
the package grew, and twelve of the twenty-seven already pin a viewport, so the
card's "only 2 of 137" is stale by an order of magnitude. Lit control on the counting
instrument: 151 of 151 test files match
describe(, so a zero from that grep would bea reading rather than a dead query.
The card's other premise holds, re-measured today: happy-dom reports
innerWidth1024 and
useIsMobile()returns false — every unpinned file here runs thedesktop branch.
Arm 1 — the card's own ablation, before and after
MOBILE_BREAKPOINT768 -> 999999 inpackages/components/src/hooks/use-mobile.tsx,then
pnpm exec vitest run packages/plugin-detail/. On-disk mutation proven bygit hash-objectagainstgit rev-parse HEAD:PATH(
97358b5e… -> 7769615c…); restored by state —git diff HEADempty for that pathand the hash back to the HEAD blob — never by an exit code;
trap … EXIT INT TERMwith absolute paths.
The after-run is byte-identical, and the failing set is the same 27 files (diff⚠️ That is the correct result for this change, not a failure of it: the
empty).
mutation moves the breakpoint above every finite pin, so it defeats a pinned
1280exactly as it defeats an unpinned
1024— the card says so itself aboutDetailSection.emptinessAuthority-8376.test.tsx, which pins 1280 and still fails 2under it. This mutation measures "depends on the desktop branch"; it structurally
cannot measure "states a viewport", which is what this PR changes.
Arm 2 — the ablation that does answer the question
So the acceptance evidence is a second ablation that moves the ambient default and
leaves
MOBILE_BREAKPOINTalone: append a mobileinnerWidthof 375 tovitest.setup.dom-light.tsx, which every one of these files runs under. A file thatstates its viewport overrides it; a file that inherits one does not.
Positive control first, because a green from a mutation that never arrived is the
failure mode here: a throwaway probe under the mutated setup reads
{ innerWidth: 375, isMobile: true }, so the ambient move does reach the tests.Leg B reverts exactly this PR's fifteen files to
c03d03bb2(each revert verified byhash against the
$BASEblob and asserted different from theHEADblob), and thefifteen files that redden are exactly the fifteen this PR pins — the two lists diff
empty. Both legs restored by state:
git diff HEADempty across the whole tree and thesetup file's hash back to its HEAD blob.
That is the reverse-verification: the pins, and only the pins, are what hold leg A green.
Each file was judged, not stamped
No file here means the mobile branch, and none is branch-independent as a whole.
RelatedList.*files.RelatedListreadsuseIsMobileand renders atype="table"list two different ways: a realdata-tableabove the breakpoint, anobject-gallerycard layout below it — no headers, no cells, no sort. Every one ofthese files reads the table: rendered headers, rendered cells, the sort the captured
table schema carries, row actions, the pager, the derived column set.
declaredActionIds.twoRenderers-7182.test.tsx. Both surfaces draw throughaction-bar, which below the breakpoint collapses all butmobileMaxVisible ?? 1buttons into a
More actionsoverflow. Measured on the mobile branch, its headercontrol reads
['Convert Lead', 'More actions']and the cross-surface equalityprecondition in its first case fails — the comparison the file is built on only holds
while both toolbars are flat.
describethat the branch does not reach —RelatedList.sortabilitySignal(surface 2) andRelatedList.unmaterializedSort(the
data-listdescribe). Both exercisetype='list', and the mobile carve-outapplies to
grid/tableonly. The file-level pin states their branch withoutchanging it, and both docblocks say exactly that rather than implying the whole file
depends on it.
No shared helper — deliberately
The card floated "a single shared
pinViewporthelper" as a shape for a triager. Theruling's binding constraint is the other one: follow objectui#8399's spelling, ⛔ do not
invent a second way of declaring a viewport. All sixteen files in this package that
already pin one use an in-file
beforeAll(orbeforeEach) doingObject.defineProperty(window, 'innerWidth', { configurable: true, value: 1280 }), so ashared module would be the second way, with sixteen files left on the first. The
suggestion is resolved against the constraint; ⛔ this is not an open question.
Gates
scripts/pm/dispatch-gates.mjsdoes not exist in this repo, so the family is derived byhand from the changed-file surface — fifteen
*.test.tsxunderpackages/plugin-detail/src/__tests__/plus one.changeset/*.md.pnpm exec vitest run packages/plugin-detail/151 passed (151)/1372 passed (1372)pnpm --filter @object-ui/plugin-detail run type-checktsc --noEmit && tsc -p tsconfig.test.json;--listFilesshows 105 files undersrc/__tests__/, the edited ones among them, so the tests are covered rather than assumedeslint .inpackages/plugin-detailno-explicit-any; 0 messages land on a line this PR addsnode scripts/check-changeset-presence.mjsnode scripts/check-changeset-fixed.mjsnode scripts/check-changeset-no-major.mjsnode scripts/check-control-bytes.mjsnode scripts/check-vi-mock-specifiers.mjsvi.mockcall sitesnode scripts/check-vi-mock-inherit.mjsnode scripts/check-comment-mask-corpus.mjspnpm --workspace-concurrency=2 --filter '@object-ui/plugin-detail^...' buildwas runfirst (exit 0) — before it,
type-checkfailed only on unbuiltdist/*.d.ts.Narrowing declared.
pnpm lintisturbo run lintacross every package; this run isone package. Universe read from eslint's own resolution, not guessed —
eslint .isverbatim the package's own
lintscript, and the 205-file count is read from--format json. Invariance:eslint.config.jsenables no type-aware linting (noproject,projectServiceorparserOptionsproject wiring), so verdicts are per-fileand a diff confined to fifteen files plus a new changeset cannot move any untouched
file's result. The remaining
check:*farm belongs to CI.node scripts/check-unreferenced-sources.mjsis not in the family: it guards everynon-test source file, and this diff is entirely tests.
Not a governed surface —
docs/adr/**,.claude/**,skills/**,AGENTS.md,CLAUDE.mdare untouched.Changeset
Empty frontmatter, the explicit "this releases nothing" declaration. These files live
under
packages/plugin-detail/src/, which the gate guards for every package in thefixedgroup, so the declaration is owed even though it is test-only.Scope
⛔ No detector was built. The triage ruling put that in a separate
domain:devxcardstarting from this card's ablation procedure, and explicitly not with the taker of this
one. One PR, not fifteen. Nothing else in these tests was touched — every hunk is an
addition of a docblock, a
beforeAll, andbeforeAllon the existingvitestimport.Generated by Claude Code