Repository navigation
fix(plugin-detail): summary chip honours percentDisplay plain - #36279
Conversation
Claude-Session: https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL Final green head for L1: |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5ozidcgr4FYrKfmrjD 维护者速读
席位核对 — ACCEPT (L1-d) · repo:objectstack#4 · head
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL Landing · head
State: ready + auto-merge; on MERGED |
Requested by Leehom · project thread
Fixes #36078
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The record header's
summaryFieldschip now honours a percent field'spercentDisplay(thepercentDisplaydescribe inpackages/spec/src/data/field.zod.ts:plain= "the percentage as text alone, with no bar"). InDetailView's chip percent arm, the bar's fill value is computed only when the merged field bag (view entry over object schema, the samepercentFieldbag the arm already readsscaleandmaxfrom) does not sayplain; withplain, the chip falls through to the plain Badge branch, so the text (formatPercent, unchanged) and the accessible name (Label: 40%, unchanged) stay and only the bar goes. Because the arm is chosen byarmType, aformulawhosereturnTypeispercenttakes the same path and its ownpercentDisplaycounts too.The bar-or-not rule is the literal
percentDisplay === 'plain'test, inline inPercentCellRenderer(@object-ui/fields) and not exported, so this is a local read of the one key, not a second copy of an exported helper and not a published-export change.No
packages/specchange. Changeset:@object-ui/plugin-detailpatch.Read first (by risk):
ui/packages/plugin-detail/src/DetailView.tsx, the hunk guardingsummaryChipPercentPointswithpercentField.percentDisplay !== 'plain'.ui/packages/plugin-detail/src/__tests__/summaryChip.percentPlain-36078.test.tsx.Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/summaryChip.percentPlain-36078.test.tsx(spec, formula and client built) prints 7 passed.Tests
New
summaryChip.percentPlain-36078.test.tsx(7 cases), stored value0.4:plainreads40%, accessible nameProbability: 40%, no bar track;returnType: 'percent')plain: same;plaindeclared on the object schema only (no view entry), judged after an arrival probe: same;percentDisplay, and withbar, draws the bar filled to40%;percentDisplay, and withbar, draws the bar;barover an object schemaplaindraws the bar (precedence).Acceptance notes
plaincases red, the four controls green.overlap-check.mjsnames open PR feat(record-page): the field area is one list in the side preview, on a phone and in the pinned left column (#36147) #36234 as sharingDetailView.tsx; it merges cleanly with this branch.Verification
All readings at head
4bf99c41.Targeted tests (under the shared verify lock)
pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/src/__tests__/summaryChip: Test Files 10 passed, 1 skipped (11); Tests 106 passed, 8 skipped. The existingsummaryChip*pins stay green.pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/src/__tests__/percentDisplayRelay-28255.test.tsx packages/plugin-grid/src/__tests__/percentAbsentScale.fiveFaces-9843.test.tsx packages/plugin-detail/src/__tests__/DetailView: Test Files 25 passed (25); Tests 170 passed (170).pnpm --filter @object-ui/plugin-detail run type-check: exit 0 (after building the@object-ui/plugin-detail^...closure);tsconfig.test.json --listFilesOnlyincludes the new test file.@object-ui/plugin-detailsuite (405 test files) is declared to CI'sTest UI, not run locally.Ablation (one, on the committed fix)
node scripts/ablation-replace.mjsreplaced the guardif (percentField.percentDisplay !== 'plain') {with an always-true guard: anchor 1 to 0, blobc62b65de4f71to915375fad2c8. The new file then read 3 failed, 4 passed: exactly the threeplaincases red, all four controls green. Restore: blob after restore equals HEAD (c62b65de4f71),git diff HEADempty, marker count 0. The test imports../DetailViewfrom source, so no build sits between the mutation and the run.Derived gates
node scripts/pm/dispatch-gates.mjs --commandsderived 38 commands for this diff; 37 ran locally with exit 0;pnpm check:type-check-debtis NOT MEASURED (its closure build never acquired the shared verify lock, exit 3 PREREQUISITE NOT MET) and is CI'sLint & Repo Gates.--ranreconciliation: 38 derived, 37 run, 1 NOT-MEASURED, 0 UNRUN. Alsopnpm --dir ui run check:new-line-citations: 0 new citations.Generated by Claude Code