Repository navigation
fix(plugin-detail): the highlights strip, the detail view and the record drawer hide a field whose own visibleWhen is false - #35545
Conversation
…ord drawer hide a field whose own visibleWhen is false Lift the details body's field-visibleWhen fold into one module-internal helper (fieldPredicateVisibility.ts) and call it from HeaderHighlight and DetailView as well as record:details. Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ Co-authored-by: Claude <noreply@anthropic.com>
…p pin gates stage Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ Co-authored-by: Claude <noreply@anthropic.com>
… without an explicit any Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ Co-authored-by: Claude <noreply@anthropic.com>
…siblewhen-highlights-drawer
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Final head for review · area ux-2 · 2026-11-19T15:18Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对L1-a: ACCEPT · head Readings, my own: The lift is unchanged. The surfaces.
Pins (names grepped, not recalled).
Each case asserts Declaration: agreed. Out of scope, noted and not filed. Routing. Not governed and no contract face: ux-2 lands it. Generated by Claude Code |
|
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ Landing · area ux-2 · 2026-11-19T15:20Z
Not filed: a host data source without |
Fixes #35437
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
A field's own object-level
visibleWhen(Field.visibleWhen: "field is shown only when TRUE (else hidden)") now hides it on every record surface inplugin-detailthat draws fields, not only on therecord:detailsbody:ui/packages/plugin-detail/src/fieldPredicateVisibility.ts(dropFieldPredicateHidden, withassemblePredicateRecord,lazyPredicateRecordandfieldPredicateVisiblemoved there unchanged). It is not exported from the package barrel. Call sites:record:details(renderers/record-details.tsx): itsdropPredicateHiddennow delegates to the helper; the group gate keeps its own fail-closed judge and reads the same lazily assembled record.HeaderHighlight: drops a gated highlight before the read/edit face split. This coversrecord:highlightsand the strip adetail-viewdraws fromhighlightFields.DetailView: a render-onlydrawnmemo filtersfields,sections[].fields,sectionGroups[].sections[].fieldsand the header summary chips. This covers thedetail-viewnode and the record drawer (RecordDetailDrawerand the views' overlay both renderRecordDetailPanel, which rendersDetailView).resolveFieldRuleState, the record bound asrecordandprevious, the host predicate scope. A predicate that cannot be evaluated SHOWS the field and warns once (ADR-0137 D3). A field with no predicate is untouched.DetailView's record read is untouched. The$expandread keepsschema's lists. A list derived from the verdict would refetch whenever the verdict moved.Tests
New
ui/packages/plugin-detail/src/__tests__/fieldVisibleWhen.surfaces-35437.test.tsx(11 tests). Each test renders the same row on four surface legs:record:highlights, thedetail-viewnode throughSchemaRenderer, the node's ownhighlightFieldsstrip, andRecordDetailDrawer. It also renders the row through the entryformrenderer and asserts{ form, highlights, node, nodeStrip, drawer }against the expected verdict in one assertion, so a red names the surface:previous, and the hostcurrent_userscope.detail-viewheader draws no chip for a gated field.DetailViewlegs wait for their own object-schema read to land. Otherwise the leg throwsHARNESS DEAD, so an empty render cannot pass a hidden leg.The details body's own pin,
record-details.fieldVisibleWhen-35314.test.tsx(19 tests), is unchanged and green.Reproduction on the base renderer: 8 red, the 3 fail-open/no-predicate controls green
DetailView.tsx,HeaderHighlight.tsxandrecord-details.tsxwere restored from the base commit 5756ae0 withgit restore --source, and the new pin was run. The sources were restored withgit checkout HEAD --in an EXIT trap. Mutation proof: helper references in the three files = 0/0/0. Restore proof:git diff HEADempty,git status --porcelainempty, and the threegit hash-objectvalues equal the HEAD blobs.All four surface legs reproduce red on the base (A1). None already routed through the details body.
Ablation of the shared helper: both pins red
node scripts/ablation-replace.mjsreplaced the helper'sif (visibleWhen == null) return true;withreturn true;: anchor 1 to 0, blob 627ab41f to 0e66c463. The new pin and the details-body pin were then run together:That is 8 red in the new pin and 14 in the
record:detailspin, the same 14 that PR #35421 measured red against its base. So the details body runs through the shared helper too. Restored withgit checkout HEAD --in an EXIT trap:git diff HEADempty, hash equals the HEAD blob, marker count 0.Package suite and type-check
Taken at head 86c2830, after merging origin/main. The build closure was rebuilt first, and the commands were chained with
&&under the verify lock, whose verdict wascommand-exit 0:The group-gate pin
record-details.groupVisibleWhen-11630.test.tsxand the details-body pinrecord-details.fieldVisibleWhen-35314.test.tsxare in that suite and unchanged.Acceptance notes
DetailView's own object-schema read (dataSource.getObjectSchema). That is the same read that gives it option labels on the record page.RecordDetailPanelhandsDetailViewtyped field descriptors and no object schema. A host that opens the panel with a data source lackinggetObjectSchematherefore still draws a gated field, as it also draws no option labels fromDetailView's side. Every in-repo caller (grid, list, gallery, kanban, calendar, gantt, map, tree, timeline) passes the view's data source.RecordDetailPanel.tsxis outside this claim's file surface, so this is noted here, not changed.detail-viewnode draws, and they have the same defect. An auto-picked chip that is hidden is dropped, not replaced by the next candidate.record:highlightsstill registers every authored highlight name for the body's dedupe. A field the predicate hides is dropped by both the strip and the body, so the registration changes nothing visible.Verification
Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/fieldVisibleWhen.surfaces-35437.test.tsx. Expect 11 passed, each asserting the form and all four surface legs together.Files to read first:
ui/packages/plugin-detail/src/DetailView.tsx, thedrawnmemo and the render sites that read it. Risk: a render path still readingschema.*(the fetch effect deliberately does).ui/packages/plugin-detail/src/fieldPredicateVisibility.ts, the single implementation.ui/packages/plugin-detail/src/HeaderHighlight.tsx, the gate before the read/edit split.Derived local gate families
At head 86c2830,
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 38 commands. Each was run with its exit code captured before any pipe, the vitest and type-check families under the verify lock. All 38 exited 0.--ranreconciliation:38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.pnpm --dir ui exec vitest run scripts/reported 171 passed and 2 skipped files (5092 passed tests).pnpm check:new-line-citations(ui) reported 0 new citations. Every other family belongs to CI; see this PR's check runs.Generated by Claude Code