Repository navigation
fix(drill): "Open in list" is offered only when the list can show exactly the drawer's records - #30735
Merged
Conversation
Claude-Session: https://claude.ai/code/session_01L6bhgTGQVA597MpPgAhmzK Co-authored-by: Claude <noreply@anthropic.com>
…a list Claude-Session: https://claude.ai/code/session_01L6bhgTGQVA597MpPgAhmzK Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL 维护者速读
席位核对 — ACCEPT · head 7519c05
|
2 tasks
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 #30654
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
drillDown.target: 'navigate',现在只有列表页的 URL 能把下钻筛选原样写出来时才给出口;写不全就不给,留在抽屉里。$in,以前会丢掉条件,打开的列表比抽屉里的数字更宽(抽屉 0 张发票,列表 4 张)。ui/packages/app-shell/src/views/useOpenRecordList.ts(drillRecordListFilter、useRecordListDrillNavigation)、ui/packages/react/src/context/DrillNavigationContext.tsx(新可选成员)、ui/packages/plugin-charts/src/ObjectChart.tsx的两处守卫。filter[status]=sent加组件的日期区间。What changes
@object-ui/react:DrillNavigationValuegains an optionalcanOpenRecordList(objectName, filter): boolean. Absent means the host claims every filter it is handed has an exact destination, which is how hosts behaved before.@object-ui/app-shell:useRecordListDrillNavigation()returns{ openRecordList, canOpenRecordList }forDashboardViewandReportView. Both go through the new puredrillRecordListFilter, which resolves placeholders first (resolveFilterPlaceholderswith the sameuseFilterScopescope the navigate arm always used), then asksexactRecordListFilter(reused unchanged, withusePermissions().checkField(object, field, 'read')).openRecordListnavigates to the exact filter and does nothing when there is none, so a caller that skipped the question still never lands on a wider list.useOpenRecordListstays as the navigate half.@object-ui/plugin-dashboard:OpenInListButtonrenders nothing, andDrillDownDrawer'snavigateOnlyis false, whencanOpenRecordListanswersfalse. The drill then stays in the drawer, the same fallback as a host with noopenRecordList.@object-ui/plugin-charts:ObjectChart's navigate arm and its own drawer-header "Open in list" ask the same question (withdrillFilterandmergedrespectively).DashboardView/ReportViewtests that mock./useOpenRecordListnow mockuseRecordListDrillNavigationinstead (mechanical, samevi.fn()opener).Metadata-protocol: none⇒ patch;Clause-②: yes (widening)for the new optional interface member, per the claim amendment).Answers to the claim's two questions:
drillDown.target: 'navigate'click with no exact destination opens the in-place drawer (no navigation, no dead click).drillRecordListFilter, with the scopeuseOpenRecordListalready read; a{current_user_id}that resolves to the same value as a bucket on the same field is one exact param (pinned).Tests
New pins:
useOpenRecordList.placeholderScope-9022.test.tsx, new top-level describe (6 cases): the repro shapecomposeDrillFilter({ status: 'paid' }, { status: 'sent' })answersfalseandopenRecordListdoes not navigate; an$inscope answersfalse; a plain equality bucket answerstrueand opens byte-for-byte/apps/crm/invoice/data?filter%5Bstatus%5D=sent; the same condition twice is one param; placeholders resolve before judging; an unreadable field answersfalse. The file's existing CONTROL (equality + date range URL pinned as a whole string) stays green unchanged.DrillDownDrawer.escapeHatch.test.tsx, new top-level describe (4 cases): host answersfalse⇒ no button, asked with the drill filter;navigatestays in the drawer; host answerstrue⇒ button; host withoutcanOpenRecordList⇒ old behaviour for both the button andnavigate.ObjectChart.drillNavigate.test.tsx, new top-level describe (2 cases): host answersfalse⇒ drawer, no header button; host answerstrue⇒ navigates. The file's existing four cases (nocanOpenRecordList) are the unchanged-host control.Ablation (each on the committed fix, restored to the HEAD blob by
scripts/ablation-replace.mjs; the tests import the source relatively, nodist/involved):OpenInListButtonguardDrillDownDrawernavigateOnlyguard →trueObjectChartnavigate guard →trueObjectChartheader-button guard →truedrillRecordListFilterreturns the resolved filter unjudged$in, unreadable field)Test runs
On
7643fb85(before the main merge):vitest run packages/plugin-dashboard/ packages/plugin-charts/ packages/react/+ the 42 app-shell test files that nameuseOpenRecordList,DrillNavigation,DashboardView,ReportView,OpenInList,DrillDownDrawer,drillUrlFilters,recordListPathorexactRecordListFilter:Test Files 485 passed (485),Tests 5230 passed | 15 skipped (5245).type-checkfor@object-ui/react,@object-ui/plugin-dashboard,@object-ui/plugin-charts,@object-ui/app-shell: all fourDone, lockVERDICT command-exit 0.Declared narrowing: the rest of app-shell's 2208 test files are left to CI's
Test UI(a full local run did not finish inside the box's budget at 2 workers).On
7519c053(after mergingorigin/main, which touchedui/packages/coreexports, and a rebuild of the app-shell closure): plugin-dashboard + plugin-charts full + the same 42 app-shell files,Test Files 348 passed (348),Tests 3662 passed | 15 skipped (3677); the fourtype-checksDone; lockVERDICT command-exit 0.Acceptance notes
exactRecordListFilteris reused unchanged, so its refusals now apply to drills too: a drill on a boolean bucket ({ is_paid: true }), on$ne, on a text operator, or with a placeholder that cannot resolve to a comparand the route carries no longer offers "Open in list" (the drawer still lists the records). Before, those opened a list scoped by a string comparand or with the condition dropped.ReportView's group-key fallback drill (older server with no drill metadata) goes through the same host, so it is judged the same way.claude/project-thread-qgekwo, claim amendment 6671583364), notclaude/issue-30654-*.Verification
Live, app-showcase on its own port (
pnpm dev -- --fresh), Console via Vite, headless Chromium at 1440 px. "Revenue Pulse (filtered)" → "Paid Rate by Status", Sent row (Sent 4 0 0.0%):origin/main)/apps/com.example.showcase/showcase_invoice/data?filter%5Bissued_on%5D%5Bgte%5D=2026-08-07&filter%5Bissued_on%5D%5Blte%5D=2026-11-05&filter%5Bstatus%5D=sentDerived gates
node scripts/pm/dispatch-gates.mjs --commandson7643fb85: 35 families, allexit 0.pnpm --dir ui exec vitest run scripts/was killed by the container's memory limit while the live rig ran (exit 1, SIGKILL, no verdict) and re-run alone:Test Files 170 passed | 2 skipped (172), exit 0.--ranwith exit codes: "35 derived famil(ies) accounted for — 35 run, 0 NOT-MEASURED (a DERIVED zero — all 35 recorded an exit code and none of them is 3)".check:nul-bytesexit 0.Generated by Claude Code