From ad1f9e76e5808b131b438553679f80b204517676 Mon Sep 17 00:00:00 2001 From: Rick Ye Date: Fri, 11 Sep 2026 11:33:08 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=8A=B6=E6=80=81=E8=83=B6=E5=9B=8A?= =?UTF-8?q?=E9=99=8D=E5=99=AA=E9=87=8D=E6=9E=84=E2=80=94=E2=80=94=E4=B8=AD?= =?UTF-8?q?=E6=80=A7=E5=BA=95+tone=20=E8=89=B2=E7=82=B9=EF=BC=9BB2=20?= =?UTF-8?q?=E5=8F=B3=E5=AF=B9=E9=BD=90=E6=A0=87=E9=A2=98=E6=A0=8F=EF=BC=9B?= =?UTF-8?q?B3=20=E6=B5=AE=E5=8A=A8=E9=92=AE=E6=8C=AA=E5=88=B0=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E5=88=97=E5=8F=B3=E4=B8=8A=E8=A7=92=E5=90=91=E4=B8=8B?= =?UTF-8?q?=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/renderer/src/components/TitleBar.tsx | 4 +-- .../src/plugins/PluginFloatingCapsules.tsx | 32 ++++++++----------- .../src/plugins/PluginStatusCapsules.tsx | 30 +++++++++-------- docs/plugins.md | 2 +- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/apps/desktop/src/renderer/src/components/TitleBar.tsx b/apps/desktop/src/renderer/src/components/TitleBar.tsx index 7eed37a..cdd1f86 100644 --- a/apps/desktop/src/renderer/src/components/TitleBar.tsx +++ b/apps/desktop/src/renderer/src/components/TitleBar.tsx @@ -27,8 +27,8 @@ export function TitleBar({ return (
{name || '新会话'}
- {extra} -
+ {extra &&
{extra}
} +
- {detailOpen && item.detail && ( - - )} + {detailOpen && item.detail && }
) })} @@ -102,14 +98,14 @@ export function PluginFloatingCapsules({ setOpen((v) => !v) setDetailKey(null) }} - className="relative flex size-9 items-center justify-center rounded-full border border-line bg-surface text-ink-2 shadow-raised transition-transform hover:text-ink active:scale-95" + className="relative flex size-8 items-center justify-center rounded-full border border-line bg-surface text-ink-2 shadow-btn transition-transform hover:text-ink active:scale-95" > {entries[0]?.item.icon ? ( - + ) : ( - + )} - + {entries.length} diff --git a/apps/desktop/src/renderer/src/plugins/PluginStatusCapsules.tsx b/apps/desktop/src/renderer/src/plugins/PluginStatusCapsules.tsx index f21a420..4e36cb8 100644 --- a/apps/desktop/src/renderer/src/plugins/PluginStatusCapsules.tsx +++ b/apps/desktop/src/renderer/src/plugins/PluginStatusCapsules.tsx @@ -11,14 +11,7 @@ import type { ReactNode } from 'react' import type { PluginStatusEntry } from '@shared/types' import { PluginIconValue } from './plugin-icons' -export const TONE_CLASS: Record = { - default: 'border-line text-ink-2', - accent: 'border-accent/40 text-accent-ink bg-accent-tint', - warn: 'border-orange/40 text-orange bg-orange-tint', - danger: 'border-red/40 text-red bg-red-tint' -} - -const BADGE_TONE_CLASS: Record = { +export const BADGE_TONE_CLASS: Record = { default: 'bg-hover text-ink-3', accent: 'bg-accent-tint text-accent-ink', warn: 'bg-orange-tint text-orange', @@ -87,6 +80,14 @@ export function StatusPopover({ ) } +/** 胶囊前导色点:tone 的安静表达(胶囊底保持中性,不整块染色) */ +export const TONE_DOT_CLASS: Record = { + default: 'bg-ink-3', + accent: 'bg-accent', + warn: 'bg-orange', + danger: 'bg-red' +} + export function PluginStatusCapsules({ entries, onOpenView @@ -122,7 +123,7 @@ export function PluginStatusCapsules({ if (entries.length === 0) return null return ( -
+
{entries.slice(0, 4).map(({ pluginId, itemId, item }) => { const tone = item.tone ?? 'default' const key = `${pluginId}:${itemId}` @@ -138,11 +139,14 @@ export function PluginStatusCapsules({ if (item.detail) setOpenKey(open ? null : key) else if (item.openView) onOpenView(item.openView.view, item.openView.params) }} - className={`flex max-w-44 shrink-0 items-center gap-1 rounded-full border px-2.5 py-0.5 text-[11px] leading-[18px] transition-transform ${ - TONE_CLASS[tone] ?? TONE_CLASS.default - } ${clickable ? 'hover:opacity-80 active:scale-[0.97]' : 'cursor-default'} ${open ? 'opacity-80' : ''}`} + className={`flex max-w-44 shrink-0 items-center gap-1.5 rounded-full border border-line bg-surface px-2 py-0.5 text-[11px] leading-[18px] text-ink-2 transition-colors ${ + clickable ? 'cursor-pointer hover:border-line-strong hover:text-ink' : 'cursor-default' + } ${open ? 'border-line-strong text-ink' : ''}`} > - {item.icon && } + + {item.icon ? ( + + ) : null} {item.text} {open && item.detail && } diff --git a/docs/plugins.md b/docs/plugins.md index 9b7bad0..104ebaf 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -174,7 +174,7 @@ api.ui.onSettingsAction((key) => {}) // button 条目点击回调(key = 按钮 | 深链 | `openView(view, params)`(main 侧 IPC 广播 / 页侧桥直通) | ✅ | | 工具栏按钮(B5) | `registerToolbarButton` 数据已通,Composer 工具行渲染 | ⏳ 下版本 | | 聊天流富组件(B4) | ```类型``` 围栏块 → 宿主元组件(data-table/stat-grid/step-list/kv-card) | ⏳ 下版本 | -| 聊天区浮动胶囊(B3) | 与 B2 同源数据:聊天列右下角折叠圆钮(计数徽标),展开为纵向胶囊堆栈,detail 弹层/深链与 B2 一致 | ✅ | +| 聊天区浮动胶囊(B3) | 与 B2 同源数据:聊天列右上角折叠圆钮(计数徽标),展开为纵向胶囊堆栈,样式/弹层/深链与 B2 一致 | ✅ | ## 交互基线