Repository navigation
fix(console): a data-page filter chip on a select field shows the option label - #37285
objectstack-fleet[bot] merged 3 commits into
Conversation
…ion label (#37259) A whole-value comparand (equality, not-equals, in, not-in) on a field that declares options is drawn through translateOptions, the grid cell's path, and the matched option's label; an unmatched value and a text-operator fragment stay raw. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
…37259) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 (p1) · area a4-U · 2026-11-25T12:04Z Card #37259. Dev report: 7161424954.
Handed to the seat session for L1. |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
| # | File | Mutation | Result |
|---|---|---|---|
| A1 (the dev's) | page | return option ? optionDisplayLabel(option) : raw; → return raw; |
4 failed |
| A2 | drillUrlFilters.ts |
the word-arm draw → String(v) |
2 failed ([in], [ne]) |
| A3 | drillUrlFilters.ts |
the = arm → String(list[0][2]) |
2 failed (zh/en =) |
| A4 | drillUrlFilters.ts |
'contains' added to WHOLE_VALUE_OP_WORDS |
1 failed (the text-fragment control) |
| A5 | drillUrlFilters.ts |
'not_in' removed from WHOLE_VALUE_OP_WORDS |
99 passed, see S1 |
S1 (should-fix): the [nin] arm is advertised but not pinned.
- The changeset ("each comparand of an … membership filter") and the PR body ("each member of a membership list (
[in],[nin])") both claim it. - Ablation A5 removes
not_infrom the set and every pin stays green. - The behaviour at head is correct by reading, since
[nin]goes through the samedrawas[in]. - Fix: one
filter[category][nin]=softwarecase in theobjectstack#37259describe, expecting${packLabelOf('zh-Hans','filterBuilder.operators.not_in')} 软件. Fold it into any patch round; if none happens before landing, carry it on the follow-up card below. It does not block on its own.
N1 — exact match vs the grid's matcher:
- The labeller matches exactly. The grid's
findDeclaredOption(ui/packages/fields/src/index.tsx:805) adds a case-insensitive fallback. - So on seed data stored as
Softwareagainst a declared valuesoftware, the grid reads软件while the chip reads= Software. - The dev disclosed this and gave a reason. Conforming data cannot hit it, because
SelectOptionSchema.valueis a lowercaseSystemIdentifier. - The changeset's "the same text the grid cell shows for that value" is therefore true only for conforming data. That is acceptable, and recorded here.
N2 — the changeset's example sentence: "in zh-CN, Category = software" puts the English field label beside a zh locale. The real chip reads 产品类别 = software. This is cosmetic.
Browser repro marked NOT MEASURED (the dev cited a shared-lock hold):
- It is weighed as a low residual, not a gap. The harness renders the real
ObjectDataPageunder the realI18nProviderand packs, with an app bundle shaped{ns}.fieldOptions.{object}.{field}.{value}. - The one link left unproven is that a served bundle and
objectDefreach this page with the same shape. The card's own repro says the grid on this same screen already draws软件through the sametranslateOptionscall, which covers that link. - The zone can glance at HotCRM
product_catalog_dashboard→top_products→ 软件 → 在列表中打开 after landing. This does not block.
Changeset, sentence by sentence ('@object-ui/app-shell': patch):
- That package is
private: truebut versioned underprivatePackages.version: true; 245 changesets onmainalready name it, so this one follows practice. - Sentence 1 (bare data page, drill landing, raw value shown): true (see N2).
- Sentence 2 (equality, does-not-equal and membership drawn as the translated label, "same text as the grid cell"): true at head.
[nin]is unpinned (S1), and the grid comparison is subject to N1. - Sentence 3 (unmatched value stays raw): true and pinned.
- Sentence 4 (text filters keep their fragment, fields without options unchanged): true; both are pinned.
- Sentence 5 (boolean and lookup unchanged): true by reading.
维护者速读, sentence by sentence:
- "选择型字段的筛选标签显示选项的显示名": true. The fix in fact covers any field that declares
options, which the body's Acceptance notes also say. - "为什么做": consistent with the card's p1 rationale.
- "列表本身的筛选结果不受影响": true.
filterChipsis read only by the chip render (ObjectDataPage.tsx:1056). "Save as view" foldsurlFilterstriples, not chip text, and the droppeduseMemohas no dependents. - "要你做什么:无": correct, since nothing is governed.
Declarations:
Clause-②: no: correct.groupFilterChips/ComparandTextare internal to the private@object-ui/app-shelland absent from itssrc/index.ts. The new parameter is optional, so no accepted set or public surface widens.Metadata-protocol: none: correct. Nothing an author writes changes; the change is display only. Both lines appear in the PR body and in the changeset body.
Check-runs at eab0575f6d: 51 total, 38 success and 13 skipped, none failed or pending. Lint & Repo Gates, TypeScript Type Check and Type Check UI are all success.
Mechanics:
git merge-tree --write-tree origin/main eab0575f6dis clean (treeaa7f8be4e5).- The 15 commits on
mainsince base touch none of the 4 files, norcore/evaluator/optionRules.tsori18n/useObjectLabel.ts. - None of the 41 other open PRs touches
ObjectDataPage.tsx,drillUrlFilters.tsor the chip harness.
Dev report and zone final:
- Dev report 7161424954 (2026-11-25T11:43:53Z) and zone final 7161902302 (2026-11-25T12:05:17Z) both pin this head.
- Their readings match the seat's own re-runs. The extra
import '@objectstack/lint'is inside the declared harness, ascheck:test-source-aliasrequires.
Same-family chip and summary producers left raw, named for one follow-up card (not filed by this seat):
- (a) Lookup comparand on
/data: a dashboard drill on a lookup dimension shows the record id (ObjectDataPagechip,=/[in]arms). It needs a name resolve. - (b) Boolean comparand on
/data: shows= true/= false. The siblingFilterConditionField.describeConditionalready usesfilterBuilder.trueLabel/falseLabel. - (c)
FilterConditionField.describeCondition(ui/packages/fields/src/widgets/FilterConditionField.tsx:636, used by the report builder and the metadata-admin dataset and field inspectors): maps options to the authored label withouttranslateOptions, and draws the field label untranslated. - (d) S1's
[nin]pin, if not folded in before then. - Checked and not raw: the saved-filter and condition surfaces
plugin-listUserFiltersandListConditionsBlock, andplugin-dashboardDashboardFilterBar, all of which go throughtranslateOptions. - Checked and not a chip: the
/apps/:app/:objectequality arm (objectViewListUrlState.ts,parseUrlEqualityFilterTriples) draws no comparand chip.
Landing: the zone merges main first (K ≥ 15); a merge-only head move keeps this ACCEPT.
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Landing · area a4-U · 2026-11-25T12:43Z · head
The seat's S1 (the State change: ready for review, and auto-merge is armed. The queue lands it. On MERGED, #37259 closes through |
Fixes #37259
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
On the bare data page (
/:objectName/data?filter[...], ADR-0055), the screen a dashboard drill's "Open in list" lands on, a URL filter chip on a field that declaresoptionsdrew the stored option value (Category = software) instead of its label (软件in zh-CN).groupFilterChips(drillUrlFilters.ts) takes an optionalcomparandText(field, value)callback and draws every whole-value comparand through it: equality (= X), does-not-equal ([ne]) and each member of a membership list ([in],[nin]). The default isString(value), so every existing caller and test reads as before. Range bounds and text-operator fragments (contains,starts_with, ...) stay verbatim: a fragment names no option.ObjectDataPagepasses a labeller that reuses the grid cell's path:translateOptions(objectDef.name, field, options)fromuseObjectLabel(the callgenerateColumnsmakes for the grid), then the option whose value equals the comparand, drawn withoptionDisplayLabelfrom@object-ui/core(whatTextCellRendererdraws). A comparand that matches no declared option stays raw, so a stale or hand-edited address still shows what it filters by.useMemo, the same as the field half'sfieldLabel, so both halves of a chip read the translation catalogue at the same moment (an app bundle that loads after the first render reaches the chip too).Responsibility:
@object-ui/app-shellURL filter chips).translateOptionsover the field's declaredoptions).Read first (by risk):
ui/packages/app-shell/src/views/ObjectDataPage.tsx, thegroupFilterChips(urlFilters, ...)labeller: the field lookup, the exact-value match and the raw fallback.ui/packages/app-shell/src/views/drillUrlFilters.ts,groupFilterChips: which operators go throughcomparandText(WHOLE_VALUE_OP_WORDSplus equality) and which stay raw.ui/packages/app-shell/src/views/ObjectDataPage.filterChipI18n-9159.test.tsx, theobjectstack#37259describe.Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectDataPage.filterChipI18n-9159.test.tsxfrom the repo root; expect 17 passed, with the sevenobjectstack#37259cases among them.Tests
New top-level
describein the existing chip harnessObjectDataPage.filterChipI18n-9159.test.tsx(real page, realI18nProvider, an app bundle carryingfieldOptions.showcase_invoice.category.software = 软件):1b91538bb2)= 软件= software)= Software= software)[in], zh-Hans:属于 软件, 硬件属于 software, hardware)[ne], zh-Hans:不等于 软件不等于 software)= legacy_code包含 software= softwareThe three controls are green on both sides by design: they pin what must not change.
The harness also gains a module-top
import '@objectstack/lint', whichcheck:test-source-aliasasks of an edited test whose source reaches that dynamic import.Readings (head eab0575)
pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/ObjectDataPage.filterChipI18n-9159.test.tsx packages/app-shell/src/views/drillUrlFilters.test.ts:Test Files 2 passed (2),Tests 99 passed (99).ObjectDataPage.tsxanddrillUrlFilters.tsrestored from1b91538bb2(tree only), harness at HEAD:Tests 4 failed | 13 passed (17); the four failures are the four label cases above (expected '= software' to be '= 软件', and so on). Restored withgit checkout HEAD --:git diff HEADempty, both blobs equal to HEAD.node scripts/ablation-replace.mjsonObjectDataPage.tsx, anchorreturn option ? optionDisplayLabel(option) : raw;replaced byreturn raw;: mutation landed (anchor 1 to 0, blob1bc2af587dc6to95bff3d412e5),Tests 4 failed | 13 passed (17), the same four cases; restored, blob after restore1bc2af587dc6equal to HEAD,git diff HEADempty. The subject is imported by relative path fromsrc/, not through a packageexports, so nodist/preflight applies.packages/app-shell/src/views/ObjectDataPage*andpackages/app-shell/src/views/drill*:Test Files 16 passed (16),Tests 241 passed (241).pnpm --filter @object-ui/app-shell type-checkafterpnpm --workspace-concurrency=2 --filter "@object-ui/app-shell^..." build: exit 0.pnpm --dir ui exec vitest run --maxWorkers=2 scripts/:Test Files 172 passed | 2 skipped (174),Tests 5130 passed | 2 skipped (5132).Acceptance notes
String(option.value) === comparand). The grid'sfindDeclaredOptionadds a case-insensitive fallback for mixed-case seed data; the chip does not, because the comparand is the filter the server applies, and a label for a value that only matches case-insensitively could name an option the filter did not select.optionslist, which is the same test the grid'sTextCellRendereruses, not only toselect/multiselect/radio.= true/= false, and a lookup comparand still reads as the referenced record's id, not its name.ObjectDataPageunder real packs instead.Verification
Local gate families from
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack(38 commands) were all run on headeab0575f6dand all exit 0.check:type-check-debtre-measured inside the verification lock:0 ledger entr(ies) re-measured, 0 raw tsc error(s) total. The CI type-check programs that dispatch-gates names but cannot run locally (Type Check UI, the workspace type-check lanes) are left to this PR's check-runs.Generated by Claude Code