跨端: 账号徽标对齐 WebUI(中性灰胶囊 + 80px 截断,原来是被染成品牌蓝)
用户:「你自己看看跟 webui 相比,观感真的差很多」。逐字段对比卡片后找到这一处。
WebUI(`MailList.tsx:303-310`):
className="text-[10px] leading-4 px-1.5 rounded-full
bg-gray-100 text-gray-600 shrink-0 max-w-[80px] truncate"
我们原来:
.fontColor(Theme.accentFor())
.backgroundColor(Theme.accentSoftFor(this.isDarkNow)).borderRadius(4)
(没有 maxWidth)
**三处都不一样**:
· 底色/字色:品牌浅蓝 + 品牌蓝 vs **中性灰**。徽标表达的是"这条来自哪个账号",
是**中性的元信息**,不该与主操作抢注意力 —— WebUI 选 gray-100 正是这个意思。
我们把品牌色用在元信息上,等于把每一行的副标题都标成了"主操作"。
· 形状:圆角方(4) vs 全圆胶囊(rounded-full)
· 截断:原来没有 `maxWidth` —— 账号名一长就把主题挤没了(WebUI 有 `max-w-[80px]`,
而多账号正是这个徽标存在的场景,名字长是常态)。
措辞上保持"用户看到什么"这个层次:这条判的是**渲染结果**,
不是"有没有这个字段"(两端字段集本来就是一致的)。
This commit is contained in:
@ -688,10 +688,28 @@ struct InboxTab {
|
||||
Row() {
|
||||
Text(mail.from_name).fontSize(14).fontWeight(mail.status === 'unread' ? FontWeight.Bold : FontWeight.Normal).fontColor(Theme.textPrimary)
|
||||
if (this.accountFilter === 'all' && mail.source_account_name.length > 0) {
|
||||
/*
|
||||
* 账号徽标(聚合模式下才显示)—— **逐项对齐 WebUI**(`MailList.tsx:303-310`):
|
||||
*
|
||||
* className="text-[10px] leading-4 px-1.5 rounded-full
|
||||
* bg-gray-100 text-gray-600 shrink-0 max-w-[80px] truncate"
|
||||
*
|
||||
* 即:**中性灰底 + 灰字 + 全圆胶囊 + 最多 80px 截断**。
|
||||
*
|
||||
* ★ 原来写的是 `accentSoftFor`(品牌浅蓝底)+ `accentFor`(品牌蓝字)
|
||||
* + `borderRadius(4)`(圆角方)。三处都不一样:
|
||||
* · 底色:品牌浅蓝 vs 中性灰 —— 徽标被染成了"我们家的"颜色,
|
||||
* 而它表达的是"这条来自哪个账号",是**中性的元信息**,
|
||||
* 不该与主操作抢注意力(WebUI 选 gray-100 就是这个意思);
|
||||
* · 形状:圆角方 vs 全圆胶囊;
|
||||
* · 截断:原来没有 maxWidth —— 账号名一长就把主题挤没了。
|
||||
*/
|
||||
Text(mail.source_account_name)
|
||||
.fontSize(10).fontColor(Theme.accentFor())
|
||||
.backgroundColor(Theme.accentSoftFor(this.isDarkNow)).borderRadius(4)
|
||||
.padding({ left: 5, right: 5, top: 1, bottom: 1 })
|
||||
.fontSize(10).fontColor(Theme.textMuted)
|
||||
.backgroundColor(Theme.surfaceMuted).borderRadius(8)
|
||||
.padding({ left: 6, right: 6, top: 1, bottom: 1 })
|
||||
.constraintSize({ maxWidth: 80 })
|
||||
.maxLines(1).textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.margin({ left: 6 })
|
||||
}
|
||||
Blank()
|
||||
|
||||
Reference in New Issue
Block a user