Skip to content

fix(console): data-page filter chips name lookup records and say booleans in the reader’s language; condition sentences use translated labels - #37319

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-37288-filter-chip-comparands
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-37288-filter-chip-comparands

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #37288
Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在对象数据页上,从仪表盘下钻过来的筛选标签不再显示关联记录的编号和 true/false,而是显示记录名称和当前语言的「是/否」;共享规则等处的条件句子改用翻译后的字段名和选项名。
  • 为什么做:补齐上一张「下拉选项筛选标签显示翻译名」修复留下的同类缺口,让中文用户看到的整行标签不再半中半英。
  • 出错会怎样:只影响标签上的显示文字,不改变筛选结果;读不到记录名时退回显示原编号,可以直接撤回本次改动。
  • 要你做什么:无

What changes

The /data page's URL filter chips and the read-only filter-condition sentence now draw each comparand the way the grid cell draws it:

  • (a) Lookup (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's displayField, else the target's name field via referencedRecordTitle), now exported from @object-ui/plugin-list with its two types. No new fetch path: the same find + getObjectSchema read, 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.
  • (b) Boolean (ObjectDataPage): a [bool] comparand reads as t('filterBuilder.trueLabel' | 'filterBuilder.falseLabel'), the keys FilterConditionField already uses, which are present in all locale packs. The text true on a text field is still the user's own comparand and stays raw.
  • (c) describeCondition (FilterConditionField): the read-only sentence receives the field list mapped through useSafeFieldLabel()'s fieldLabel and translateOptions for the object, so field and option labels are the translated ones, with the authored label as the fallback.
  • (d) [nin]: no code change. The arm was already correct; it is now pinned.
  • New export (the widening): @object-ui/plugin-list adds useLookupValueNames and its two types, LookupValueName and NamedCondition, to its package entry (ui/packages/plugin-list/src/index.tsx, +6). Nothing is removed or renamed. The changeset declares Clause-②: yes (widening) at patch for all three packages. This follows AGENTS.md (Post-Task Checklist step 3: "a non-protocol change, widening or breaking, ships patch"; Metadata-protocol: none takes patch) and the precedents on main: .changeset/35053-lookup-label-namefield.md (referencedRecordTitle, a new @object-ui/core export, 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/core subpath, patch).
  • drillUrlFilters.ts: doc comments only. ComparandText / FilterChip now 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 describe per 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|false in zh, true in en with the packs differing, CONTROL for the word true on 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 empty git diff HEAD)

Leg Mutation Red (observed)
A1 (a) drop the lookupNameOf lookup in the page's comparandText 3 lookup pins plus the mixed unnamed-id control, which also asserts a named member. The failed-read control stays green.
A2 (b) drop the boolean line the 3 boolean pins. The text-field control stays green.
A3 (d) remove not_in from WHOLE_VALUE_OP_WORDS the 2 [nin] pins. The raw-member control stays green.
A4 (c) pass the untranslated fields to describeFilterGroup the zh pin and both zh controls (each asserts the translated field label). The en pin stays green.
A5 (c) drop only the translateOptions mapping the zh pin alone. The option half is pinned separately from the field half.

Every subject is imported from source (./ObjectDataPage, ../../index), so no leg depends on a dist/ rebuild.

Acceptance notes

  • The record name comes from referencedRecordTitle (core's ADR-0079 ladder), which the list's condition chips use. The grid cell's useLookupName resolves through getRecordDisplayName on 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.
  • A user-type field without a declared reference still shows the raw id, the same as the list's own chip (useLookupValueNames reads only reference). Noted, not filed.
  • The editable FilterBuilder inside FilterConditionField still 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:

  1. ui/packages/app-shell/src/views/ObjectDataPage.tsx: the new lookupChipFields / lookupNameOf block and the comparandText callback. Risk: hook placement (unconditional, before any return) and the source-condition exclusion.
  2. ui/packages/fields/src/widgets/FilterConditionField.tsx: the wordFields mapping in the read-only branch.
  3. 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. Expect Test Files 2 passed, Tests 36 passed.

All readings below were taken at head e988464d4, on a shared box. Head 8534111c6 changes only the changeset's Clause-②: line and its export sentence. On that head: check-empty-changeset, check-changeset-no-major and check-adr-0087-registration each exit 0, and overlap-check is clean against origin/main d88c41e 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 ObjectDataPage or drillUrlFilters, every FilterConditionField* test in fields, and every plugin-list test that names useLookupValueNames / ListConditionControls: Test Files 48 passed (48), Tests 708 passed (708). The full app-shell / fields / plugin-list suites are left to CI's Test 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-shell ran both tsc programs (tsc --noEmit and tsconfig.test.json) for each of the three packages: Tasks: 73 successful, 73 total, lock VERDICT command-exit 0.

Derived gate families (dispatch-gates --commands): 38 derived, 38 run, 0 NOT-MEASURED
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0

check:type-check-debt was 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). Also pnpm --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

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 8534111c6302ee7bbdc0a2f9d0e3b193dcd27fc9
Local-runs: none
Scope: ui/packages/plugin-list/src/index.tsx + ui/packages/plugin-list/src/conditions/ListConditionControls.tsx (the declarations it re-exports, read at this head)
Security-touching: no
Rule-change-verified: none

① Derived judgments

  • The @object-ui/plugin-list package entry gains three names, all re-exported from existing module code with no behaviour change:
    • useLookupValueNames, a function (ListConditionControls.tsx:298);
    • LookupValueName, a type: (field: string, id: string) => string | undefined (:83);
    • NamedCondition, an interface (:274).
  • The two types are what the hook's signature reaches, so exporting them with it is right. Without them the published hook would expose types a caller could not name.
  • Nothing on the entry is removed or renamed. No accept set narrows. This is a pure widening, and Clause-②: yes (widening) names it correctly.

② Semver level

  • All three packages ship patch, and the changeset carries Clause-②: yes (widening) with the three names and Metadata-protocol: none. This matches AGENTS.md's Post-Task Checklist step 3 as the PR body quotes it: "a non-protocol change, widening or breaking, ships patch".
  • Three merged precedents agree, each a new @object-ui/* export shipped as patch: .changeset/35053-lookup-label-namefield.md, .changeset/35033-form-recomputes-formulas.md and .changeset/33581-plugin-detail-core-subpath.md.

③ Boundary flags

  • The report has no open_questions.
  • The dev flagged two out-of-scope findings, both read from code only: the editable FilterBuilder's labels, and a user field with no reference. Neither touches this declaration. The seat handles both at ACCEPT under the filing gate.
  • SQL push-down: the hook reads the referenced records by id through the data source's find, the same read the list's own chips already make. It is not a new in-app join, so there is no finding.

Implemented-by: claude/issue-37288-filter-chip-comparands
Reviewed-by: session_012MmDsSBHy5paNUz6zke9Re

No must-fix, no should-fix.

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re

席位核对

ACCEPT · 2026-11-25T15:52Z · head 8534111c6302ee7bbdc0a2f9d0e3b193dcd27fc9 · L1 by the dispatching seat. L2 at TIER_DEFAULT (owed by Clause-②: yes (widening) alone): PASS 7166974582 on this head.

  • Shape: l1-face reads CLEAN. The PR is a draft against main, its first line closes Filter chips and condition summaries still draw raw comparands: lookup ids, booleans, untranslated option labels, and an unpinned [nin] arm #37288, and it delivers items (a)–(d) in full (the card's split rule for (a) did not fire). No other card is bound, and there is no releases path.
  • Declaration: the claim was amended to Clause-②: yes (widening) once the diff showed the @object-ui/plugin-list entry gaining useLookupValueNames, LookupValueName and NamedCondition. The PR body and changeset now match. All three packages ship patch, per AGENTS.md and three merged precedents (L2 ②).
  • Diff read (ObjectDataPage.tsx):
    • A [bool] comparand reads t('filterBuilder.trueLabel' | 'falseLabel').
    • A lookup comparand reads useLookupValueNames, the read the list's own chips already make, so there is no new fetch path. It keeps the raw id while that read is in flight, when it fails, or when it names nothing. The record-trail source condition stays out of the read.
    • An options comparand keeps PR fix(console): a data-page filter chip on a select field shows the option label #37285's translateOptions path.
    • FilterConditionField's read-only sentence now uses fieldLabel and translateOptions. [nin] needed no code and is pinned.
  • Pins: 16 new top-level describes in en and zh, each with a raw-fallback control. The dev ran ablations A1–A5 with ablation-replace.mjs and a blob-equality restore; every leg turned its pins red.
  • Changeset: one file, read sentence by sentence; each sentence matches the diff, the export sentence included.
  • Gates (check-runs at this head): 46 success, 15 expected skip, 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check are both success. mergeable_state is clean.
  • Landing reads: check-governed-merges --pr 37319 reads NOT governed (0 of 7 paths), 369 changed lines. K = 6 (merge-base 08bf7d2 to origin/main, first parent), and nothing merged since then touches the changed files.
  • Deviations accepted: three WIP pushes went out before overlap-check ran; it ran clean on the final head. One commit was amended before its first push, at the pre-push hook's refusal.
  • Out of scope (both as Acceptance notes; neither is filed, because both were read from code only and filing gate ① needs a measured reach):
    • The editable FilterBuilder inside FilterConditionField still receives authored labels.
    • A user field with no declared reference keeps the raw id on a chip.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · os-lizheng · session_012MmDsSBHy5paNUz6zke9Re

Landing (2026-11-25T15:54Z): head 8534111c6302ee7bbdc0a2f9d0e3b193dcd27fc9, on L1 ACCEPT 7167407125 and the same-head L2 PASS 7166974582 (TIER_DEFAULT, Clause-②: yes (widening)).

Probe Reading
check-governed-merges.mjs --pr 37319 NOT governed: 0 of 7 paths hit the register; 369 changed lines, under the human-merge threshold
Check-runs at this head 46 success · 15 expected skip · 0 failed · 0 pending
Landing K 6 (git, first parent from merge-base 08bf7d2); under 15, so no main merge

State: pr_ready + automerge_enable; #37288 closes on merge through Fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter chips and condition summaries still draw raw comparands: lookup ids, booleans, untranslated option labels, and an unpinned [nin] arm

2 participants