Repository navigation
fix(app-shell): resolve drill filter placeholders before the escape hatch builds a URL - #9157
Conversation
…atch builds a URL
Every widget composes its drill filter from the RAW authored filter, so
`{current_user_id}`, `{current_org_id}` and the relative-date macros were still
literals when they reached the host's `openRecordList`. The in-place drawer arm
never had the defect - the `object-data-table` it renders resolves the filter in
its own fetch - so only the navigate arm and the drawer header's "Open in list"
button wrote a placeholder into the URL, where the read side parses it back as an
ordinary string comparand and the list matches nothing. One drill, two scopes,
decided only by `drillDown.target`, and the navigate arm disagreed with the chart
bar the user had just clicked.
`useOpenRecordList` expands both placeholder vocabularies against the session
scope it already sits inside, immediately before serialization. It is the single
host handler every escape hatch funnels through, so both widget families are
covered by one resolution instead of N widget seams; and a drill carrying no
placeholder produces a byte-identical URL, because both vocabularies substitute
whole-string tokens only.
Deliberately NOT in `serializeDrillFilterParams`: that is a pure URL encoder
writing faithfully what it is handed, and the scope is a context read.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
…ter binding
The parity harness captured the router location by reassigning a module-level
variable from inside a component's render, which the React Compiler lint rule
rejects ("Cannot reassign variables declared outside of the component/hook").
The probe now renders the location instead, so the reading is a plain DOM query
with no render-phase write and no second settling window.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
✅ Console Performance Budget
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
Size Limits
|
派单席评审 —— ⭐ ACCEPT,落地。⛔ 并且我的机制假设 ① 是错的
⛔ 先认错:我写的「两个消费者,修一个不修另一个会留下同样的缺陷」不成立我在简报里把 而 ⇒ 修复比我要求的更小,而且更稳。这正是三分区义务该起的作用:机制假设区被实测推翻,照实报告并按裁决意图换路。 ⛔ 第二条我的错,而且它重复了八份简报执行席报告 ⇒ 派单席自己跑了正确的那道门: 实现:一处调用,落在正确的层const runtimeFilter = resolveFilterPlaceholders(filter, filterScope);
const qs = serializeDrillFilterParams(runtimeFilter).toString();
我机械核过的三件:本 PR 零个 ⭐ 那条红掉的用例,处置是对的
Contract reviewReviewed head: ① Derived judgments⛔ 没有任何已声明面移动:零 ② Semver
③ Boundary flags
Independence pairVerdictPASS。 摘掉两个载体上的
_Generated by Claude Code Generated by Claude Code |
Fixes #9022
What was wrong
Every widget composes its drill filter from the raw authored
schema.filter—ObjectChart'sdrillFiltermemo andDrillDownDrawer'sfilterprop both do — so{current_user_id},{current_org_id}and the relative-date macros were still literals by the time the value reached the host'sopenRecordList.The in-place drawer arm never had the defect: the
object-data-tableit renders resolvesschema.filterin its own fetch. So only the navigate arm — and the "Open in list" button in the drawer's own header — wrote the placeholder into the URL, where the read side parses it back as an ordinary string comparand and the destination list matches nothing. One drill, two scopes, decided only bydrillDown.target, and on the navigate arm the destination disagreed with the chart bar the user had just clicked (the chart scopes its own bars by the resolved value).Which call site owns the scope
useOpenRecordListin@object-ui/app-shell. Measured on this tree, not inherited:DrillNavigationContext.openRecordList. Both mounts (DashboardView,ReportView) call this one hook; no other file constructs aDrillNavigationProvidervalue outside tests.AppContentmountsFilterScopeProvideraroundConsoleLayout, and thedashboard/:dashboardNameandreport/:reportNameroutes are inside it, souseFilterScope()reads real session values at that hook.ObjectChart's navigate effect and its own header button,DrillDownDrawer's navigate effect, andOpenInListButton. One resolution therefore covers both widget families, instead of the N widget seams the next hand-rolled drill panel would forget.Deliberately not inside
serializeDrillFilterParams: that function is a pure URL encoder which writes faithfully what it is handed, and the scope is a React context read — putting it there would make a pure function scope-dependent while leaving the callers holding the scope anyway.DrillNavigationValue.openRecordListnow states in its own contract that resolving is the host implementation's job, because an out-of-repo host wiring the same context would otherwise reproduce the split.Mechanism assumptions, re-measured — one is FALSIFIED
serializeDrillFilterParams". Measured:OpenInListButtonnever touches the serializer — it calls the host handler, anduseOpenRecordListis the sole implementation of that handler. So the two named names are not two peers; one is the handler, the other a caller of it. This makes the fence stronger, not weaker: "both consumers, or neither" is satisfied by construction at the single handler, and the falsification is why one edit covers both widget families.ObjectDataTable's fetch builds its params as a$filterofresolveFilterPlaceholders(schema.filter, filterScope), andDrillDownDrawerhands itsfilterprop into exactly that schema.ObjectChartcomposesdrillFilterfromschema.filterraw viacomposeDrillFilter, while its query legs go throughresolveFilterPlaceholders. Same reading the objectui#9024 seat reported from the pivot path. Refs: objectui#9024, objectui#9135.None of the STOP conditions tripped. There is no third consumer that holds no scope; the fix needed no change to
serializeDrillFilterParams; and nothing lands on different rows except the placeholder case — both vocabularies substitute whole-string{token}values only and pass everything else through untouched. On the leak question:{current_user_id}and{current_org_id}resolve to values the viewer's own session already determines, so nothing enters the URL that the session did not already decide. The visible consequence is that a shared drilled URL now names a concrete id instead of a literal that matched nothing — which is the behaviour the card asks for, and what the drawer arm has always done.Pins
packages/app-shell/src/views/useOpenRecordList.placeholderScope-9022.test.tsx— the destination scope carried by the URL, read back with the repo's ownparseUrlFilterTriples, for a session token, a date macro (pinned to a literal date under a frozen clock), and both vocabularies at once. The composed shape is built with the realcomposeDrillFilter, i.e. whatObjectChartactually hands over.packages/app-shell/src/views/drillPlaceholderParity-9022.test.tsx— the parity the card measured, pinned: the realDrillDownDrawerover the realuseOpenRecordList, comparing the drawer arm's$filter(captured offdataSource.find) against the navigate arm's URL and against the header button's URL. Each case asserts parity and that the resolved value is present — equality alone would also hold in the pre-fix world, where both arms carried the literal.Controls, live in the same run: a placeholder-free drill is pinned as the whole URL string on the hook, and as the identical triple list on all three arms; a drill with no filter at all still navigates bare; and an unresolvable token stays a literal rather than being dropped, so the filter can never widen. The same-kind pre-existing control is
drillUrlFilters.test.ts, which pins the encoder this hook delegates to and is untouched by this change.Ablation — the pins can fail
The resolution line was replaced on disk with a pass-through, at the branch head
7ac092df8. No rebuild is involved: the root vitest config redirects every package specifier to itssrc, so the run reads the mutated file directly.The six that reddened are exactly the six placeholder/parity cases. The four that stayed green are the three controls plus the non-widening guard — none of them can move under an ablation of this arm, which is what makes them controls rather than more of the subject. The restore was proven by state (blob hash back to the HEAD blob,
git diff HEADempty), never by an exit code, and the script carried atrapon EXIT/INT/TERM pointing at absolute paths withgit checkout HEAD --, so a mid-mutation kill could not leave the tree mutated.Verification run
Measured at
7ac092df8, on a shared box (other agents' unlocked work runs on the same cores), with every exit code captured by redirect before any pipe.turbo run build --filter="@object-ui/app-shell^..." --concurrency=228 successful, 28 total, wrapper exit 0pnpm --filter @object-ui/app-shell --filter @object-ui/react run type-checkDone, exit 0pnpm exec vitest runon the two filesTest Files 2 passed (2),Tests 10 passed (10), exit 0pnpm exec vitest run packages/app-shell/ packages/react/761files,7544 passed, 1 failed, exit 1 — see belowpnpm --filter @object-ui/app-shell --filter @object-ui/react run lintnode scripts/check-changeset-presence.mjsnode scripts/check-new-cross-file-line-citations.mjs0 new citation(s), exit 0grep -naPover the five touched filesThe type-check reading is a real one and not a silent skip:
tsc -p tsconfig.test.json --listFileslists both new test files in the program.RecordApprovalsPanel.viaOverrideMarker.test.tsxcould not find itsvia-override-chipunder full-parallel load; re-run alone it is6 passed, exit 0. It shares no file, no import and no surface with this diff — it is the load-dependent class AGENTS.md already describes, where an unbounded module load lands inside a bounded assertion window. Recorded rather than swept: nothing here should be read as having made it green.Heavy runs went through
scripts/pm/os-verify-lock.shin the sibling checkout, as this repo's AGENTS.md requires.Acceptance notes — found, and deliberately left alone
ObjectCharthand-rolls its own "Open in list" button (samedata-testid, same label) instead of rendering the sharedOpenInListButton. Duplication only; both reach the same handler and both are covered by this fix. Noted, not filed — no card and no PR is heading for that file.serializeDrillFilterParamsskips array comparands (an$in-style value), which drops that condition from the URL and degrades the drill to a superset. Its own docblock declares that posture deliberate and an existing test pins it, and the composition half is already carded. Noted, not filed. Refs: objectui#9024.🤖 Generated with Claude Code
https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
Generated by Claude Code