Repository navigation
fix(console): data-page filter chips name lookup records and say booleans in the reader’s language; condition sentences use translated labels - #37319
Conversation
…ean words and translated labels Claude-Session: https://claude.ai/code/session_012MmDsSBHy5paNUz6zke9Re Co-authored-by: Claude <noreply@anthropic.com>
…dition labels Claude-Session: https://claude.ai/code/session_012MmDsSBHy5paNUz6zke9Re Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MmDsSBHy5paNUz6zke9Re Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MmDsSBHy5paNUz6zke9Re Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: No must-fix, no should-fix. VERDICT: PASS |
|
repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re 席位核对ACCEPT · 2026-11-25T15:52Z · head
|
|
repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re Landing (2026-11-25T15:54Z): head
State: |
Fixes #37288
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The
/datapage's URL filter chips and the read-onlyfilter-conditionsentence now draw each comparand the way the grid cell draws it:ObjectDataPage): a whole-value comparand on a lookup field reads as the referenced record's name. The page reuses the read the list's own condition chips already make,useLookupValueNames(the target's records by id through the page's data source, named by the lookup'sdisplayField, else the target's name field viareferencedRecordTitle), now exported from@object-ui/plugin-listwith its two types. No new fetch path: the samefind+getObjectSchemaread, one per target, keyed on target and ids. While the read is in flight, when it fails, or when it names nothing, the chip keeps the raw id. The record-trail source condition is left out of the read, because its chip is named by the trail.ObjectDataPage): a[bool]comparand reads ast('filterBuilder.trueLabel' | 'filterBuilder.falseLabel'), the keysFilterConditionFieldalready uses, which are present in all locale packs. The texttrueon a text field is still the user's own comparand and stays raw.describeCondition(FilterConditionField): the read-only sentence receives the field list mapped throughuseSafeFieldLabel()'sfieldLabelandtranslateOptionsfor the object, so field and option labels are the translated ones, with the authored label as the fallback.[nin]: no code change. The arm was already correct; it is now pinned.@object-ui/plugin-listaddsuseLookupValueNamesand its two types,LookupValueNameandNamedCondition, to its package entry (ui/packages/plugin-list/src/index.tsx, +6). Nothing is removed or renamed. The changeset declaresClause-②: yes (widening)atpatchfor all three packages. This follows AGENTS.md (Post-Task Checklist step 3: "a non-protocol change, widening or breaking, shipspatch";Metadata-protocol: nonetakespatch) and the precedents onmain:.changeset/35053-lookup-label-namefield.md(referencedRecordTitle, a new@object-ui/coreexport,patch),.changeset/35033-form-recomputes-formulas.md(planObjectFormulas,@object-ui/core,patch) and.changeset/33581-plugin-detail-core-subpath.md(a new@object-ui/plugin-detail/coresubpath,patch).drillUrlFilters.ts: doc comments only.ComparandText/FilterChipnow describe the caller's drawing in general terms (option label, record name, boolean word) rather than options only.Landing points are the ones the claim names, plus one line in
ui/packages/plugin-list/src/index.tsx: the export of the existing read. Reusing it is how (a) avoids a new fetch path, so the split rule did not fire.Tests
One top-level
describeper item in the existing harnesses, in en and zh:ObjectDataPage.filterChipI18n-9159.test.tsx: (a) lookup:=in zh,[in]in en and zh, CONTROL for an unnamed id after the read settles, CONTROL for a failed read keeping the raw id. (b) boolean:[bool]=true|falsein zh,truein en with the packs differing, CONTROL for the wordtrueon a text field staying raw. (d)[nin]: zh and en option labels, CONTROL for a member with no matching option staying raw.FilterConditionField.readWords-30209.test.tsx: (c) the zh field and option labels, the authored en labels under en, CONTROL for an untranslated field or option keeping its authored label, CONTROL for a value with no matching option staying as stored.Ablations (one-off, each through
scripts/ablation-replace.mjs: mutate, run, restore, with the restore proven by blob equal to HEAD and an emptygit diff HEAD)lookupNameOflookup in the page'scomparandTextnot_infromWHOLE_VALUE_OP_WORDS[nin]pins. The raw-member control stays green.fieldstodescribeFilterGrouptranslateOptionsmappingEvery subject is imported from source (
./ObjectDataPage,../../index), so no leg depends on adist/rebuild.Acceptance notes
referencedRecordTitle(core's ADR-0079 ladder), which the list's condition chips use. The grid cell'suseLookupNameresolves throughgetRecordDisplayNameon the same ladder and also masks fields the reader may not read before naming. For a backend that strips denied fields, the two produce the same name. The chip takes the list-chip read so that the two chip rows on one page agree.user-type field without a declaredreferencestill shows the raw id, the same as the list's own chip (useLookupValueNamesreads onlyreference). Noted, not filed.FilterBuilderinsideFilterConditionFieldstill receives authored field and option labels (it has no translation step of its own). This is outside (c), which names the read-only sentence, and it is unmeasured in a browser, so it is noted here and not fixed.Verification
Read first:
ui/packages/app-shell/src/views/ObjectDataPage.tsx: the newlookupChipFields/lookupNameOfblock and thecomparandTextcallback. Risk: hook placement (unconditional, before any return) and the source-condition exclusion.ui/packages/fields/src/widgets/FilterConditionField.tsx: thewordFieldsmapping in the read-only branch.ui/packages/plugin-list/src/index.tsx: the new export.Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectDataPage.filterChipI18n-9159.test.tsx packages/fields/src/widgets/__tests__/FilterConditionField.readWords-30209.test.tsx. ExpectTest Files 2 passed,Tests 36 passed.All readings below were taken at head
e988464d4, on a shared box. Head8534111c6changes only the changeset'sClause-②:line and its export sentence. On that head:check-empty-changeset,check-changeset-no-majorandcheck-adr-0087-registrationeach exit 0, andoverlap-checkis clean againstorigin/maind88c41e with 0 PR heads.Pinned harnesses: Test Files 2 passed, Tests 36 passed
pnpm --dir ui exec vitest run packages/fields/src/widgets/__tests__/FilterConditionField.readWords-30209.test.tsx packages/app-shell/src/views/ObjectDataPage.filterChipI18n-9159.test.tsx:Test Files 2 passed (2),Tests 36 passed (36)(20 before this PR plus 16 new).Affected-package tests (declared narrowing): Test Files 48 passed, Tests 708 passed
Every app-shell test file that names
ObjectDataPageordrillUrlFilters, everyFilterConditionField*test in fields, and every plugin-list test that namesuseLookupValueNames/ListConditionControls:Test Files 48 passed (48),Tests 708 passed (708). The full app-shell / fields / plugin-list suites are left to CI'sTest UI.Type check: turbo type-check over plugin-list, fields, app-shell: 73/73 tasks, 0 error TS
pnpm exec turbo run type-check --concurrency=2 --filter=@object-ui/plugin-list --filter=@object-ui/fields --filter=@object-ui/app-shellran both tsc programs (tsc --noEmitandtsconfig.test.json) for each of the three packages:Tasks: 73 successful, 73 total, lockVERDICT command-exit 0.Derived gate families (dispatch-gates --commands): 38 derived, 38 run, 0 NOT-MEASURED
check:type-check-debtwas first NOT MEASURED (exit 3: its closure build lost the verify-lock queue). It was re-run under the lock (bash scripts/pm/os-verify-lock.sh -c 'pnpm check:type-check-debt'), with--re-measure: OK, and that exit is the one recorded.dispatch-gates --ran:38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero). Alsopnpm --dir ui check:new-line-citations:0 new citation(s). File-scoped eslint on the six touched ui files: 0 errors.Generated by Claude Code