Repository navigation
fix(components, plugin-list, i18n): sort directions read by field type — size for numbers on the builder and the phone sheet - #37049
Conversation
…irection as size SortBuilder kept its own direction table that knew only date and datetime, so a number, percent, progress or currency level read A to Z while the list's sort chip read Low to High. The wording now lives beside SortBuilder (sortWording + sortDirectionLabel over the listConditions.sort keys) and the list conditions read it from there. Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW
… to SortBuilder The list's sortDirectionLabel had no non-test caller; its only live reader of these rows is SortBuilder now, so the copy and its defaults rows go. Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW
|
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW Final green head for L1 (2026-11-24T19:56Z):
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…ds left to right; pin the pack wording Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW
|
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW Final green head for delta L1 (2026-11-24T21:33Z):
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW Landing (2026-11-24T21:35Z) — head
State change: ready for review + auto-merge armed; the merge queue lands it. On MERGED, #37027 closes by |
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes #37027
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
SortBuilder(ui/packages/components/src/custom/sort-builder.tsx) had its own direction table that knew onlydate/datetime, so every other type read "A → Z". It now words a level by a module-localsortWording+sortDirectionLabel(no new package export): date-like types (FILTER_DATE_LIKE_TYPES: date, datetime, time) read as time, the spec's numeric family (FILTER_NUMBER_LIKE_TYPES: number, currency, percent, rating, slider, progress, summary) plus boolean as size, anything else as the alphabet, over thelistConditions.sort.{time,size,alphabet}_{asc,desc}rows every locale already carries. No i18n key is added.ui/packages/plugin-list/src/phone/PhoneListPanels.tsx) had the same date-only table oversortBuilder.*keys. They now readsortDirectionLabelfromplugin-list'sconditions/conditionModel.ts(an internal module, not a package export), with the same rule and the same keys. The list's formersortWording/ListConditionControls.sortDirectionLabelpair, which had no non-test caller, is folded into that helper.@object-ui/componentsand inplugin-list's condition model, over the same@object-ui/typeslists and the same locale rows; each copy carries a comment pointing at its twin. One copy would need a new published export from@object-ui/componentsor@object-ui/types, which would make thisClause-②: yes (widening). Both copies are pinned for number, progress, percent, currency, boolean, time, date and text, so the two cannot drift apart unnoticed.@object-ui/i18n, Arabic:listConditions.sort.alphabet_asc/alphabet_descread "A ← Z" / "Z ← A". A run of two Latin letters stays left to right on a right-to-left page, so ascending displayed as Z to A; this PR is the first to show those rows, so they now read "A → Z" / "Z → A". The key set is unchanged.sortBuilder.ascending/descending/oldestFirst/newestFirstrows are no longer read by either surface (plugin-list's provider-less defaults drop them). The locale rows stay in the published packs: removing them would be a narrowing. A host that overrode them now overrideslistConditions.sort.*.origin/mainmerged in (merge commit 597bdd4).Tests
ui/packages/components/src/__tests__/sort-builder-date-direction-duplicates-27520.test.tsx: number, progress, percent and currency rows offer "Low → High" / "High → Low"; boolean reads as size and time as time; CONTROL: date keeps time and text keeps the alphabet. Under the realI18nProvider: zh number and progress rows read 「小 → 大」 / 「大 → 小」, and ar text rows read "A → Z" / "Z → A". These replace the removed plugin-list unit test of the dead helper.ui/packages/plugin-list/src/__tests__/ListView.phonePanels-35884.test.tsx, on the real phoneListView: number, progress, percent, currency and boolean levels read "Low → High", a time level reads as time; CONTROL: date as time, text as the alphabet.Acceptance notes
showcase_task(Console fromui/source via Vite against a private backend): desktop sort builder options forestimate_hoursandprogressread["小 → 大","大 → 小"]anddue_datereads["最早 → 最新","最新 → 最早"]. At phone width (390 px), a newestimate_hoursorprogresslevel reads 「小 → 大」.Verification
Head f1c5804: tests, fails-before, ablation, typecheck
cd ui && pnpm exec vitest run --maxWorkers=2 packages/plugin-list/src/__tests__/ListView.phonePanels-35884.test.tsx packages/plugin-list/src/conditions packages/components/src/__tests__/sort-builder packages/i18n/src/__tests__/all-locales-key-parity.test.ts: VERDICT command-exit 0, Test Files 7 passed (7), Tests 167 passed (167).sort-builder.tsxat origin/main bytes): command-exit 1, the numeric case red; controls green.PhoneListPanels.tsxandconditionTranslations.tsat origin/main bytes): command-exit 1, number / progress / percent / currency red; controls green.ar.tspair back to "A ← Z" / "Z ← A" throughscripts/ablation-replace.mjs, landing confirmed injected=1 fixed=0;@object-ui/i18nresolves tosrcin the ui vitest config): the ar case is red; restored from HEAD, hash equal, tree clean.pnpm --filter @object-ui/plugin-list --filter @object-ui/components --filter @object-ui/i18n run type-check: command-exit 0, all three Done.Head f1c5804: gates
dispatch-gates --ran: 38 derived families, 38 run, 0 not measured, all exit 0 (includingpnpm --dir ui exec vitest run scripts/: 172 files passed, 2 skipped).check:i18n-keys0,check:i18n-drift0,check:i18n-dead-keys0 (report lists the four unreadsortBuilder.*direction rows).🤖 Generated with Claude Code
https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW