Skip to content

fix(plugin-dashboard): route object-metric's drill through the shared DrillDownDrawer - #8999

Merged
os-steve merged 1 commit into
mainfrom
claude/issue-8970-metric-drill-drawer
Sep 10, 2026
Merged

os-steve merged 1 commit into
mainfrom
claude/issue-8970-metric-drill-drawer

Conversation

@os-steve

@os-steve os-steve commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #8970

ObjectMetricWidget hand-rolled its own drill panel. Triage's ruling was to fix it by routing the block through the shared DrillDownDrawer, not by re-implementing the dropped members inline — "Two implementations of one drawer is the defect; teaching the copy five more members guarantees a sixth divergence." That is what this does.

The member enumeration, re-measured (the card's "five" splits 3 / 2)

DrillDownConfig has eight members. Measured on both implementations rather than taken from the card:

member hand-rolled panel shared DrillDownDrawer this PR
enabled read via isDrillEnabled caller's open unchanged
target — drawer / dialog read read unchanged
target: 'navigate' no read site read via navigateOnly now acts
title read via resolveDrillTitle caller's title unchanged
report read read unchanged
columns no read site read (column whitelist) now acts
maxRows no read site read (page size) now acts
filter no read site no read site — the caller computes it still unread
mode no read site no read site — the drawer has no such prop still unread

⚠️ The dispatching assumption that all five are "honoured by the shared DrillDownDrawer" does not survive measurement. Rerouting closes three, not five:

  • mode is not a DrillDownDrawerProps member at all. Its only read site in the repo is ObjectDataTable.tsx ((drillDown?.mode ?? 'record') === 'record'), where a table row decides drill-to-record. Routing through the drawer cannot deliver it.
  • filter is read by computeDrillFilter in @object-ui/core, called by ObjectChart and ObjectPivotTable — not by the drawer, which takes an already-computed filter prop.

Both are exactly the two the filing seat flagged as possibly a deliberate refusal, and said "That is a judgement nobody has made." This PR does not make it. See the open question at the bottom.

Dependency measurement

DrillDownDrawer lives in the same package (packages/plugin-dashboard/src/DrillDownDrawer.tsx), so the new import is relative — ./DrillDownDrawer. Its own imports are react (already a peer dep), @object-ui/components and @object-ui/react (already dependencies), and two same-package siblings. No edge added to dependencies, peerDependencies or devDependencies. Not a manual-floor item.

The net import surface shrank: ObjectMetricWidget no longer imports Sheet/Dialog from @object-ui/components, SchemaRenderer from @object-ui/react, or ./OpenInListButton.

What routing through the shared drawer changed

Nothing broke. The metric tile's own layout is untouched — the hand-rolled panel was a drawer, not a tile constraint. Three differences exist between the two implementations and each is named rather than papered over:

  1. Page size — preserved, deliberately. The inline body hard-coded pageSize: 25; the shared drawer passes pageSize: maxRows, which is undefined when unauthored and would fall to data-table's default of 10. A METRIC_DRILL_PAGE_SIZE = 25 fallback keeps a config that never named maxRows drilling exactly as before, while an authored maxRows now wins.
  2. The drilled list loses its search box. The inline table never set searchable, so it inherited data-table's default of true; the shared drawer sets searchable: false. This is inherited-default drift, not a constraint the inline version handled, and adopting the shared value makes a metric drill the same self-contained peek as a pivot, chart or dataset drill. Adding a searchable prop to the shared drawer for one caller would be the sixth divergence triage warned about.
  3. The sheet's widest breakpoint narrows one step, lg:max-w-5xl to the shared lg:max-w-4xl. The centred dialog arm is byte-identical between the two and is unchanged.

Two latent problems in the inline copy go away with it: the report body built { type: 'spec-report', ...report }, which clobbered the inner report's own type and never produced the nested report limb ReportRenderer unwraps; and an explicitly-passed dataSource prop never reached the drilled table, because the inline path rendered a bare schema and relied on context.

Acceptance — each member asserted on its EFFECT

packages/plugin-dashboard/src/__tests__/ObjectMetricWidget.drillRoutedToSharedDrawer-8970.test.tsx, mounted through the registered object-metric block, 7 cases. Every case reads something the drilled list did, never that a prop reached a mock — a test that only checked a drawer appears would have passed against the hand-rolled panel too, which also drew a drawer.

  • target: 'navigate' — with a host openRecordList, clicking the tile calls it with the metric's own resolved filter and draws no panel. Two controls: the same host handler with target: 'drawer' draws the panel and never navigates (so the row reads target, not the handler's presence); and target: 'navigate' with no host handler still draws the sheet, which is the contract's conditional half — DrillDownConfig.target promises the fallback happens only "when none is available", and the bug was that it happened either way.
  • columns — columns: ['name'] renders exactly one column header; the control without the member auto-derives all three.
  • maxRows — with twelve records and maxRows: 2, two body rows render. The control without the member renders all twelve, which also pins the preserved 25 (the shared drawer's own fallback of 10 would show ten of the twelve).

The panel is located by role="dialog", which both implementations satisfy, rather than by the shared drawer's data-testid. That is what makes the ablation below legible.

Ablation — the fix removed, from the committed state

git checkout BASECOMMIT -- packages/plugin-dashboard/src/ObjectMetricWidget.tsx (BASECOMMIT spelled as a word on purpose — this repo's body sanitizer eats tag-shaped placeholders), proven on disk before running (DrillDownDrawer occurrences 4 to 0, SheetContent 0 to 3, on-disk blob hash equal to the base blob and unequal to the HEAD blob), restored by a trap to the HEAD blob and verified by git diff HEAD being empty.

3 red, 4 green — one red per delivered member, each with its control still green:

case ablated failure
target: 'navigate' navigates, no panel RED expected "vi.fn()" to be called with arguments: [ 'deal', { stage: 'won' } ]
target: 'drawer' control green —
target: 'navigate' no-handler fallback control green —
columns: ['name'] renders one column RED expected [ 'name', 'stage', 'amount' ] to deeply equal [ 'name' ]
auto-derive control green —
maxRows: 2 renders 2 rows RED expected 12 to be 2
preserved-25 control green —

All 13 cases of the objectui#8071 slice 9 member pin pass in both arms. That is the point of the filing seat's restraint: nothing had to be deleted for these members to become live. ⛔ No pin asserting the dead behaviour was added.

Gate table

gate exit
dependency-closure build (--filter '@object-ui/plugin-dashboard^...') 0
vitest run packages/plugin-dashboard/ 0 — 107 files, 967 tests
vitest run apps/console/src/__tests__/registry-inputs-spec-parity.test.ts 0 — 198 tests
turbo run type-check (plugin-dashboard + console) 0 — 37 tasks; plugin-dashboard's runs tsc -p tsconfig.test.json, so the new test file is type-checked
turbo run lint (plugin-dashboard + console + root) 0 errors; ObjectMetricWidget.tsx warnings 16 to 11, as any 5 to 0
check-control-bytes.mjs 0
check-changeset-presence.mjs 0
check-governed-queue-guard.mjs --test 0 — NOT GOVERNED
check:new-line-citations 0
check:doc-types 0
check:doc-snippets 2 (PREREQUISITE — unbuilt), then 0 after the scoped build it names
check:doc-examples 0 — 124 blocks, 89 failing exactly as their ledger rows declare
check:vi-mock-{specifiers,inherit,override-shape} 0
check:unreferenced-sources 0

Heavy runs were serialized through the shared verify lock.

Acceptance notes

  • ObjectChart is a third implementation of this drawer (packages/plugin-charts/src/ObjectChart.tsx, its own Sheet/Dialog at the tail of the file plus its own navigateOnly). The dispatching assumption that object-metric was the only block hand-rolling a drill panel is therefore false. It is not touched here and it drops no members — it reads columns, maxRows, filter and the navigate arm itself — so it is named for a follow-up rather than filed as a dropped-metadata finding. Its registration description does understate its own contract (target?: 'drawer' | 'dialog' while the code implements navigate). Successor: whoever next consolidates drill panels; objectui#8944 is already open against the same file's drill path.
  • Filed separately: the drilled list's column headers read as raw field names whenever columns is authored, and as humanized labels when it is not. Both branches call fieldLabel; only the fallback differs (ObjectDataTable.tsx passes the humanized form on the auto-derive branch and the caller's header on the whitelist branch, and both DrillDownDrawer and ObjectChart set that header to the raw field name). It predates this card, belongs to the shared drawer rather than to object-metric, and would change headers for four widgets, so it is not fixed here. It is why the new test compares column names case-folded, with the reason written into the helper.

Open question left to the card

drillDown.filter and drillDown.mode still have no read site on object-metric, and this PR does not add one — the shared drawer honours neither, so the reroute does not settle them. The card's own framing stands: a metric has no click event for ${event.*} to interpolate against, and the block's registration promises "the same filter narrows the drill-down list, so the number and the records behind it always agree", which an author-supplied filter override would break. If refusal is the intent, the remedy is to say so in the registration text or the shared type rather than to implement them. That judgement is a maintainer call, and this PR does not pre-empt it. Note the trailer at the top of this body closes the card on merge, per the dispatching seat's explicit instruction; if the maintainer wants the two-member judgement tracked, it needs its own card, because a closed card drops out of every open-issue sweep. Flagged back to the dispatching seat rather than decided here.

Authored by an agent seat via Claude Code; the session reference is https://claude.ai/code/session_01MPaVWWMuWeT5LgB1qoXjVB (in prose and as a code span, because the footer form does not survive an edit to this body).


Generated by Claude Code

… DrillDownDrawer

`ObjectMetricWidget` hand-rolled its own drill panel — a Radix `Dialog` when
`drillDown.target` was the literal `dialog`, a `Sheet` otherwise, with a
record-list body it built itself. That copy read `enabled`, `target`'s two
in-place arms, `title` and `report`, and had no read site for the rest of the
`DrillDownConfig` the designer inspector offers. Three members were accepted
from the author and discarded on this block alone while acting on every other
block that shares the config: `columns`, `maxRows` and `target: 'navigate'`.

`target: 'navigate'` was the sharpest, because the declared contract states a
CONDITIONAL fallback — "falls back to 'drawer' when none is available" — and
the inline copy fell back even when a host handler was available, reading as
the documented behaviour while being a different one.

Routing through the shared component delivers all three and deletes the
duplicate. Two behaviour changes come with it, both deliberate: the drilled
list loses its search box (the inline panel never opted out of the record
table's default; the shared drawer does, so a metric drill is now the same
self-contained peek as every other drill), and the sheet's widest breakpoint
narrows one step to the shared `lg:max-w-4xl`. The default page size is kept
at the 25 the inline panel hard-coded rather than dropping to `data-table`'s
default of 10, so a config that never authored `maxRows` drills as before.

`drillDown.filter` and `drillDown.mode` are unchanged and still unread here:
the shared drawer honours neither, a metric has no click event for `${event.*}`
to resolve against, and the block's registration promises the drilled list
agrees with the number. objectui#8970 asks for a judgement on those two; this
change does not make it.

The member pin from objectui#8071 slice 9 passes unchanged against the shared
drawer — nothing had to be deleted for these members to become live, which is
what its stated restraint was for.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MPaVWWMuWeT5LgB1qoXjVB
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3484.4 KB 3512.7 KB
Main entry chunk (gzip) 144.2 KB 350 KB
Entry file index-DZnRrXYQ.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.69KB 6.21KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 500.20KB 114.67KB
core (index.js) 7.95KB 3.19KB
create-plugin (index.js) 28.04KB 9.46KB
data-objectstack (index.js) 206.14KB 56.97KB
fields (index.js) 247.01KB 62.29KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 6.57KB 2.76KB
i18n (index.js) 3.65KB 1.47KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.84KB 10.94KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 4.39KB 1.66KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.39KB 3.10KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 14.81KB 3.63KB
plugin-calendar (index.js) 49.03KB 13.93KB
plugin-charts (index.js) 71.63KB 19.99KB
plugin-chatbot (index.js) 195.32KB 46.51KB
plugin-dashboard (index.js) 130.98KB 34.54KB
plugin-designer (index.js) 215.68KB 44.27KB
plugin-detail (index.js) 253.71KB 65.78KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 136.79KB 34.19KB
plugin-gantt (index.js) 166.65KB 40.91KB
plugin-grid (index.js) 210.87KB 57.30KB
plugin-kanban (index.js) 46.03KB 14.30KB
plugin-list (index.js) 112.52KB 27.64KB
plugin-map (index.js) 20.49KB 6.83KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.42KB 11.92KB
plugin-timeline (index.js) 30.10KB 8.74KB
plugin-tree (index.js) 9.55KB 3.32KB
plugin-view (index.js) 84.42KB 20.80KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 83.34KB 27.61KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.66KB 2.50KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 14.82KB 4.99KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.93KB 1.49KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.73KB 2.28KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 14.27KB 5.47KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@os-steve
os-steve marked this pull request as ready for review September 10, 2026 16:47
@os-steve
os-steve added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit 2596b1b Sep 10, 2026
36 checks passed
@os-steve
os-steve deleted the claude/issue-8970-metric-drill-drawer branch September 10, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants