Repository navigation
fix(console): re-ticking a dashboard card's Apply restores the shipped filter binding - #37162
Merged
objectstack-fleet[bot] merged 3 commits intoNov 25, 2026
Conversation
…d filter binding Unticking Apply writes the card's opt-out; ticking it again dropped the entry, which binds the card to the filter's own field instead of the field the app ships. The save stores the whole document, so the shipped re-target was lost and the publish could be refused. The card panel now restores the binding the shipped layer (the layered read's code) gives the card, and drops the entry only where nothing is shipped. The in-page edit state and Studio's editor hand the panel that layer. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As5bdhV5T4N9vpjmZzH
Contributor
Author
|
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH 席位核对 — REWORK · head 4e94d7dL1 review of #37162 against #37031, read at 2026-11-25T01:18Z from the PR's committed tree (base Must-fix
Checklist
Next: the same dev, a patch round for must-fix 1, then a fresh L1 on the new head. |
…ersists Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As5bdhV5T4N9vpjmZzH
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As5bdhV5T4N9vpjmZzH
Contributor
Author
|
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH 席位核对 — ACCEPT · head 0b0d4b4Delta L1 against REWORK 7149430001 (head Delta
Checklist (carried from 7149430001; re-read where the head moved)
Accepted deviation
|
Contributor
Author
|
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH Landing — seat arms #37162
|
objectstack-fleet
Bot
deleted the
claude/issue-37031-dashboard-binding-recheck-persists
branch
November 25, 2026 03:08
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.
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH
Fixes #37031
Clause-②: no
Metadata-protocol: none
Skills-docs: none — no authoring surface changes; a console panel restores a value the package already ships
维护者速读
What changes
DashboardWidgetInspector(the card panel Studio and the in-page edit state share): re-ticking Apply on a filter row now writes the binding the dashboard as its package ships it gives that card, when that binding re-targets the filter to a field (a string). Where the shipped card opts out too (false), binds nothing, or is not in the shipped document, the entry is dropped as before. Unticking still writesfalse. A new exported helpershippedFilterBindingreads it.MetadataInspectorPropsgains an optionalshippedprop: the item as its package ships it (the layered read'scode). It is a React prop of an internal module of@object-ui/app-shell(not in itsexports), not metadata.openDashboardForEditreturnsshippedfrom the same layered read it opens the document from (the pair's read, or the base's when the pair does not hold the item yet); the edit state keeps it andDashboardEditPanelhands it to the card panel. No extra request.ResourceEditPage) hands its scoped inspectorshippedfrom the layered read it already keeps. Same defect class through the same panel, one line, pinned in that page's existing inspector harness.Read first, by risk:
DashboardWidgetInspector.tsx, the Apply checkbox'sonCommitandshippedFilterBinding: what a re-tick writes.DashboardInPageEditor.tsx,openDashboardForEdit: which layered readshippedcomes from.ResourceEditPage.tsx,shippedLayerOfand theInspectorComponentprops.Why
Measured, not the card's mechanism. The overlay is not merged key by key: a save into
com.example.showcase.customstores the whole dashboard document (ADR-0146, whole-document override). Onmainre-ticking deletedfilterBindings.dateRange, which binds the card to the filter's own field,issued_on.kpi_new_accountsreads the account dataset, which has noissued_on, so the PUT staged the draft (200) and the publish was refused (422INVALID_METADATA, ruledashboard-filter-field-unknown: "inherits dashboard filterdateRange(issued_on), but objectshowcase_account... has no fieldissued_on"). The editor then discards its draft, so the served dashboard keepsdateRange: false. The value to restore is the package's own re-target (signed_on), which only the shipped layer carries once the overlay holdsfalse. The server's merge contract is unchanged.Tests
New and updated pins (app-shell, run from ui/ root)
pnpm --dir ui exec vitest run --maxWorkers=2over the four files below at4e94d7d45cb: Test Files 4 passed (4), Tests 67 passed (67); lock VERDICT command-exit 0.DashboardWidgetInspector.test.tsx, new describe "re-ticking Apply restores the shipped binding": unticking writes{ dateRange: false, region: 'sales_region' }; re-ticking an opt-out writes{ dateRange: 'signed_on', region: 'sales_region' }; control: a shippedfalse, no shipped binding, or a shipped card with another id drops the entry ({ region: 'sales_region' }). The existing "re-ticking removes the entry" case (noshipped) stays as a second control.DashboardInPageEditor.test.ts:openDashboardForEditreturnsshipped(the code layer) for a writable package, for a base opened before the pair holds the item, for a pair holding a customization (one layered read, at the pair), andnullwhen nothing ships.DashboardView.inPageEdit-36372.test.tsx: through the realDashboardView, the card panel is handed the code layer of an installed app's customized dashboard.ResourceEditPage.inspectorReadOnlyReason-29079.test.tsx: the page hands a registered scoped inspector the layered read'scode, andnullwhen nothing ships.Ablation at head 4e94d7d (fix committed first; mutation landed on disk, then restored)
node scripts/ablation-replace.mjsreplacedsetBinding(apply ? shippedFilterBinding(shipped, widget.id, def.name) : false)withsetBinding(apply ? undefined : false)(themainbehaviour). Anchor 1 to 0, blob574a32e50efato812b69365391. Predicted: only the re-tick case goes red; the untick case and the controls stay green. Observed: 1 failed, 21 passed, the failure being "re-ticking an opt-out restores the field the shipped dashboard binds". Restore: blob equals HEAD574a32e50efa,git diff HEADempty. No build step: the suite imports the inspector from source.Type check and lint
pnpm --filter @object-ui/app-shell run type-check(both programs,tsconfig.jsonandtsconfig.test.json) at4e94d7d45cb, after building the@object-ui/app-shell^...closure: lock VERDICT command-exit 0.eslint --no-inline-configover the eight changed TS/TSX files: 3 errors, all inResourceEditPage.tsxand allreact-hooks/static-componentson lines that carry an inline disable onmain; the same command overorigin/main's copy of that file reports the same 3 errors. The diff adds none. The repo-wide run is CI's.Acceptance notes
main; onkpi_new_accountsthat is a field the dataset lacks, and the publish refuses it with the rule above, saying what to do. Whether Reset should mean "the shipped binding" is a product question, not this card's.Verification
Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/DashboardWidgetInspector.test.tsxand expect 22 passed. In the app:OS_PORT=3000 pnpm dev, open the Revenue Pulse dashboard, Edit, select "Accounts Signed", untick Date's Apply, Save; Edit again, tick it, Save. Expect a "Dashboard saved" toast, and the Date row showing "Customer Since" after a reload.Browser check on showcase at head 4e94d7d (console built from that head)
Fresh showcase (
objectstack dev --ui --seed-admin, own port, own DB), Chromium driven by Playwright, asadmin@objectos.ai, on/_console/apps/com.example.showcase/dashboard/showcase_revenue_pulse:kpi_new_accounts.filterBindings={"dateRange":"signed_on","region":"sales_region"}.?mode=draft&package=com.example.showcase.custom200 with bodyfilterBindings{"dateRange":false,"region":"sales_region"}; publish 200; toast "Dashboard saved". GET after:{"dateRange":false,"region":"sales_region"}.filterBindings{"dateRange":"signed_on","region":"sales_region"}; publish 200 (seq 4); toast "Dashboard saved". GET after:{"dateRange":"signed_on","region":"sales_region"}.{"dateRange":"signed_on","region":"sales_region"}; reopened edit state shows Date's Apply checked with the field "Customer Since" (thesigned_onlabel). Discarded.Control (before the fix: REST replay of
main's re-tick body; the server is unchanged by this diff): after the untick, a PUT withfilterBindings{"region":"sales_region"}answered 200 and its publish 422dashboard-filter-field-unknown; GET stayed{"dateRange":false,...}.Local gates at
4e94d7d45cb:dispatch-gates --commands --repo objectstack-ai/objectstackderives 39 families for this diff; all 39 exited 0 (pnpm --dir ui exec vitest run scripts/: 172 files passed, 2 skipped).dispatch-gates --ranwith exit codes: 39 derived, 39 run, 0 NOT-MEASURED (a derived zero).pnpm --dir ui check:new-line-citations: 0 new citations. Thetest:repoproject, the type-check lanes and the repo-wide lint are CI's.Human Minimum
packages/specholds no runtime logic. (Not touched.)pnpm lintpasses. (Changed files: no new errors, see Tests; the repo-wide run is CI's.)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (Not applicable.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code