Repository navigation
feat(plugin-dashboard): a dataset KPI tile opens the records behind its number - #30634
Merged
Merged
Conversation
…e number A dataset-bound metric tile opens the list its number counts through the shared drill drawer, keyboard included, and offers no click whenever the list cannot be proven to match the number. The tile's number also carries the dataset's own scope and the measure's own filter, which only the server knows, so the scope is read from a server sidecar that is not on the wire yet: until it lands, every tile keeps today's no-click markup. Co-Authored-By: Claude <noreply@anthropic.com>
…ts number The metric tile reads its measure's drillScopes entry off the dataset answer and opens the shared drill drawer with the widget filter AND the date window AND that scope, so the list matches the number. A measure with no entry offers no click. The drawer is the tile's sibling, so a click or a key typed inside it never reaches the tile's handlers. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL 维护者速读
席位核对 — ACCEPT · head 8f48513
|
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.
Requested by Sales · project thread
Fixes #30080
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/packages/plugin-dashboard/src/metricDrill.ts(new):metricDrillFiltercomposes the widget filter (dashboard filters already merged in), the answer's date window (drillRanges[0]) and the tile measure'sdrillScopesentry through the shared drill sinks (composeDrillFilter,buildDatasetDrillFilter). It answersnull, meaning no click, when the answer names no object, when the measure has nodrillScopesentry, or when the sink refuses the filter (FilterOperatorError).readMeasureDrillScopereads one measure's entry off the answer. Neither is exported from the package entry.DatasetWidget.tsx, metric branch only: when the filter is notnullthe tile getsrole="button",tabIndex=0, Enter/Space, the test iddataset-metric-drilland a hover/focus ring, and opens the existingDrillDownDrawertitled by the tile's heading. With no filter, the markup is the previous markup. The drawer renders as the tile's sibling, never its child, so events from inside the portal never reach the tile's handlers. The package-localDatasetResulttype gainsdrillScopes.@object-ui/plugin-dashboard: patch).Why
Ruling A (comment 6631202970): a dashboard tile opens the matching records through the report drill path, and a tile whose filter cannot be expressed as a list filter offers no click. A tile's number also carries the dataset's own filter and the measure's own filter, which only the server knows; #30526 (PR #30596) added the per-measure
drillScopessidecar this reads, so the list is the set of records the number counts.Tests
pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-dashboard/on 8f48513: Test Files 203 passed (203), Tests 1948 passed, 6 skipped (VERDICT command-exit 0).__tests__/metricDrill.test.ts(composition, every no-click arm, the entry reader) and a top-leveldescribe('DatasetWidget metric tile drill')in the sharedDatasetWidget.test.tsxharness: nodrillScopes, no entry for the tile measure, scope AND widget filter on click (asserts thefindobject and$filter), an empty entry by Enter key, and the date window bound.pnpm --filter @object-ui/plugin-dashboard run type-check(tsc --noEmitandtsc -p tsconfig.test.json): VERDICT command-exit 0.Ablation (one, on the scope leg)
node scripts/ablation-replace.mjsreplacedconst scoped = hasScope ? composeDrillFilter(runtimeFilter, measureScope) : runtimeFilter;with a form that drops the measure scope (anchor 1 -> 0, blob bca877be1179 -> 4a067a960ce7). The two files' run then failed 3 tests:keeps the measure scope AND the widget filter, never only one of them,keeps the measure scope when the widget declares no filter,opens the widget filter AND the measure scope on click(Tests 3 failed, 72 passed). Restored withgit checkout HEAD --; hash-object after equals the HEAD blob bca877be1179. ui vitest resolves@object-ui/*to source, so no dist leg.Acceptance notes
drillScopesthere is Report, chart and table drills list more records than the number for a filtered measure: they do not read the answer's per-measure drillScopes #30615, not this PR.pipeline_dashboard, so the derived-measure no-click arm was measured by the widget pin only, not live.Verification
Live: example CRM pipeline_dashboard, zh-CN, 1440 wide
Before (main fa9c0aa, report 6660360476): the three metric tiles had no pointer, no drill test id, and a click opened nothing.
After (8f48513,
objectstack dev --freshexample CRM + Console vite dev server), each answer carried adrillScopesentry for the tile measure (total_amountandavg_amount:amountnot null). Three tiles carrydataset-metric-drill; each click opened the drawer, and the listed records match the number:Gates on 8f48513
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 35; each ran with its exit code captured before any pipe, all 35 exit 0, pluspnpm --dir ui run check:spec-symbolsexit 0.--ranreconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN. Families CI runs are read from this PR's check-runs.Branch:
claude/project-thread-pezzx8is the card thread's platform-assigned branch (claim 6666212190), not theclaude/issue-30080-*convention.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgWjsoG4R5yUYFw3T6s
Generated by Claude Code