Repository navigation
Commit 829a45e
fix(plugin-kanban): a collapsed lane CJK title stands upright instead of turned 180 degrees (#37316)
Fixes #37274
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
中文、日文、韩文用户在看板上看到的折叠列(例如没有卡片的「已取消」)列名,从之前每个字倒立、读不出,变为每个字立着、从上往下竖排;英文列名照旧。
- 修的是用户截图报来的问题:订单看板的折叠列在中文界面下读不出是哪一列。
- 出错的话只是折叠列标题显示方式不对,不影响展开、拖拽和数据;改动只在一处样式,可直接撤回。
- 无。
## What changes
A collapsed kanban lane draws its title down a narrow spine. It was
`writing-mode: vertical-rl` plus a 180° turn (`rotate-180`). vertical-rl
already sets Han, kana and Hangul glyphs upright, so the extra turn
stood every CJK glyph on its head and the title read bottom to top. The
issue described the glyphs as lying sideways; measured in Chromium they
are upside down (180°), the same root cause.
`ui/packages/plugin-kanban/src/KanbanImpl.tsx` gains
`collapsedTitleClass(title)`:
- a title that contains Han, Hiragana, Katakana or Hangul
(`\p{Script=…}`) renders `[writing-mode:vertical-rl]
[text-orientation:upright]`, no turn: every glyph upright, top to
bottom;
- any other title keeps today's `[writing-mode:vertical-rl] rotate-180`
byte for byte (the CONTROL).
Why `upright` for the CJK arm and not simply dropping `rotate-180` for
every title (`text-orientation: mixed`): dropping the turn for all
titles would flip a Latin title from bottom-to-top to top-to-bottom,
which breaks the CONTROL. `upright` also keeps a mixed title such as 「Q3
已取消」 in one readable column instead of turning its Latin run sideways.
The swimlane collapsed header (the row header near the swimlane loop)
was checked as the triage asked: it is a horizontal row with no vertical
writing mode, so it does not have this defect shape and is unchanged.
The swimlane layout's column title row uses the same `LaneHeading`, so
it gets the fix too.
## Tests
- New pin
`ui/packages/plugin-kanban/src/__tests__/collapsedTitleCjkUpright-37274.test.tsx`:
a collapsed 「已取消」 lane carries `[writing-mode:vertical-rl]` +
`[text-orientation:upright]` and no `rotate-180`; a collapsed
`Cancelled` lane (CONTROL) keeps `[writing-mode:vertical-rl]` +
`rotate-180`. jsdom lays nothing out, so the pin reads the classes that
decide orientation.
- Red without the fix (`KanbanImpl.tsx` restored from `origin/main`
4fb03eb, then put back from HEAD, `git diff HEAD` empty and blob hash
matched): 1 failed,
`expect(element).toHaveClass("[writing-mode:vertical-rl]
[text-orientation:upright]")`.
- Green with it: 1 passed.
- Whole package at 363a53c: `type-check` exit 0, `vitest run
packages/plugin-kanban/` Test Files 88 passed (88), Tests 576 passed
(576).
## Acceptance notes
- Rendered in Chromium (Unifont, the container's only CJK font with
vertical metrics): old rule = 「已取消」 upside down, reading bottom to top;
new rule = upright, top to bottom; Latin `CANCELLED` under the old rule
reads bottom to top and is unchanged by this PR.
- The detection is per title, not per locale: a Latin title in a zh-CN
console keeps the turn, a CJK title in an en console stands upright.
## Verification
Two-minute check: open any kanban in a zh-CN console with an empty lane
that auto-collapses (or a lane authored `collapsed: true` titled 「已取消」).
Expected: the spine shows 已 / 取 / 消 upright, top to bottom; an English
collapsed lane still reads bottom to top.
Read first: `ui/packages/plugin-kanban/src/KanbanImpl.tsx` (the
`collapsedTitleClass` hunk, the only behaviour change), then the pin.
Derived gate families at 363a53c (`dispatch-gates.mjs --commands`): 38
derived, 38 run locally, all exit 0 (`check:type-check-debt` first run
exited 3, its output not retained; the re-run waited 274s on the shared
verify lock and exited 0). `--ran` reconciliation: 38 accounted, 0
NOT-MEASURED. `test:repo` and the full CI farm are left to CI.
---
_Generated by [Claude
Code](https://claude.ai/code/session_012MmDsSBHy5paNUz6zke9Re)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6210a08 commit 829a45e
3 files changed
Lines changed: 90 additions & 1 deletion
File tree
- .changeset
- ui/packages/plugin-kanban/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
647 | 667 | | |
648 | 668 | | |
649 | 669 | | |
| |||
704 | 724 | | |
705 | 725 | | |
706 | 726 | | |
707 | | - | |
| 727 | + | |
708 | 728 | | |
709 | 729 | | |
710 | 730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments