DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
feat(ui): 新增通用状态点 Dot,替换调度器自建未读点
hairyfa61bc380e2af
diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/runs-tab.tsx b/packages/dsh-tauri-panel-scheduler/src/client/components/runs-tab.tsxindex 69219687..6a47278d 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/components/runs-tab.tsx+++ b/packages/dsh-tauri-panel-scheduler/src/client/components/runs-tab.tsx@@ -1,7 +1,7 @@import type { ReactElement } from 'react'import type { LocaleKey, Translate } from '../locales/index.types'import type { RunView } from '../types'-import { Alarm, CircleCheck, CircleDashed, CircleStop, CircleXmark, Icon, IconButton, TrashBin } from 'dsh-tauri-ui/client'+import { Alarm, CircleCheck, CircleDashed, CircleStop, CircleXmark, Dot, Icon, IconButton, TrashBin } from 'dsh-tauri-ui/client'import { formatLocalTime, isRunUnread } from './schedule.utils'export interface RunsTabProps {@@ -55,7 +55,7 @@ export function RunsTab({ t, runs, readAt, readIds, emptyLabel, onOpen, onDelete<div style={{ flex: 1, minWidth: 0 }}><span className="dshp-scheduler__card-title" title={run.taskName}>{run.taskName}- {isRunUnread(run, readAt, readIds) ? <span className="dshp-scheduler__unread-dot" /> : null}+ {isRunUnread(run, readAt, readIds) ? <Dot state="done" /> : null}</span><div className="dshp-scheduler__card-meta"><span className="dshp-scheduler__card-meta-text">{formatLocalTime(run.startedAt) ?? ''}</span>diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-nav-icon.tsx b/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-nav-icon.tsxindex a49cb802..7ba4c070 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-nav-icon.tsx+++ b/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-nav-icon.tsx@@ -1,5 +1,5 @@import type { ReactElement } from 'react'-import { Clock, Icon } from 'dsh-tauri-ui/client'+import { Clock, Dot, Icon } from 'dsh-tauri-ui/client'import { useStore } from 'dsh-tauri/client'import { store } from '../store'import { countUnreadRuns } from './schedule.utils'@@ -10,11 +10,7 @@ export function SchedulerNavIcon({ size }: { size: number }): ReactElement {<><Icon as={Clock} size={size} />{countUnreadRuns(state.runs, state.readAt, state.readIds) > 0- ? (- <span className="dshp-scheduler__nav-badge">- <span className="dshp-scheduler__unread-dot" />- </span>- )+ ? <Dot className="dshp-scheduler__nav-dot" state="done" />: null}</>)diff --git a/packages/dsh-tauri-panel-scheduler/src/client/styles/index.cssr.ts b/packages/dsh-tauri-panel-scheduler/src/client/styles/index.cssr.tsindex 28152f40..dc42f8b0 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/styles/index.cssr.ts+++ b/packages/dsh-tauri-panel-scheduler/src/client/styles/index.cssr.ts@@ -44,9 +44,8 @@ export default c([c('.dshp-scheduler__card-meta-text', { flex: '1', minWidth: '0', color: tertiary, fontSize: '12px', lineHeight: '18px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),c('.dshp-scheduler__card-meta-text strong', { color: secondary, fontWeight: '600' }),- c('button:has(.dshp-scheduler__nav-badge)', { position: 'relative' }),- c('.dshp-scheduler__nav-badge', { position: 'absolute', right: '8px', top: '50%', transform: 'translateY(-50%)', width: '16px', height: '20px', flex: 'none', display: 'inline-flex', justifyContent: 'center', alignItems: 'center', color: tertiary }),- c('.dshp-scheduler__unread-dot', { flex: 'none', width: '6px', height: '6px', borderRadius: '50%', background: success }),+ c('button:has(.dshp-scheduler__nav-dot)', { position: 'relative' }),+ c('.dshp-scheduler__nav-dot', { position: 'absolute', right: '8px', top: '50%', transform: 'translateY(-50%)' }),c('.dshp-scheduler__recs', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '20px 0 0' }),c('.dshp-scheduler__recs-title', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),diff --git a/packages/dsh-tauri-ui-playground/src/client/ui/components-playground/ui-components.tsx b/packages/dsh-tauri-ui-playground/src/client/ui/components-playground/ui-components.tsxindex 5b7398cb..642a1fce 100644--- a/packages/dsh-tauri-ui-playground/src/client/ui/components-playground/ui-components.tsx+++ b/packages/dsh-tauri-ui-playground/src/client/ui/components-playground/ui-components.tsx@@ -7,6 +7,7 @@ import {Chip,CircleTree,Comments,+ Dot,Gear,GoalBar,GoalBarAction,@@ -235,6 +236,14 @@ export function UiComponentsPanel(): ReactElement {<Tag tone="info" variant="status">info</Tag><Tag tone="danger" variant="status">danger</Tag></div>+ <div className="dshp-ui-components__sample">+ <Dot state="done" />+ <Dot state="warning" />+ <Dot state="error" />+ <Dot state="idle" />+ <Dot />+ <Dot size={16} state="done" />+ </div></section><section className="dshp-ui-components__section">diff --git a/packages/dsh-tauri-ui/src/client/components/dot.cssr.ts b/packages/dsh-tauri-ui/src/client/components/dot.cssr.tsnew file mode 100644index 00000000..e9f3afe3--- /dev/null+++ b/packages/dsh-tauri-ui/src/client/components/dot.cssr.ts@@ -0,0 +1,24 @@+import { styles as sharedStyles } from '../constants/theme'+import { cssr } from '../utils/cssr'++const { c, bem: { b } } = cssr+const { error, idle, success, warn } = sharedStyles++export default b('dot', {+ position: 'relative',+ display: 'inline-block',+ flex: 'none',+}, [+ c('&::after', {+ content: '""',+ position: 'absolute',+ inset: '20%',+ borderRadius: '50%',+ cornerShape: 'round',+ background: 'currentColor',+ }),+ c('&[data-state="done"]', { color: success }),+ c('&[data-state="warning"]', { color: warn }),+ c('&[data-state="error"]', { color: error }),+ c('&[data-state="idle"]', { color: idle }),+])diff --git a/packages/dsh-tauri-ui/src/client/components/dot.tsx b/packages/dsh-tauri-ui/src/client/components/dot.tsxnew file mode 100644index 00000000..d5d66c45--- /dev/null+++ b/packages/dsh-tauri-ui/src/client/components/dot.tsx@@ -0,0 +1,27 @@+// 引用源 @deepseek-ai/dsh-client-ui-primitives · packages/client/ui-primitives/src/StateDot.module.css · 版本 0.1.7-alpha.1(≥0.1.7-alpha.1)· hash dot=_dot_1i3xo_2+import type { ReactElement } from 'react'+import { compact } from 'dsh-tauri/client'+import { useMountStyle } from '../hooks/use-mount-style'+import dotStyle from './dot.cssr'++export type DotState = 'done' | 'warning' | 'error' | 'idle'++export interface DotProps {+ state?: DotState+ size?: number+ className?: string+}++export const DOT_STYLE_ID = 'dsh-tauri-ui-dot-styles'++export function Dot({ state, size = 10, className }: DotProps): ReactElement {+ useMountStyle(dotStyle, DOT_STYLE_ID)+ return (+ <span+ aria-hidden+ className={compact(['dshp-dot', className]).join(' ')}+ data-state={state}+ style={{ width: size, height: size }}+ />+ )+}diff --git a/packages/dsh-tauri-ui/src/client/components/index.ts b/packages/dsh-tauri-ui/src/client/components/index.tsindex ccf7606b..396ecf95 100644--- a/packages/dsh-tauri-ui/src/client/components/index.ts+++ b/packages/dsh-tauri-ui/src/client/components/index.ts@@ -1,6 +1,7 @@export * from './button'export * from './checkbox'export * from './chip'+export * from './dot'export * from './goal-bar'export * from './icon'export * from './icon-button'diff --git a/packages/dsh-tauri-ui/src/client/components/registry.ts b/packages/dsh-tauri-ui/src/client/components/registry.tsindex b8f31798..427d90dd 100644--- a/packages/dsh-tauri-ui/src/client/components/registry.ts+++ b/packages/dsh-tauri-ui/src/client/components/registry.ts@@ -93,6 +93,12 @@ export const UI_COMPONENT_REGISTRY: readonly UiComponentEntry[] = [upstreamPath: 'packages/client/ui-primitives/src/Checkbox.tsx',mappedClass: 'checkbox',}),+ reforkVariant('StateDot', 'dot', {+ package: PRIMITIVES,+ availableAt: AVAILABLE_LATEST,+ upstreamPath: 'packages/client/ui-primitives/src/StateDot.module.css',+ mappedClass: 'dot',+ }),reforkVariant('Button', 'elevated', {package: '@deepseek-ai/dsh-client-ui-sidebar',availableAt: AVAILABLE_BOTH,diff --git a/packages/dsh-tauri-ui/src/client/components/styles.test.tsx b/packages/dsh-tauri-ui/src/client/components/styles.test.tsxindex 5ecc4951..11ad3238 100644--- a/packages/dsh-tauri-ui/src/client/components/styles.test.tsx+++ b/packages/dsh-tauri-ui/src/client/components/styles.test.tsx@@ -31,6 +31,8 @@ import { Checkbox } from './checkbox'import checkboxStyle from './checkbox.cssr'import { Chip } from './chip'import chipStyle from './chip.cssr'+import { Dot } from './dot'+import dotStyle from './dot.cssr'import { GoalBar, GoalBarAction } from './goal-bar'import goalBarStyle from './goal-bar.cssr'import { IconButton } from './icon-button'@@ -212,6 +214,14 @@ const CASES: AuditCase[] = [.map(variant => draw(Chip, { variant, icon: createElement('span'), badge: createElement('span'), chevron: createElement('span'), open: true, children: 'x' })).join(''),},+ {+ name: 'components/dot',+ style: dotStyle,+ sources: ['dot.tsx'],+ markup: () => ['done', 'warning', 'error', 'idle', undefined]+ .map(state => draw(Dot, { state }))+ .join(''),+ },{name: 'components/goal-bar',style: goalBarStyle,diff --git a/packages/dsh-tauri-ui/src/client/constants/theme.ts b/packages/dsh-tauri-ui/src/client/constants/theme.tsindex 22e9d208..99048853 100644--- a/packages/dsh-tauri-ui/src/client/constants/theme.ts+++ b/packages/dsh-tauri-ui/src/client/constants/theme.ts@@ -18,6 +18,8 @@ export const styles = {hoverDanger: 'var(--dsw-alias-interactive-bg-hover-danger)',error: 'var(--dsw-alias-state-error-primary)',success: 'var(--dsw-alias-state-success-primary)',+ warn: 'var(--dsw-alias-state-warn-primary)',+ idle: 'var(--dsw-alias-state-idle-primary)',primaryFill: 'var(--dsw-alias-button-primary-fill)',primaryHover: 'var(--dsw-alias-button-primary-hover)',primaryFg: 'var(--dsw-alias-label-primary-foreground)',