You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9c5fb3e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(components, plugin-list, i18n): sort directions read by field type — size for numbers on the builder and the phone sheet (#37049)
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes#37027
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 列表「全部排序层级」和手机上的排序面板里,数字、百分比、进度、金额、布尔字段的方向选项从「A → Z / Z → A」改为「小 → 大 /
大 → 小」;日期与时间仍按「最早 → 最新」,文本仍按字母序;阿拉伯语的字母序方向不再显示反了。
- 列表页重做专题的里程碑验收发现的显示错误,让排序方向的说法与字段类型一致。
- 出错时只是方向文字不对,排序结果本身不变;可直接撤回。
- 无
## What changes
- `SortBuilder` (`ui/packages/components/src/custom/sort-builder.tsx`)
had its own direction table that knew only `date` / `datetime`, so every
other type read "A → Z". It now words a level by a module-local
`sortWording` + `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 the
`listConditions.sort.{time,size,alphabet}_{asc,desc}` rows every locale
already carries. No i18n key is added.
- The phone sort sheet's levels
(`ui/packages/plugin-list/src/phone/PhoneListPanels.tsx`) had the same
date-only table over `sortBuilder.*` keys. They now read
`sortDirectionLabel` from `plugin-list`'s `conditions/conditionModel.ts`
(an internal module, not a package export), with the same rule and the
same keys. The list's former `sortWording` /
`ListConditionControls.sortDirectionLabel` pair, which had no non-test
caller, is folded into that helper.
- Trade-off, stated: the rule lives twice, module-local in
`@object-ui/components` and in `plugin-list`'s condition model, over the
same `@object-ui/types` lists 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/components` or `@object-ui/types`,
which would make this `Clause-②: 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_desc` read "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.
- The four `sortBuilder.ascending/descending/oldestFirst/newestFirst`
rows 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
overrides `listConditions.sort.*`.
- Visible wording that moves with the source rows: Japanese and Korean
dates read 「古い → 新しい」 / 「오래된 순 → 최신 순」 (were 「古い順」 / 「오래된 순」), Russian
dates "Старые → Новые" (was "Сначала старые") and Russian text "А → Я"
(was "A → Z").
- `origin/main` merged 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 real `I18nProvider`: 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 phone `ListView`: 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
- Browser check, showcase app, zh-CN, `showcase_task` (Console from
`ui/` source via Vite against a private backend): desktop sort builder
options for `estimate_hours` and `progress` read `["小 → 大","大 → 小"]` and
`due_date` reads `["最早 → 最新","最新 → 最早"]`. At phone width (390 px), a new
`estimate_hours` or `progress` level reads 「小 → 大」.
## Verification
<details><summary>Head f1c5804: tests, fails-before, ablation,
typecheck</summary>
- `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).
- Fails-before, SortBuilder (`sort-builder.tsx` at origin/main bytes):
command-exit 1, the numeric case red; controls green.
- Fails-before, phone (`PhoneListPanels.tsx` and
`conditionTranslations.ts` at origin/main bytes): command-exit 1, number
/ progress / percent / currency red; controls green.
- Ablation of the Arabic fix (`ar.ts` pair back to "A ← Z" / "Z ← A"
through `scripts/ablation-replace.mjs`, landing confirmed injected=1
fixed=0; `@object-ui/i18n` resolves to `src` in 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.
</details>
<details><summary>Head f1c5804: gates</summary>
- `dispatch-gates --ran`: 38 derived families, 38 run, 0 not measured,
all exit 0 (including `pnpm --dir ui exec vitest run scripts/`: 172
files passed, 2 skipped).
- i18n: `check:i18n-keys` 0, `check:i18n-drift` 0,
`check:i18n-dead-keys` 0 (report lists the four unread `sortBuilder.*`
direction rows).
- overlap-check before the push: VERDICT clean exit 0.
- CI check-runs on f1c5804: 45 success, 13 skipped, none failing.
</details>
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(components, plugin-list): the sort builder and the phone sort sheet word a number, percent, progress or currency direction as size
8
+
9
+
Clause-②: no
10
+
Metadata-protocol: none
11
+
12
+
A sort level on a numeric field read "A → Z" / "Z → A" in the sort builder (the list's "All sort levels" panel) and in the phone sort sheet's levels, while a date read "Oldest → Newest". Numeric, percent, progress, currency, rating and boolean levels now read "Low → High" / "High → Low" (zh: 「小 → 大」 / 「大 → 小」), date, datetime and time levels read as time, and text keeps the alphabet, on both surfaces. The words come from the `listConditions.sort.*` rows every locale already carries.
13
+
14
+
What else a reader sees change:
15
+
16
+
- The four `sortBuilder.ascending`, `sortBuilder.descending`, `sortBuilder.oldestFirst` and `sortBuilder.newestFirst` rows are no longer read by either surface; the rows stay in the packs. A host that overrode them to reword a sort direction now overrides `listConditions.sort.alphabet_asc` / `alphabet_desc` / `time_asc` / `time_desc` (and `size_asc` / `size_desc` for numbers) instead.
17
+
- Because the words now come from `listConditions.sort.*`, the date and text wording changes in some locales: Japanese and Korean dates read 「古い → 新しい」 / 「오래된 순 → 최신 순」 instead of 「古い順」 / 「오래된 순」, Russian dates read "Старые → Новые" instead of "Сначала старые", and Russian text reads "А → Я" instead of "A → Z".
18
+
- Arabic: the `listConditions.sort.alphabet_asc` / `alphabet_desc` pair now reads "A → Z" / "Z → A". A run of two Latin letters stays left to right on a right-to-left page, so the old "A ← Z" showed ascending as Z to A.
0 commit comments