From c4f7f794eee71d945c9e242b239e12781dfd3479 Mon Sep 17 00:00:00 2001 From: GOXF <131693427+GOXF@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:12:49 +0000 Subject: [PATCH 1/6] =?UTF-8?q?goxf(mock):=20v34=20=E7=BE=A4=E8=81=8A?= =?UTF-8?q?=E9=A1=B5=E6=8D=A2=E7=9A=AE=E5=89=8D=E5=90=8E=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=EF=BC=88BoardUI=20=E9=A3=8E=E6=A0=BC=EF=BC=8C=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E5=9B=BE=E4=B8=93=E7=94=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/mock/mocks/v34-reskin-board.css | 92 +++++++++++++++++++ .../src/mock/mocks/v34-reskin-room.tsx | 50 ++++++++++ src/renderer/src/mock/registry.ts | 5 +- 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 src/renderer/src/mock/mocks/v34-reskin-board.css create mode 100644 src/renderer/src/mock/mocks/v34-reskin-room.tsx diff --git a/src/renderer/src/mock/mocks/v34-reskin-board.css b/src/renderer/src/mock/mocks/v34-reskin-board.css new file mode 100644 index 0000000..9b12cfe --- /dev/null +++ b/src/renderer/src/mock/mocks/v34-reskin-board.css @@ -0,0 +1,92 @@ +/* + * v34 效果图专用:BoardUI 风格皮肤(只在 .goxf-skin-board 范围内生效,不进应用)。 + * 做法 = 「换皮不换组件」:只改 token 值 + 少量组件级规则,组件代码一行不动。 + * 数值参考 BoardUI 免费版(MIT)styles/theme.css;开工后并入 globals.css / goxf-scale.css。 + */ +.goxf-skin-board { + /* 中性色:BoardUI neutral 阶梯(950/600/500/400,200 线,100 底) */ + --color-canvas: #f7f7f7; + --color-main: #f7f7f7; + --color-surface: #ffffff; + --color-surface-hover: #f7f7f7; + --color-bubble: transparent; + --color-bubble-user: #ffffff; + --color-hover: rgb(10 10 10 / 0.05); + --color-active: rgb(10 10 10 / 0.08); + --color-sunken: #ebebeb; + --color-line: #ebebeb; + --color-line-strong: #e5e5e5; + --color-ink: #0a0a0a; + --color-ink-secondary: #525252; + --color-ink-muted: #737373; + --color-ink-faint: #a3a3a3; + /* 阴影:BoardUI 6%/10% 配方 + 1px 接触影 + 侧栏三层 */ + --shadow-hairline: 0 0 0 1px rgb(0 0 0 / 0.05); + --shadow-soft: 0 1px 1px 0 rgb(0 0 0 / 0.05); + --shadow-card: 0 1px 2px 0 rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1); + --shadow-float: 0 1px 0 0 rgb(0 0 0 / 0.02), 0 1px 12px 0 rgb(0 0 0 / 0.06), 0 0 1px 0 rgb(0 0 0 / 0.32); + --shadow-pop: 0 1px 1px 0 rgb(0 0 0 / 0.04), 0 4px 4px 0 rgb(0 0 0 / 0.02), 0 0 1px 0 rgb(0 0 0 / 0.32); + --shadow-dialog: 0 0 6px 0 rgb(0 0 0 / 0.06), 0 0 64px 0 rgb(0 0 0 / 0.16), 0 0 1px 0 rgb(0 0 0 / 0.32); + --gradient-primary: linear-gradient(180deg, var(--color-accent-500) 0%, var(--color-accent-600) 100%); + --gradient-primary-hover: linear-gradient(180deg, var(--color-accent-400) 0%, var(--color-accent-500) 100%); + --shadow-primary: 0 1px 2px 0 rgb(0 0 0 / 0.18), inset 0 1px 0 0 rgb(255 255 255 / 0.25); + --color-bubble-user-ink: var(--color-ink); +} +[data-theme='dark'] .goxf-skin-board { + --color-canvas: #121212; + --color-main: #171717; + --color-surface: #262626; + --color-surface-hover: #2e2e2e; + --color-bubble: transparent; + --color-bubble-user: #262626; + --color-hover: rgb(250 250 250 / 0.06); + --color-active: rgb(250 250 250 / 0.1); + --color-sunken: #262626; + --color-line: #262626; + --color-line-strong: #404040; + --color-ink: #fafafa; + --color-ink-secondary: #a3a3a3; + --color-ink-muted: #8a8a8a; + --color-ink-faint: #525252; + --shadow-hairline: 0 0 0 1px rgb(255 255 255 / 0.06); + --shadow-soft: 0 1px 1px 0 rgb(0 0 0 / 0.3); + --shadow-card: 0 1px 2px 0 rgb(0 0 0 / 0.4), inset 0 1px 0 0 rgb(255 255 255 / 0.04); + --shadow-float: 0 1px 12px 0 rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.06); + --shadow-pop: 0 4px 12px 0 rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.08); + --shadow-primary: 0 1px 2px 0 rgb(0 0 0 / 0.4), inset 0 1px 0 0 rgb(255 255 255 / 0.18); +} + +/* 自己的气泡:深色实心 → 白卡 + 接触影(BoardUI 用户消息样式) */ +.goxf-skin-board .bg-bubble-user { + color: var(--color-bubble-user-ink); + box-shadow: var(--shadow-card); +} +/* 成员回复:去气泡,正文直接排在名字下(BoardUI 助手消息样式) */ +.goxf-skin-board .bg-bubble.px-4 { + padding-inline: 0; +} +/* 自己气泡里的 @成员:反白胶囊 → 浅强调胶囊 */ +.goxf-skin-board .bg-bubble-user .text-main { + background-color: var(--color-accent-50); + color: var(--color-accent-700); +} +[data-theme='dark'] .goxf-skin-board .bg-bubble-user .text-main { + color: var(--color-accent-400); +} +/* 主按钮 / 发送:纯色 → 上浅下深渐变 + 顶部高光 */ +.goxf-skin-board .bg-accent-600 { + background-image: var(--gradient-primary); + box-shadow: var(--shadow-primary); +} +.goxf-skin-board .bg-accent-600:hover { + background-image: var(--gradient-primary-hover); +} +/* 输入框:去描边,白色胶囊 + 柔影 */ +.goxf-skin-board form.border-line-strong, +.goxf-skin-board .border-line-strong.shadow-card { + border-color: transparent; + box-shadow: var(--shadow-card); +} + +/* 效果图专用:假群没有真账号,隐藏「成员掉线」提示(前后两张都隐藏) */ +.v34-frame [role='status'].animate-step-in { display: none; } diff --git a/src/renderer/src/mock/mocks/v34-reskin-room.tsx b/src/renderer/src/mock/mocks/v34-reskin-room.tsx new file mode 100644 index 0000000..ad26e15 --- /dev/null +++ b/src/renderer/src/mock/mocks/v34-reskin-room.tsx @@ -0,0 +1,50 @@ +import './v34-reskin-board.css' +import type { CollabRoom, RoomMember, RoomMessage } from '@/rooms/model' +import { useEffect } from 'react' +import { setRoomDraft } from '@/rooms/roomComposerEvents' +import { RoomView } from '@/rooms/RoomView' +import { useRooms } from '@/rooms/roomStore' +import { useBotStore } from '@/store/botStore' + +/** + * v34 界面换皮:群聊页「现在」vs「BoardUI 风格」。 + * 两张都是真 RoomView(同一份假群数据);「BoardUI 风格」只是外面包了 .goxf-skin-board, + * 改的是 token 值和少量组件级规则(见 v34-reskin-board.css),组件代码不动。 + */ +const member = (botId: string, name: string): RoomMember => + ({ botId, name, accountId: `acc-${botId}`, platform: 'meta-muse', cursor: 0 } as RoomMember) +const MEMBERS = [member('a', 'Claude'), member('b', 'GPT'), member('c', 'Hark')] +const at = new Date(2026, 11, 3, 17, 40).getTime() +const MESSAGES: RoomMessage[] = [ + { id: 'h1', author: 'User', text: '@Claude 本地存储用 SQLite 还是 IndexedDB?给结论和理由。', createdAt: at }, + { id: 'r1', author: 'Claude', authorBotId: 'a', createdAt: at + 60_000, + text: '结论:用 SQLite(better-sqlite3,放主进程)。\n\n1. 群聊消息量大,要按群、按时间查,SQL 索引更省事;\n2. 主进程统一读写,多窗口不会互相覆盖;\n3. 备份就是拷一个文件。' }, + { id: 'h2', author: 'User', text: '@GPT 评审一下,有没有坑?', createdAt: at + 120_000 }, + { id: 'r2', author: 'GPT', authorBotId: 'b', createdAt: at + 180_000, + text: '两个坑:原生模块要按 Electron 版本重编;便携版要把数据库放在 BotArkData 里,别写进程序目录。' } +] +const roomFor = (id: string): CollabRoom => + ({ id, title: '架构评审', mode: 'manual', limit: 8, brief: '', members: MEMBERS, messages: MESSAGES } as unknown as CollabRoom) + +const IDS = ['mock-v34-before', 'mock-v34-after'] +useRooms.setState((s) => ({ + rooms: [...IDS.map(roomFor), ...s.rooms.filter((r) => !IDS.includes(r.id))], +})) +useBotStore.setState({ infoPanelOpen: false }) + +function Frame({ id, skin }: { id: string; skin?: boolean }) { + useEffect(() => { + const t = setTimeout(() => setRoomDraft(id, '@Hark 汇总一下两位的意见,给最终方案'), 50) + return () => clearTimeout(t) + }, [id]) + return ( +
+
+ +
+
+ ) +} + +export const V34ReskinBeforeMock = () => +export const V34ReskinAfterMock = () => diff --git a/src/renderer/src/mock/registry.ts b/src/renderer/src/mock/registry.ts index 491c434..173173e 100644 --- a/src/renderer/src/mock/registry.ts +++ b/src/renderer/src/mock/registry.ts @@ -21,6 +21,7 @@ import { V32RoomContextMock } from './mocks/v32-room-context' import { V32bRoomContextLiveMock } from './mocks/v32b-room-context-live' import { V32RoomWorkflowMock } from './mocks/v32-room-workflow' import { V32RoomWorkflowRealMock } from './mocks/v32-room-workflow-real' +import { V34ReskinAfterMock, V34ReskinBeforeMock } from './mocks/v34-reskin-room' /** Mock name (the ?mock= value and PNG file name) → component. */ export const MOCKS: Record = { @@ -49,5 +50,7 @@ export const MOCKS: Record = { 'v32-room-context': V32RoomContextMock, 'v32b-room-context-live': V32bRoomContextLiveMock, 'v32-room-workflow': V32RoomWorkflowMock, - 'v32-room-workflow-real': V32RoomWorkflowRealMock + 'v32-room-workflow-real': V32RoomWorkflowRealMock, + 'v34-reskin-before': V34ReskinBeforeMock, + 'v34-reskin-after': V34ReskinAfterMock } From da7c7622277639e4e8944c84bf5e51670f209944 Mon Sep 17 00:00:00 2001 From: GOXF <131693427+GOXF@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:22:51 +0000 Subject: [PATCH 2/6] =?UTF-8?q?goxf(mock):=20v35=20BoardUI=20=E5=85=8D?= =?UTF-8?q?=E8=B4=B9=E4=BB=B6=E6=8C=89=20goxf=20=E6=A1=A3=E4=BD=8D?= =?UTF-8?q?=E9=87=8D=E5=86=99=E6=95=88=E6=9E=9C=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/mock/mocks/v35-free-parts.css | 49 +++ .../src/mock/mocks/v35-free-parts.tsx | 335 ++++++++++++++++++ src/renderer/src/mock/registry.ts | 5 +- 3 files changed, 388 insertions(+), 1 deletion(-) create mode 100644 src/renderer/src/mock/mocks/v35-free-parts.css create mode 100644 src/renderer/src/mock/mocks/v35-free-parts.tsx diff --git a/src/renderer/src/mock/mocks/v35-free-parts.css b/src/renderer/src/mock/mocks/v35-free-parts.css new file mode 100644 index 0000000..bd93397 --- /dev/null +++ b/src/renderer/src/mock/mocks/v35-free-parts.css @@ -0,0 +1,49 @@ +/* + * v35 效果图:BoardUI 免费件(MIT)按 goxf 档位重写后的样式。 + * 动效节奏取自 BoardUI styles/globals.css(Copyright 2026 BoardUI,MIT)。 + * 开工后搬进 goxf-scale.css;新增 token 在这里先定义。 + */ +:root { + --color-glow-1: #5eead4; + --color-glow-2: #46baec; + --color-glow-3: #e633a4; + --color-glow-4: #00faa7; +} + +@keyframes goxf-thinking-shimmer { + from { background-position: 200% center; } + to { background-position: -100% center; } +} +.goxf-thinking-label { + color: transparent; + background-image: linear-gradient(100deg, + color-mix(in oklab, var(--goxf-thinking-tone) 55%, transparent) 30%, + var(--goxf-thinking-tone) 50%, + color-mix(in oklab, var(--goxf-thinking-tone) 55%, transparent) 70%); + background-position: 200% center; + background-size: 300% 100%; + background-clip: text; + -webkit-background-clip: text; + animation: goxf-thinking-shimmer 2.6s linear infinite; +} +@keyframes goxf-thinking-star { + 0%, 100% { transform: scale(0); opacity: 0; } + 40% { transform: scale(1); opacity: 1; } + 60% { transform: scale(0.8); opacity: 0.9; } +} +.goxf-thinking-star { + animation-name: goxf-thinking-star; + animation-timing-function: ease-in-out; + animation-iteration-count: infinite; +} +@keyframes goxf-dash { to { stroke-dashoffset: -100; } } +.goxf-thinking-comet, +.goxf-loader-rect { + animation-name: goxf-dash; + animation-timing-function: linear; + animation-iteration-count: infinite; +} +@media (prefers-reduced-motion: reduce) { + .goxf-thinking-label { color: var(--goxf-thinking-tone); background-image: none; animation: none; } + .goxf-thinking-star, .goxf-thinking-comet, .goxf-loader-rect { animation: none; } +} diff --git a/src/renderer/src/mock/mocks/v35-free-parts.tsx b/src/renderer/src/mock/mocks/v35-free-parts.tsx new file mode 100644 index 0000000..6b02425 --- /dev/null +++ b/src/renderer/src/mock/mocks/v35-free-parts.tsx @@ -0,0 +1,335 @@ +/* + * v35 效果图:BoardUI 免费件按 goxf 档位重写(字号 7 档、圆角 5 档、颜色只用 token)。 + * 参考 BoardUI(https://github.com/BoardUI/boardui,MIT,Copyright 2026 BoardUI)的 + * agent-thinking、composer-loader、token-input、notification-center;开工后拆成正式组件。 + */ +import './v35-free-parts.css' +import { useEffect, useId, useRef, useState, type CSSProperties, type ReactNode } from 'react' +import { ArrowUp, AtSign, Bell, CheckCircle2, FileText, Info, Plus, Sparkles, Square, XCircle } from 'lucide-react' +import { BotAvatar } from '@/components/ui/Avatar' +import { Button } from '@/components/ui/Button' +import { IconButton } from '@/components/ui/IconButton' +import { MENU_SURFACE } from '@/components/ui/Menu' +import { SegmentedControl } from '@/components/ui/SegmentedControl' +import { cn } from '@/lib/cn' + +/* ───────────────────────── Agent Thinking ───────────────────────── */ + +type Variant = 'wave' | 'spin' | 'stars' | 'infinity' +const TONE = { muted: 'var(--color-ink-muted)', secondary: 'var(--color-ink-secondary)', accent: 'var(--color-accent-600)' } + +function dotOpacities(variant: 'wave' | 'spin', phase: number) { + return Array.from({ length: 9 }, (_, i) => { + const col = i % 3 + const row = Math.floor(i / 3) + const s = variant === 'wave' ? ((col + row) / 4) * 0.75 : (Math.atan2(row - 1, col - 1) / (2 * Math.PI) + 1) % 1 + const behind = (phase - s + 1) % 1 + return 0.12 + 0.88 * Math.max(0, 1 - behind / 0.3) ** 1.5 + }) +} + +function Dots({ variant }: { variant: 'wave' | 'spin' }) { + const [phase, setPhase] = useState(0.45) + useEffect(() => { + const id = window.setInterval(() => setPhase((p) => (p + 1 / 8) % 1), 80) + return () => window.clearInterval(id) + }, []) + return ( + + {dotOpacities(variant, phase).map((o, i) => ( + + ))} + + ) +} + +const STARS = [{ x: 50, y: 46, s: 1 }, { x: 18, y: 22, s: 0.55 }, { x: 82, y: 26, s: 0.45 }, { x: 78, y: 76, s: 0.55 }, { x: 22, y: 78, s: 0.4 }] +function Stars() { + return ( + + {STARS.map((st, i) => { + const size = 14 * st.s + return ( + + + + ) + })} + + ) +} + +const INF = 'M28 14C33 5 47 5 47 14C47 23 33 23 28 14C23 5 9 5 9 14C9 23 23 23 28 14Z' +function Infinity_() { + return ( + + + + + ) +} + +export function AgentThinking({ variant = 'wave', label = '思考中', tone = 'secondary', seconds }: { + variant?: Variant; label?: string; tone?: keyof typeof TONE; seconds?: number +}) { + const color = TONE[tone] + return ( +
+ {(variant === 'wave' || variant === 'spin') && } + {variant === 'stars' && } + {variant === 'infinity' && } + {label} + {seconds !== undefined && {seconds.toFixed(1)}s} +
+ ) +} + +/* ───────────────────────── Composer Loader ───────────────────────── */ + +export function ComposerLoader({ active, children, speed = 4.5, arc = 120, line = 2.5, bloom = 16 }: { + active: boolean; children: ReactNode; speed?: number; arc?: number; line?: number; bloom?: number +}) { + const gid = `goxf-cl-${useId().replace(/[^a-zA-Z0-9]/g, '')}` + const ref = useRef(null) + const [box, setBox] = useState({ w: 640, h: 52 }) + useEffect(() => { + const el = ref.current + if (!el) return + const ro = new ResizeObserver(() => setBox({ w: Math.max(1, el.clientWidth), h: Math.max(1, el.clientHeight) })) + ro.observe(el) + return () => ro.disconnect() + }, []) + const band = (arc / 360) * 100 + const r = box.h / 2 + const per = 2 * (box.w - box.h) + Math.PI * box.h + const back = (px: number) => (px * 100) / per + const stroke = (width: number, blur: number, opacity: number, len: number, backPx: number) => ( + + ) + return ( +
+ + + + + + + + + + + {[14, 6, 1].map((b) => ( + + ))} + + {stroke(bloom * 2, 14, 0.3, band * 0.9, bloom + 16)} + {stroke(line * 3.2, 6, 0.8, band * 0.95, 10)} + {stroke(line, 1, 1, band, 0)} + + +
{children}
+
+ ) +} + +/* ───────────────────────── Token Input(静态视觉) ───────────────────────── */ + +type Tok = { label: string; tone: 'accent' | 'neutral'; icon?: ReactNode } +const Chip = ({ t, selected }: { t: Tok; selected?: boolean }) => ( + + {t.icon}{t.label} + +) + +function PillComposer({ children, busy, send = true }: { children: ReactNode; busy?: boolean; send?: boolean }) { + return ( +
+ + +
{children}
+ {busy ? ( + + ) : ( + + )} +
+ ) +} + +const T = { + claude: { label: '@Claude', tone: 'accent' } as Tok, + gpt: { label: '@GPT', tone: 'accent' } as Tok, + skill: { label: '先给结论', tone: 'neutral', icon: } as Tok, + file: { label: '架构草案.md', tone: 'neutral', icon: } as Tok +} + +function MentionMenu() { + const rows = [ + { name: 'Claude', note: '安全审查 · 在线', seed: 'a', on: true }, + { name: 'GPT', note: '性能与体积 · 在线', seed: 'b' }, + { name: 'Hark', note: '空闲', seed: 'c' } + ] + return ( +
+
成员
+ {rows.map((r) => ( +
+ + {r.name} + {r.note} +
+ ))} +
+ ) +} + +/* ───────────────────────── Notification Center ───────────────────────── */ + +type Status = 'neutral' | 'info' | 'success' | 'error' +const STATUS: Record = { + neutral: { icon: , cls: 'bg-sunken text-ink-secondary' }, + info: { icon: , cls: 'bg-status-busy/12 text-status-busy-ink' }, + success: { icon: , cls: 'bg-status-online/10 text-status-online-ink' }, + error: { icon: , cls: 'bg-status-error/10 text-status-error-ink' } +} +type Note = { id: string; title: string; desc: string; time: string; unread?: boolean; status?: Status; bot?: string; actions?: string[] } +const NOTES: Note[] = [ + { id: '1', bot: 'a', title: 'Claude 在「架构评审」@了你', desc: '结论已给出,等你确认要不要接给 GPT 评审。', time: '2 分钟前', unread: true, actions: ['去看看', '接给 GPT'] }, + { id: '2', status: 'error', title: 'Hark 账号掉线', desc: '点名它会失败,重新登录后恢复。', time: '8 分钟前', unread: true, actions: ['重新登录'] }, + { id: '3', status: 'success', title: '测试版 0.19.3 已下载', desc: '重启后生效,不影响正在跑的群聊。', time: '17:40' }, + { id: '4', status: 'info', title: '上游有 6 个新提交', desc: '可以同步上游,预计冲突 0 个。', time: '昨天' } +] + +function NotificationCenter() { + const [tab, setTab] = useState<'all' | 'mention' | 'system'>('all') + const unread = NOTES.filter((n) => n.unread).length + const count = (n: number) => {n} + return ( +
+
+
+
+

通知

+

{unread} 条未读

+
+ +
+ 全部{count(4)} }, + { value: 'mention', label: <>@我{count(1)} }, + { value: 'system', label: <>系统{count(3)} } + ]} /> +
+
+
+ {NOTES.map((n) => ( +
+ {n.bot ? ( + + ) : ( + + {STATUS[n.status ?? 'neutral'].icon} + + )} +
+
+

{n.title}

+
+ {n.time} + {n.unread && } +
+
+

{n.desc}

+ {n.actions && ( +
+ {n.actions.map((a, i) => )} +
+ )} +
+
+ ))} +
+
+
+ ) +} + +/* ───────────────────────── 画面 ───────────────────────── */ + +function Card({ title, note, children, w = 'w-[520px]' }: { title: string; note?: string; children: ReactNode; w?: string }) { + return ( +
+
{title}
+
{children}
+ {note &&

{note}

} +
+ ) +} + +export function V35ThinkingLoaderMock() { + return ( +
+ + + + + +
+
+ +
+ Claude + +
+
+ + + + 发消息,或输入 @ 点名… + + + 等待 @Claude 回复… + + +
+ ) +} + +export function V35TokenNotifyMock() { + return ( +
+ +
+ + 用 看看 + +
+
+ + 评审一下,然后 @C + +
+
+
+
+
Notification Center · 群聊与系统通知
+ +
+
+ ) +} diff --git a/src/renderer/src/mock/registry.ts b/src/renderer/src/mock/registry.ts index 173173e..73ce3b1 100644 --- a/src/renderer/src/mock/registry.ts +++ b/src/renderer/src/mock/registry.ts @@ -22,6 +22,7 @@ import { V32bRoomContextLiveMock } from './mocks/v32b-room-context-live' import { V32RoomWorkflowMock } from './mocks/v32-room-workflow' import { V32RoomWorkflowRealMock } from './mocks/v32-room-workflow-real' import { V34ReskinAfterMock, V34ReskinBeforeMock } from './mocks/v34-reskin-room' +import { V35ThinkingLoaderMock, V35TokenNotifyMock } from './mocks/v35-free-parts' /** Mock name (the ?mock= value and PNG file name) → component. */ export const MOCKS: Record = { @@ -52,5 +53,7 @@ export const MOCKS: Record = { 'v32-room-workflow': V32RoomWorkflowMock, 'v32-room-workflow-real': V32RoomWorkflowRealMock, 'v34-reskin-before': V34ReskinBeforeMock, - 'v34-reskin-after': V34ReskinAfterMock + 'v34-reskin-after': V34ReskinAfterMock, + 'v35-thinking-loader': V35ThinkingLoaderMock, + 'v35-token-notify': V35TokenNotifyMock } From 8c926b9fe0863f4fb49cf5427ca2928cd2089288 Mon Sep 17 00:00:00 2001 From: GOXF <131693427+GOXF@users.noreply.github.com> Date: Thu, 3 Dec 2026 12:22:35 +0000 Subject: [PATCH 3/6] =?UTF-8?q?mock(v36):=20=E6=8C=89=20Craft=20Anything?= =?UTF-8?q?=20=E5=AE=9E=E6=B5=8B=E4=BF=AE=E6=AD=A3=E7=BE=A4=E8=81=8A?= =?UTF-8?q?=E6=8D=A2=E7=9A=AE=E6=95=88=E6=9E=9C=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/mock/mocks/v36-reskin-measured.css | 89 +++++++++++++++++++ .../src/mock/mocks/v36-reskin-measured.tsx | 51 +++++++++++ src/renderer/src/mock/registry.ts | 4 +- 3 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 src/renderer/src/mock/mocks/v36-reskin-measured.css create mode 100644 src/renderer/src/mock/mocks/v36-reskin-measured.tsx diff --git a/src/renderer/src/mock/mocks/v36-reskin-measured.css b/src/renderer/src/mock/mocks/v36-reskin-measured.css new file mode 100644 index 0000000..0d8f25e --- /dev/null +++ b/src/renderer/src/mock/mocks/v36-reskin-measured.css @@ -0,0 +1,89 @@ +/* + * v36 效果图专用:按 Craft Anything(净室模式)实测 boardui.com/templates/multi-agent-chat 修正 v34。 + * 实测:页面底 #ffffff,聊天面板 #f7f7f7 圆角 16;成员消息灰气泡 #ebebeb 圆角 16、内边距 12、最宽 520、14/20; + * 自己的消息白气泡 + 1px #ebebeb 描边影;文字三档 #0a0a0a/#737373/#a1a1a1;输入框白底、上方柔影 0 -2px 13px 4.3%; + * 发送键纯色圆,无渐变。深色值取 BoardUI 免费版(MIT)theme.css。 + */ + +.goxf-skin-measured { + /* 中性色:BoardUI neutral 阶梯(950/600/500/400,200 线,100 底) */ + --color-canvas: #ffffff; + --color-main: #f7f7f7; + --color-surface: #ffffff; + --color-surface-hover: #f7f7f7; + --color-bubble: #ebebeb; + --color-bubble-user: #ffffff; + --color-hover: rgb(10 10 10 / 0.05); + --color-active: rgb(10 10 10 / 0.08); + --color-sunken: #ebebeb; + --color-line: #ebebeb; + --color-line-strong: #e5e5e5; + --color-ink: #0a0a0a; + --color-ink-secondary: #525252; + --color-ink-muted: #737373; + --color-ink-faint: #a1a1a1; + /* 阴影:BoardUI 6%/10% 配方 + 1px 接触影 + 侧栏三层 */ + --shadow-hairline: 0 0 0 1px rgb(0 0 0 / 0.05); + --shadow-soft: 0 1px 1px 0 rgb(0 0 0 / 0.05); + --shadow-card: 0 1px 2px 0 rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1); + --shadow-float: 0 1px 0 0 rgb(0 0 0 / 0.02), 0 1px 12px 0 rgb(0 0 0 / 0.06), 0 0 1px 0 rgb(0 0 0 / 0.32); + --shadow-pop: 0 1px 1px 0 rgb(0 0 0 / 0.04), 0 4px 4px 0 rgb(0 0 0 / 0.02), 0 0 1px 0 rgb(0 0 0 / 0.32); + --shadow-dialog: 0 0 6px 0 rgb(0 0 0 / 0.06), 0 0 64px 0 rgb(0 0 0 / 0.16), 0 0 1px 0 rgb(0 0 0 / 0.32); + --gradient-primary: linear-gradient(180deg, var(--color-accent-500) 0%, var(--color-accent-600) 100%); + --gradient-primary-hover: linear-gradient(180deg, var(--color-accent-400) 0%, var(--color-accent-500) 100%); + --shadow-primary: 0 1px 2px 0 rgb(0 0 0 / 0.18), inset 0 1px 0 0 rgb(255 255 255 / 0.25); + --color-bubble-user-ink: var(--color-ink); +} +[data-theme='dark'] .goxf-skin-measured { + --color-canvas: #0a0a0a; + --color-main: #171717; + --color-surface: #262626; + --color-surface-hover: #2e2e2e; + --color-bubble: #262626; + --color-bubble-user: #1f1f1f; + --color-hover: rgb(250 250 250 / 0.06); + --color-active: rgb(250 250 250 / 0.1); + --color-sunken: #262626; + --color-line: #262626; + --color-line-strong: #404040; + --color-ink: #fafafa; + --color-ink-secondary: #a3a3a3; + --color-ink-muted: #8a8a8a; + --color-ink-faint: #525252; + --shadow-hairline: 0 0 0 1px rgb(255 255 255 / 0.06); + --shadow-soft: 0 1px 1px 0 rgb(0 0 0 / 0.3); + --shadow-card: 0 1px 2px 0 rgb(0 0 0 / 0.4), inset 0 1px 0 0 rgb(255 255 255 / 0.04); + --shadow-float: 0 1px 12px 0 rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.06); + --shadow-pop: 0 4px 12px 0 rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.08); + --shadow-primary: 0 1px 2px 0 rgb(0 0 0 / 0.4), inset 0 1px 0 0 rgb(255 255 255 / 0.18); +} + +/* 自己的气泡:深色实心 → 白底 + 1px 描边影,圆角 16(实测) */ +.goxf-skin-measured .bg-bubble-user { + color: var(--color-bubble-user-ink); + border-radius: var(--radius-2xl); + box-shadow: 0 0 0 1px var(--color-line); +} +/* 自己气泡里的 @成员:反白胶囊 → 浅强调胶囊 */ +.goxf-skin-measured .bg-bubble-user .text-main { + background-color: var(--color-accent-50); + color: var(--color-accent-700); +} +[data-theme='dark'] .goxf-skin-measured .bg-bubble-user .text-main { + color: var(--color-accent-400); +} +/* 成员回复:保留灰气泡,内边距 12,最宽 520(实测) */ +.goxf-skin-measured .bg-bubble.px-4 { + padding: 12px; + max-width: 520px; + line-height: 20px; +} +/* 输入框:去描边,白底,上方柔影(实测 0 -2px 13px 4.3%) */ +.goxf-skin-measured form.border-line-strong, +.goxf-skin-measured .border-line-strong.shadow-card { + border-color: transparent; + box-shadow: 0 -2px 13px 0 rgb(0 0 0 / 0.043), 0 0 0 1px var(--color-line); +} + +/* 效果图专用:假群没有真账号,隐藏「成员掉线」提示 */ +.v36-frame [role='status'].animate-step-in { display: none; } diff --git a/src/renderer/src/mock/mocks/v36-reskin-measured.tsx b/src/renderer/src/mock/mocks/v36-reskin-measured.tsx new file mode 100644 index 0000000..766806c --- /dev/null +++ b/src/renderer/src/mock/mocks/v36-reskin-measured.tsx @@ -0,0 +1,51 @@ +import './v36-reskin-measured.css' +import type { CollabRoom, RoomMember, RoomMessage } from '@/rooms/model' +import { useEffect } from 'react' +import { setRoomDraft } from '@/rooms/roomComposerEvents' +import { RoomView } from '@/rooms/RoomView' +import { useRooms } from '@/rooms/roomStore' +import { useBotStore } from '@/store/botStore' + +/** + * v36 界面换皮:按 Craft Anything 实测数值修正的 BoardUI 风格(v34 留档不删)。 + * 两张都是真 RoomView(同一份假群数据);「BoardUI 风格」只是外面包了 .goxf-skin-board, + * 改的是 token 值和少量组件级规则(见 v34-reskin-board.css),组件代码不动。 + */ +const member = (botId: string, name: string): RoomMember => + ({ botId, name, accountId: `acc-${botId}`, platform: 'meta-muse', cursor: 0 } as RoomMember) +const MEMBERS = [member('a', 'Claude'), member('b', 'GPT'), member('c', 'Hark')] +const at = new Date(2026, 11, 3, 17, 40).getTime() +const MESSAGES: RoomMessage[] = [ + { id: 'h1', author: 'User', text: '@Claude 本地存储用 SQLite 还是 IndexedDB?给结论和理由。', createdAt: at }, + { id: 'r1', author: 'Claude', authorBotId: 'a', createdAt: at + 60_000, + text: '结论:用 SQLite(better-sqlite3,放主进程)。\n\n1. 群聊消息量大,要按群、按时间查,SQL 索引更省事;\n2. 主进程统一读写,多窗口不会互相覆盖;\n3. 备份就是拷一个文件。' }, + { id: 'h2', author: 'User', text: '@GPT 评审一下,有没有坑?', createdAt: at + 120_000 }, + { id: 'r2', author: 'GPT', authorBotId: 'b', createdAt: at + 180_000, + text: '两个坑:原生模块要按 Electron 版本重编;便携版要把数据库放在 BotArkData 里,别写进程序目录。' } +] +const roomFor = (id: string): CollabRoom => + ({ id, title: '架构评审', mode: 'manual', limit: 8, brief: '', members: MEMBERS, messages: MESSAGES } as unknown as CollabRoom) + +const IDS = ['mock-v36-after'] +useRooms.setState((s) => ({ + rooms: [...IDS.map(roomFor), ...s.rooms.filter((r) => !IDS.includes(r.id))], +})) +useBotStore.setState({ infoPanelOpen: false }) + +function Frame({ id, skin }: { id: string; skin?: boolean }) { + useEffect(() => { + const t = setTimeout(() => setRoomDraft(id, '@Hark 汇总一下两位的意见,给最终方案'), 50) + return () => clearTimeout(t) + }, [id]) + return ( +
+
+
+ +
+
+
+ ) +} + +export const V36ReskinMeasuredMock = () => diff --git a/src/renderer/src/mock/registry.ts b/src/renderer/src/mock/registry.ts index 73ce3b1..b6f4dfa 100644 --- a/src/renderer/src/mock/registry.ts +++ b/src/renderer/src/mock/registry.ts @@ -22,6 +22,7 @@ import { V32bRoomContextLiveMock } from './mocks/v32b-room-context-live' import { V32RoomWorkflowMock } from './mocks/v32-room-workflow' import { V32RoomWorkflowRealMock } from './mocks/v32-room-workflow-real' import { V34ReskinAfterMock, V34ReskinBeforeMock } from './mocks/v34-reskin-room' +import { V36ReskinMeasuredMock } from './mocks/v36-reskin-measured' import { V35ThinkingLoaderMock, V35TokenNotifyMock } from './mocks/v35-free-parts' /** Mock name (the ?mock= value and PNG file name) → component. */ @@ -55,5 +56,6 @@ export const MOCKS: Record = { 'v34-reskin-before': V34ReskinBeforeMock, 'v34-reskin-after': V34ReskinAfterMock, 'v35-thinking-loader': V35ThinkingLoaderMock, - 'v35-token-notify': V35TokenNotifyMock + 'v35-token-notify': V35TokenNotifyMock, + 'v36-reskin-measured': V36ReskinMeasuredMock } From 49ff045717c7e90fd1658135c562b6a48e60ec2d Mon Sep 17 00:00:00 2001 From: GOXF <131693427+GOXF@users.noreply.github.com> Date: Thu, 3 Dec 2026 13:10:53 +0000 Subject: [PATCH 4/6] =?UTF-8?q?goxf(reskin):=20A=20token=20=E5=B1=82?= =?UTF-8?q?=E6=8D=A2=E6=88=90=20BoardUI=20=E5=85=8D=E8=B4=B9=E7=89=88?= =?UTF-8?q?=E6=95=B0=E5=80=BC=EF=BC=88=E4=B8=AD=E6=80=A7=E8=89=B2/?= =?UTF-8?q?=E9=98=B4=E5=BD=B1/=E6=B8=90=E5=8F=98/=E5=8A=A8=E6=95=88/?= =?UTF-8?q?=E8=A1=8C=E9=AB=98/=E5=AD=97=E4=BD=93=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/goxf-design.md | 106 +++++++---- scripts/goxf-design-check.mjs | 5 +- src/renderer/src/styles/globals.css | 235 ++++++++++++++++++------- src/renderer/src/styles/goxf-scale.css | 5 +- 4 files changed, 247 insertions(+), 104 deletions(-) diff --git a/docs/goxf-design.md b/docs/goxf-design.md index 5f28082..6234672 100644 --- a/docs/goxf-design.md +++ b/docs/goxf-design.md @@ -11,8 +11,8 @@ ## 1. 字号(7 档 + 1 个例外) -写法统一用 `text-[Npx]`(与现有代码一致,脚本好查)。`text-ui` = 14px / 行高 22px, -`text-caption` = 12px / 行高 16px,两个 token 可以继续用,等同 14 / 12 档 +写法统一用 `text-[Npx]`(与现有代码一致,脚本好查)。`text-ui` = 14px / 行高 20px(BoardUI body 14/20), +`text-caption` = 12px / 行高 16px、字距 0.15px,两个 token 可以继续用,等同 14 / 12 档 (注意 globals.css 注释写的是 13/11,实际值是 14/12,以值为准)。 | 档 | 用途 | 现有出处 | @@ -51,25 +51,30 @@ ### 3.1 中性色 +2026-12-03 起换成 BoardUI 免费版(MIT)的值。浅色:页底白、浮面板 #f7f7f7、卡片和控件白。 + | token(类名前缀 bg-/text-/border-) | 浅色 | 深色 | 用途 | |---|---|---|---| -| `canvas` | #f5f5f5 | #0e0e0e | 窗口底 | -| `main` | #ffffff | #161616 | 主内容区、菜单/弹窗面 | -| `surface` | #ffffff | #1f1f1f | 卡片 | -| `surface-hover` | ink 6% | 6% | 卡片悬停 | -| `bubble` | ink 6% | 6% | 对方气泡 | -| `bubble-user` | #1c1c1c | #f5f5f5 | 自己的气泡 | -| `hover` | ink 6% | 6% | 悬停底、次要按钮底、分段控件槽 | -| `active` | ink 9% | 10% | 按下 / 选中底 | -| `sunken` | ink 4% | 5% | 凹陷区、计数胶囊底 | -| `line` | ink 8% | 8% | 分隔线、卡片边 | -| `line-strong` | ink 14% | 14% | 输入框边、菜单/弹窗 0.5px 边 | -| `ink` | #1c1c1c | #f5f5f5 | 主文字 | -| `ink-secondary` | ink 68% | 68% | 次级文字、ghost 按钮 | -| `ink-muted` | ink 52% | 50% | 说明文字、占位符 | -| `ink-faint` | ink 34% | 32% | 禁用感文字、极弱提示 | - -(浅色 ink = rgb(28 28 28),深色 = rgb(245 245 245)。) +| `canvas` | #ffffff | #121212 | 窗口底(页底) | +| `main` | #f7f7f7 | #171717 | 主内容区、侧栏等浮面板、弹窗面 | +| `surface` | #ffffff | #262626 | 卡片、控件、菜单面 | +| `surface-hover` | #f7f7f7 | neutral-700 60% | 白面上的悬停(菜单项、白底按钮) | +| `hover` | #ebebeb | neutral-700 60% | `main` 上的行悬停、次要底、分段控件槽 | +| `hover-on-main` | #ebebeb | #262626 | 同 `hover`,显式写在 `main` 上的场景(新增) | +| `active` | #ebebeb | #262626 | 按下 / 选中底(Bot 列表选中用灰,不用蓝) | +| `sunken` | #ebebeb | #262626 | 输入框填充、计数胶囊底 | +| `bubble` / `bubble-user` | 不变 | 不变 | 气泡(PR C 再换) | +| `line` | #ebebeb | #262626 | 分隔线、卡片边 | +| `line-strong` | #ebebeb | #404040 | 控件 1px 边、菜单/弹窗边 | +| `line-hover` | #d4d4d4 | #737373 | 控件描边悬停、输入框悬停 inset ring(新增) | +| `line-active` | #a1a1a1 | #525252 | 控件按下、输入框聚焦 inset ring(新增) | +| `ink` | #0a0a0a | #fafafa | 主文字 | +| `ink-secondary` | #525252 | #a1a1a1 | 次级文字 | +| `ink-muted` | #737373 | #737373 | 说明文字、图标 | +| `ink-faint` | #a1a1a1 | #525252 | 占位符、极弱提示(不过 3:1,不能放正文) | +| `ink-disabled` | #d4d4d4 | #404040 | 禁用文字(替代 opacity,新增) | + +浅色在 `main` 上 `hover` 与 `surface-hover` 不同:`main` 是 #f7f7f7,所以 `main` 上的悬停用 #ebebeb,白面上的悬停用 `surface-hover`。 ### 3.2 强调色(accent) @@ -80,9 +85,9 @@ | `accent-200` | #bfdbfe | / .35 | | `accent-300` | #93c5fd | / .50 | | `accent-400` | #4d9bff | 同浅色 | -| `accent-500` | #1e86fc | 同浅色 | -| `accent-600` | #1680f3 | 同浅色(主按钮、焦点环) | -| `accent-700` | #126fd4 | 同浅色(主按钮悬停) | +| `accent-500` | #1e86fc | 同浅色(焦点环 2px offset 2) | +| `accent-600` | #1680f3 | 同浅色 | +| `accent-700` | #126fd4 | 同浅色(主按钮渐变终点) | 一屏只有一个 `primary` 按钮。浅底上的强调字用 `accent-700`,深色模式下改 `dark:text-accent-400`。 @@ -112,17 +117,52 @@ ## 4. 阴影 -| token | 用途 | -|---|---| -| `shadow-hairline` | 平铺面的 1px 描边感(无边框时) | -| `shadow-soft` | 卡片、输入框、设置分组卡(默认) | -| `shadow-card` | 可点的浮起卡片 | -| `shadow-float` | 分段控件滑块、悬浮小块 | -| `shadow-pop` | 菜单、下拉、弹出层 | -| `shadow-toast` | Toast | -| `shadow-dialog` | 弹窗 | - -`shadow-xs/sm/2xs` 及自写阴影一律当 `shadow-soft`。深色模式下各阴影已在 globals.css 重定义,不要加 `dark:shadow-*`。 +BoardUI 配方(2026-12-03)。深色模式下各阴影已在 globals.css 重定义,不要加 `dark:shadow-*`。 + +| token | 值(浅色) | 用途 | +|---|---|---| +| `shadow-hairline` | 0 1px 0 /.05(BoardUI 2xs) | 分段控件滑块 | +| `shadow-soft` | 0 1px 2px /.05(BoardUI xs) | 白底按钮、选择器、卡片(默认) | +| `shadow-card` | 0 1px 1px /.05 | 可点的浮起卡片 | +| `shadow-float` | 0 1px 12px /.06 + 0 0 1px /.32 + 0 1px 0 /.02 | 浮面板、悬浮小块 | +| `shadow-pop` | 0 1px 1px /.04 + 0 4px 4px /.02,配 1px `line-strong` 边 | 菜单、下拉、弹出层 | +| `shadow-toast` | 同 float 配方 | Toast | +| `shadow-dialog` | BoardUI waitlist 配方(5 层) | 弹窗(遮罩 40%) | +| `shadow-primary` | 0 1px 2px /.05 | 主按钮(新增) | +| `shadow-nav-selected` | 1px accent-500 + 内 1px 白 25% | 顶部导航选中(新增) | +| `shadow-control-selected` | 内 2px 白 25% + 内 1px accent-500 | 复选类开态(新增;开关保留绿色,不用) | +| `inset-shadow-2xs/xs/sm` | inset 0 1px 0 / 0 1px 1px / 0 2px 4px,/.05 | 凹陷感(新增) | + +`shadow-xs/sm` 及自写阴影一律当 `shadow-soft`,`shadow-2xs` 当 `shadow-hairline`。 + +## 4.1 渐变 + +180° 竖向渐变,工具类 `bg-gradient-primary` / `bg-gradient-danger` 自带悬停、按下、禁用态;`bg-gradient-nav-selected` 带 `shadow-nav-selected`。 + +| token | 值 | 用途 | +|---|---|---| +| `--gradient-primary` | #1e86fc → #126fd4 | 主按钮、发送键 | +| `--gradient-primary-hover` | #4d9bff → #1e86fc | 悬停 | +| `--gradient-primary-active` | #1680f3 → #126fd4 | 按下 | +| `--gradient-primary-disabled` | #ebebeb → #d4d4d4(深 #404040 → #262626),字 `ink-faint` | 禁用主按钮 / 危险按钮 | +| `--gradient-danger(-hover/-active)` | #fb2c36 → #e7000b(悬停 #ff6467 → #fb2c36,按下 #e7000b → #c10007) | `danger-confirm` | +| `--gradient-nav-selected` | = primary | 只给顶部导航选中;Bot 列表选中用灰 `active` | + +goxf 蓝 500/600 太接近,所以各态跳一档。 + +## 4.2 动效 + +| token | 值 | 用途 | +|---|---|---| +| `--duration-color` | 150ms ease | 颜色、边框、阴影过渡 | +| `--duration-control` | 200ms ease | 分段滑块、开关、选择器 | +| `--duration-press` + `--ease-standard` | 220ms cubic-bezier(.4,0,.2,1) | `press` / `press-icon`,按下 scale .98 | +| `--duration-menu` | 150ms ease-out,scale .95 + blur 2px | 菜单、下拉(`animate-pop-*`) | +| `--duration-dialog` + `--ease-dialog` | 300ms cubic-bezier(.32,.72,0,1),scale .85 + blur 4px | 弹窗(`animate-dialog-rise`),遮罩 300ms | +| `--ease-check` | cubic-bezier(.65,0,.35,1) | 完成勾 | +| `shimmer-text` | 背景 200% → -100% | 「思考中」文字 | + +退出动画保留原时长(菜单 120ms、弹窗 160ms),只换形状,避免影响卸载时机。 ## 5. 组件 diff --git a/scripts/goxf-design-check.mjs b/scripts/goxf-design-check.mjs index 678dd7a..608f5d3 100644 --- a/scripts/goxf-design-check.mjs +++ b/scripts/goxf-design-check.mjs @@ -39,7 +39,7 @@ export const ALLOWED_RADIUS = new Set(['none', 'sm', 'md', 'lg', 'xl', '2xl', 'f * check so someone decides whether it maps to a token. */ export const ALLOWED_RADIUS_ARBITRARY = new Set(['3px', '4px', '9px', '10px', '11px', '12px', '14px', '18px', '20px', '22px']) -export const ALLOWED_SHADOW = new Set(['soft', 'float', 'hairline', 'card', 'pop', 'toast', 'dialog', 'none']) +export const ALLOWED_SHADOW = new Set(['soft', 'float', 'hairline', 'card', 'pop', 'toast', 'dialog', 'none', 'primary', 'nav-selected', 'control-selected']) /** Neutral palette colors tolerated anywhere (media overlays, on-dark text). */ export const ALLOWED_PALETTE = new Set(['black', 'white']) /** Individually reviewed exceptions (exact class, any variant). */ @@ -79,9 +79,10 @@ export const MAPPING = { rounded: radius('md'), 'rounded-3xl': radius('2xl'), 'rounded-xs': radius('sm'), + 'rounded-[10px]': radius('xl'), // BoardUI 2lg(10) -> xl(12), user 2026-12-03 // shadows (only --tw-shadow is swapped, so rings etc. still compose) shadow: SOFT, - 'shadow-2xs': SOFT, + 'shadow-2xs': { '--tw-shadow': 'var(--shadow-hairline)' }, // BoardUI shadow-2xs 'shadow-xs': SOFT, 'shadow-sm': SOFT, // palette colors -> status tokens diff --git a/src/renderer/src/styles/globals.css b/src/renderer/src/styles/globals.css index a518bf1..e066077 100644 --- a/src/renderer/src/styles/globals.css +++ b/src/renderer/src/styles/globals.css @@ -7,31 +7,37 @@ * a single iris accent, and semantic status colors. */ @theme { - --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', 'Inter Variable', ui-sans-serif, sans-serif; + --font-sans: 'Inter Variable', Inter, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', 'Microsoft YaHei', ui-sans-serif, sans-serif; --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace; /* Type scale additions (13px UI text, 11px captions) */ --text-ui: 0.875rem; - --text-ui--line-height: 1.375rem; + --text-ui--line-height: 1.25rem; --text-caption: 0.75rem; --text-caption--line-height: 1rem; + --text-caption--letter-spacing: 0.15px; - /* Neutrals (aligned with Grok Bot Sand Light) */ - --color-canvas: #f5f5f5; - --color-main: #ffffff; - --color-bubble: rgb(28 28 28 / 0.06); - --color-bubble-user: #1c1c1c; - --color-hover: rgb(28 28 28 / 0.06); - --color-active: rgb(28 28 28 / 0.09); + /* Neutrals — BoardUI free (MIT) values, see docs/goxf-design.md §3.1. + canvas = page (white), main = floating panels, surface = cards/controls. */ + --color-canvas: #ffffff; + --color-main: #f7f7f7; + --color-bubble: rgb(28 28 28 / 0.06); /* bubbles: PR C */ + --color-bubble-user: #1c1c1c; /* bubbles: PR C */ + --color-hover: #ebebeb; /* rows sit on main (#f7f7f7); on white surfaces use surface-hover */ + --color-active: #ebebeb; --color-surface: #ffffff; - --color-surface-hover: rgb(28 28 28 / 0.06); - --color-sunken: rgb(28 28 28 / 0.04); - --color-line: rgb(28 28 28 / 0.08); - --color-line-strong: rgb(28 28 28 / 0.14); - --color-ink: #1c1c1c; - --color-ink-secondary: rgb(28 28 28 / 0.68); - --color-ink-muted: rgb(28 28 28 / 0.52); - --color-ink-faint: rgb(28 28 28 / 0.34); + --color-surface-hover: #f7f7f7; + --color-sunken: #ebebeb; + --color-line: #ebebeb; + --color-line-strong: #ebebeb; + --color-line-hover: #d4d4d4; + --color-line-active: #a1a1a1; + --color-hover-on-main: #ebebeb; + --color-ink: #0a0a0a; + --color-ink-secondary: #525252; + --color-ink-muted: #737373; + --color-ink-faint: #a1a1a1; + --color-ink-disabled: #d4d4d4; /* Accent — Grok Bot Sand blue */ --color-accent-50: #eff6ff; @@ -56,14 +62,31 @@ --color-status-offline-ink: #6b6b75; --color-status-error-ink: #c32f37; - /* Elevation — flat cards use a 1px line; floating surfaces a .5px hairline. */ - --shadow-hairline: 0 0 0 1px rgb(20 20 20 / 0.04); - --shadow-soft: 0 1px 2px rgb(0 0 0 / 0.04); - --shadow-float: 0 2px 8px -1px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.04); - --shadow-card: 0 2px 8px -1px rgb(0 0 0 / 0.05), 0 1px 2px rgb(0 0 0 / 0.03); - --shadow-pop: 0 10px 20px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); - --shadow-toast: 0 8px 28px rgb(0 0 0 / 0.14); - --shadow-dialog: 0 24px 80px rgb(0 0 0 / 0.24); + /* Elevation — BoardUI shadow recipes (xs / card / sidebar / 2xs / dropdown / waitlist). */ + --shadow-hairline: 0 1px 0 0 rgb(0 0 0 / 0.05); + --shadow-soft: 0 1px 2px 0 rgb(0 0 0 / 0.05); + --shadow-float: 0 1px 0 rgb(0 0 0 / 0.0196), 0 1px 12px rgb(0 0 0 / 0.0588), 0 0 1px rgb(0 0 0 / 0.3216); + --shadow-card: 0 1px 1px 0 rgb(0 0 0 / 0.05); + --shadow-pop: 0 1px 1px rgb(0 0 0 / 0.04), 0 4px 4px rgb(0 0 0 / 0.02); + --shadow-toast: 0 1px 12px rgb(0 0 0 / 0.06), 0 0 1px rgb(0 0 0 / 0.32), 0 1px 0 rgb(0 0 0 / 0.02); + --shadow-dialog: 0 0 6px rgb(0 0 0 / 0.06), 0 0 64px rgb(0 0 0 / 0.16), 0 0 1px rgb(0 0 0 / 0.32), 0 1px 12px rgb(0 0 0 / 0.06), 0 1px 0 rgb(0 0 0 / 0.02); + --shadow-primary: 0 1px 2px 0 rgb(0 0 0 / 0.05); + --shadow-nav-selected: 0 0 0 1px var(--color-accent-500), inset 0 1px 0 rgb(255 255 255 / 0.251); + --shadow-control-selected: inset 0 2px 0 rgb(255 255 255 / 0.25), inset 0 0 0 1px var(--color-accent-500); + --inset-shadow-2xs: inset 0 1px 0 rgb(0 0 0 / 0.05); + --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05); + --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05); + + /* Gradients (180°). goxf blue keeps #1e86fc; 500/600 are too close, so + each state jumps a step: default 500→700, hover 400→500, press 600→700. */ + --gradient-primary: linear-gradient(180deg, #1e86fc, #126fd4); + --gradient-primary-hover: linear-gradient(180deg, #4d9bff, #1e86fc); + --gradient-primary-active: linear-gradient(180deg, #1680f3, #126fd4); + --gradient-primary-disabled: linear-gradient(180deg, #ebebeb, #d4d4d4); + --gradient-danger: linear-gradient(180deg, #fb2c36, #e7000b); + --gradient-danger-hover: linear-gradient(180deg, #ff6467, #fb2c36); + --gradient-danger-active: linear-gradient(180deg, #e7000b, #c10007); + --gradient-nav-selected: var(--gradient-primary); /* Motion — springs sampled into CSS linear() (ω / ζ in comments). Shapes (size, position, scale) move on springs; colors and opacity use @@ -73,16 +96,25 @@ --ease-spring-pop: linear(0, 0.07, 0.239, 0.453, 0.669, 0.858, 1.004, 1.103, 1.156, 1.171, 1.159, 1.13, 1.093, 1.057, 1.024, 0.999, 0.982, 0.973, 0.971, 0.973, 0.978, 0.984, 0.99, 0.996, 1); /* ω=22.4 ζ=.49 ≈430ms */ --ease-spring-glide: linear(0, 0.06, 0.188, 0.332, 0.469, 0.587, 0.685, 0.763, 0.824, 0.87, 0.905, 0.931, 0.95, 0.964, 0.974, 0.981, 0.987, 0.991, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 1); /* ω=31.6 ζ=1 ≈300ms */ --ease-exit: cubic-bezier(0.4, 0, 1, 1); + /* BoardUI motion: controls 150–200ms, press .98, dialog curve. */ + --ease-standard: cubic-bezier(0.4, 0, 0.2, 1); + --ease-dialog: cubic-bezier(0.32, 0.72, 0, 1); + --ease-check: cubic-bezier(0.65, 0, 0.35, 1); + --duration-color: 150ms; + --duration-control: 200ms; + --duration-press: 220ms; + --duration-menu: 150ms; + --duration-dialog: 300ms; --animate-fade-in: fade-in 220ms ease-out; --animate-veil-in: veil-in 220ms ease-out both; - --animate-pop-in: pop-drop 290ms var(--ease-spring-tap), veil-in 140ms ease-out; - --animate-pop-drop: pop-drop 290ms var(--ease-spring-tap), veil-in 140ms ease-out; - --animate-pop-lift: pop-lift 290ms var(--ease-spring-tap), veil-in 140ms ease-out; - --animate-pop-out: pop-out 120ms var(--ease-exit) forwards; - --animate-dialog-rise: dialog-rise 420ms var(--ease-spring-shape), veil-in 200ms ease-out; - --animate-dialog-sink: dialog-sink 160ms var(--ease-exit) forwards; - --animate-scrim-in: fade-in 220ms ease-out; + --animate-pop-in: menu-in 150ms ease-out both; + --animate-pop-drop: menu-in 150ms ease-out both; + --animate-pop-lift: menu-in 150ms ease-out both; + --animate-pop-out: menu-out 120ms ease-out forwards; /* exit kept at 120ms: unmount timing */ + --animate-dialog-rise: dialog-in 300ms var(--ease-dialog) both; + --animate-dialog-sink: dialog-out 160ms var(--ease-exit) forwards; /* exit kept at 160ms */ + --animate-scrim-in: fade-in 300ms ease-out; --animate-scrim-out: fade-out 160ms ease-in forwards; --animate-palette-in: palette-in 420ms var(--ease-spring-shape), veil-in 200ms ease-out; --animate-toast-in: toast-in 420ms var(--ease-spring-shape), veil-in 200ms ease-out; @@ -113,6 +145,34 @@ filter: blur(6px); } } + @keyframes menu-in { + from { + opacity: 0; + transform: scale(0.95); + filter: blur(2px); + } + } + @keyframes menu-out { + to { + opacity: 0; + transform: scale(0.95); + filter: blur(2px); + } + } + @keyframes dialog-in { + from { + opacity: 0; + transform: scale(0.85); + filter: blur(4px); + } + } + @keyframes dialog-out { + to { + opacity: 0; + transform: scale(0.85); + filter: blur(4px); + } + } @keyframes pop-drop { from { transform: translateY(-4px) scale(0.96); @@ -177,10 +237,10 @@ } @keyframes shimmer { from { - background-position: 150% 0; + background-position: 200% 0; } to { - background-position: -50% 0; + background-position: -100% 0; } } @keyframes grok-breathe { @@ -255,7 +315,7 @@ } :focus-visible { - outline: 2px solid var(--color-accent-600); + outline: 2px solid var(--color-accent-500); outline-offset: 2px; } @@ -283,25 +343,25 @@ */ @utility press { transition: - scale 290ms var(--ease-spring-tap), - background-color 0.12s ease, - color 0.12s ease, - border-color 0.12s ease, - box-shadow 0.12s ease, - opacity 0.12s ease; + scale var(--duration-press) var(--ease-standard), + background-color var(--duration-color) ease, + color var(--duration-color) ease, + border-color var(--duration-color) ease, + box-shadow var(--duration-color) ease, + opacity var(--duration-color) ease; &:active:not(:disabled):not([aria-disabled='true']) { - scale: 0.96; + scale: 0.98; } } @utility press-icon { transition: - scale 290ms var(--ease-spring-tap), - background-color 0.12s ease, - color 0.12s ease, - opacity 0.12s ease; + scale var(--duration-press) var(--ease-standard), + background-color var(--duration-color) ease, + color var(--duration-color) ease, + opacity var(--duration-color) ease; &:active:not(:disabled):not([aria-disabled='true']) { - scale: 0.9; + scale: 0.98; } } @@ -315,13 +375,45 @@ var(--color-ink-muted) 60%, var(--color-ink-muted) 100% ) - 0 0 / 250% 100%; + 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: var(--animate-shimmer); } +/* BoardUI gradient fills. Hover/press swap the gradient (no ::before needed). */ +@utility bg-gradient-primary { + background-image: var(--gradient-primary); + &:hover:not(:disabled):not([aria-disabled='true']) { + background-image: var(--gradient-primary-hover); + } + &:active:not(:disabled):not([aria-disabled='true']) { + background-image: var(--gradient-primary-active); + } + &:disabled, + &[aria-disabled='true'] { + background-image: var(--gradient-primary-disabled); + } +} +@utility bg-gradient-danger { + background-image: var(--gradient-danger); + &:hover:not(:disabled):not([aria-disabled='true']) { + background-image: var(--gradient-danger-hover); + } + &:active:not(:disabled):not([aria-disabled='true']) { + background-image: var(--gradient-danger-active); + } + &:disabled, + &[aria-disabled='true'] { + background-image: var(--gradient-primary-disabled); + } +} +@utility bg-gradient-nav-selected { + background-image: var(--gradient-nav-selected); + box-shadow: var(--shadow-nav-selected); +} + /* Electron window chrome helpers (no-ops in a regular browser). */ @utility drag-region { -webkit-app-region: drag; @@ -349,21 +441,25 @@ :root[data-theme='dark'] { color-scheme: dark; - --color-canvas: #0e0e0e; - --color-main: #161616; + --color-canvas: #121212; + --color-main: #171717; --color-bubble: rgb(245 245 245 / 0.06); --color-bubble-user: #f5f5f5; - --color-hover: rgb(245 245 245 / 0.06); - --color-active: rgb(245 245 245 / 0.10); - --color-surface: #1f1f1f; - --color-surface-hover: rgb(245 245 245 / 0.06); - --color-sunken: rgb(245 245 245 / 0.05); - --color-line: rgb(245 245 245 / 0.08); - --color-line-strong: rgb(245 245 245 / 0.14); - --color-ink: #f5f5f5; - --color-ink-secondary: rgb(245 245 245 / 0.68); - --color-ink-muted: rgb(245 245 245 / 0.50); - --color-ink-faint: rgb(245 245 245 / 0.32); + --color-hover: rgb(64 64 64 / 0.6); + --color-active: #262626; + --color-surface: #262626; + --color-surface-hover: rgb(64 64 64 / 0.6); + --color-sunken: #262626; + --color-line: #262626; + --color-line-strong: #404040; + --color-line-hover: #737373; + --color-line-active: #525252; + --color-hover-on-main: #262626; + --color-ink: #fafafa; + --color-ink-secondary: #a1a1a1; + --color-ink-muted: #737373; + --color-ink-faint: #525252; + --color-ink-disabled: #404040; --color-accent-50: rgb(24 132 252 / 0.12); --color-accent-100: rgb(24 132 252 / 0.22); --color-accent-200: rgb(24 132 252 / 0.35); @@ -373,11 +469,18 @@ --color-status-attention-ink: #fb9500; --color-status-offline-ink: #959595; --color-status-error-ink: #ff6463; - --shadow-hairline: 0 0 0 1px rgb(255 255 255 / 0.05); - --shadow-float: 0 2px 10px -1px rgb(0 0 0 / 0.5), 0 0 0 0.5px rgb(255 255 255 / 0.06); - --shadow-card: 0 2px 10px -1px rgb(0 0 0 / 0.45); - --shadow-pop: 0 12px 28px -4px rgb(0 0 0 / 0.6), 0 0 0 0.5px rgb(255 255 255 / 0.08); - --shadow-dialog: 0 24px 80px rgb(0 0 0 / 0.6), 0 0 0 0.5px rgb(255 255 255 / 0.08); + --shadow-hairline: 0 1px 0 0 rgb(0 0 0 / 0.16); + --shadow-soft: 0 1px 2px 0 rgb(0 0 0 / 0.18); + --shadow-float: 0 1px 0 rgb(0 0 0 / 0.10), 0 1px 12px rgb(0 0 0 / 0.16), 0 0 1px rgb(0 0 0 / 0.42); + --shadow-card: 0 1px 1px 0 rgb(0 0 0 / 0.14); + --shadow-pop: 0 1px 1px rgb(0 0 0 / 0.14), 0 4px 4px rgb(0 0 0 / 0.10); + --shadow-toast: 0 1px 12px rgb(0 0 0 / 0.16), 0 0 1px rgb(0 0 0 / 0.42), 0 1px 0 rgb(0 0 0 / 0.10); + --shadow-dialog: 0 0 6px rgb(0 0 0 / 0.12), 0 0 64px rgb(0 0 0 / 0.22), 0 0 1px rgb(0 0 0 / 0.42), 0 1px 12px rgb(0 0 0 / 0.14), 0 1px 0 rgb(0 0 0 / 0.08); + --shadow-primary: 0 1px 2px 0 rgb(0 0 0 / 0.18); + --inset-shadow-2xs: inset 0 1px 0 rgb(0 0 0 / 0.16); + --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.16); + --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.16); + --gradient-primary-disabled: linear-gradient(180deg, #404040, #262626); } /* GOXF: settings account lists in grid mode — cards that fill wide windows. diff --git a/src/renderer/src/styles/goxf-scale.css b/src/renderer/src/styles/goxf-scale.css index 83eda5f..da6336d 100644 --- a/src/renderer/src/styles/goxf-scale.css +++ b/src/renderer/src/styles/goxf-scale.css @@ -18,10 +18,11 @@ .bg-amber-500\/15 { background-color: color-mix(in oklab, var(--color-status-attention) 15%, transparent); } .bg-orange-500\/15 { background-color: color-mix(in oklab, var(--color-status-attention) 15%, transparent); } .rounded { border-radius: var(--radius-md); } +.rounded-\[10px\] { border-radius: var(--radius-xl); } .rounded-3xl { border-radius: var(--radius-2xl); } .rounded-xs { border-radius: var(--radius-sm); } .shadow { --tw-shadow: var(--shadow-soft); } -.shadow-2xs { --tw-shadow: var(--shadow-soft); } +.shadow-2xs { --tw-shadow: var(--shadow-hairline); } .shadow-sm { --tw-shadow: var(--shadow-soft); } .shadow-xs { --tw-shadow: var(--shadow-soft); } .text-\[10\.5px\] { font-size: 11px; } @@ -45,7 +46,5 @@ .text-lg { font-size: 17px; } .text-orange-400 { color: var(--color-status-attention-ink); } .text-orange-600 { color: var(--color-status-attention-ink); } -.dark\:text-amber-400:where([data-theme=dark], [data-theme=dark] *) { color: var(--color-status-attention-ink); } -.dark\:text-orange-400:where([data-theme=dark], [data-theme=dark] *) { color: var(--color-status-attention-ink); } @media (width >= 40rem) { .sm\:text-\[30px\] { font-size: 28px; } } @media (width >= 40rem) { .sm\:text-\[32px\] { font-size: 28px; } } From 4ef2d4ee566a32264a46870bf5e9f361b9615b78 Mon Sep 17 00:00:00 2001 From: GOXF <131693427+GOXF@users.noreply.github.com> Date: Thu, 3 Dec 2026 13:12:20 +0000 Subject: [PATCH 5/6] =?UTF-8?q?goxf(reskin):=20B=20=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=8C=89=20BoardUI=20=E5=85=8D=E8=B4=B9?= =?UTF-8?q?=E7=89=88=E6=94=B9=E5=86=99=EF=BC=88props/=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=B8=8D=E5=8F=98=EF=BC=9B=E5=BC=80=E5=85=B3=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E7=BB=BF=E8=89=B2=EF=BC=8C=E9=81=AE=E7=BD=A9=2040%=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/ui/Avatar.tsx | 2 +- .../components/ui/BotAvatarEditorDialog.tsx | 10 ++++---- src/renderer/src/components/ui/Button.tsx | 25 ++++++++++--------- src/renderer/src/components/ui/Controls.tsx | 25 ++++++++++--------- src/renderer/src/components/ui/Dialog.tsx | 6 ++--- .../src/components/ui/ErrorBoundary.tsx | 21 +++++++--------- src/renderer/src/components/ui/Field.tsx | 8 +++--- src/renderer/src/components/ui/IconButton.tsx | 14 +++++------ src/renderer/src/components/ui/InlineEdit.tsx | 2 +- src/renderer/src/components/ui/Menu.tsx | 12 ++++----- .../src/components/ui/PlatformGlyph.tsx | 2 +- .../src/components/ui/SegmentedControl.tsx | 10 ++++---- src/renderer/src/components/ui/Select.tsx | 16 ++++++------ src/renderer/src/components/ui/Status.tsx | 2 +- 14 files changed, 78 insertions(+), 77 deletions(-) diff --git a/src/renderer/src/components/ui/Avatar.tsx b/src/renderer/src/components/ui/Avatar.tsx index 323f150..306a309 100644 --- a/src/renderer/src/components/ui/Avatar.tsx +++ b/src/renderer/src/components/ui/Avatar.tsx @@ -131,7 +131,7 @@ export function AccountAvatar({ diff --git a/src/renderer/src/components/ui/BotAvatarEditorDialog.tsx b/src/renderer/src/components/ui/BotAvatarEditorDialog.tsx index b315b21..b669acd 100644 --- a/src/renderer/src/components/ui/BotAvatarEditorDialog.tsx +++ b/src/renderer/src/components/ui/BotAvatarEditorDialog.tsx @@ -133,7 +133,7 @@ export function BotAvatarEditorDialog({ bot, open, onOpenChange }: BotAvatarEdit return ( -
+
@@ -106,7 +107,7 @@ export function NumberStepper({ aria-label="Increase" disabled={disabled || value >= max} onClick={() => onChange(clamp(value + step))} - className="press-icon grid size-7 place-items-center rounded-full text-ink-secondary hover:bg-hover hover:text-ink disabled:pointer-events-none disabled:opacity-30" + className="press-icon grid size-7 place-items-center rounded-md text-ink-muted hover:bg-line-hover hover:text-ink disabled:pointer-events-none disabled:text-ink-disabled" > @@ -123,10 +124,10 @@ export function NumberStepper({ disabled={disabled} onClick={() => onChange(clamp(p))} className={cn( - 'press h-7 rounded-full px-2.5 text-[12px] font-medium tabular-nums transition-colors', + 'press h-7 rounded-lg px-2.5 text-[12px] font-medium tabular-nums transition-colors', active - ? 'bg-accent-600 text-white shadow-soft' - : 'bg-hover text-ink-secondary hover:bg-active hover:text-ink' + ? 'bg-accent-100 text-accent-700 dark:text-accent-400' + : 'border border-line-strong bg-surface text-ink-secondary shadow-soft hover:border-line-hover hover:text-ink' )} > {p} diff --git a/src/renderer/src/components/ui/Dialog.tsx b/src/renderer/src/components/ui/Dialog.tsx index c2ae20f..3f4c674 100644 --- a/src/renderer/src/components/ui/Dialog.tsx +++ b/src/renderer/src/components/ui/Dialog.tsx @@ -25,7 +25,7 @@ interface DialogProps { } /** - * Centered modal. Rises on the shape spring and sinks out in .16s; Radix keeps + * Centered modal (BoardUI: white, 1px line, 40% scrim). Scales in from .85 with a blur (300ms) and sinks out in .16s; Radix keeps * it mounted until the exit animation ends. Esc, the scrim and the close * button all dismiss it. */ @@ -46,13 +46,13 @@ export function Dialog({ return ( - + -
+
@@ -56,18 +57,14 @@ export class ErrorBoundary extends Component
- + {!this.props.surface && ( - + )}
diff --git a/src/renderer/src/components/ui/Field.tsx b/src/renderer/src/components/ui/Field.tsx index 57eeec8..4dbe30f 100644 --- a/src/renderer/src/components/ui/Field.tsx +++ b/src/renderer/src/components/ui/Field.tsx @@ -38,9 +38,11 @@ export function TextInput({ className, invalid, ...props }: TextInputProps) { shortcut?: string active?: boolean size?: 'sm' | 'md' - /** 36px circle with a hairline border (sidebar header actions). */ + /** 36px white tile with a 1px line + xs shadow (BoardUI icon-button). */ round?: boolean ref?: Ref } @@ -31,14 +31,14 @@ export function IconButton({ title={shortcut ? `${label} (${shortcut})` : label} aria-pressed={active || undefined} className={cn( - 'no-drag press-icon inline-flex shrink-0 items-center justify-center rounded-full text-ink-secondary', - 'hover:bg-hover hover:text-ink disabled:pointer-events-none disabled:opacity-35', + 'no-drag press-icon inline-flex shrink-0 items-center justify-center text-ink-muted', + 'hover:bg-hover hover:text-ink-secondary disabled:pointer-events-none disabled:opacity-60', round - ? 'size-9 border border-line bg-main text-ink [&_svg]:size-[18px]' + ? 'size-9 rounded-xl border border-line-strong bg-surface text-ink shadow-soft hover:border-line-hover hover:bg-surface-hover hover:text-ink [&_svg]:size-[18px]' : size === 'sm' - ? 'size-7 [&_svg]:size-4' - : 'size-8 [&_svg]:size-[18px]', - active && 'bg-active text-ink hover:bg-active', + ? 'size-7 rounded-md [&_svg]:size-4' + : 'size-8 rounded-lg [&_svg]:size-[18px]', + active && 'bg-active text-ink hover:bg-active hover:text-ink', className )} {...props} diff --git a/src/renderer/src/components/ui/InlineEdit.tsx b/src/renderer/src/components/ui/InlineEdit.tsx index c32840b..1587fbc 100644 --- a/src/renderer/src/components/ui/InlineEdit.tsx +++ b/src/renderer/src/components/ui/InlineEdit.tsx @@ -46,7 +46,7 @@ export function InlineEdit({ value, onCommit, onDone, label, maxLength = 40, cla } }} className={cn( - 'h-7 w-full min-w-0 rounded-md border border-accent-600 bg-surface px-1.5 text-ink ring-3 ring-accent-100 outline-none', + 'h-7 w-full min-w-0 rounded-lg bg-sunken px-1.5 text-ink ring-2 ring-line-active ring-inset outline-none', className )} /> diff --git a/src/renderer/src/components/ui/Menu.tsx b/src/renderer/src/components/ui/Menu.tsx index c2b8b19..c05deb3 100644 --- a/src/renderer/src/components/ui/Menu.tsx +++ b/src/renderer/src/components/ui/Menu.tsx @@ -5,7 +5,7 @@ import { useOverlayLock } from '@/lib/overlay' /** * Thin styling layer over Radix DropdownMenu: arrow keys, typeahead and Esc - * come from Radix; menus pop in on the tap spring and fade out in .12s. + * come from Radix; menus scale in from .95 with a 2px blur (150ms) and fade out in .12s. */ export function Menu({ onOpenChange, open: openProp, ...props }: ComponentProps) { const [openState, setOpenState] = useState(false) @@ -25,7 +25,7 @@ export function Menu({ onOpenChange, open: openProp, ...props }: ComponentProps< export const MenuTrigger = DropdownMenu.Trigger export const MENU_SURFACE = - 'rounded-xl border-[0.5px] border-line-strong bg-main p-1.5 shadow-pop outline-none' + 'rounded-2xl border border-line-strong bg-surface p-2 shadow-pop outline-none' export function MenuContent({ className, sideOffset = 6, ...props }: ComponentProps) { return ( @@ -54,8 +54,8 @@ export function MenuItem({ return ( ) { return ( ) } export function MenuSeparator({ className, ...props }: ComponentProps) { - return + return } diff --git a/src/renderer/src/components/ui/PlatformGlyph.tsx b/src/renderer/src/components/ui/PlatformGlyph.tsx index 22bfd47..f67e785 100644 --- a/src/renderer/src/components/ui/PlatformGlyph.tsx +++ b/src/renderer/src/components/ui/PlatformGlyph.tsx @@ -10,7 +10,7 @@ interface PlatformGlyphProps { const SIZES = { sm: 'size-5 rounded-md text-[10px]', - md: 'size-9 rounded-[10px] text-sm', + md: 'size-9 rounded-xl text-sm', lg: 'size-14 rounded-2xl text-lg' } as const diff --git a/src/renderer/src/components/ui/SegmentedControl.tsx b/src/renderer/src/components/ui/SegmentedControl.tsx index dbedd1c..a7b9ac6 100644 --- a/src/renderer/src/components/ui/SegmentedControl.tsx +++ b/src/renderer/src/components/ui/SegmentedControl.tsx @@ -49,7 +49,7 @@ export function SegmentedControl({ role="tablist" aria-label={ariaLabel} className={cn( - 'no-drag relative inline-flex items-center rounded-[11px] bg-hover p-0.5 select-none', + 'no-drag relative inline-flex items-center rounded-xl bg-hover p-0.5 select-none', pill && 'rounded-full', fullWidth && 'flex w-full', className @@ -72,7 +72,7 @@ export function SegmentedControl({ {glide.thumb && ( )} @@ -89,12 +89,12 @@ export function SegmentedControl({ tabIndex={active ? 0 : -1} onClick={() => onValueChange(opt.value)} className={cn( - 'press relative inline-flex min-w-0 items-center justify-center rounded-[9px] font-medium tracking-tight whitespace-nowrap transition-colors outline-none', - 'disabled:pointer-events-none disabled:opacity-35', + 'press relative inline-flex min-w-0 items-center justify-center rounded-lg tracking-tight whitespace-nowrap transition-colors duration-200 outline-none', + 'disabled:pointer-events-none disabled:text-ink-disabled', fullWidth && 'flex-1', pill && 'rounded-full', ITEM_SIZES[size], - active ? 'text-ink' : 'text-ink-secondary hover:text-ink' + active ? 'font-medium text-ink' : 'text-ink-muted hover:text-ink' )} > {opt.icon && {opt.icon}} diff --git a/src/renderer/src/components/ui/Select.tsx b/src/renderer/src/components/ui/Select.tsx index 33d3121..269ab42 100644 --- a/src/renderer/src/components/ui/Select.tsx +++ b/src/renderer/src/components/ui/Select.tsx @@ -35,10 +35,10 @@ export interface SelectProps { } const TRIGGER_VARIANTS = { - pill: 'rounded-full border-[0.5px] border-line-strong bg-surface text-ink shadow-soft hover:bg-hover data-[state=open]:bg-hover', + pill: 'rounded-full border border-line-strong bg-surface text-ink shadow-soft hover:border-line-hover hover:bg-surface-hover data-[state=open]:border-line-active', field: - 'w-full rounded-lg border border-line-strong bg-surface text-ink shadow-soft hover:border-ink/20 data-[state=open]:border-accent-300 data-[state=open]:ring-3 data-[state=open]:ring-accent-100', - ghost: 'rounded-full bg-transparent text-ink-secondary hover:bg-hover hover:text-ink data-[state=open]:bg-hover data-[state=open]:text-ink' + 'w-full rounded-xl border border-line-strong bg-surface text-ink shadow-soft hover:border-line-hover hover:bg-surface-hover data-[state=open]:border-line-active', + ghost: 'rounded-lg bg-transparent text-ink-secondary hover:bg-hover hover:text-ink data-[state=open]:bg-hover data-[state=open]:text-ink' } as const const TRIGGER_SIZES = { @@ -85,7 +85,7 @@ export function Select({ title={title ?? selected?.label} className={cn( 'no-drag group press inline-flex min-w-0 items-center justify-between font-medium outline-none select-none', - 'disabled:pointer-events-none disabled:opacity-40', + 'disabled:pointer-events-none disabled:text-ink-disabled disabled:shadow-none', TRIGGER_VARIANTS[variant], TRIGGER_SIZES[size], className @@ -104,7 +104,7 @@ export function Select({ @@ -130,9 +130,9 @@ export function Select({ disabled={opt.disabled} onSelect={() => onValueChange(opt.value)} className={cn( - 'flex min-h-[30px] cursor-default items-center gap-2 rounded-lg px-2.5 py-1.5 text-[12.5px] leading-[18px] text-ink outline-none select-none', - 'transition-colors duration-100 data-[disabled]:opacity-35 data-[highlighted]:bg-hover', - active && 'bg-accent-50/70 font-medium text-ink' + 'flex min-h-8 cursor-default items-center gap-2 rounded-lg p-2 text-[13px] leading-[18px] text-ink outline-none select-none', + 'transition-colors duration-150 data-[disabled]:text-ink-disabled data-[highlighted]:bg-surface-hover', + active && 'bg-surface-hover font-medium text-ink' )} > {opt.icon && ( diff --git a/src/renderer/src/components/ui/Status.tsx b/src/renderer/src/components/ui/Status.tsx index 4f3cc5d..29beeb3 100644 --- a/src/renderer/src/components/ui/Status.tsx +++ b/src/renderer/src/components/ui/Status.tsx @@ -52,7 +52,7 @@ export function StatusBadge({ status, label, className }: StatusBadgeProps) { return ( Date: Thu, 3 Dec 2026 13:20:24 +0000 Subject: [PATCH 6/6] =?UTF-8?q?mock(v37):=20ui-kit=20=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=80=BB=E8=A1=A8=20+=20=E7=BE=A4=E8=81=8A/=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E9=A1=B5=E9=9D=A2=EF=BC=9Bdanger-confirm=20?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=80=81=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/ui/Button.tsx | 2 +- src/renderer/src/mock/mocks/v37-app.tsx | 56 ++++++ src/renderer/src/mock/mocks/v37-ui-kit.css | 13 ++ src/renderer/src/mock/mocks/v37-ui-kit.tsx | 210 +++++++++++++++++++++ src/renderer/src/mock/registry.ts | 7 +- 5 files changed, 286 insertions(+), 2 deletions(-) create mode 100644 src/renderer/src/mock/mocks/v37-app.tsx create mode 100644 src/renderer/src/mock/mocks/v37-ui-kit.css create mode 100644 src/renderer/src/mock/mocks/v37-ui-kit.tsx diff --git a/src/renderer/src/components/ui/Button.tsx b/src/renderer/src/components/ui/Button.tsx index b2e6a92..57cd52d 100644 --- a/src/renderer/src/components/ui/Button.tsx +++ b/src/renderer/src/components/ui/Button.tsx @@ -10,7 +10,7 @@ const VARIANTS = { ghost: 'text-ink-secondary hover:bg-hover hover:text-ink disabled:text-ink-disabled', danger: 'text-status-error hover:bg-status-error/10 disabled:text-ink-disabled', /** Destructive action waiting for a second click (BoardUI danger: solid red gradient). */ - 'danger-confirm': 'bg-gradient-danger text-white shadow-primary' + 'danger-confirm': 'bg-gradient-danger text-white shadow-primary disabled:text-ink-faint disabled:shadow-none' } as const const SIZES = { diff --git a/src/renderer/src/mock/mocks/v37-app.tsx b/src/renderer/src/mock/mocks/v37-app.tsx new file mode 100644 index 0000000..ea6ee5b --- /dev/null +++ b/src/renderer/src/mock/mocks/v37-app.tsx @@ -0,0 +1,56 @@ +import type { CollabRoom, RoomMember, RoomMessage } from '@/rooms/model' +import { useEffect } from 'react' +import { setRoomDraft } from '@/rooms/roomComposerEvents' +import { RoomView } from '@/rooms/RoomView' +import { useRooms } from '@/rooms/roomStore' +import { useBotStore } from '@/store/botStore' +import { SettingsView } from '@/components/settings/SettingsView' + +/** + * v37 真实页面(换皮 PR A+B 后):群聊页 RoomView、设置页 SettingsView,只看 token 生效后的整体效果。 + * 外壳(白底 + 浮面板)和气泡留给 PR C,这里外框照旧:canvas 底 + main 面板。 + */ +const member = (botId: string, name: string): RoomMember => + ({ botId, name, accountId: `acc-${botId}`, platform: 'meta-muse', cursor: 0 } as RoomMember) +const MEMBERS = [member('a', 'Claude'), member('b', 'GPT'), member('c', 'Hark')] +const at = new Date(2026, 11, 3, 17, 40).getTime() +const MESSAGES: RoomMessage[] = [ + { id: 'h1', author: 'User', text: '@Claude 本地存储用 SQLite 还是 IndexedDB?给结论和理由。', createdAt: at }, + { id: 'r1', author: 'Claude', authorBotId: 'a', createdAt: at + 60_000, + text: '结论:用 SQLite(better-sqlite3,放主进程)。\n\n1. 群聊消息量大,要按群、按时间查,SQL 索引更省事;\n2. 主进程统一读写,多窗口不会互相覆盖;\n3. 备份就是拷一个文件。' }, + { id: 'h2', author: 'User', text: '@GPT 评审一下,有没有坑?', createdAt: at + 120_000 }, + { id: 'r2', author: 'GPT', authorBotId: 'b', createdAt: at + 180_000, + text: '两个坑:原生模块要按 Electron 版本重编;便携版要把数据库放在 BotArkData 里,别写进程序目录。' } +] +const ID = 'mock-v37-room' +useRooms.setState((s) => ({ + rooms: [ + { id: ID, title: '架构评审', mode: 'manual', limit: 8, brief: '', members: MEMBERS, messages: MESSAGES } as unknown as CollabRoom, + ...s.rooms.filter((r) => r.id !== ID) + ] +})) +useBotStore.setState({ infoPanelOpen: false }) + +export function V37AppRoomMock() { + useEffect(() => { + const t = setTimeout(() => setRoomDraft(ID, '@Hark 汇总一下两位的意见,给最终方案'), 50) + return () => clearTimeout(t) + }, []) + return ( +
+
+ +
+
+ ) +} + +export function V37AppSettingsMock() { + return ( +
+
+ +
+
+ ) +} diff --git a/src/renderer/src/mock/mocks/v37-ui-kit.css b/src/renderer/src/mock/mocks/v37-ui-kit.css new file mode 100644 index 0000000..a99ae62 --- /dev/null +++ b/src/renderer/src/mock/mocks/v37-ui-kit.css @@ -0,0 +1,13 @@ +/* v37 UI kit:把弹窗遮罩和弹窗收进右下角区域,免得盖住状态总表(只影响这张效果图)。 */ +body:has(#v37-kit) .fixed.inset-0.z-40 { + inset: auto; + left: 664px; + top: 1040px; + width: 680px; + height: 340px; + border-radius: 16px; +} +body:has(#v37-kit) [role='dialog'] { + left: 1004px; + top: 1210px; +} diff --git a/src/renderer/src/mock/mocks/v37-ui-kit.tsx b/src/renderer/src/mock/mocks/v37-ui-kit.tsx new file mode 100644 index 0000000..7358bbf --- /dev/null +++ b/src/renderer/src/mock/mocks/v37-ui-kit.tsx @@ -0,0 +1,210 @@ +import './v37-ui-kit.css' +import type { ReactNode } from 'react' +import type { PlatformDescriptor } from '@adapters/types' +import { Bell, Copy, Pencil, Plus, Search, Settings, Trash2 } from 'lucide-react' +import { Button } from '@/components/ui/Button' +import { IconButton } from '@/components/ui/IconButton' +import { Field, TextInput } from '@/components/ui/Field' +import { InlineEdit } from '@/components/ui/InlineEdit' +import { Select } from '@/components/ui/Select' +import { Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuTrigger } from '@/components/ui/Menu' +import { Dialog } from '@/components/ui/Dialog' +import { SegmentedControl } from '@/components/ui/SegmentedControl' +import { NumberStepper, SwitchPill } from '@/components/ui/Controls' +import { StatusBadge, StatusDot, UnreadBadge } from '@/components/ui/Status' +import { AccountAvatar, BotAvatar } from '@/components/ui/Avatar' +import { ErrorBoundary } from '@/components/ui/ErrorBoundary' +import { PlatformGlyph } from '@/components/ui/PlatformGlyph' + +/** + * v37 UI kit:components/ui 每个组件的各状态放一张图(换皮 PR A+B 改前 / 改后对比)。 + * 「悬停 / 聚焦 / 按下」由截图脚本用 CDP forcePseudoState 按 data-force 强制,不是手写样式。 + * BotAvatarEditorDialog 是弹窗,与 Dialog 同时打开会互相抢焦点,本图不放(其分段切换与 SegmentedControl 同款)。 + */ +const noop = () => {} +const COLS = ['默认', '悬停', '聚焦', '禁用', '出错 / 其他'] +const STATUSES = ['online', 'busy', 'attention', 'offline', 'error'] as const +const OPTS = [ + { value: 'claude', label: 'Claude' }, + { value: 'gpt', label: 'GPT-5' }, + { value: 'hark', label: 'Hark', description: '浏览器 Bot' } +] +const glyph = (name: string, ok: boolean) => + ({ id: `mock-${name}`, name, monogram: name.slice(0, 2), availability: ok ? 'available' : 'unavailable' }) as unknown as PlatformDescriptor + +function Boom(): ReactNode { + throw new Error('mock render failure') +} + +function Row({ name, children }: { name: string; children: ReactNode[] }) { + return ( + <> +
{name}
+ {children.map((c, i) => ( +
+ {c} +
+ ))} + + ) +} + +const btn = (variant: 'primary' | 'secondary' | 'ghost' | 'danger' | 'danger-confirm', label: string) => [ + , + , + , + , + +] + +export function V37UiKitMock() { + return ( +
+
components/ui · 状态总表
+
+
+ {COLS.map((c) => ( +
{c}
+ ))} + {btn('primary', '发送')} + {btn('secondary', '取消')} + {btn('ghost', '更多')} + {btn('danger', '删除')} + {btn('danger-confirm', '确认删除')} + + {[ + , + , + , + , + + ]} + + + {[ + <>, + , + , + , + <>active + ]} + + + {[ + , + , + , + , + + ]} + + + {[ + , + , + , + , + + ]} + + + {[ + , + , + , + , + + ]} + + + {[ + , + , +