Repository navigation
Conversation
图标层 withUiStroke 把描边设为 1.75,apps/web 另有 14 处手写钉值跟随, 而直接使用 lucide 的界面仍是默认 2,同一菜单、同一侧栏里两种粗细混用。 对比整站 1.75 / 2 预览后定为 2:移除 withUiStroke 与全部 1.75 钉值, 图标层沿用 lucide 默认描边。 - ShortcutIcon 箭头头部按原 1.75 : 2 的比例改为 2 : 2.29。 - ErrorIcon 不再是例外,删除对应说明。 - README 写明笔画标准为 2,并记录输入框下方会话控件行使用 quiet。 - ui-icon-contract.test.ts 描边断言改为 2,quiet 文字触发器不要求 tone="muted"。
图标层导出 uiIconStrokeWidth = 2,所有图标层导出和自绘线框图标读取它,不把设计决策寄托在 Lucide 默认值上。 保留 withUiStroke 作为统一入口,ShortcutIcon 箭头头部按共享变量的 8/7 计算;删除 apps/web 剩余的 1.75 钉值和 Search 的重复 2 钉值。 契约测试改为读取共享变量,并覆盖直接导入 Lucide 图标时的默认描边一致性。
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Author
Type
Summary
问题:界面图标同时有两种描边。#1177 建立的图标层
@memohai/icon/ui用withUiStroke把描边设为 1.75,apps/web 另有 14 处手写:stroke-width="1.75"跟随;其余约 200 个直接使用 lucide 的文件是默认的 2。同一个侧栏、同一个菜单里两种粗细并存:改动前,聊天页有 13 个图标是 1.75、109 个是 2,设置页是 23 个对 112 个。为什么选 2:用 Inter 的实测竖笔粗细换算图标的理想描边(理想描边 = 文字竖笔 × 24 ÷ 图标尺寸):
两者整体接近持平:2 贴合最常见的按钮和导航组合,1.75 贴合 360 字重的文字。最终选 2,还因为它与 Lucide 当前默认一致,迁移成本较低。但图标标准不由第三方默认值代管:本次由图标层自己导出并读取描边变量,未来调整时有明确的工程入口。
改动
packages/icons/src/ui/index.ts:导出uiIconStrokeWidth = 2,所有图标层导出通过withUiStroke读取它,不再把设计标准寄托在 Lucide 默认值上。ShortcutIcon的箭头头部按共享变量的8/7计算,当前为 2.29,保持头部略重于箭杆。ErrorIcon也经过共享入口;其内部填充几何按当前描边 2 调整,若以后改变变量需重新校准。apps/web:删除 14 处:stroke-width="1.75",删除侧栏 Search 重复的:stroke-width="2";check-draw、share、fork-split、appearance 四个自绘线框图标的默认描边改为引用uiIconStrokeWidth。packages/icons/README.md:明确笔画由uiIconStrokeWidth统一决定;写明输入框下方的会话控件行(Computer、Folder、Agent、Permission)使用variant="quiet",只变文字颜色,不使用 ghost 底色。apps/web/src/lib/ui-icon-contract.test.ts:描边断言读取共享变量;新增一项检查,要求直接导入的 Lucide 图标的内置默认值等于该变量(lucide-vue-next 0.562 无法全局设置默认值);quiet文字触发器不再被要求额外设置tone="muted",因为 quiet 本身就是 muted-foreground 起步、hover 变 foreground。配套 PR 与不在本 PR
packages/uigitlink;合并顺序为 ui#39 → 更新本 PR 的子模块指针并复验 → 本 PR。lucide-vue-next导入的其它图标仍取 Lucide 内置默认值,目前由契约测试检查它与uiIconStrokeWidth一致;@lucide/vue迁移不在本 PR。Related Issues
Validation
自动检查(Agent 已执行)
apps/web/src/lib/ui-icon-contract.test.ts:main 上原有 2 项失败,本分支现在 3 项通过(含直接 Lucide 描边一致性检查)。node scripts/check-ui-contract.mjs:通过,保留 3 个既有 warning。pnpm --filter @memohai/web typecheck(vue-tsc):均通过。pnpm type-check、pnpm build:均通过。实际界面
宿主机 vite 指向本地 dev 后端。在同一地址
http://127.0.0.1:8212先后运行 main 和本分支,登录态和界面状态相同;深色主题,1440×900,DPR 2。依次打开 Bot 聊天页、输入框 + 菜单和设置页,统计页面上的svg[stroke-width]:未覆盖
Screenshots / Recordings
截图取自上述实际运行的界面,左(或上)为 main,右(或下)为本分支变量版。
1. 侧栏:Chat / Files / Schedule / Apps 页签,以及 New Session、Bot Settings 图标。
2. 设置页导航,包括 Keyboard Shortcuts 的
ShortcutIcon。3. 输入框:+ 按钮,以及下方 Cloud Computer、Folder、Agent 文字触发器。
4. 输入框 + 菜单:Upload、Apps 图标;当前 head 的 Apps 行尾子菜单箭头仍是 1.75,由 ui#39 处理。
Human QA