Skip to content

fix(ui): 徽章补 whitespace-nowrap 防止中文逐字竖排 (#156) - #158

Merged
fxbin merged 1 commit into
mainfrom
issue-156-badge-nowrap
Oct 25, 2026
Merged

fxbin merged 1 commit into
mainfrom
issue-156-badge-nowrap

Conversation

@fxbin

@fxbin fxbin commented Oct 25, 2026

Copy link
Copy Markdown
Owner

变更内容

修复后台列表「状态」列中文徽章(如"已分析")被压成逐字竖排胶囊链的问题。分支 issue-156-badge-nowrap ↔ issue #156。

根因:AdminTable 为 table-layout: auto,列定义的 width 只是分配提示;共享 Badge 原语缺 whitespace-nowrap,中文逐字断行后 min-content 为 1 字宽,标题列 nowrap 长文占走弹性空间时状态列被压穿。英文状态值(SUCCESS 等)不逐字断行,故仅中文徽章页面暴露。

修复:Badge 基类补 whitespace-nowrap,一处覆盖内容列表、任务页中文徽章、信源页等全部同类隐患;新增 Badge.test.ts 渲染断言(含调用方覆盖 className 时仍保留 nowrap)。

Verification

命令 结果
cd frontend && npx tsc --noEmit 通过
cd frontend && npm run test:coverage 33 个测试文件 288 测试全绿(含新增 Badge.test.ts 2 例)

Closes #156

@fxbin
fxbin merged commit 30887ce into main Oct 25, 2026
8 checks passed
@fxbin
fxbin deleted the issue-156-badge-nowrap branch October 25, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

后台列表状态徽章被自动列宽压成逐字竖排

1 participant