DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
refactor(plugins): 六个插件包改用 dsh-tauri-ui/client,并归位依赖
hairyff0f2f677851b
diff --git a/packages/dsh-tauri-panel-extension/package.json b/packages/dsh-tauri-panel-extension/package.jsonindex 40a2c297..163f215e 100644--- a/packages/dsh-tauri-panel-extension/package.json+++ b/packages/dsh-tauri-panel-extension/package.json@@ -38,7 +38,6 @@"client": {"inject": ["@deepseek-ai/dsh-client-ui-layout",- "@deepseek-ai/dsh-client-ui-primitives","dsh-tauri","dsh-tauri-ui"],@@ -61,7 +60,6 @@},"dependencies": {"dsh-tauri": "workspace:*",- "dsh-tauri-ui": "workspace:*","hookable": "catalog:utils","lodash-es": "catalog:utils","ofetch": "catalog:utils",@@ -75,6 +73,7 @@"@types/lodash-es": "catalog:types","dompurify": "catalog:ui","dsh-tauri-tsdown": "workspace:*",+ "dsh-tauri-ui": "workspace:*","marked": "catalog:ui","smol-toml": "catalog:utils","tsdown": "catalog:cli"diff --git a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.cssr.tsdeleted file mode 100644index 3e202bb2..00000000--- a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.cssr.ts+++ /dev/null@@ -1,50 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c, bem: { b, e } } = cssr-const { primary, tertiary, borderL2: border, business } = sharedStyles--export default b('extension', [- e('section', {- display: 'flex',- flexDirection: 'column',- gap: '14px',- color: primary,- }),- e('tabs', {- display: 'flex',- alignItems: 'flex-end',- gap: '22px',- borderBottom: `1px solid ${border}`,- marginTop: '2px',- }),- e('tab', {- position: 'relative',- border: '0',- padding: '7px 1px 9px',- background: 'transparent',- color: tertiary,- font: 'inherit',- fontSize: '13px',- lineHeight: '20px',- cursor: 'pointer',- }, [- c('&:hover, &[data-active="true"]', { color: primary }),- c('&[data-active="true"]::after, &:focus-visible::after', {- position: 'absolute',- right: '0',- bottom: '-1px',- left: '0',- height: '2px',- borderRadius: '2px 2px 0 0',- background: primary,- content: '""',- }),- c('&:focus-visible', {- outline: `2px solid ${business}`,- outlineOffset: '2px',- borderRadius: '2px',- color: primary,- }),- ]),- e('tab-panel', { minWidth: '0', paddingTop: '2px' }),-])diff --git a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsxindex 24a0c0c0..1e00f645 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx@@ -1,10 +1,8 @@import type { ReactElement } from 'react'import type { MarketFace } from '../service/market.types'-import { useMountStyle } from 'dsh-tauri-ui/client'-import { useEffect, useId, useRef, useState } from 'react'-import { EXTENSION_PANEL_STYLE_ID } from '../constants'+import { SegmentedControl } from 'dsh-tauri-ui/client'+import { useEffect, useId, useState } from 'react'import { locale } from '../locales'-import extensionPanelStyle from './extension-panel.cssr'import { MarketTab } from './market-tab'import { McpTab } from './mcp-tab'import { SkillsTab } from './skills-tab'@@ -23,9 +21,7 @@ interface ExtensionTab {export function ExtensionPanel({ createSkill, market }: ExtensionPanelProps): ReactElement {const t = locale.text- useMountStyle(extensionPanelStyle, EXTENSION_PANEL_STYLE_ID)const tabsId = useId()- const tabRefs = useRef<Array<HTMLButtonElement | null>>([])const marketFace = marketconst rows: ExtensionTab[] = [...(marketFace === undefined@@ -42,46 +38,18 @@ export function ExtensionPanel({ createSkill, market }: ExtensionPanelProps): Rereturn (<div className="dshp-extension"><div className="dshp-extension__section">- <div className="dshp-extension__tabs" role="tablist" aria-label={t('extension')}>- {rows.map((row, index) => {- const selected = row.id === activeId- return (- <button- key={row.id}- ref={(element) => { tabRefs.current[index] = element }}- id={`${tabsId}-tab-${row.id}`}- type="button"- role="tab"- className="dshp-extension__tab"- aria-selected={selected}- aria-controls={`${tabsId}-panel-${row.id}`}- data-active={selected ? 'true' : undefined}- tabIndex={selected ? 0 : -1}- onClick={() => setActiveId(row.id)}- onKeyDown={(event) => {- let next: number- if (event.key === 'ArrowRight')- next = (index + 1) % rows.length- else if (event.key === 'ArrowLeft')- next = (index - 1 + rows.length) % rows.length- else if (event.key === 'Home')- next = 0- else if (event.key === 'End')- next = rows.length - 1- else return- event.preventDefault()- setActiveId(rows[next]?.id ?? 'skills')- tabRefs.current[next]?.focus()- }}- >- {row.label}- </button>- )- })}+ <div>+ <SegmentedControl+ id={tabsId}+ label={t('extension')}+ value={activeId}+ options={rows.map(row => ({ value: row.id, label: row.label }))}+ onChange={setActiveId}+ /></div>{rows.filter(row => row.id === activeId || visited.has(row.id)).map((row) => {const selected = row.id === activeId- return <div key={row.id} id={`${tabsId}-panel-${row.id}`} className="dshp-extension__tab-panel" role="tabpanel" aria-labelledby={`${tabsId}-tab-${row.id}`} hidden={!selected}>{row.render()}</div>+ return <div key={row.id} id={`${tabsId}-${row.id}-panel`} className="dshp-extension__tab-panel" role="tabpanel" aria-labelledby={`${tabsId}-${row.id}`} hidden={!selected}>{row.render()}</div>})}</div></div>diff --git a/packages/dsh-tauri-panel-extension/src/client/components/markdown.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/markdown.cssr.tsdeleted file mode 100644index 8736e7d8..00000000--- a/packages/dsh-tauri-panel-extension/src/client/components/markdown.cssr.ts+++ /dev/null@@ -1,42 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c, bem: { b, e } } = cssr-const { primary, borderL2: border, business, layer1, layer3 } = sharedStyles--export default b('extension', [- e('md-preview', {- minHeight: '320px',- maxHeight: '60vh',- overflowY: 'auto',- border: `1px solid ${border}`,- borderRadius: '8px',- padding: '8px 12px',- background: layer1,- fontSize: '13px',- }),- e('md-body', [- c('& h1, & h2, & h3, & h4', { margin: '14px 0 6px', color: primary, lineHeight: '1.4' }),- c('& h1', { fontSize: '18px' }),- c('& h2', { fontSize: '16px' }),- c('& h3', { fontSize: '14px' }),- c('& h4', { fontSize: '13px' }),- c('& p', { margin: '6px 0', lineHeight: '20px' }),- c('& ul, & ol', { margin: '6px 0', paddingLeft: '20px' }),- c('& code', {- fontFamily: 'var(--ds-font-family-code)',- fontSize: '12px',- background: layer3,- borderRadius: '4px',- padding: '1px 5px',- }),- c('& pre', {- margin: '8px 0',- padding: '10px 12px',- overflowX: 'auto',- border: `1px solid ${border}`,- borderRadius: '8px',- background: layer3,- }),- c('& a', { color: business }),- ]),-])diff --git a/packages/dsh-tauri-panel-extension/src/client/components/markdown.tsx b/packages/dsh-tauri-panel-extension/src/client/components/markdown.tsxindex 24a375b1..983b815b 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/markdown.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/markdown.tsx@@ -1,17 +1,13 @@import type { ReactElement } from 'react'import DOMPurify from 'dompurify'-import { useMountStyle } from 'dsh-tauri-ui/client'import { marked } from 'marked'import { useMemo } from 'react'-import { MARKDOWN_STYLE_ID } from '../constants'-import markdownStyle from './markdown.cssr'function parseMarkdown(text: string): string {return DOMPurify.sanitize(marked.parse(text, { async: false, gfm: true, breaks: false }) as string)}export function MarkdownPreview(props: { text: string }): ReactElement {- useMountStyle(markdownStyle, MARKDOWN_STYLE_ID)const html = useMemo(() => parseMarkdown(props.text), [props.text])return <div className="dshp-extension__md-body" dangerouslySetInnerHTML={{ __html: html }} />}diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.cssr.tsdeleted file mode 100644index c547902c..00000000--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.cssr.ts+++ /dev/null@@ -1,38 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c, bem: { b, e } } = cssr-const { primary, tertiary, borderL2: border, business } = sharedStyles--export default b('extension', [- e('editor-tabs', { display: 'flex', gap: '4px', borderBottom: `1px solid ${border}` }),- e('editor-tab', {- position: 'relative',- border: '0',- padding: '7px 10px 9px',- background: 'transparent',- color: tertiary,- font: 'inherit',- fontSize: '13px',- lineHeight: '20px',- cursor: 'pointer',- }, [- c('&:hover, &[data-active="true"]', { color: primary }),- c('&[data-active="true"]::after', {- position: 'absolute',- right: '8px',- bottom: '-1px',- left: '8px',- height: '2px',- borderRadius: '2px 2px 0 0',- background: primary,- content: '""',- }),- c('&:focus-visible', {- outline: `2px solid ${business}`,- outlineOffset: '-2px',- borderRadius: '4px',- color: primary,- }),- ]),- e('json-editor', { minHeight: '260px' }),-])diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.tsx b/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.tsxindex a0c232a5..a62efb14 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.tsx@@ -1,10 +1,8 @@import type { ReactElement } from 'react'import type { Translate } from '../locales/index.types'import type { McpEditorMode, McpEditorState } from './mcp-tab.types'-import { Button } from '@deepseek-ai/dsh-client-ui-primitives'-import { useMountStyle } from 'dsh-tauri-ui/client'-import { MCP_EDITOR_FORM_STYLE_ID } from '../constants'-import mcpEditorFormStyle from './mcp-editor-form.cssr'+import { Button, ChevronDown, Chip, Icon, Input, Menu, SegmentedControl } from 'dsh-tauri-ui/client'+import { useId, useState } from 'react'export interface McpEditorFormProps {t: Translate@@ -23,28 +21,28 @@ export interface McpEditorFormProps {}export function McpEditorForm(props: McpEditorFormProps): ReactElement {- useMountStyle(mcpEditorFormStyle, MCP_EDITOR_FORM_STYLE_ID)const { t, editor, mode, busy, pasteJson, pasteError, formError, onModeChange, onEditorChange, onPasteJsonChange, onPasteFill, onCancel, onSave } = props+ const tabsId = useId()+ const [transportOpen, setTransportOpen] = useState(false)+ const transportOptions = [+ { id: 'stdio', label: t('transportStdio') },+ { id: 'streamable-http', label: t('transportHttp') },+ ]return (<div className="dshp-extension__form">- <div className="dshp-extension__editor-tabs" role="tablist" aria-label={t('addServer')}>- {(['json', 'form'] as const).map(modeKey => (- <button- key={modeKey}- type="button"- role="tab"- className="dshp-extension__editor-tab"- aria-selected={mode === modeKey}- data-active={mode === modeKey ? 'true' : undefined}- onClick={() => onModeChange(modeKey)}- >- {t(modeKey === 'json' ? 'editorJsonTab' : 'editorFormTab')}- </button>- ))}- </div>+ <SegmentedControl+ id={tabsId}+ label={t('addServer')}+ value={mode}+ options={[+ { value: 'json', label: t('editorJsonTab') },+ { value: 'form', label: t('editorFormTab') },+ ]}+ onChange={next => onModeChange(next as McpEditorMode)}+ />{mode === 'json'? (- <div className="dshp-extension__form" role="tabpanel">+ <div id={`${tabsId}-json-panel`} className="dshp-extension__form" role="tabpanel" aria-labelledby={`${tabsId}-json`}><label className="dshp-extension__label"><span>{t('formatPaste')}</span><textarea@@ -61,34 +59,48 @@ export function McpEditorForm(props: McpEditorFormProps): ReactElement {</div>): (- <div className="dshp-extension__form" role="tabpanel">+ <div id={`${tabsId}-form-panel`} className="dshp-extension__form" role="tabpanel" aria-labelledby={`${tabsId}-form`}><label className="dshp-extension__label"><span>{t('serverName')}</span>- <input- className="dshp-extension__input"+ <Inputvalue={editor.serverName}disabled={editor.id !== ''}onChange={event => onEditorChange({ serverName: event.target.value })}/></label>- <label className="dshp-extension__label">+ <div className="dshp-extension__label"><span>{t('transport')}</span>- <select- className="dshp-extension__select"- value={editor.transport}- disabled={editor.id !== ''}- onChange={event => onEditorChange({ transport: event.target.value as McpEditorState['transport'] })}- >- <option value="stdio">{t('transportStdio')}</option>- <option value="streamable-http">{t('transportHttp')}</option>- </select>- </label>+ <Menu+ open={transportOpen}+ onClose={() => setTransportOpen(false)}+ onSelect={(id) => {+ onEditorChange({ transport: id as McpEditorState['transport'] })+ setTransportOpen(false)+ }}+ items={transportOptions}+ selectedId={editor.transport}+ portal+ anchor={(+ <Chip+ variant="selector"+ disabled={editor.id !== ''}+ aria-label={t('transport')}+ aria-haspopup="menu"+ aria-expanded={transportOpen}+ chevron={<Icon as={ChevronDown} />}+ onClick={() => setTransportOpen(value => !value)}+ >+ {transportOptions.find(option => option.id === editor.transport)?.label}+ </Chip>+ )}+ />+ </div>{editor.transport === 'stdio'? (<><label className="dshp-extension__label"><span>{t('command')}</span>- <input className="dshp-extension__input" value={editor.command} onChange={event => onEditorChange({ command: event.target.value })} />+ <Input value={editor.command} onChange={event => onEditorChange({ command: event.target.value })} /></label><label className="dshp-extension__label"><span>{t('args')}</span>@@ -104,7 +116,7 @@ export function McpEditorForm(props: McpEditorFormProps): ReactElement {<><label className="dshp-extension__label"><span>{t('url')}</span>- <input className="dshp-extension__input" value={editor.url} onChange={event => onEditorChange({ url: event.target.value })} />+ <Input value={editor.url} onChange={event => onEditorChange({ url: event.target.value })} /></label><label className="dshp-extension__label"><span>{t('headersPairs')}</span>diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.cssr.tsdeleted file mode 100644index d6d6666e..00000000--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.cssr.ts+++ /dev/null@@ -1,36 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { bem: { b, e, m } } = cssr-const { secondary, tertiary } = sharedStyles--export default b('extension', [- e('import-scroll', {- display: 'flex',- flexDirection: 'column',- gap: '14px',- maxHeight: 'min(400px,52vh)',- overflowY: 'auto',- padding: '2px 4px 2px 2px',- }),- e('import-group', { display: 'flex', flexDirection: 'column', gap: '8px' }),- e('import-head', { display: 'flex', alignItems: 'center', gap: '8px', padding: '0 2px' }),- e('import-count', { fontSize: '12px', lineHeight: '18px', color: tertiary }),- e('import-all', {- marginLeft: 'auto',- display: 'inline-flex',- alignItems: 'center',- gap: '6px',- fontSize: '12px',- color: secondary,- cursor: 'pointer',- }),- e('import-choice', {- display: 'inline-flex',- alignItems: 'center',- gap: '8px',- cursor: 'pointer',- minWidth: '0',- }, [- m('disabled', { cursor: 'default' }),- ]),-])diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.tsx b/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.tsxindex e06aa4fd..004c08f4 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.tsx@@ -1,10 +1,7 @@import type { ReactElement } from 'react'import type { Translate } from '../locales/index.types'import type { McpImportItem } from './mcp-tab.types'-import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'-import { useMountStyle } from 'dsh-tauri-ui/client'-import { MCP_IMPORT_DIALOG_STYLE_ID } from '../constants'-import mcpImportDialogStyle from './mcp-import-dialog.cssr'+import { Button, Checkbox, Modal, Tag } from 'dsh-tauri-ui/client'import { importGroups } from './mcp-tab.utils'export interface McpImportDialogProps {@@ -20,7 +17,6 @@ export interface McpImportDialogProps {}export function McpImportDialog(props: McpImportDialogProps): ReactElement {- useMountStyle(mcpImportDialogStyle, MCP_IMPORT_DIALOG_STYLE_ID)const { t, open, items, busy, formError, onClose, onToggle, onToggleGroup, onImport } = propsreturn (<Modal@@ -45,17 +41,14 @@ export function McpImportDialog(props: McpImportDialogProps): ReactElement {return (<section className="dshp-extension__import-group" key={group.agent}><div className="dshp-extension__import-head">- <span className="dshp-extension__tag" data-kind="source">{group.label}</span>+ <Tag tone="info">{group.label}</Tag><span className="dshp-extension__import-count">{group.items.length}</span>{selectable.length > 0 && (- <label className="dshp-extension__import-all">- <input- type="checkbox"- checked={allChecked}- onChange={event => onToggleGroup(selectable, event.target.checked)}- />- {t('importSelectAll')}- </label>+ <div className="dshp-extension__import-all">+ <Checkbox checked={allChecked} onChange={next => onToggleGroup(selectable, next)}>+ {t('importSelectAll')}+ </Checkbox>+ </div>)}</div><ul className="dshp-extension__cards dshp-extension__cards--single">@@ -66,17 +59,16 @@ export function McpImportDialog(props: McpImportDialogProps): ReactElement {return (<li className={`dshp-extension__card${item.existing ? ' dshp-extension__card--muted' : ''}`} key={`${item.server.agent}/${item.server.name}`}><div className="dshp-extension__card-top">- <label className={`dshp-extension__import-choice${item.existing ? ' dshp-extension__import-choice--disabled' : ''}`}>- <input- type="checkbox"- checked={item.checked}- disabled={item.existing}- onChange={event => onToggle(index, event.target.checked)}- />+ <Checkbox+ checked={item.checked}+ disabled={item.existing}+ onChange={next => onToggle(index, next)}+ title={item.server.name}+ ><strong className="dshp-extension__card-title" title={item.server.name}>{item.server.name}</strong>- </label>- <span className="dshp-extension__tag">{item.server.transport}</span>- {item.existing && <span className="dshp-extension__tag">{t('importExisting')}</span>}+ </Checkbox>+ <Tag tone="neutral">{item.server.transport}</Tag>+ {item.existing && <Tag tone="quiet">{t('importExisting')}</Tag>}</div><p className="dshp-extension__card-desc" title={command}>{command}</p></li>diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.cssr.tsdeleted file mode 100644index 70859222..00000000--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.cssr.ts+++ /dev/null@@ -1,24 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c, bem: { b, e } } = cssr-const { primary, borderL2: border, business, layer1 } = sharedStyles--export default b('extension', [- e('scope', {- boxSizing: 'border-box',- border: `1px solid ${border}`,- borderRadius: '8px',- padding: '4px 10px',- outline: 'none',- background: layer1,- color: primary,- font: 'inherit',- fontSize: '12px',- lineHeight: '18px',- }, [- c('&:focus-visible', {- borderColor: business,- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,- }),- ]),-])diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsxindex bacd16f4..88501c9d 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx@@ -2,22 +2,19 @@ import type { ReactElement } from 'react'import type { McpSaveBody } from '../apis/index.type'import type { McpRow } from '../types'import type { McpEditorMode, McpEditorState, McpImportItem, McpTabProps } from './mcp-tab.types'-import { Button, Modal, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'-import { ArrowRotateRight, Icon, PlugConnection, useMountStyle } from 'dsh-tauri-ui/client'+import { ArrowRotateRight, Button, ChevronDown, Chip, Icon, IconButton, Menu, Modal, PlugConnection, StateDot, Tag } from 'dsh-tauri-ui/client'import { compact } from 'dsh-tauri/client'import { useEffect, useState } from 'react'import { deleteMcp, getImportScan, getMcp, postImportApply, postMcp, postMcpCheck, postMcpToggle } from '../apis'-import { MCP_RESTART_INITIAL_DELAY_MS, MCP_RESTART_POLL_INTERVAL_MS, MCP_RESTART_TIMEOUT_MS, MCP_TAB_STYLE_ID } from '../constants'+import { MCP_RESTART_INITIAL_DELAY_MS, MCP_RESTART_POLL_INTERVAL_MS, MCP_RESTART_TIMEOUT_MS } from '../constants'import { useTimers } from '../hooks/use-timers'import { restartHost } from '../service/restart'import { isDesktopHost } from '../service/restart.utils'import { McpEditorForm } from './mcp-editor-form'import { McpImportDialog } from './mcp-import-dialog'-import mcpTabStyle from './mcp-tab.cssr'import { mapToPairs, parseMcpJson, parsePairs } from './mcp-tab.utils'export function McpTab({ t }: McpTabProps): ReactElement {- useMountStyle(mcpTabStyle, MCP_TAB_STYLE_ID)const [servers, setServers] = useState<McpRow[] | null>(null)const [editor, setEditor] = useState<McpEditorState | null>(null)const [confirmId, setConfirmId] = useState<string | null>(null)@@ -34,6 +31,7 @@ export function McpTab({ t }: McpTabProps): ReactElement {const [pasteJson, setPasteJson] = useState('')const [pasteError, setPasteError] = useState<string | null>(null)const [scope, setScope] = useState<'all' | 'global' | 'profile'>('all')+ const [scopeOpen, setScopeOpen] = useState(false)const [checking, setChecking] = useState<string | null>(null)const [globalError, setGlobalError] = useState('')const { later } = useTimers()@@ -304,6 +302,12 @@ export function McpTab({ t }: McpTabProps): ReactElement {</div>)+ const scopeOptions = [+ { id: 'all', label: t('scopeAll') },+ { id: 'global', label: t('global') },+ { id: 'profile', label: t('profile') },+ ]+return (<div className="dshp-extension__section"><div className="dshp-extension__head">@@ -327,15 +331,32 @@ export function McpTab({ t }: McpTabProps): ReactElement {<div className="dshp-extension__list-head"><h3>{t('mcpTab')}</h3>{servers !== null && <span className="dshp-extension__count">{servers.length}</span>}- <select className="dshp-extension__scope" aria-label={t('scope')} value={scope} onChange={event => setScope(event.target.value as typeof scope)}>- <option value="all">{t('scopeAll')}</option>- <option value="global">{t('global')}</option>- <option value="profile">{t('profile')}</option>- </select>+ <Menu+ open={scopeOpen}+ onClose={() => setScopeOpen(false)}+ onSelect={(id) => {+ setScope(id as typeof scope)+ setScopeOpen(false)+ }}+ items={scopeOptions}+ selectedId={scope}+ portal+ align="end"+ anchor={(+ <Chip+ variant="selector"+ aria-label={t('scope')}+ aria-haspopup="menu"+ aria-expanded={scopeOpen}+ chevron={<Icon as={ChevronDown} />}+ onClick={() => setScopeOpen(value => !value)}+ >+ {scopeOptions.find(option => option.id === scope)?.label}+ </Chip>+ )}+ /><span className="dshp-extension__spacer" />- <button type="button" className="dshp-extension__refresh" aria-label={t('view')} title={t('view')} disabled={busy} onClick={() => setReload(value => value + 1)}>- <Icon as={ArrowRotateRight} />- </button>+ <IconButton variant="toolbar" icon={<Icon as={ArrowRotateRight} />} aria-label={t('view')} title={t('view')} disabled={busy} onClick={() => setReload(value => value + 1)} /></div>{servers === null && <p className="dshp-extension__empty">{t('loading')}</p>}@@ -346,9 +367,9 @@ export function McpTab({ t }: McpTabProps): ReactElement {<li className="dshp-extension__card" key={row.id}><div className="dshp-extension__card-top"><strong className="dshp-extension__card-title" title={row.id}>{row.serverName}</strong>- <span className="dshp-extension__tag" data-kind={(row.scope ?? row.layer) === 'global' ? 'source' : undefined}>{(row.scope ?? row.layer) === 'global' ? t('scopeGlobal') : t('scopeProfile')}</span>- <span className="dshp-extension__tag">{row.transport}</span>- <span className="dshp-extension__tag" data-kind={row.disabled ? 'off' : undefined}>{row.disabled ? t('disabled') : t('enabled')}</span>+ <Tag tone={(row.scope ?? row.layer) === 'global' ? 'info' : 'neutral'}>{(row.scope ?? row.layer) === 'global' ? t('scopeGlobal') : t('scopeProfile')}</Tag>+ <Tag tone="neutral">{row.transport}</Tag>+ <Tag tone={row.disabled ? 'warning' : 'neutral'}>{row.disabled ? t('disabled') : t('enabled')}</Tag></div><p className="dshp-extension__card-desc">{row.transport === 'stdio' ? `${row.command ?? ''} ${(row.args ?? []).join(' ')}` : row.url ?? ''}diff --git a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.tsdeleted file mode 100644index 5aabd418..00000000--- a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.ts+++ /dev/null@@ -1,156 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c, bem: { b, e } } = cssr-const { primary, secondary, tertiary, borderL2: border, business, layer1, layer3, hover } = sharedStyles--export default b('extension', [- e('list-head', {- display: 'flex',- alignItems: 'center',- gap: '7px',- padding: '0 2px',- marginTop: '2px',- }, [- c('& h3', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),- ]),- e('count', { fontSize: '12px', lineHeight: '18px', color: tertiary, fontVariantNumeric: 'tabular-nums' }),- e('refresh', {- display: 'inline-flex',- alignItems: 'center',- justifyContent: 'center',- width: '26px',- height: '26px',- border: '0',- borderRadius: '6px',- background: 'transparent',- color: tertiary,- cursor: 'pointer',- textDecoration: 'none',- }, [- c('&:hover', { background: hover, color: primary }),- c('&:focus-visible', { outline: `2px solid ${business}`, outlineOffset: '-2px' }),- ]),- e('icon-link', {- display: 'inline-flex',- alignItems: 'center',- justifyContent: 'center',- width: '26px',- height: '26px',- border: '0',- borderRadius: '6px',- background: 'transparent',- color: tertiary,- cursor: 'pointer',- textDecoration: 'none',- }, [- c('&:hover', { background: hover, color: primary }),- c('&:focus-visible', { outline: `2px solid ${business}`, outlineOffset: '-2px' }),- ]),- e('banner', {- display: 'flex',- alignItems: 'flex-start',- gap: '8px',- border: `1px solid ${border}`,- borderRadius: '8px',- padding: '10px 12px',- background: layer3,- fontSize: '13px',- lineHeight: '20px',- }, [- c('&[data-kind="ok"]', {- borderColor: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 35%,transparent)',- background: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent)',- }),- c('&[data-kind="error"]', {- borderColor: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 35%,transparent)',- background: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent)',- }),- c('&[data-kind="info"]', {- borderColor: `color-mix(in srgb,${business} 35%,transparent)`,- background: `color-mix(in srgb,${business} 8%,transparent)`,- }),- ]),- e('banner-body', { flex: '1', minWidth: '0', display: 'flex', flexDirection: 'column', gap: '4px' }),- e('banner-hint', {- display: 'flex',- alignItems: 'center',- gap: '8px',- flexWrap: 'wrap',- color: secondary,- fontSize: '12px',- lineHeight: '18px',- }),- e('chips', { display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap' }),- e('chip', {- border: `1px solid ${border}`,- borderRadius: '999px',- padding: '2px 10px',- background: 'transparent',- color: secondary,- font: 'inherit',- fontSize: '12px',- cursor: 'pointer',- }, [- c('&:hover, &[data-active="true"]', { color: business, background: hover }),- ]),- e('switch', {- position: 'relative',- flex: 'none',- width: '30px',- height: '18px',- border: '0',- borderRadius: '999px',- background: layer1,- boxShadow: `inset 0 0 0 1px ${border}`,- cursor: 'pointer',- }, [- c('&[aria-checked="true"]', {- background: `color-mix(in srgb,${business} 55%,transparent)`,- boxShadow: 'none',- }),- c('&[aria-checked="true"] .dshp-extension__switch-knob', { left: '14px', background: '#fff' }),- ]),- e('switch-knob', {- position: 'absolute',- top: '2px',- left: '2px',- width: '14px',- height: '14px',- borderRadius: '50%',- background: primary,- transition: 'left .15s',- }),- e('link', {- border: '0',- padding: '0',- background: 'transparent',- font: 'inherit',- fontSize: '12px',- lineHeight: '18px',- cursor: 'pointer',- textDecoration: 'none',- color: business,- }, [- c('&:hover', { textDecoration: 'underline' }),- ]),- e('segments', {- display: 'inline-flex',- gap: '4px',- border: `1px solid ${border}`,- borderRadius: '8px',- padding: '3px',- background: layer1,- }),- e('segment', {- border: '0',- borderRadius: '6px',- padding: '4px 14px',- background: 'transparent',- color: secondary,- font: 'inherit',- fontSize: '12px',- cursor: 'pointer',- }, [- c('&[data-active="true"]', { background: hover, color: primary, fontWeight: '600' }),- ]),-])diff --git a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsxindex d39dcc3f..c172d227 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx@@ -1,19 +1,16 @@import type { ReactElement } from 'react'import type { SkillRowView } from '../types'import type { OpenTarget, SkillEditorState, SkillsTabProps } from './skills-tab.types'-import { Button, Modal, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'-import { ArrowRotateRight, GraduationCap, Icon, LogoGithub, useMountStyle } from 'dsh-tauri-ui/client'+import { ArrowRotateRight, Button, Checkbox, GraduationCap, Icon, IconButton, Input, LogoGithub, Modal, Pill, SegmentedControl, StateDot, Switch, Tag } from 'dsh-tauri-ui/client'import { orderBy, uniq } from 'dsh-tauri/client'import { useEffect, useMemo, useState } from 'react'import { deleteSkill, getSkill, getSkills, postOpenDir, postRoots, postSkill, postSkillPolicy, postSkillsRefresh } from '../apis'import { MarkdownPreview } from '../components/markdown'-import { IMPORT_REFRESH_DELAYS_MS, SKILL_REFRESH_INTERVAL_MS, SKILL_REFRESH_TIMEOUT_MS, SKILLS_TAB_STYLE_ID, SOURCE_LOCALE_KEYS } from '../constants'+import { IMPORT_REFRESH_DELAYS_MS, SKILL_REFRESH_INTERVAL_MS, SKILL_REFRESH_TIMEOUT_MS, SOURCE_LOCALE_KEYS } from '../constants'import { useTimers } from '../hooks/use-timers'-import skillsTabStyle from './skills-tab.cssr'import { normalizeRepository, policyTag } from './skills-tab.utils'export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {- useMountStyle(skillsTabStyle, SKILLS_TAB_STYLE_ID)const [skills, setSkills] = useState<SkillRowView[] | null>(null)const [editor, setEditor] = useState<SkillEditorState | null>(null)const [preview, setPreview] = useState(false)@@ -224,29 +221,30 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {</span>)}<span className="dshp-extension__spacer" />- <input className="dshp-extension__search" type="search" placeholder={t('searchSkills')} aria-label={t('searchSkills')} value={query} onChange={event => setQuery(event.target.value)} />- <button type="button" className="dshp-extension__refresh" aria-label={t('refresh')} title={t('refresh')} disabled={busy} onClick={() => void doRefresh()}><Icon as={ArrowRotateRight} /></button>+ <Input className="dshp-extension__search" type="search" placeholder={t('searchSkills')} aria-label={t('searchSkills')} value={query} onChange={event => setQuery(event.target.value)} />+ <IconButton variant="toolbar" icon={<Icon as={ArrowRotateRight} />} aria-label={t('refresh')} title={t('refresh')} disabled={busy} onClick={() => void doRefresh()} /></div>- {sources.length > 1 && <div className="dshp-extension__chips" role="group" aria-label={t('source')}>{[{ id: 'all', label: t('filterAll') }, ...sources.map(source => ({ id: source, label: t(SOURCE_LOCALE_KEYS[source] ?? 'sourceCustom') }))].map(chip => <button key={chip.id} type="button" className="dshp-extension__chip" data-active={sourceFilter === chip.id ? 'true' : undefined} onClick={() => setSourceFilter(chip.id)}>{chip.label}</button>)}</div>}+ {sources.length > 1 && <div className="dshp-extension__chips" role="group" aria-label={t('source')}>{[{ id: 'all', label: t('filterAll') }, ...sources.map(source => ({ id: source, label: t(SOURCE_LOCALE_KEYS[source] ?? 'sourceCustom') }))].map(chip => <Pill key={chip.id} active={sourceFilter === chip.id} onClick={() => setSourceFilter(chip.id)}>{chip.label}</Pill>)}</div>}{skills === null && <p className="dshp-extension__empty">{t('loading')}</p>}{skills !== null && filtered.length === 0 && <p className="dshp-extension__empty">{skills.length === 0 ? t('emptySkills') : t('noMatch')}</p>}{filtered.length > 0 && (<ul className="dshp-extension__cards">{filtered.map((skill) => {const tag = policyTag(skill)+ const githubUrl = skill.repository?.githubUrlreturn (<li className="dshp-extension__card" key={`${skill.source}/${skill.name}`}><div className="dshp-extension__card-top"><strong className="dshp-extension__card-title" title={skill.name}>{skill.name}</strong>- <span className="dshp-extension__tag" data-kind="source">{t(SOURCE_LOCALE_KEYS[skill.source] ?? 'sourceCustom')}</span>- {tag.key && <span className="dshp-extension__tag" data-kind={tag.off ? 'off' : undefined}>{t(tag.key)}</span>}+ <Tag tone="info">{t(SOURCE_LOCALE_KEYS[skill.source] ?? 'sourceCustom')}</Tag>+ {tag.key && <Tag tone={tag.off ? 'warning' : 'neutral'}>{t(tag.key)}</Tag>}</div><p className="dshp-extension__card-desc" title={skill.description}>{skill.description}</p><div className="dshp-extension__card-row">- {skill.policyEditable && <button type="button" className="dshp-extension__switch" role="switch" aria-checked={skill.invocation.modelInvocable || skill.invocation.userInvocable} aria-label={t('toggleSkill')} title={t('toggleSkillHint')} disabled={busy} onClick={() => void doToggle(skill)}><span className="dshp-extension__switch-knob" /></button>}- {skill.dir && <button type="button" className="dshp-extension__link" onClick={() => void doOpen({ target: 'skill', name: skill.name })}>{t('openFolder')}</button>}+ {skill.policyEditable && <Switch checked={skill.invocation.modelInvocable || skill.invocation.userInvocable} onChange={() => void doToggle(skill)} label={t('toggleSkill')} title={t('toggleSkillHint')} disabled={busy} />}+ {skill.dir && <Button variant="ghost" size="sm" onClick={() => void doOpen({ target: 'skill', name: skill.name })}>{t('openFolder')}</Button>}<span className="dshp-extension__spacer" />- {skill.repository?.githubUrl && <a className="dshp-extension__icon-link" href={skill.repository.githubUrl} target="_blank" rel="noreferrer" aria-label={t('githubRepository')} title={t('githubRepository')}><Icon as={LogoGithub} /></a>}+ {githubUrl !== undefined && <IconButton variant="toolbar" icon={<Icon as={LogoGithub} />} aria-label={t('githubRepository')} title={t('githubRepository')} onClick={() => window.open(githubUrl, '_blank', 'noopener,noreferrer')} />}<Button variant="ghost" size="sm" disabled={busy} onClick={() => void openExisting(skill)}>{skill.editable ? t('edit') : t('view')}</Button>{skill.removable && <Button variant="ghost" size="sm" disabled={busy} onClick={() => setConfirmName(skill.name)}>{t('delete')}</Button>}</div>@@ -261,34 +259,37 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {<div className="dshp-extension__form"><label className="dshp-extension__label"><span>{t('skillName')}</span>- <input className="dshp-extension__input" value={editor.name} disabled />+ <Input value={editor.name} disabled /></label><label className="dshp-extension__label"><span>{t('skillDescription')}</span>- <input className="dshp-extension__input" value={editor.description} disabled={readOnly} onChange={event => setEditor({ ...editor, description: event.target.value })} />+ <Input value={editor.description} disabled={readOnly} onChange={event => setEditor({ ...editor, description: event.target.value })} /></label><label className="dshp-extension__label"><span>{t('skillWhenToUse')}</span>- <input className="dshp-extension__input" value={editor.whenToUse} disabled={readOnly} onChange={event => setEditor({ ...editor, whenToUse: event.target.value })} />+ <Input value={editor.whenToUse} disabled={readOnly} onChange={event => setEditor({ ...editor, whenToUse: event.target.value })} /></label><div className="dshp-extension__checks">- <label>- <input type="checkbox" checked={editor.modelInvocable} disabled={readOnly} onChange={event => setEditor({ ...editor, modelInvocable: event.target.checked })} />+ <Checkbox checked={editor.modelInvocable} disabled={readOnly} onChange={next => setEditor({ ...editor, modelInvocable: next })}>{t('modelInvocable')}- </label>- <label>- <input type="checkbox" checked={editor.userInvocable} disabled={readOnly} onChange={event => setEditor({ ...editor, userInvocable: event.target.checked })} />+ </Checkbox>+ <Checkbox checked={editor.userInvocable} disabled={readOnly} onChange={next => setEditor({ ...editor, userInvocable: next })}>{t('userInvocable')}- </label>+ </Checkbox></div><div className="dshp-extension__label"><div className="dshp-extension__card-row"><span>{t('skillContent')}</span><span className="dshp-extension__spacer" />- <div className="dshp-extension__segments" role="tablist" aria-label={t('skillContent')}>- <button type="button" role="tab" aria-selected={preview} className="dshp-extension__segment" data-active={preview ? 'true' : undefined} onClick={() => setPreview(true)}>{t('skillPreview')}</button>- <button type="button" role="tab" aria-selected={!preview} className="dshp-extension__segment" data-active={!preview ? 'true' : undefined} onClick={() => setPreview(false)}>{readOnly ? t('skillPlainText') : t('edit')}</button>- </div>+ <SegmentedControl+ label={t('skillContent')}+ value={preview ? 'preview' : 'text'}+ options={[+ { value: 'preview', label: t('skillPreview') },+ { value: 'text', label: readOnly ? t('skillPlainText') : t('edit') },+ ]}+ onChange={next => setPreview(next === 'preview')}+ /></div>{preview ? <div className="dshp-extension__md-preview"><MarkdownPreview text={editor.content} /></div> : <textarea className="dshp-extension__textarea" value={editor.content} readOnly={readOnly} onChange={event => setEditor({ ...editor, content: event.target.value })} />}</div>@@ -321,9 +322,8 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {<p className="dshp-extension__intro">{t('importRepositoryHint')}</p><label className="dshp-extension__label"><span>{t('repository')}</span>- <input+ <InputautoFocus- className="dshp-extension__input"placeholder={t('importRepositoryPlaceholder')}value={repositoryUrl}onChange={event => setRepositoryUrl(event.target.value)}diff --git a/packages/dsh-tauri-panel-extension/src/client/constants/index.ts b/packages/dsh-tauri-panel-extension/src/client/constants/index.tsindex ce602f44..991bf320 100644--- a/packages/dsh-tauri-panel-extension/src/client/constants/index.ts+++ b/packages/dsh-tauri-panel-extension/src/client/constants/index.ts@@ -11,12 +11,6 @@ export const INPUT_PREFILL_ID = `${PLUGIN_ID}.skill-prefill`export const INPUT_PREFILL_ORDER = 40export const INPUT_PREFILL_PRIORITY = 0export const STYLE_ID = `${PLUGIN_ID}-styles`-export const EXTENSION_PANEL_STYLE_ID = `${PLUGIN_ID}-panel-styles`-export const SKILLS_TAB_STYLE_ID = `${PLUGIN_ID}-skills-tab-styles`-export const MCP_TAB_STYLE_ID = `${PLUGIN_ID}-mcp-tab-styles`-export const MARKDOWN_STYLE_ID = `${PLUGIN_ID}-markdown-styles`-export const MCP_EDITOR_FORM_STYLE_ID = `${PLUGIN_ID}-editor-form-styles`-export const MCP_IMPORT_DIALOG_STYLE_ID = `${PLUGIN_ID}-import-dialog-styles`export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`export const STYLES_EFFECT = `${PLUGIN_ID}: styles`diff --git a/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.tsindex 965b733b..02997d5f 100644--- a/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.ts+++ b/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.ts@@ -4,6 +4,12 @@ const { c, bem: { b, e, m } } = cssrconst { primary, secondary, tertiary, borderL2: border, business, layer1, layer3, hover } = sharedStylesexport default b('extension', [+ e('section', {+ display: 'flex',+ flexDirection: 'column',+ gap: '14px',+ color: primary,+ }),e('intro', { margin: '0', fontSize: '12px', lineHeight: '18px', color: tertiary }),e('empty', { margin: '0', fontSize: '13px', lineHeight: '20px', color: tertiary }),e('spacer', { flex: '1' }),@@ -23,24 +29,50 @@ export default b('extension', [width: '22px',height: '22px',}),- e('search', {- width: '200px',- boxSizing: 'border-box',+ e('list-head', {+ display: 'flex',+ alignItems: 'center',+ gap: '7px',+ padding: '0 2px',+ marginTop: '2px',+ }, [+ c('& h3', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),+ ]),+ e('count', { fontSize: '12px', lineHeight: '18px', color: tertiary, fontVariantNumeric: 'tabular-nums' }),+ e('banner', {+ display: 'flex',+ alignItems: 'flex-start',+ gap: '8px',border: `1px solid ${border}`,borderRadius: '8px',- padding: '4px 10px',- outline: 'none',- background: layer1,- color: primary,- font: 'inherit',- fontSize: '12px',- lineHeight: '18px',+ padding: '10px 12px',+ background: layer3,+ fontSize: '13px',+ lineHeight: '20px',}, [- c('&:focus-visible', {- borderColor: business,- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,+ c('&[data-kind="ok"]', {+ borderColor: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 35%,transparent)',+ background: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent)',+ }),+ c('&[data-kind="error"]', {+ borderColor: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 35%,transparent)',+ background: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent)',+ }),+ c('&[data-kind="info"]', {+ borderColor: `color-mix(in srgb,${business} 35%,transparent)`,+ background: `color-mix(in srgb,${business} 8%,transparent)`,}),]),+ e('banner-body', { flex: '1', minWidth: '0', display: 'flex', flexDirection: 'column', gap: '4px' }),+ e('banner-hint', {+ display: 'flex',+ alignItems: 'center',+ gap: '8px',+ flexWrap: 'wrap',+ color: secondary,+ fontSize: '12px',+ lineHeight: '18px',+ }),e('form', { display: 'flex', flexDirection: 'column', gap: '10px' }),e('label', {display: 'flex',@@ -52,76 +84,12 @@ export default b('extension', [}, [c('& > span:first-child', { color: tertiary }),]),- e('input', {- width: '100%',- boxSizing: 'border-box',- border: `1px solid ${border}`,- borderRadius: '8px',- padding: '7px 10px',- outline: 'none',- background: layer1,- color: primary,- font: 'inherit',- fontSize: '13px',- }, [- c('&:focus-visible', {- borderColor: business,- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,- }),- ]),- e('textarea', {- width: '100%',- boxSizing: 'border-box',- border: `1px solid ${border}`,- borderRadius: '8px',- padding: '7px 10px',- outline: 'none',- background: layer1,- color: primary,- font: 'inherit',- fontSize: '13px',- minHeight: '320px',- resize: 'vertical',- fontFamily: 'var(--ds-font-family-code)',- lineHeight: '1.5',- }, [- c('&[data-short="true"]', { minHeight: '96px' }),- c('&:focus-visible', {- borderColor: business,- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,- }),- ]),- e('select', {- width: '100%',- boxSizing: 'border-box',- border: `1px solid ${border}`,- borderRadius: '8px',- padding: '7px 10px',- outline: 'none',- background: layer1,- color: primary,- font: 'inherit',- fontSize: '13px',- }, [- c('&:focus-visible', {- borderColor: business,- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,- }),- ]),e('checks', {display: 'flex',+ alignItems: 'center',gap: '16px',- fontSize: '13px',- lineHeight: '20px',- }, [- c('& label', {- display: 'inline-flex',- alignItems: 'center',- gap: '8px',- cursor: 'pointer',- minWidth: '0',- }),- ]),+ flexWrap: 'wrap',+ }),e('form-error', {margin: '0',color: 'var(--dsw-alias-state-error-primary)',@@ -178,39 +146,80 @@ export default b('extension', [WebkitBoxOrient: 'vertical',overflow: 'hidden',}),- e('tag', {- display: 'inline-flex',- alignItems: 'center',- minHeight: '20px',- borderRadius: '5px',- padding: '1px 6px',+ e('chips', { display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap' }),+ e('search', { width: '200px' }),+ // dsh-tauri-ui 无 Textarea 导出,多行正文/参数编辑器保留原生元素与自有外观。+ e('textarea', {+ width: '100%',+ boxSizing: 'border-box',+ border: `1px solid ${border}`,+ borderRadius: '8px',+ padding: '7px 10px',+ outline: 'none',background: layer1,- color: secondary,- fontSize: '11px',- lineHeight: '16px',- whiteSpace: 'nowrap',+ color: primary,+ font: 'inherit',+ fontSize: '13px',+ minHeight: '320px',+ resize: 'vertical',+ fontFamily: 'var(--ds-font-family-code)',+ lineHeight: '1.5',}, [- c('&[data-kind="source"]', {- background: `color-mix(in srgb,${business} 10%,transparent)`,- color: business,- }),- c('&[data-kind="off"]', {- background: 'color-mix(in srgb,var(--dsw-alias-state-warning-primary,var(--dsw-alias-label-tertiary)) 12%,transparent)',- color: secondary,+ c('&[data-short="true"]', { minHeight: '96px' }),+ c('&:focus-visible', {+ borderColor: business,+ boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,}),]),- e('code', {- fontFamily: 'var(--ds-font-family-code)',- fontSize: '11px',- lineHeight: '17px',- whiteSpace: 'pre',- margin: '8px 0',- padding: '10px 12px',- overflowX: 'auto',+ e('json-editor', { minHeight: '260px' }),+ e('md-preview', {+ minHeight: '320px',+ maxHeight: '60vh',+ overflowY: 'auto',border: `1px solid ${border}`,borderRadius: '8px',- background: layer3,+ padding: '8px 12px',+ background: layer1,+ fontSize: '13px',+ }),+ e('md-body', [+ c('& h1, & h2, & h3, & h4', { margin: '14px 0 6px', color: primary, lineHeight: '1.4' }),+ c('& h1', { fontSize: '18px' }),+ c('& h2', { fontSize: '16px' }),+ c('& h3', { fontSize: '14px' }),+ c('& h4', { fontSize: '13px' }),+ c('& p', { margin: '6px 0', lineHeight: '20px' }),+ c('& ul, & ol', { margin: '6px 0', paddingLeft: '20px' }),+ c('& code', {+ fontFamily: 'var(--ds-font-family-code)',+ fontSize: '12px',+ background: layer3,+ borderRadius: '4px',+ padding: '1px 5px',+ }),+ c('& pre', {+ margin: '8px 0',+ padding: '10px 12px',+ overflowX: 'auto',+ border: `1px solid ${border}`,+ borderRadius: '8px',+ background: layer3,+ }),+ c('& a', { color: business }),+ ]),+ e('tab-panel', { minWidth: '0', paddingTop: '2px' }),+ e('import-scroll', {+ display: 'flex',+ flexDirection: 'column',+ gap: '14px',+ maxHeight: 'min(400px,52vh)',+ overflowY: 'auto',+ padding: '2px 4px 2px 2px',}),+ e('import-group', { display: 'flex', flexDirection: 'column', gap: '8px' }),+ e('import-head', { display: 'flex', alignItems: 'center', gap: '8px', padding: '0 2px' }),+ e('import-count', { fontSize: '12px', lineHeight: '18px', color: tertiary }),+ e('import-all', { marginLeft: 'auto' }),c('@media (max-width: 680px)', [c('.dshp-extension__cards', { gridTemplateColumns: 'minmax(0,1fr)' }),c('.dshp-extension__search', { width: '140px' }),diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/model-picker.cssr.ts b/packages/dsh-tauri-panel-scheduler/src/client/components/model-picker.cssr.tsdeleted file mode 100644index 583f5c4a..00000000--- a/packages/dsh-tauri-panel-scheduler/src/client/components/model-picker.cssr.ts+++ /dev/null@@ -1,22 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c } = cssr-const { primary, secondary, tertiary, hover } = sharedStyles--/** ModelPicker(model-picker.tsx):只保留触发控件与官方 `Menu` 行内节点的样式。 */-export default c([- c('.dshp-scheduler__model-select', { position: 'relative', zIndex: '1', minWidth: '0', flex: 'none', height: '28px' }),- c('.dshp-scheduler__model-select--open', { zIndex: '30' }),- c('.dshp-scheduler__model-trigger', { display: 'flex', alignItems: 'center', gap: '4px', minWidth: '0', maxWidth: '260px', height: '28px', padding: '0 4px 0 8px', border: '0', borderRadius: '24px', background: 'transparent', color: secondary, fontSize: '13px', fontWeight: '500', lineHeight: '20px', cursor: 'pointer' }),- c('.dshp-scheduler__model-trigger:hover', { background: hover, color: primary }),- c('.dshp-scheduler__model-trigger > span:first-child', { minWidth: '0', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),- c('.dshp-scheduler__model-trigger-effort', { flex: 'none', color: tertiary, whiteSpace: 'nowrap' }),- c('.dshp-scheduler__model-trigger-chevron', { flex: 'none', transition: 'transform .16s ease' }),- c('.dshp-scheduler__model-trigger-chevron--open', { transform: 'rotate(180deg)' }),- c('.dshp-scheduler__model-row', { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '12px', width: '100%' }),- c('.dshp-scheduler__model-row-label', { flex: 'none' }),- c('.dshp-scheduler__model-row-hint', { flex: '1', minWidth: '0', overflow: 'hidden', color: tertiary, textAlign: 'right', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),- c('.dshp-scheduler__model-option-copy', { display: 'flex', minWidth: '0', flex: '1', flexDirection: 'column' }),- c('.dshp-scheduler__model-name', { overflow: 'hidden', fontSize: '14px', fontWeight: '500', lineHeight: '20px', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),- c('.dshp-scheduler__model-description', { overflow: 'hidden', color: tertiary, fontSize: '12px', lineHeight: '18px', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),-])diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/model-picker.tsx b/packages/dsh-tauri-panel-scheduler/src/client/components/model-picker.tsxindex 448ec551..5068ea1f 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/components/model-picker.tsx+++ b/packages/dsh-tauri-panel-scheduler/src/client/components/model-picker.tsx@@ -1,18 +1,10 @@-/**- * components/model-picker.tsx — 模型选择器(对齐 dsh-automation create-modal 的 ModelPicker:- * root / model / effort 三 pane + provider 分组),弹层走官方 primitives `Menu`。- */--import type { MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'+import type { MenuEntry } from 'dsh-tauri-ui/client'import type { ReactElement } from 'react'import type { Translate } from '../locales/index.types'import type { ModelCatalogFailure, ModelOption } from '../types'-import { Menu } from '@deepseek-ai/dsh-client-ui-primitives'-import { ChevronDown, Icon, useMountStyle } from 'dsh-tauri-ui/client'+import { ChevronDown, Chip, Icon, Menu } from 'dsh-tauri-ui/client'import { groupBy } from 'dsh-tauri/client'import { useEffect, useState } from 'react'-import { MODEL_PICKER_STYLE_ID } from '../constants'-import modelPickerStyle from './model-picker.cssr'type Pane = 'root' | 'model' | 'effort'@@ -49,7 +41,6 @@ export function ModelPicker({readonly reasoningEffort: stringreadonly onSelection: (modelKey: string, reasoningEffort: string) => void}) {- useMountStyle(modelPickerStyle, MODEL_PICKER_STYLE_ID)const [open, setOpen] = useState(false)const [pane, setPane] = useState<Pane>('root')const selected = models.find(item => `${item.provider}::${item.model}` === modelKey)@@ -69,8 +60,7 @@ export function ModelPicker({models: group,}))- // 弹层打开时的 Escape 一律由本组件消费:子 pane 回 root,root 关闭弹层。- // 必须拦在 capture 阶段,否则事件会同时触达外层 Modal 的 Escape(连带关掉对话框)。+ // Escape 必须拦在 capture 阶段,否则会同时触达外层 Modal 并连带关掉对话框useEffect(() => {if (!open)return@@ -165,7 +155,6 @@ export function ModelPicker({portalside="top"align="end"- className={`${'dshp-scheduler__model-select'}${open ? ` ${'dshp-scheduler__model-select--open'}` : ''}`}items={items}selectedId={selectedId}onSelect={onSelect}@@ -174,9 +163,9 @@ export function ModelPicker({setPane('root')}}anchor={(- <button- type="button"- className="dshp-scheduler__model-trigger"+ <Chip+ variant="composerTrigger"+ open={open}aria-label={selected === undefined? t('trigger.selectAria'): effortLabel === undefined@@ -193,11 +182,11 @@ export function ModelPicker({setPane('root')setOpen(true)}}+ chevron={<Icon as={ChevronDown} size={14} />}>- <span>{trigger}</span>+ <span className="dshp-scheduler__model-trigger-label">{trigger}</span>{effortLabel !== undefined && <span className="dshp-scheduler__model-trigger-effort">{effortLabel}</span>}- <Icon as={ChevronDown} className={`${'dshp-scheduler__model-trigger-chevron'}${open ? ` ${'dshp-scheduler__model-trigger-chevron--open'}` : ''}`} />- </button>+ </Chip>)}/>)diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/recommendations.cssr.ts b/packages/dsh-tauri-panel-scheduler/src/client/components/recommendations.cssr.tsdeleted file mode 100644index 1cf0fe4b..00000000--- a/packages/dsh-tauri-panel-scheduler/src/client/components/recommendations.cssr.ts+++ /dev/null@@ -1,19 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c } = cssr-const { primary, secondary, tertiary, hover } = sharedStyles--/** 推荐(预置)定时任务(recommendations.tsx)。 */-export default c([- 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' }),- c('.dshp-scheduler__recs-list', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),- c('.dshp-scheduler__recs-item', { boxSizing: 'border-box', display: 'flex', alignItems: 'flex-start', gap: '10px', width: '100%', minWidth: '0', padding: '10px 12px', border: `none`, borderRadius: '10px', background: 'transparent', color: 'inherit', font: 'inherit', fontSize: '13px', lineHeight: '20px', textAlign: 'left', cursor: 'pointer' }),- c('.dshp-scheduler__recs-item:hover', { background: hover }),- c('.dshp-scheduler__recs-icon', { flex: 'none', display: 'inline-flex', marginTop: '2px', fontSize: '16px' }),- c('.dshp-scheduler__recs-body', { display: 'flex', flexDirection: 'column', gap: '2px', minWidth: '0' }),- c('.dshp-scheduler__recs-name', { color: primary, fontSize: '13px', lineHeight: '18px', fontWeight: '500' }),- c('.dshp-scheduler__recs-name strong', { color: secondary, fontWeight: '600' }),- c('.dshp-scheduler__recs-prompt', { color: tertiary, fontSize: '12px', lineHeight: '18px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),- c('.dshp-scheduler__muted', { margin: '0', color: secondary, fontSize: '12px' }),-])diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/recommendations.tsx b/packages/dsh-tauri-panel-scheduler/src/client/components/recommendations.tsxindex c68822bb..0d100003 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/components/recommendations.tsx+++ b/packages/dsh-tauri-panel-scheduler/src/client/components/recommendations.tsx@@ -2,10 +2,8 @@ import type { IconComponent } from 'dsh-tauri-ui/client'import type { ReactElement } from 'react'import type { LocaleKey, Translate } from '../locales/index.types'import type { ScheduleForm, TaskFormState, TaskView } from '../types'-import { Calendar, Icon, useMountStyle } from 'dsh-tauri-ui/client'-import { RECOMMENDATIONS_STYLE_ID } from '../constants'+import { Calendar, Icon, styles as sharedStyles } from 'dsh-tauri-ui/client'import { createTask } from '../service/scheduler'-import recommendationsStyle from './recommendations.cssr'import { recommendationMatchesTask } from './recommendations.utils'import { describeSchedule } from './schedule.utils'@@ -27,7 +25,7 @@ export const RECOMMENDATIONS: Recommendation[] = [nameKey: 'recReviewName',promptKey: 'recReviewPrompt',schedule: { kind: 'weekly', weekdays: ['FR'], time: '16:00' },- accent: '#8B6FF0',+ accent: sharedStyles.business,icon: Calendar,form: t => ({ name: t('recReviewName'), schedule: { kind: 'weekly', weekdays: ['FR'], time: '16:00' }, prompt: t('recReviewPrompt'), workspaceId: '', permission: 'read-only', provider: '', model: '', reasoningEffort: '' }),},@@ -36,7 +34,7 @@ export const RECOMMENDATIONS: Recommendation[] = [nameKey: 'recWeekdayBriefingName',promptKey: 'recWeekdayBriefingPrompt',schedule: { kind: 'workdays', time: '08:00' },- accent: '#3D9A80',+ accent: sharedStyles.success,icon: Calendar,form: t => ({ name: t('recWeekdayBriefingName'), schedule: { kind: 'workdays', time: '08:00' }, prompt: t('recWeekdayBriefingPrompt'), workspaceId: '', permission: 'read-only', provider: '', model: '', reasoningEffort: '' }),},@@ -44,13 +42,11 @@ export const RECOMMENDATIONS: Recommendation[] = [export interface RecommendationsProps {t: Translate- /** 只读:直接消费 store snapshot。 */tasks: readonly TaskView[]}/** 推荐(预置)定时任务列表:点击直接创建,成功后该项从任务列表中消失。 */export function Recommendations({ t, tasks }: RecommendationsProps): ReactElement {- useMountStyle(recommendationsStyle, RECOMMENDATIONS_STYLE_ID)async function add(rec: Recommendation): Promise<void> {const form = rec.form(t)await createTask({diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/runs-tab.cssr.ts b/packages/dsh-tauri-panel-scheduler/src/client/components/runs-tab.cssr.tsdeleted file mode 100644index ddcede31..00000000--- a/packages/dsh-tauri-panel-scheduler/src/client/components/runs-tab.cssr.ts+++ /dev/null@@ -1,8 +0,0 @@-import { cssr } from 'dsh-tauri-ui/client'--const { c } = cssr--/** 执行记录(runs-tab.tsx):列表;行本体与未读角标样式见 styles/index.cssr.ts。 */-export default c([- c('.dshp-scheduler__runs-list', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),-])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 c6f363d3..69219687 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,9 +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, TrashBin, useMountStyle } from 'dsh-tauri-ui/client'-import { RUNS_TAB_STYLE_ID } from '../constants'-import runsTabStyle from './runs-tab.cssr'+import { Alarm, CircleCheck, CircleDashed, CircleStop, CircleXmark, Icon, IconButton, TrashBin } from 'dsh-tauri-ui/client'import { formatLocalTime, isRunUnread } from './schedule.utils'export interface RunsTabProps {@@ -37,7 +35,6 @@ const STATUS_ICONS = {}export function RunsTab({ t, runs, readAt, readIds, emptyLabel, onOpen, onDelete }: RunsTabProps): ReactElement {- useMountStyle(runsTabStyle, RUNS_TAB_STYLE_ID)if (runs.length === 0)return <p className="dshp-scheduler__empty">{emptyLabel}</p>return (@@ -64,17 +61,15 @@ export function RunsTab({ t, runs, readAt, readIds, emptyLabel, onOpen, onDelete<span className="dshp-scheduler__card-meta-text">{formatLocalTime(run.startedAt) ?? ''}</span></div></div>- <button- type="button"- className="dshp-scheduler__icon-button"+ <IconButton+ variant="action"+ icon={<Icon as={TrashBin} size={12} />}aria-label={t('deleteRun')}onClick={(event) => {event.stopPropagation()onDelete(run.id)}}- >- <Icon as={TrashBin} size={12} />- </button>+ /></li>))}</ul>diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-panel.cssr.ts b/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-panel.cssr.tsdeleted file mode 100644index 8fb71125..00000000--- a/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-panel.cssr.ts+++ /dev/null@@ -1,26 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c } = cssr-const { primary, secondary, tertiary, borderL2: border, font } = sharedStyles--/** 定时任务面板主容器(scheduler-panel.tsx):外壳 + 搜索 + Tabs。 */-export default c([- c('.dshp-scheduler__shell', { boxSizing: 'border-box', color: primary, fontFamily: font, fontSize: '13px', lineHeight: '1.5' }),- c('.dshp-scheduler__top', { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: '16px', marginBottom: '12px' }),- c('.dshp-scheduler__heading', { minWidth: '0' }),- c('.dshp-scheduler__heading h1', { margin: '0', fontSize: '20px', lineHeight: '28px', fontWeight: '500' }),- c('.dshp-scheduler__heading p', { margin: '4px 0 0', color: secondary, fontSize: '13px', lineHeight: '20px' }),- c('.dshp-scheduler__toolbar', { display: 'flex', justifyContent: 'flex-end', alignItems: 'center', gap: '16px' }),- c('.dshp-scheduler__search-bar', { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '12px' }),- c('.dshp-scheduler__search-wrap', { position: 'relative', display: 'inline-flex', flex: '0 1 280px', minWidth: '0', maxWidth: '280px' }),- c('.dshp-scheduler__search-wrap .dshp-scheduler__input', { width: '100%', paddingLeft: '32px' }),- c('.dshp-scheduler__search-icon', { position: 'absolute', left: '10px', top: '50%', transform: 'translateY(-50%)', pointerEvents: 'none', color: tertiary }),- c('.dshp-scheduler__tabs', { display: 'flex', alignItems: 'center', gap: '16px', margin: '4px 0 14px', borderBottom: `1px solid ${border}` }),- c('.dshp-scheduler__tab', { padding: '8px 0', border: '0', borderBottom: '2px solid transparent', background: 'transparent', color: secondary, font: 'inherit', fontSize: '13px', cursor: 'pointer' }),- c('.dshp-scheduler__tab:hover', { color: primary }),- c('.dshp-scheduler__tab--active', { borderBottomColor: 'currentColor', color: primary, fontWeight: '650' }),- c('.dshp-scheduler__cards', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),- c('.dshp-scheduler__empty', { margin: '0', padding: '48px 0', color: tertiary, fontSize: '13px', textAlign: 'center' }),- c('.dshp-scheduler__error', { color: 'var(--dsw-alias-state-error-primary)', margin: '0', fontSize: '12px', lineHeight: '18px' }),- c('@media (max-width: 680px)', [c('.dshp-scheduler__search-wrap', { maxWidth: '160px' })]),-])diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-panel.tsx b/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-panel.tsxindex 70e144a6..67f4b21e 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-panel.tsx+++ b/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-panel.tsx@@ -1,18 +1,16 @@import type { ReactElement } from 'react'import type { Translate } from '../locales/index.types'import type { RunView, TaskFormState, TaskView } from '../types'-import { Button } from '@deepseek-ai/dsh-client-ui-primitives'-import { Check, CommentPlus, Icon, Magnifier, Plus, useMountStyle } from 'dsh-tauri-ui/client'+import { Button, Check, CommentPlus, Icon, Input, Magnifier, Plus, SegmentedControl } from 'dsh-tauri-ui/client'import { filter, includes, isEmpty, lowerCase, omit, useEventListener } from 'dsh-tauri/client'import { useCallback, useEffect, useRef, useState } from 'react'-import { REFRESH_INTERVAL_MS, SCHEDULER_PANEL_STYLE_ID } from '../constants'+import { REFRESH_INTERVAL_MS } from '../constants'import { useScheduler } from '../hooks/use-scheduler'import { deleteRun, loadScheduler } from '../service/scheduler'import { store } from '../store'import { Recommendations } from './recommendations'import { RunsTab } from './runs-tab'import { countUnreadRuns, describeSchedule, formatRelative, isTaskPaused } from './schedule.utils'-import schedulerPanelStyle from './scheduler-panel.cssr'import { TaskCard } from './task-card'import { TaskCreateDialog } from './task-create-dialog'@@ -22,14 +20,12 @@ interface SchedulerPanelProps {onOpenSession: (sessionId: string) => 'opened' | 'archived' | 'unavailable'}-/** 对话框状态:手动创建(无 initial/taskId)、编辑(taskId + initial)、推荐(initial)。 */type DialogState = { taskId?: string, initial?: TaskFormState } | null/** 由任务视图构造编辑表单(去掉 timeZone 等宿主字段)。 */function taskToForm(task: TaskView): TaskFormState {return {name: task.name,- // ScheduleForm 不含 timeZone;仅保留 kind 相关字段。schedule: omit(task.schedule, 'timeZone') as TaskFormState['schedule'],prompt: task.prompt,workspaceId: task.workspaceId ?? '',@@ -42,7 +38,6 @@ function taskToForm(task: TaskView): TaskFormState {}export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelProps): ReactElement {- useMountStyle(schedulerPanelStyle, SCHEDULER_PANEL_STYLE_ID)const state = useScheduler()const [tab, setTab] = useState<'tasks' | 'runs'>('tasks')const [search, setSearch] = useState('')@@ -62,8 +57,7 @@ export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelPrreturn () => clearInterval(timer)}, [])- // 回到前台 / 重新聚焦时立刻补一次刷新(离开期间轮询可能被浏览器节流)。- // reause 的 useEventListener 收的是 ref 目标(与 dsh-tauri-worktree 的 dialog 一致)。+ // 回到前台 / 重新聚焦时立刻补一次刷新(离开期间轮询可能被浏览器节流)const refreshOnResume = useCallback((): void => {if (document.visibilityState === 'visible')void loadScheduler(false)@@ -106,27 +100,25 @@ export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelPr<p>{t('subtitle')}</p></div><div className="dshp-scheduler__toolbar">- <Button style={{ flexShrink: 0 }} variant="outline" size="sm" icon={<Icon as={CommentPlus} />} onClick={onViaChat}>+ <Button style={{ flexShrink: 0 }} variant="addGhost" icon={<Icon as={CommentPlus} />} onClick={onViaChat}>{t('viaChat')}</Button>- <Button style={{ flexShrink: 0 }} variant="primary" size="sm" icon={<Icon as={Plus} size={13} />} onClick={() => setDialog({})}>+ <Button style={{ flexShrink: 0 }} variant="add" icon={<Icon as={Plus} size={13} />} onClick={() => setDialog({})}>{t('createManual')}</Button></div></header><div className="dshp-scheduler__search-bar">- <div className="dshp-scheduler__search-wrap">- <Icon as={Magnifier} className="dshp-scheduler__search-icon" />- <input- className="dshp-scheduler__input"- type="search"- aria-label={t('searchPlaceholder')}- placeholder={t('searchPlaceholder')}- value={search}- onChange={event => setSearch(event.target.value)}- />- </div>+ <Input+ className="dshp-scheduler__search-wrap"+ type="search"+ icon={<Icon as={Magnifier} />}+ aria-label={t('searchPlaceholder')}+ placeholder={t('searchPlaceholder')}+ value={search}+ onChange={event => setSearch(event.target.value)}+ />{tab === 'runs' && unread > 0? (<Button variant="ghost" size="sm" icon={<Icon as={Check} />} onClick={() => store.scheduler.markAllRunsRead()}>@@ -136,25 +128,17 @@ export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelPr: null}</div>- <div className="dshp-scheduler__tabs" role="tablist" aria-label={t('scheduler')}>- <button- type="button"- role="tab"- aria-selected={tab === 'tasks'}- className={tab === 'tasks' ? `${'dshp-scheduler__tab'} ${'dshp-scheduler__tab--active'}` : 'dshp-scheduler__tab'}- onClick={() => setTab('tasks')}- >- {t('tasksTab')}- </button>- <button- type="button"- role="tab"- aria-selected={tab === 'runs'}- className={tab === 'runs' ? `${'dshp-scheduler__tab'} ${'dshp-scheduler__tab--active'}` : 'dshp-scheduler__tab'}- onClick={() => setTab('runs')}- >- {t('runsTab')}- </button>+ <div className="dshp-scheduler__tabs">+ <SegmentedControl+ id="dshp-scheduler-tabs"+ label={t('scheduler')}+ value={tab}+ options={[+ { value: 'tasks', label: t('tasksTab') },+ { value: 'runs', label: t('runsTab') },+ ]}+ onChange={next => setTab(next === 'runs' ? 'runs' : 'tasks')}+ /></div>{state.error ? <p className="dshp-scheduler__error" role="alert">{state.error}</p> : null}diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/task-card.cssr.ts b/packages/dsh-tauri-panel-scheduler/src/client/components/task-card.cssr.tsdeleted file mode 100644index ef138e34..00000000--- a/packages/dsh-tauri-panel-scheduler/src/client/components/task-card.cssr.ts+++ /dev/null@@ -1,10 +0,0 @@-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'--const { c } = cssr-const { secondary, tertiary } = sharedStyles--/** 任务卡片开关(task-card.tsx):卡片本体样式见 styles/index.cssr.ts。 */-export default c([- c('.dshp-scheduler__task-toggle', { flex: 'none', display: 'inline-flex', marginTop: '2px', fontSize: '16px', color: tertiary, cursor: 'pointer' }),- c('.dshp-scheduler__task-toggle:hover', { color: secondary }),-])diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/task-card.tsx b/packages/dsh-tauri-panel-scheduler/src/client/components/task-card.tsxindex 960e3c96..6f106a17 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/components/task-card.tsx+++ b/packages/dsh-tauri-panel-scheduler/src/client/components/task-card.tsx@@ -1,13 +1,10 @@-import type { MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'+import type { MenuEntry } from 'dsh-tauri-ui/client'import type { ReactElement } from 'react'import type { LocaleKey, Translate } from '../locales/index.types'import type { TaskView } from '../types'-import { Menu, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives'-import { CirclePause, CirclePlay, EllipsisVertical, Icon, TrashBin, useMountStyle, TriangleExclamation as Warning } from 'dsh-tauri-ui/client'+import { Button, CirclePause, CirclePlay, EllipsisVertical, Icon, IconButton, Menu, Modal, Tag, Toast, TrashBin, TriangleExclamation as Warning } from 'dsh-tauri-ui/client'import { useRef, useState } from 'react'-import { TASK_CARD_STYLE_ID } from '../constants'import { deleteTask, runTask, toggleTask } from '../service/scheduler'-import taskCardStyle from './task-card.cssr'export interface TaskCardProps {task: TaskView@@ -19,7 +16,6 @@ export interface TaskCardProps {}export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCardProps): ReactElement {- useMountStyle(taskCardStyle, TASK_CARD_STYLE_ID)const [menuOpen, setMenuOpen] = useState(false)const [confirmOpen, setConfirmOpen] = useState(false)const [actionError, setActionError] = useState('')@@ -87,16 +83,15 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCar}}><div style={{ height: 36 }}>- <span- className="dshp-scheduler__task-toggle"+ <IconButton+ variant="action"+ icon={paused ? <Icon as={CirclePlay} /> : <Icon as={CirclePause} />}aria-label={paused ? t('resume') : t('pause')}onClick={(event) => {event.stopPropagation()void onToggle()}}- >- {paused ? <Icon as={CirclePlay} /> : <Icon as={CirclePause} />}- </span>+ /></div><div style={{ flex: 1 }}><span className="dshp-scheduler__card-title" title={task.name}>@@ -119,7 +114,7 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCar: <strong>{t('paused')}</strong>}</span>{task.waiting === true- ? <span className="dshp-scheduler__card-waiting">{t('waiting')}</span>+ ? <Tag variant="status" tone="info">{t('waiting')}</Tag>: null}</div></div>@@ -141,9 +136,9 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCarportalalign="end"anchor={(- <button- type="button"- className="dshp-scheduler__icon-button"+ <IconButton+ variant="action"+ icon={<Icon as={EllipsisVertical} size={12} />}aria-label={task.name}aria-haspopup="menu"aria-expanded={menuOpen}@@ -151,9 +146,7 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCarevent.stopPropagation()setMenuOpen(openState => !openState)}}- >- <Icon as={EllipsisVertical} size={12} />- </button>+ />)}/>{actionError ? <p className="dshp-scheduler__error" role="alert">{actionError}</p> : null}@@ -177,8 +170,8 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCarcloseLabel={t('close')}footer={(<>- <button className="dshp-scheduler__btn" type="button" onClick={() => setConfirmOpen(false)}>{t('cancel')}</button>- <button className={`${'dshp-scheduler__btn'} ${'dshp-scheduler__btn--danger'}`} type="button" onClick={() => void onDelete()}>{t('deleteConfirmAction')}</button>+ <Button variant="outline" onClick={() => setConfirmOpen(false)}>{t('cancel')}</Button>+ <Button variant="danger" onClick={() => void onDelete()}>{t('deleteConfirmAction')}</Button></>)}/>diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/task-create-dialog.cssr.ts b/packages/dsh-tauri-panel-scheduler/src/client/components/task-create-dialog.cssr.tsdeleted file mode 100644index ff9ef9d7..00000000--- a/packages/dsh-tauri-panel-scheduler/src/client/components/task-create-dialog.cssr.ts+++ /dev/null@@ -1,9 +0,0 @@-import { cssr } from 'dsh-tauri-ui/client'--const { c } = cssr--/** 新建/编辑任务对话框(task-create-dialog.tsx):官方 Modal 加宽。 */-export default c([- c('.dshp-scheduler__modal', { width: 'min(640px,100%) !important' }),- c('.dshp-scheduler__schedule-once', { flex: '1', minWidth: 0 }),-])diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/task-create-dialog.tsx b/packages/dsh-tauri-panel-scheduler/src/client/components/task-create-dialog.tsxindex b385fdd4..3c1f32ee 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/components/task-create-dialog.tsx+++ b/packages/dsh-tauri-panel-scheduler/src/client/components/task-create-dialog.tsx@@ -1,25 +1,12 @@-/**- * components/task-create-dialog.tsx — 新建任务对话框。- *- * 外壳用官方 primitives `Modal`(居中弹层 + 标题/描述/关闭按钮/页脚),- * 字段控件复刻官方样式:名称 = input 类;计划下拉 = input + selectInput 类;- * 任务指令 = textarea 类;底部 composer 的 workspace / permission / 模型 三个- * 选择器 = selector 触发按钮 + 官方 `Menu`。- * 计划动态参数保持 #307 语义:每天/工作日=时间段;间隔=时长;每周=星期+时间段。- */-import type { ReactElement } from 'react'import type { LocaleKey, Translate } from '../locales/index.types'import type { ScheduleForm, ScheduleKind, SchedulerOptions, TaskFormState, TaskInput, Weekday } from '../types'-import { Modal } from '@deepseek-ai/dsh-client-ui-primitives'-import { ChevronDown, Chip, Icon, Menu, useMountStyle } from 'dsh-tauri-ui/client'+import { Button, ChevronDown, Chip, Icon, Input, Menu, Modal } from 'dsh-tauri-ui/client'import { isEmpty, map, omitBy, pick, range } from 'dsh-tauri/client'import { useRef, useState } from 'react'import { SCHEDULE_KINDS } from '../../shared/constants'-import { TASK_CREATE_DIALOG_STYLE_ID } from '../constants'import { createTask, updateTask } from '../service/scheduler'import { ModelPicker } from './model-picker'-import taskCreateDialogStyle from './task-create-dialog.cssr'export interface TaskCreateDialogProps {t: Translate@@ -58,14 +45,26 @@ const SCHEDULE_KIND_KEYS: Record<ScheduleKind, LocaleKey> = {custom: 'scheduleCustom',}+interface SelectOption {+ value: string+ label: string+}+/** 时间段选项:00:00 ~ 23:45,每 15 分钟一档。 */-const TIME_OPTIONS = range(96).map((index) => {+const TIME_OPTIONS: SelectOption[] = range(96).map((index) => {const total = index * 15const h = String(Math.floor(total / 60)).padStart(2, '0')const m = String(total % 60).padStart(2, '0')- return `${h}:${m}`+ const time = `${h}:${m}`+ return { value: time, label: time }})+/** 整点分钟选项。 */+const MINUTE_OPTIONS: SelectOption[] = Array.from({ length: 60 }, (_, minute) => ({+ value: String(minute),+ label: `: ${String(minute).padStart(2, '0')}`,+}))+/** 表单里「空串即缺省」的可选字段(写入宿主前剔除)。 */const OPTIONAL_INPUT_FIELDS = ['workspaceId', 'permission', 'provider', 'model', 'reasoningEffort'] as const@@ -94,23 +93,55 @@ function defaultScheduleFor(kind: ScheduleForm['kind']): ScheduleForm {}}+/** dsh-tauri-ui 没有独立 Select:统一用 Chip(selector) + Menu 组合。 */+function Select({ label, value, options, onChange }: {+ label: string+ value: string+ options: readonly SelectOption[]+ onChange: (value: string) => void+}): ReactElement {+ const [open, setOpen] = useState(false)+ return (+ <Menu+ open={open}+ onClose={() => setOpen(false)}+ onSelect={(id) => {+ setOpen(false)+ onChange(id)+ }}+ items={options.map(option => ({ id: option.value, label: option.label }))}+ selectedId={value}+ portal+ align="end"+ anchor={(+ <Chip+ variant="selector"+ aria-label={label}+ aria-haspopup="menu"+ aria-expanded={open}+ onClick={() => setOpen(openState => !openState)}+ chevron={<Icon as={ChevronDown} />}+ >+ <span>{options.find(option => option.value === value)?.label ?? value}</span>+ </Chip>+ )}+ />+ )+}+export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskCreateDialogProps): ReactElement {- useMountStyle(taskCreateDialogStyle, TASK_CREATE_DIALOG_STYLE_ID)const [form, setForm] = useState<TaskFormState>(() => initial ?? {name: '',schedule: { kind: 'daily', time: '09:00' },prompt: '',workspaceId: '',permission: options.defaultPermission || 'read-only',- // 照搬 dsh-automation defaultFormState:默认选中宿主默认模型(不出现空选择)。provider: options.defaultModel?.provider ?? '',model: options.defaultModel?.model ?? '',reasoningEffort: options.defaultModel?.reasoning?.defaultEffort ?? '',})const [saving, setSaving] = useState(false)const [error, setError] = useState('')- const [openWorkspace, setOpenWorkspace] = useState(false)- const [openPermission, setOpenPermission] = useState(false)// 保存中禁止关闭(Esc / 遮罩 / 关闭按钮):用 ref 供稳定闭包读取最新值。const savingRef = useRef(false)savingRef.current = saving@@ -148,26 +179,26 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskCconst currentEveryMinutes = form.schedule.kind === 'interval' ? form.schedule.everyMinutes : 30const currentWeekday: Weekday = form.schedule.kind === 'weekly' ? (form.schedule.weekdays[0] ?? 'MO') : 'MO'- const workspaceOptions = [- // Keep the empty id: the host interprets it as the ungrouped/default workspace.- { id: '', label: t('workspaceDefault') },- ...options.workspaces.map(ws => ({ id: ws.id, label: ws.title || ws.path })),+ const workspaceOptions: SelectOption[] = [+ // 空 id 由宿主解释为默认/未分组工作区,必须保留。+ { value: '', label: t('workspaceDefault') },+ ...options.workspaces.map(ws => ({ value: ws.id, label: ws.title || ws.path })),]// 权限选项:来自宿主 permissionPresets;缺失降级为常见三项(含完全访问)。- const fallbackPermissions = [- { id: 'read-only', label: t('permissionReadOnly') },- { id: 'workspace-write', label: t('permissionWrite') },- { id: 'danger-full-access', label: t('permissionFullAccess') },+ const fallbackPermissions: SelectOption[] = [+ { value: 'read-only', label: t('permissionReadOnly') },+ { value: 'workspace-write', label: t('permissionWrite') },+ { value: 'danger-full-access', label: t('permissionFullAccess') },]- const permissionOptions = isEmpty(options.permissions)+ const permissionOptions: SelectOption[] = isEmpty(options.permissions)? fallbackPermissions: map(options.permissions, option => ({- id: option.value,+ value: option.value,label: PERMISSION_LABEL_KEYS[option.value] ? t(PERMISSION_LABEL_KEYS[option.value]) : option.name,}))// 编辑旧任务:当前值不在选项里时补一项,避免显示空值。- if (form.permission && !permissionOptions.some(option => option.id === form.permission))- permissionOptions.unshift({ id: form.permission, label: form.permission })+ if (form.permission && !permissionOptions.some(option => option.value === form.permission))+ permissionOptions.unshift({ value: form.permission, label: form.permission })const modelKey = form.provider && form.model ? `${form.provider}::${form.model}` : 'default'@@ -181,18 +212,17 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskCclassName="dshp-scheduler__modal"footer={(<>- <button className="dshp-scheduler__btn" type="button" disabled={saving} onClick={closeSafe}>{t('cancel')}</button>- <button className={`${'dshp-scheduler__btn'} ${'dshp-scheduler__btn--primary'}`} type="button" disabled={saving} onClick={() => void onSave()}>+ <Button variant="outline" disabled={saving} onClick={closeSafe}>{t('cancel')}</Button>+ <Button variant="primary" disabled={saving} onClick={() => void onSave()}>{t('save')}- </button>+ </Button></>)}><div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}><label className="dshp-scheduler__field"><span className="dshp-scheduler__field-label">{t('taskName')}</span>- <input- className="dshp-scheduler__input"+ <Inputtype="text"value={form.name}placeholder={t('taskNamePlaceholder')}@@ -203,77 +233,103 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskC<div className="dshp-scheduler__field"><span className="dshp-scheduler__field-label">{t('schedule')}</span><div className="dshp-scheduler__inline">- <select- className={`${'dshp-scheduler__input'} ${'dshp-scheduler__select-input'} ${'dshp-scheduler__inline-select'}`}+ <Select+ label={t('schedule')}value={scheduleKind}- aria-label={t('schedule')}- onChange={event => setForm(state => ({ ...state, schedule: defaultScheduleFor(event.target.value as ScheduleForm['kind']) }))}- >- {SCHEDULE_KINDS.map(kind => (- <option key={kind} value={kind}>{t(SCHEDULE_KIND_KEYS[kind])}</option>- ))}- </select>+ options={SCHEDULE_KINDS.map(kind => ({ value: kind, label: t(SCHEDULE_KIND_KEYS[kind]) }))}+ onChange={value => setForm(state => ({ ...state, schedule: defaultScheduleFor(value as ScheduleForm['kind']) }))}+ />{scheduleKind === 'once'- ? <input className="dshp-scheduler__input dshp-scheduler__schedule-once" type="datetime-local" value={String(form.schedule.at).slice(0, 16)} onChange={event => setSchedule({ kind: 'once', at: new Date(event.target.value).toISOString() })} />+ ? (+ <Input+ className="dshp-scheduler__schedule-once"+ type="datetime-local"+ value={String(form.schedule.at).slice(0, 16)}+ onChange={event => setSchedule({ kind: 'once', at: new Date(event.target.value).toISOString() })}+ />+ ): scheduleKind === 'hourly'- ? <select className="dshp-scheduler__input" value={form.schedule.minute} onChange={event => setSchedule({ kind: 'hourly', minute: Number(event.target.value) })}>{Array.from({ length: 60 }, (_, minute) => <option key={minute} value={minute}>{`: ${String(minute).padStart(2, '0')}`}</option>)}</select>+ ? (+ <Select+ label={t('scheduleHourly')}+ value={String(form.schedule.minute)}+ options={MINUTE_OPTIONS}+ onChange={value => setSchedule({ kind: 'hourly', minute: Number(value) })}+ />+ ): scheduleKind === 'monthly'? (<>- <input className="dshp-scheduler__input dshp-scheduler__inline-select--auto" type="number" min={1} max={31} value={form.schedule.kind === 'monthly' ? form.schedule.day : 1} aria-label={t('scheduleMonthDay')} onChange={event => setSchedule({ kind: 'monthly', day: Number(event.target.value), time: currentTime })} />- <select className="dshp-scheduler__input dshp-scheduler__select-input dshp-scheduler__inline-select--auto" value={currentTime} aria-label={t('scheduleTime')} onChange={event => setSchedule({ kind: 'monthly', day: form.schedule.kind === 'monthly' ? form.schedule.day : 1, time: event.target.value })}>{TIME_OPTIONS.map(time => <option key={time} value={time}>{time}</option>)}</select>+ <Input+ type="number"+ min={1}+ max={31}+ value={form.schedule.kind === 'monthly' ? form.schedule.day : 1}+ aria-label={t('scheduleMonthDay')}+ onChange={event => setSchedule({ kind: 'monthly', day: Number(event.target.value), time: currentTime })}+ />+ <Select+ label={t('scheduleTime')}+ value={currentTime}+ options={TIME_OPTIONS}+ onChange={value => setSchedule({ kind: 'monthly', day: form.schedule.kind === 'monthly' ? form.schedule.day : 1, time: value })}+ /></>): scheduleKind === 'custom'? (<>- <input className="dshp-scheduler__input dshp-scheduler__inline-select--auto" type="number" min={1} max={366} value={form.schedule.kind === 'custom' ? form.schedule.everyDays : 1} aria-label={t('scheduleEveryDays')} onChange={event => setSchedule({ kind: 'custom', everyDays: Number(event.target.value), time: currentTime })} />+ <Input+ type="number"+ min={1}+ max={366}+ value={form.schedule.kind === 'custom' ? form.schedule.everyDays : 1}+ aria-label={t('scheduleEveryDays')}+ onChange={event => setSchedule({ kind: 'custom', everyDays: Number(event.target.value), time: currentTime })}+ /><span>{t('dayShort')}</span>- <select className="dshp-scheduler__input dshp-scheduler__select-input dshp-scheduler__inline-select--auto" value={currentTime} aria-label={t('scheduleTime')} onChange={event => setSchedule({ kind: 'custom', everyDays: form.schedule.kind === 'custom' ? form.schedule.everyDays : 1, time: event.target.value })}>{TIME_OPTIONS.map(time => <option key={time} value={time}>{time}</option>)}</select>+ <Select+ label={t('scheduleTime')}+ value={currentTime}+ options={TIME_OPTIONS}+ onChange={value => setSchedule({ kind: 'custom', everyDays: form.schedule.kind === 'custom' ? form.schedule.everyDays : 1, time: value })}+ /></>): scheduleKind === 'interval'? (- <select- className={`${'dshp-scheduler__input'} ${'dshp-scheduler__select-input'} ${'dshp-scheduler__inline-select--auto'}`}- value={currentEveryMinutes}- aria-label={t('scheduleEveryMinutes')}- onChange={event => setSchedule({ kind: 'interval', everyMinutes: Number(event.target.value), anchor: form.schedule.kind === 'interval' ? form.schedule.anchor : undefined })}- >- {INTERVAL_OPTIONS.map(minutes => <option key={minutes} value={minutes}>{`${minutes} ${t('minuteShort')}`}</option>)}- </select>+ <Select+ label={t('scheduleEveryMinutes')}+ value={String(currentEveryMinutes)}+ options={INTERVAL_OPTIONS.map(minutes => ({ value: String(minutes), label: `${minutes} ${t('minuteShort')}` }))}+ onChange={value => setSchedule({ kind: 'interval', everyMinutes: Number(value), anchor: form.schedule.kind === 'interval' ? form.schedule.anchor : undefined })}+ />): scheduleKind === 'weekly'? (<>- <select- className={`${'dshp-scheduler__input'} ${'dshp-scheduler__select-input'} ${'dshp-scheduler__inline-select--auto'}`}+ <Select+ label={t('scheduleWeekdays')}value={currentWeekday}- aria-label={t('scheduleWeekdays')}- onChange={event => setSchedule({ kind: 'weekly', weekdays: [event.target.value as Weekday], time: currentTime })}- >- {WEEKDAYS.map(day => <option key={day} value={day}>{t(WEEKDAY_KEYS[day])}</option>)}- </select>- <select- className={`${'dshp-scheduler__input'} ${'dshp-scheduler__select-input'} ${'dshp-scheduler__inline-select--auto'}`}+ options={WEEKDAYS.map(day => ({ value: day, label: t(WEEKDAY_KEYS[day]) }))}+ onChange={value => setSchedule({ kind: 'weekly', weekdays: [value as Weekday], time: currentTime })}+ />+ <Select+ label={t('scheduleTime')}value={currentTime}- aria-label={t('scheduleTime')}- onChange={event => setSchedule({ ...form.schedule, time: event.target.value } as ScheduleForm)}- >- {TIME_OPTIONS.map(time => <option key={time} value={time}>{time}</option>)}- </select>+ options={TIME_OPTIONS}+ onChange={value => setSchedule({ ...form.schedule, time: value } as ScheduleForm)}+ /></>): (- <select- className={`${'dshp-scheduler__input'} ${'dshp-scheduler__select-input'} ${'dshp-scheduler__inline-select--auto'}`}+ <Select+ label={t('scheduleTime')}value={currentTime}- aria-label={t('scheduleTime')}- onChange={event => setSchedule({ ...form.schedule, time: event.target.value } as ScheduleForm)}- >- {TIME_OPTIONS.map(time => <option key={time} value={time}>{time}</option>)}- </select>+ options={TIME_OPTIONS}+ onChange={value => setSchedule({ ...form.schedule, time: value } as ScheduleForm)}+ />)}</div></div>@@ -288,53 +344,17 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskConChange={event => setForm(state => ({ ...state, prompt: event.target.value }))}/><div className="dshp-scheduler__composer">- <Menu- open={openWorkspace}- onClose={() => setOpenWorkspace(false)}- onSelect={(id) => {- setOpenWorkspace(false)- setForm(state => ({ ...state, workspaceId: id }))- }}- items={workspaceOptions}- selectedId={form.workspaceId}- portal- align="end"- anchor={(- <Chip- variant="selector"- aria-label={t('workspace')}- aria-haspopup="menu"- aria-expanded={openWorkspace}- onClick={() => setOpenWorkspace(openState => !openState)}- chevron={<Icon as={ChevronDown} />}- >- <span>{workspaceOptions.find(option => option.id === form.workspaceId)?.label ?? form.workspaceId}</span>- </Chip>- )}+ <Select+ label={t('workspace')}+ value={form.workspaceId}+ options={workspaceOptions}+ onChange={id => setForm(state => ({ ...state, workspaceId: id }))}/>- <Menu- open={openPermission}- onClose={() => setOpenPermission(false)}- onSelect={(id) => {- setOpenPermission(false)- setForm(state => ({ ...state, permission: id }))- }}- items={permissionOptions}- selectedId={form.permission}- portal- align="end"- anchor={(- <Chip- variant="selector"- aria-label={t('permission')}- aria-haspopup="menu"- aria-expanded={openPermission}- onClick={() => setOpenPermission(openState => !openState)}- chevron={<Icon as={ChevronDown} />}- >- <span>{permissionOptions.find(option => option.id === form.permission)?.label ?? form.permission}</span>- </Chip>- )}+ <Select+ label={t('permission')}+ value={form.permission}+ options={permissionOptions}+ onChange={id => setForm(state => ({ ...state, permission: id }))}/><div style={{ flex: 1 }} /><ModelPickerdiff --git a/packages/dsh-tauri-panel-scheduler/src/client/constants/index.ts b/packages/dsh-tauri-panel-scheduler/src/client/constants/index.tsindex 0300d7ee..eaeec9a0 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/constants/index.ts+++ b/packages/dsh-tauri-panel-scheduler/src/client/constants/index.ts@@ -11,12 +11,6 @@ export const INPUT_PREFILL_ORDER = 40export const INPUT_PREFILL_PRIORITY = 0export const STYLE_ID = `${PLUGIN_ID}-styles`-export const SCHEDULER_PANEL_STYLE_ID = `${PLUGIN_ID}-panel-styles`-export const TASK_CARD_STYLE_ID = `${PLUGIN_ID}-task-card-styles`-export const RUNS_TAB_STYLE_ID = `${PLUGIN_ID}-runs-tab-styles`-export const RECOMMENDATIONS_STYLE_ID = `${PLUGIN_ID}-recommendations-styles`-export const MODEL_PICKER_STYLE_ID = `${PLUGIN_ID}-model-picker-styles`-export const TASK_CREATE_DIALOG_STYLE_ID = `${PLUGIN_ID}-task-create-dialog-styles`export const SESSION_ICON_STYLE_ID = `${PLUGIN_ID}-session-clock-icon`export const SESSION_ICON_ATTRIBUTE = 'data-dsh-scheduler-icon'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 a58a2ec9..28152f40 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@@ -2,48 +2,40 @@ import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'import { SESSION_ICON_ATTRIBUTE } from '../constants'const { c } = cssr-const { primary, secondary, tertiary, dimmed, borderL3, borderL4, brand, layer1, modulePlatform, hover, hoverSolid, hoverDanger, error, success, primaryFill, primaryHover, primaryFg, chevronSelectSvg: chevronSvg, focusRing } = sharedStyles+const { primary, secondary, tertiary, dimmed, borderL4, brand, business, layer1, font, hover, error, success } = sharedStyles-/**- * 跨组件通用的官方控件复刻(input / selectInput / textarea / iconButton /- * 36px 胶囊按钮 / field / pill selector),多组件共享,不属任何单一组件。- */export default c([- // —— 官方控件复刻:input / selectInput / textarea ——- c('.dshp-scheduler__input', { boxSizing: 'border-box', border: `.5px solid ${borderL4}`, width: '100%', height: '32px', font: 'inherit', background: layer1, color: primary, borderRadius: '8px', padding: '0 10px', fontSize: '14px', lineHeight: '22px' }),- c('select.dshp-scheduler__input', { cursor: 'pointer', maxWidth: '240px' }),- c('.dshp-scheduler__input:focus', { borderColor: brand, outline: 'none' }),- c('.dshp-scheduler__input::placeholder', { color: dimmed }),- c('.dshp-scheduler__input:disabled', { opacity: '.6', cursor: 'default' }),- c('.dshp-scheduler__select-input', { appearance: 'none', backgroundImage: chevronSvg, backgroundPosition: 'right 12px center', backgroundRepeat: 'no-repeat', backgroundSize: '12px 12px', paddingRight: '32px' }),+ c('.dshp-scheduler__shell', { boxSizing: 'border-box', color: primary, fontFamily: font, fontSize: '13px', lineHeight: '1.5' }),+ c('.dshp-scheduler__top', { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: '16px', marginBottom: '12px' }),+ c('.dshp-scheduler__heading', { minWidth: '0' }),+ c('.dshp-scheduler__heading h1', { margin: '0', fontSize: '20px', lineHeight: '28px', fontWeight: '500' }),+ c('.dshp-scheduler__heading p', { margin: '4px 0 0', color: secondary, fontSize: '13px', lineHeight: '20px' }),+ c('.dshp-scheduler__toolbar', { display: 'flex', justifyContent: 'flex-end', alignItems: 'center', gap: '16px' }),+ c('.dshp-scheduler__search-bar', { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '12px' }),+ c('.dshp-scheduler__search-wrap', { flex: '0 1 280px', minWidth: '0', maxWidth: '280px' }),+ c('.dshp-scheduler__tabs', { display: 'flex', margin: '4px 0 14px' }),+ c('.dshp-scheduler__cards', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),+ c('.dshp-scheduler__runs-list', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),+ c('.dshp-scheduler__empty', { margin: '0', padding: '48px 0', color: tertiary, fontSize: '13px', textAlign: 'center' }),+ c('.dshp-scheduler__error', { margin: '0', color: error, fontSize: '12px', lineHeight: '18px' }),+ c('@media (max-width: 680px)', [c('.dshp-scheduler__search-wrap', { maxWidth: '160px' })]),++ c('.dshp-scheduler__modal', { width: 'min(640px,100%) !important' }),+ c('.dshp-scheduler__field', { display: 'flex', flexDirection: 'column', gap: '2px', minWidth: '0', fontSize: '13px' }),+ c('.dshp-scheduler__field-label', { display: 'inline-flex', alignItems: 'center', gap: '10px', color: secondary, fontSize: '12px', fontWeight: '500', lineHeight: '18px' }),+ c('.dshp-scheduler__inline', { display: 'flex', flexWrap: 'wrap', gap: '8px', alignItems: 'center' }),+ c('.dshp-scheduler__schedule-once', { flex: '1', minWidth: '0' }),+ c('.dshp-scheduler__prompt-wrap', { position: 'relative', display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: '8px' }),+ c('.dshp-scheduler__composer', { display: 'flex', gap: '8px', alignItems: 'center' }),c('.dshp-scheduler__textarea', { boxSizing: 'border-box', border: `.5px solid ${borderL4}`, width: '100%', height: 'auto', minHeight: '240px', font: 'inherit', background: layer1, color: primary, borderRadius: '8px', padding: '10px', paddingBottom: '46px', fontSize: '14px', lineHeight: '1.55', resize: 'vertical', outline: 'none' }),c('.dshp-scheduler__textarea:focus', { borderColor: brand }),c('.dshp-scheduler__textarea::placeholder', { color: dimmed }),- // —— 官方控件复刻:iconButton ——- c('.dshp-scheduler__icon-button:focus-visible', focusRing),- c('.dshp-scheduler__icon-button', {- display: 'inline-flex',- alignItems: 'center',- justifyContent: 'center',- width: '20px',- height: '20px',- padding: 0,- border: 'none',- borderRadius: '6px',- background: 'transparent',- color: 'var(--dsw-alias-label-secondary)',- cursor: 'pointer',- fontSize: '18px',- lineHeight: '1',- }, [- c('&:hover', { background: 'var(--dsw-alias-interactive-bg-hover)' }),- ]),- // —— 任务 / 执行记录行(task-card.tsx 与 runs-tab.tsx 共用,须随注册样式挂载)——+c('.dshp-scheduler__card', { boxSizing: 'border-box', display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: '10px', width: '100%', minWidth: '0', height: '60px', padding: '10px 12px', borderRadius: '10px', background: 'transparent', color: 'inherit', font: 'inherit', fontSize: '13px', lineHeight: '20px', textAlign: 'left', cursor: 'pointer', overflow: 'hidden' }),c('.dshp-scheduler__card:hover', { background: hover }),c('.dshp-scheduler__card--paused', { opacity: '.6' }),c('.dshp-scheduler__card-title', { display: 'flex', alignItems: 'center', gap: '8px', margin: '0', fontSize: '13px', lineHeight: '18px', fontWeight: '500', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),- c('.dshp-scheduler__card-icon', { flex: 'none', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', marginTop: '2px', width: '16px', height: '16px', fontSize: '16px', color: 'var(--dsw-alias-state-business-primary)' }),+ c('.dshp-scheduler__card-icon', { flex: 'none', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', marginTop: '2px', width: '16px', height: '16px', fontSize: '16px', color: business }),c('.dshp-scheduler__card-icon[data-status="succeeded"]', { color: success }),c('.dshp-scheduler__card-icon[data-status="failed"],.dshp-scheduler__card-icon[data-status="interrupted"]', { color: error }),c('.dshp-scheduler__card-icon[data-status="running"],.dshp-scheduler__card-icon[data-status="queued"]', { color: secondary }),@@ -51,44 +43,33 @@ export default c([c('.dshp-scheduler__card-meta', { display: 'flex', alignItems: 'center', gap: '10px', minWidth: '0' }),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('.dshp-scheduler__card-waiting', { flex: 'none', display: 'inline-flex', alignItems: 'center', height: '18px', padding: '0 6px', borderRadius: '6px', background: hover, color: 'var(--dsw-alias-state-business-primary)', fontSize: '11px', lineHeight: '18px', whiteSpace: 'nowrap' }),- // —— 未读角标:侧边栏 panellist 行(复刻官方尾部槽位几何)与执行记录标题 ——+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 }),- // —— 官方控件复刻:36px 胶囊按钮(primary / secondary / danger)——- c('.dshp-scheduler__btn,.dshp-scheduler__btn--primary,.dshp-scheduler__btn--danger', { boxSizing: 'border-box', height: '36px', font: 'inherit', cursor: 'pointer', border: 'none', borderRadius: '18px', justifyContent: 'center', alignItems: 'center', gap: '4px', padding: '0 14px', fontSize: '14px', lineHeight: '22px', display: 'inline-flex', whiteSpace: 'nowrap' }),- c('.dshp-scheduler__btn', { border: `.5px solid ${borderL3}`, color: primary, background: 'transparent' }),- c('.dshp-scheduler__btn:not(:disabled):hover', { background: hoverSolid }),- c('.dshp-scheduler__btn--primary', { background: primaryFill, color: primaryFg, borderColor: 'transparent' }),- c('.dshp-scheduler__btn--primary:not(:disabled):hover', { background: primaryHover, borderColor: 'transparent' }),- c('.dshp-scheduler__btn--danger', { color: error }),- c('.dshp-scheduler__btn--danger:not(:disabled):hover', { background: hoverDanger }),- c('.dshp-scheduler__btn:disabled,.dshp-scheduler__btn--primary:disabled,.dshp-scheduler__btn--danger:disabled', { opacity: '.4', cursor: 'default' }),- c('.dshp-scheduler__btn:focus-visible,.dshp-scheduler__btn--primary:focus-visible,.dshp-scheduler__btn--danger:focus-visible', focusRing),- // —— 官方控件复刻:字段 / 下拉 pill selector ——- c('.dshp-scheduler__field', { flexDirection: 'column', gap: '2px', display: 'flex', minWidth: '0', fontSize: '13px' }),- c('.dshp-scheduler__field-label', { color: secondary, alignItems: 'center', gap: '10px', fontSize: '12px', fontWeight: '500', lineHeight: '18px', display: 'inline-flex' }),- c('.dshp-scheduler__inline', { display: 'flex', flexWrap: 'wrap', gap: '8px', alignItems: 'center' }),- c('.dshp-scheduler__inline-select', { flex: '1', minWidth: '120px' }),- c('.dshp-scheduler__inline-select--auto', { flex: 'none', width: 'auto', minWidth: '120px' }),- c('.dshp-scheduler__composer', { display: 'flex', gap: '8px', alignItems: 'center', right: '10px' }),- c('.dshp-scheduler__prompt-wrap', { position: 'relative', display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: '8px' }),- c('.dshp-scheduler__selector', { background: modulePlatform, height: '36px', font: 'inherit', color: primary, cursor: 'pointer', border: 'none', borderRadius: '18px', alignItems: 'center', gap: '12px', padding: '0 14px', fontSize: '14px', lineHeight: '22px', display: 'inline-flex', whiteSpace: 'nowrap' }),- c('.dshp-scheduler__selector:hover', { background: hover }),- c('.dshp-scheduler__selector-chevron', { flex: 'none' }),- c('.dshp-scheduler__selector-effort', { color: tertiary, fontSize: '12px', maxWidth: '120px', overflow: 'hidden', textOverflow: 'ellipsis' }),- // —— 侧边栏会话行时钟图标补丁(配合 register/session-icons.ts 的 DOM 观察器)——- c(`[${SESSION_ICON_ATTRIBUTE}]`, {- width: '16px',- height: '20px',- flex: 'none',- display: 'inline-flex',- alignItems: 'center',- justifyContent: 'center',- marginLeft: '2px',- marginRight: '5px',- color: 'var(--dsw-alias-label-secondary)',- }),++ 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' }),+ c('.dshp-scheduler__recs-list', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),+ c('.dshp-scheduler__recs-item', { boxSizing: 'border-box', display: 'flex', alignItems: 'flex-start', gap: '10px', width: '100%', minWidth: '0', padding: '10px 12px', border: 'none', borderRadius: '10px', background: 'transparent', color: 'inherit', font: 'inherit', fontSize: '13px', lineHeight: '20px', textAlign: 'left', cursor: 'pointer' }),+ c('.dshp-scheduler__recs-item:hover', { background: hover }),+ c('.dshp-scheduler__recs-icon', { flex: 'none', display: 'inline-flex', marginTop: '2px', fontSize: '16px' }),+ c('.dshp-scheduler__recs-body', { display: 'flex', flexDirection: 'column', gap: '2px', minWidth: '0' }),+ c('.dshp-scheduler__recs-name', { color: primary, fontSize: '13px', lineHeight: '18px', fontWeight: '500' }),+ c('.dshp-scheduler__recs-name strong', { color: secondary, fontWeight: '600' }),+ c('.dshp-scheduler__recs-prompt', { color: tertiary, fontSize: '12px', lineHeight: '18px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),+ c('.dshp-scheduler__muted', { margin: '0', color: secondary, fontSize: '12px' }),++ c('.dshp-scheduler__model-trigger-label', { minWidth: '0', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),+ c('.dshp-scheduler__model-trigger-effort', { flex: 'none', color: tertiary, whiteSpace: 'nowrap' }),+ c('.dshp-scheduler__model-row', { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '12px', width: '100%' }),+ c('.dshp-scheduler__model-row-label', { flex: 'none' }),+ c('.dshp-scheduler__model-row-hint', { flex: '1', minWidth: '0', overflow: 'hidden', color: tertiary, textAlign: 'right', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),+ c('.dshp-scheduler__model-option-copy', { display: 'flex', minWidth: '0', flex: '1', flexDirection: 'column' }),+ c('.dshp-scheduler__model-name', { overflow: 'hidden', fontSize: '14px', fontWeight: '500', lineHeight: '20px', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),+ c('.dshp-scheduler__model-description', { overflow: 'hidden', color: tertiary, fontSize: '12px', lineHeight: '18px', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),++ // register/session-icons.ts 通过 DOM 观察器注入侧边栏会话行时钟图标+ c(`[${SESSION_ICON_ATTRIBUTE}]`, { width: '16px', height: '20px', flex: 'none', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', marginLeft: '2px', marginRight: '5px', color: secondary }),c('[role="treeitem"]', { position: 'relative' }),])diff --git a/packages/dsh-tauri-pet/package.json b/packages/dsh-tauri-pet/package.jsonindex f539c233..01f3a049 100644--- a/packages/dsh-tauri-pet/package.json+++ b/packages/dsh-tauri-pet/package.json@@ -60,8 +60,7 @@},"dependencies": {"@deepseek-ai/dsh-skill-filesystem": "catalog:dsh",- "dsh-tauri": "workspace:*",- "dsh-tauri-ui": "workspace:*"+ "dsh-tauri": "workspace:*"},"devDependencies": {"@deepseek-ai/cordis": "catalog:dsh",@@ -70,6 +69,7 @@"@deepseek-ai/dsh-client-ui-renderer": "catalog:dsh","@deepseek-ai/dsh-client-ui-slots": "catalog:dsh","dsh-tauri-tsdown": "workspace:*",+ "dsh-tauri-ui": "workspace:*","react": "catalog:runtime","tsdown": "catalog:cli"}diff --git a/packages/dsh-tauri-pet/src/client/components/pet-card.cssr.ts b/packages/dsh-tauri-pet/src/client/components/pet-card.cssr.tsdeleted file mode 100644index 27c6ca0d..00000000--- a/packages/dsh-tauri-pet/src/client/components/pet-card.cssr.ts+++ /dev/null@@ -1,102 +0,0 @@-/** 桌宠卡片样式(仅卡片面;页签/工具栏见 pet-settings.cssr.ts)。 */-import { cssr } from 'dsh-tauri-ui/client'--const { c } = cssr--export default c([- c('.dshp-pet__cards', { display: 'flex', flexDirection: 'column', gap: '12px' }),- c('.dshp-pet__card-item', {- display: 'flex',- alignItems: 'center',- gap: '12px',- padding: '12px 14px',- borderRadius: '12px',- border: '1px solid var(--dsw-alias-border-weak, rgba(127,127,127,0.2))',- background: 'var(--dsw-alias-bg-base)',- }),- c('.dshp-pet__card-thumb', {- flex: 'none',- width: '56px',- height: '56px',- display: 'flex',- alignItems: 'center',- justifyContent: 'center',- fontSize: '28px',- borderRadius: '10px',- background: 'var(--dsw-alias-bg-layer-1)',- overflow: 'hidden',- objectFit: 'cover',- }),- c('.dshp-pet__card-thumb > img', {- display: 'block',- width: '100%',- height: '100%',- }),- // 精灵图缩略图:8 列 × 11 行的雪碧图只露出左上角一帧。- c('.dshp-pet__card-thumbSprite', {- position: 'relative',- }, [- c('& > img', {- position: 'absolute',- width: '800%',- height: '1100%',- maxWidth: 'none',- objectFit: 'fill',- left: '0',- top: '0',- }),- ]),- c('.dshp-pet__card-body', {- flex: '1',- minWidth: '0',- display: 'flex',- flexDirection: 'column',- gap: '2px',- }),- c('.dshp-pet__card-nameRow', {- display: 'flex',- alignItems: 'center',- gap: '6px',- minWidth: '0',- }),- c('.dshp-pet__card-name', {- fontWeight: '600',- fontSize: '14px',- lineHeight: '20px',- minWidth: '0',- overflow: 'hidden',- textOverflow: 'ellipsis',- whiteSpace: 'nowrap',- }),- c('.dshp-pet__card-desc', {- fontSize: '12px',- lineHeight: '18px',- color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))',- }),- c('.dshp-pet__card-actions', {- flex: 'none',- display: 'flex',- alignItems: 'center',- gap: '6px',- }),- c('.dshp-pet__card-action', {- flex: 'none',- appearance: 'none',- cursor: 'pointer',- padding: '5px 14px',- borderRadius: '8px',- border: '1px solid var(--dsw-alias-border-weak, rgba(127,127,127,0.2))',- background: 'transparent',- color: 'var(--dsw-alias-label-primary)',- fontSize: '12px',- lineHeight: '18px',- }, [- c('&:hover:not(:disabled)', { background: 'var(--dsw-alias-interactive-bg-hover)' }),- c('&:disabled', { opacity: '0.4', cursor: 'default' }),- ]),- c('.dshp-pet__card-action.dshp-pet__card-actionActive', {- borderColor: 'var(--dsw-alias-brand-primary)',- color: 'var(--dsw-alias-brand-primary)',- background: 'var(--dsw-alias-interactive-bg-hover)',- }),-])diff --git a/packages/dsh-tauri-pet/src/client/components/pet-card.tsx b/packages/dsh-tauri-pet/src/client/components/pet-card.tsxindex f78e31c9..1a389940 100644--- a/packages/dsh-tauri-pet/src/client/components/pet-card.tsx+++ b/packages/dsh-tauri-pet/src/client/components/pet-card.tsx@@ -1,15 +1,9 @@import type { ReactElement } from 'react'import type { PetCardProps } from './pet-card.types'-import { useMountStyle } from 'dsh-tauri-ui/client'-import { PET_CARD_STYLES_ID } from '../constants'-import petCardStyle from './pet-card.cssr'+import { Button } from 'dsh-tauri-ui/client'/** 桌宠卡片:缩略图 + 名称/描述 + 单个动作按钮(启用 / 选择 / 取消选择)。 */export function PetCard(props: PetCardProps): ReactElement {- useMountStyle(petCardStyle, PET_CARD_STYLES_ID)- const actionClassName = props.active- ? 'dshp-pet__card-action dshp-pet__card-actionActive'- : 'dshp-pet__card-action'const thumbnailClassName = props.thumbnailType === 'spritesheet'? 'dshp-pet__card-thumb dshp-pet__card-thumbSprite': 'dshp-pet__card-thumb'@@ -24,7 +18,7 @@ export function PetCard(props: PetCardProps): ReactElement {</span>): <img className={thumbnailClassName} src={props.thumbnail} alt="" aria-hidden="true" />- : <div className="dshp-pet__card-thumb dshp-pet__card-thumbPlaceholder" aria-hidden="true">PET</div>}+ : <div className="dshp-pet__card-thumb" aria-hidden="true">PET</div>}<span className="dshp-pet__card-body"><span className="dshp-pet__card-nameRow"><span className="dshp-pet__card-name">{props.name}</span>@@ -32,14 +26,15 @@ export function PetCard(props: PetCardProps): ReactElement {{props.desc ? <span className="dshp-pet__card-desc">{props.desc}</span> : null}</span><span className="dshp-pet__card-actions">- <button+ <Buttontype="button"- className={actionClassName}+ variant={props.active ? 'primary' : 'outline'}+ size="sm"disabled={props.disabled}onClick={props.onAction}>{props.actionLabel}- </button>+ </Button></span></div>)diff --git a/packages/dsh-tauri-pet/src/client/components/pet-settings.cssr.ts b/packages/dsh-tauri-pet/src/client/components/pet-settings.cssr.tsdeleted file mode 100644index 5fca7ee0..00000000--- a/packages/dsh-tauri-pet/src/client/components/pet-settings.cssr.ts+++ /dev/null@@ -1,116 +0,0 @@-/**- * components/pet-settings.cssr.ts — 设置分区面样式(页签 / 工具栏 / 描述 / 尺寸滑条)。- *- * 全部走 `--dsw-alias-*` 主题变量,明暗主题自适应;工具栏按钮取与卡片操作按钮同尺寸的- * 小号 secondary(官方 36px 胶囊在本工具栏过大会挤压页签行)。卡片样式见 pet-card.cssr.ts。- */-import { cssr } from 'dsh-tauri-ui/client'--const { c } = cssr--export default c([- c('.dshp-pet__page', {- display: 'flex',- flexDirection: 'column',- gap: '12px',- color: 'var(--dsw-alias-label-primary)',- }),- c('.dshp-pet__tabs', {- display: 'flex',- alignItems: 'center',- justifyContent: 'space-between',- gap: '16px',- flexWrap: 'wrap',- margin: '4px 0 14px',- borderBottom: '1px solid var(--dsw-alias-border-l2)',- }),- c('.dshp-pet__tab-list', { display: 'flex', alignItems: 'center', gap: '16px' }),- c('.dshp-pet__tab-btn', {- appearance: 'none',- background: 'transparent',- color: 'var(--dsw-alias-label-secondary)',- font: 'inherit',- fontSize: '13px',- lineHeight: '1.5',- border: '0',- borderBottom: '2px solid transparent',- cursor: 'pointer',- padding: '8px 0',- }, [- c('&:hover', { color: 'var(--dsw-alias-label-primary)' }),- ]),- c('.dshp-pet__tab-btn.dshp-pet__tab-btnActive', {- borderBottomColor: 'currentColor',- color: 'var(--dsw-alias-label-primary)',- fontWeight: '650',- }),- c('.dshp-pet__tab-tools', { display: 'flex', alignItems: 'center', gap: '6px' }),- c('.dshp-pet__tool-btn', {- flex: 'none',- appearance: 'none',- cursor: 'pointer',- padding: '5px 10px',- borderRadius: '8px',- border: '1px solid var(--dsw-alias-border-weak, rgba(127,127,127,0.2))',- background: 'transparent',- color: 'var(--dsw-alias-label-primary)',- fontSize: '12px',- lineHeight: '18px',- display: 'inline-flex',- alignItems: 'center',- gap: '4px',- whiteSpace: 'nowrap',- }, [- c('&:hover:not(:disabled)', { background: 'var(--dsw-alias-interactive-bg-hover)' }),- c('&:disabled', { opacity: '0.4', cursor: 'default' }),- c('&:focus-visible', {- boxShadow: '0 0 0 2px var(--dsw-alias-border-l3)',- outline: 'none',- }),- ]),- c('.dshp-pet__tab-desc', {- margin: '0',- fontSize: '13px',- lineHeight: '20px',- color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))',- }),- c('.dshp-pet__divider', {- border: '0',- borderTop: '1px solid var(--dsw-alias-border-weak, rgba(127,127,127,0.2))',- }),- c('.dshp-pet__size-row', { display: 'flex', alignItems: 'center', gap: '12px' }),- c('.dshp-pet__size-label', { flex: 'none', fontWeight: '500' }),- c('.dshp-pet__size-slider', {- flex: '1',- accentColor: 'var(--dsw-alias-brand-primary)',- cursor: 'pointer',- }),- c('.dshp-pet__hint', {- margin: '0',- fontSize: '12px',- lineHeight: '18px',- color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))',- }),- c('.dshp-pet__empty', {- padding: '24px 16px',- textAlign: 'center',- fontSize: '13px',- lineHeight: '20px',- borderRadius: '12px',- border: '1px dashed var(--dsw-alias-border-weak, rgba(127,127,127,0.2))',- color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))',- }),- // 初次加载占位(首次打开设置页、清单尚未到达时显示,避免空卡片闪烁)。- c('.dshp-pet__loading', {- padding: '24px 16px',- textAlign: 'center',- fontSize: '13px',- lineHeight: '20px',- color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))',- }),- c('.dshp-pet__error', {- fontSize: '12px',- lineHeight: '18px',- color: 'var(--dsw-alias-state-error-primary, var(--dsw-alias-danger-text, #ff7a7a))',- }),-])diff --git a/packages/dsh-tauri-pet/src/client/components/pet-settings.tsx b/packages/dsh-tauri-pet/src/client/components/pet-settings.tsxindex e78a3752..5252e9f2 100644--- a/packages/dsh-tauri-pet/src/client/components/pet-settings.tsx+++ b/packages/dsh-tauri-pet/src/client/components/pet-settings.tsx@@ -1,9 +1,9 @@import type { ChangeEvent, ReactElement } from 'react'import type { PetSettingsProps } from './pet-settings.types'-import { ArrowDownToLine, Icon, Plus, useMountStyle } from 'dsh-tauri-ui/client'+import { ArrowDownToLine, Button, Icon, Plus, SegmentedControl } from 'dsh-tauri-ui/client'import { useStore, useWatchImmediate } from 'dsh-tauri/client'-import { useEffect, useRef, useState } from 'react'-import { PET_DEFAULT_SIZE, PET_SETTINGS_STYLES_ID, PET_SIZE_MAX, PET_SIZE_MIN, PET_SIZE_STEP } from '../constants'+import { useEffect, useId, useRef, useState } from 'react'+import { PET_DEFAULT_SIZE, PET_SIZE_MAX, PET_SIZE_MIN, PET_SIZE_STEP } from '../constants'import { locale } from '../locales'import {choosePet,@@ -16,7 +16,11 @@ import {} from '../service/pet'import { store } from '../store'import { PetCard } from './pet-card'-import petSettingsStyle from './pet-settings.cssr'++const TAB_OPTIONS = [+ { value: 'pets', label: 'Pets' },+ { value: 'codex', label: 'Codex' },+] as const/** 读取 .zip 归档为 base64(桌面端命令按字符串收包)。 */function readAsBase64(file: File): Promise<string> {@@ -34,20 +38,20 @@ function readAsBase64(file: File): Promise<string> {/** 桌宠设置页:预设 / Chat / Codex 三类宠物卡片(选择、启用、取消选择)、开关、大小滑条与导入。 */export function PetSettings(props: PetSettingsProps): ReactElement {- useMountStyle(petSettingsStyle, PET_SETTINGS_STYLES_ID)locale.useLocale()const { status, presetPets, chatPets, codexPets, catalogLoaded } = useStore(store.pet)const [tab, setTab] = useState<'pets' | 'codex'>('pets')- // 无缓存(首次挂载)时进入加载态,避免空列表闪烁;有缓存直接渲染、后台静默刷新。const [busy, setBusy] = useState(() => !catalogLoaded)const [error, setError] = useState<string | null>(null)const [size, setSize] = useState(status?.pet_size ?? PET_DEFAULT_SIZE)+ const tabsId = useId()+ const fileRef = useRef<HTMLInputElement>(null)const committedSizeRef = useRef<number | null>(null)const enabled = Boolean(status?.enabled)const active = status?.active_pet ?? ''const statusSize = status?.pet_size ?? PET_DEFAULT_SIZE- // 宿主状态里的尺寸变化(别的入口改过)同步到本地滑条;本地正在拖动的值不被覆盖。+ // 宿主侧尺寸变化同步到本地滑条,正在拖动的本地值不被覆盖。useWatchImmediate(statusSize, () => {if (statusSize !== committedSizeRef.current)setSize(statusSize)@@ -67,7 +71,6 @@ export function PetSettings(props: PetSettingsProps): ReactElement {}}, [])- /** 启用预设宠物:选择它,并确保桌宠被唤醒。 */async function enablePreset(id: string): Promise<void> {if (busy || active === id)return@@ -90,7 +93,6 @@ export function PetSettings(props: PetSettingsProps): ReactElement {setBusy(false)}- /** 取消选择:清空已选宠物;仍在启用时一并关闭桌宠(无内容可渲染,不留空窗口)。 */async function clearSelection(): Promise<void> {if (busy || active === '')return@@ -102,7 +104,6 @@ export function PetSettings(props: PetSettingsProps): ReactElement {setBusy(false)}- /** 启用/关闭桌宠:纯持久开关,关闭后重启不再自动拉起。 */async function toggleEnabled(): Promise<void> {if (busy)return@@ -162,7 +163,6 @@ export function PetSettings(props: PetSettingsProps): ReactElement {? <div className="dshp-pet__loading">{locale.text('loading')}</div>: (<div className="dshp-pet__cards">- {/* 预设宠物直连远端素材:没有下载/更新步骤,卡片动作只有「启用 / 已选」。 */}{presetPets.map(item => (<PetCardkey={item.id}@@ -216,59 +216,68 @@ export function PetSettings(props: PetSettingsProps): ReactElement {return (<div className="dshp-pet__page"><div className="dshp-pet__tabs">- <div className="dshp-pet__tab-list" role="tablist" aria-label={locale.text('name')}>- <button- type="button"- role="tab"- aria-selected={tab === 'pets'}- className={tab === 'pets' ? 'dshp-pet__tab-btn dshp-pet__tab-btnActive' : 'dshp-pet__tab-btn'}- onClick={() => setTab('pets')}- >- Pets- </button>- <button- type="button"- role="tab"- aria-selected={tab === 'codex'}- className={tab === 'codex' ? 'dshp-pet__tab-btn dshp-pet__tab-btnActive' : 'dshp-pet__tab-btn'}- onClick={() => setTab('codex')}- >- Codex- </button>- </div>+ <SegmentedControl+ id={tabsId}+ label={locale.text('name')}+ value={tab}+ options={TAB_OPTIONS}+ onChange={next => setTab(next === 'codex' ? 'codex' : 'pets')}+ /><div className="dshp-pet__tab-tools">{tab === 'pets'? (<>- <button type="button" className="dshp-pet__tool-btn" disabled={busy} onClick={() => { void createPet() }}>- <Icon as={Plus} />+ <Button+ type="button"+ variant="outline"+ size="sm"+ icon={<Icon as={Plus} />}+ disabled={busy}+ onClick={() => { void createPet() }}+ >{locale.text('create')}- </button>- <button type="button" className="dshp-pet__tool-btn" disabled={busy} onClick={() => { void toggleEnabled() }}>+ </Button>+ <Button+ type="button"+ variant="outline"+ size="sm"+ disabled={busy}+ onClick={() => { void toggleEnabled() }}+ >{enabled ? locale.text('closePet') : locale.text('enablePet')}- </button>+ </Button></>): (- <label className="dshp-pet__tool-btn" aria-disabled={busy}>- <Icon as={ArrowDownToLine} />- {locale.text('import')}+ <>+ <Button+ type="button"+ variant="outline"+ size="sm"+ icon={<Icon as={ArrowDownToLine} />}+ disabled={busy}+ onClick={() => fileRef.current?.click()}+ >+ {locale.text('import')}+ </Button><input+ ref={fileRef}type="file"accept=".zip"hiddendisabled={busy}onChange={(event) => { void onImport(event) }}/>- </label>+ </>)}</div></div><p className="dshp-pet__tab-desc">{tab === 'pets' ? locale.text('tabInstalledDesc') : locale.text('tabCodexDesc')}</p>- <div className="dshp-pet__divider" role="separator" />- {tab === 'pets' ? petsPanel : codexPanel}+ <div id={`${tabsId}-${tab}-panel`} role="tabpanel" aria-labelledby={`${tabsId}-${tab}`}>+ {tab === 'pets' ? petsPanel : codexPanel}+ </div>{error ? <div className="dshp-pet__error" role="alert">{error}</div> : null}<div className="dshp-pet__size-row"><span className="dshp-pet__size-label">{locale.text('sizeLabel')}</span>diff --git a/packages/dsh-tauri-pet/src/client/constants/index.ts b/packages/dsh-tauri-pet/src/client/constants/index.tsindex 0f6a569d..f3b7802b 100644--- a/packages/dsh-tauri-pet/src/client/constants/index.ts+++ b/packages/dsh-tauri-pet/src/client/constants/index.ts@@ -6,8 +6,6 @@ export const PET_SECTION_ORDER = 230/** 样式挂载 id 与 effect 标签。 */export const PET_STYLES_ID = 'dsh-tauri-pet-styles'-export const PET_SETTINGS_STYLES_ID = 'dsh-tauri-pet-settings-styles'-export const PET_CARD_STYLES_ID = 'dsh-tauri-pet-card-styles'export const PET_LOCALE_EFFECT = `${PLUGIN_ID}: locale`export const PET_STYLES_EFFECT = `${PLUGIN_ID}: styles`export const PET_SECTION_EFFECT = `${PLUGIN_ID}: settings section`diff --git a/packages/dsh-tauri-pet/src/client/register/sidebar-icon.ts b/packages/dsh-tauri-pet/src/client/register/sidebar-icon.tsindex 1bdb3de2..1465483d 100644--- a/packages/dsh-tauri-pet/src/client/register/sidebar-icon.ts+++ b/packages/dsh-tauri-pet/src/client/register/sidebar-icon.ts@@ -1,6 +1,10 @@import type { RegisterController } from 'dsh-tauri/client'+import { Icon, IconButton, StateDot } from 'dsh-tauri-ui/client'import { defineRegister } from 'dsh-tauri/client'+import { createElement } from 'react'+import { createRoot } from 'react-dom/client'import {+ PET_ICON_ATTRIBUTE,PET_ICON_RETRY_MAX,PET_ICON_RETRY_MS,SETTINGS_TRIGGER_SELECTOR,@@ -11,40 +15,25 @@ import { loadPetStatus, togglePet } from '../service/pet'import { store } from '../store'import {applySettingsRow,- createIconButton,isRailTrigger,+ PetPawIcon,revertSettingsRow,- syncIconState,} from './sidebar-icon.utils'/**- * register/sidebar-icon.ts — 侧栏「桌宠入口」DOM 补丁。- *- * 入口是 `.sidebar.settings` 容器(dsh-tauri-ui 的设置触发器所在处)的子元素:紧贴- * `.dshp-settings-trigger` 右侧的原生按钮,样式复刻官方 iconButton。按钮两态(绿点 =- * 已启用),点击即切换启用状态,不弹面板(设置走 settings.section 页)。- *- * 挂载策略:MutationObserver 监听 document.body,侧栏就绪后插入并持续看护(React- * 重渲染容器后自动补插);guard 属性 + 位置校验防止重复插入与死循环。观察器、重试- * 计时器、订阅、事件与收尾全部登记进控制器,卸载即释放。+ * 侧栏桌宠入口补丁:入口由 dsh-tauri-ui 的 IconButton 渲染,插在 `.dshp-settings-trigger`+ * 右侧;两态(绿点 = 已启用),点击切换启用状态,设置页走 settings.section。*/export const sidebarIconFeature = defineRegister((controller) => {registerSidebarPetIcon(controller)})-// --- internal ----/** 当前是否启用(绿点两态的唯一真值来自共享 store)。 */function iconActive(): boolean {return store.pet.$state.status?.enabled ?? false}-/**- * 切换桌宠启用状态(失败由服务层记录,设置页内有完整错误展示)。- *- * 纯持久开关:关掉就落盘 `enabled=false`,重启后不会自己再起来。用户点这个按钮的语义- * 是「关掉宠物」,不是「这次先收起来」。- */+/** 纯持久开关:关掉即落盘 `enabled=false`,重启后不会自己再起来(失败由服务层记录)。 */async function toggleEnabled(): Promise<void> {await togglePet({ enabled: !iconActive() })}@@ -53,24 +42,54 @@ function registerSidebarPetIcon(controller: RegisterController): void {if (typeof document === 'undefined')return- const button = createIconButton(locale.text('name'))- /** 当前打过设置行类的宿主(卸载时移除,React 重渲染换宿主时随旧节点废弃)。 */+ const label = locale.text('name')+ // 按钮渲染在脱离文档的 React 根里再搬进侧栏:根外收不到合成事件(交互走原生监听),+ // 卸载前必须搬回容器(React 只从自己的容器里摘节点)。+ const entryHost = document.createElement('div')+ const entryRoot = createRoot(entryHost)+ let button: HTMLButtonElement | undefinedlet rowHost: HTMLElement | undefined- /** 上一次做过内联宽度修正的触发器(折叠态/卸载时撤销)。 */let patchedTrigger: HTMLElement | undefined- /** 上次修正时触发器是否为折叠态(Rail),状态翻转时需重写内联样式。 */let patchedRail: boolean | undefinedconst onClick = (): void => {void toggleEnabled()}- button.addEventListener('click', onClick)- controller.add(() => button.removeEventListener('click', onClick))- // 状态缓存订阅:绿点两态随 store 变化;首屏再拉取一次权威状态。- controller.add(store.pet.$subscribe(() => syncIconState(button, iconActive())))- void loadPetStatus()- syncIconState(button, iconActive())+ function render(): void {+ const active = iconActive()+ entryRoot.render(createElement(+ IconButton,+ {+ 'variant': 'round',+ 'className': 'dshp-pet__icon-entry',+ 'icon': createElement(Icon, { as: PetPawIcon }),+ 'aria-label': label,+ 'aria-pressed': active,+ },+ active+ ? createElement(+ 'span',+ { className: 'dshp-pet__icon-dot' },+ createElement(StateDot, { state: 'done', size: 6 }),+ )+ : null,+ ))+ }++ /** 按钮由 React 异步渲染进宿主,落到宿主后才挂守卫属性、提示气泡与点击监听。 */+ function capture(): void {+ if (button !== undefined)+ return+ const node = entryHost.firstElementChild+ if (!(node instanceof HTMLButtonElement))+ return+ button = node+ button.setAttribute(PET_ICON_ATTRIBUTE, '1')+ button.setAttribute('data-tip', label)+ button.addEventListener('click', onClick)+ scan()+ }/** 行布局只在宿主/触发器/折叠态真的变化时才重写(观察器回调高频)。 */function applyRowStyles(host: HTMLElement, trigger: HTMLElement): void {@@ -89,10 +108,9 @@ function registerSidebarPetIcon(controller: RegisterController): void {if (!trigger?.parentElement)returnapplyRowStyles(trigger.parentElement, trigger)- if (button.isConnected && button.previousElementSibling === trigger)+ if (button === undefined || (button.isConnected && button.previousElementSibling === trigger))returntrigger.after(button)- syncIconState(button, iconActive())}function scan(): void {@@ -102,22 +120,31 @@ function registerSidebarPetIcon(controller: RegisterController): void {ensurePlaced()}+ // 按钮异步落到宿主,宿主一变就去认领;两态随 store 变化,首屏再拉一次权威状态。+ controller.observe(entryHost, capture, { childList: true })+ render()+ controller.add(store.pet.$subscribe(render))+ void loadPetStatus()+controller.observe(document.body, scan, { childList: true, subtree: true })- // 观察器已覆盖侧栏子树,这里再保留一条短暂轮询兜底(侧栏出现即停、最多- // PET_ICON_RETRY_MAX 次):应用晚挂载时可能长时间没有任何 DOM 变更。+ // 观察器覆盖不到「应用晚挂载、长时间无 DOM 变更」的空窗,补一条短暂轮询(侧栏出现即停)。let tries = 0const stopPolling = controller.interval(() => {scan()if (document.querySelector(SIDEBAR_SELECTOR) || ++tries > PET_ICON_RETRY_MAX)stopPolling()}, PET_ICON_RETRY_MS)- // 首轮立即尝试(侧栏可能已就绪)。scan()// 收尾:注册顺序保证它在观察器断开之后执行(否则移除按钮会触发 scan 重新插入)。controller.add(() => {- button.remove()+ if (button !== undefined) {+ button.removeEventListener('click', onClick)+ entryHost.append(button)+ button = undefined+ }+ entryRoot.unmount()revertSettingsRow(rowHost, patchedTrigger)rowHost = undefinedpatchedTrigger = undefineddiff --git a/packages/dsh-tauri-pet/src/client/register/sidebar-icon.utils.ts b/packages/dsh-tauri-pet/src/client/register/sidebar-icon.utils.tsindex 2310813d..cb227e44 100644--- a/packages/dsh-tauri-pet/src/client/register/sidebar-icon.utils.ts+++ b/packages/dsh-tauri-pet/src/client/register/sidebar-icon.utils.ts@@ -1,28 +1,26 @@+import type { ReactElement, SVGProps } from 'react'+import { createElement } from 'react'import {- PET_ICON_ATTRIBUTE,PET_SETTINGS_ROW_CLASS,SETTINGS_TRIGGER_RAIL_CLASS,} from '../constants'-/** 入口图标(爪印,currentColor 跟随官方 iconButton 悬停变色)。 */-const PET_ICON_SVG = '<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 13.5c-2.7 0-5.5 2-5.5 4.3 0 1.4 1 2.2 2.3 2.2 1 0 1.9-.6 3.2-.6s2.2.6 3.2.6c1.3 0 2.3-.8 2.3-2.2 0-2.3-2.8-4.3-5.5-4.3z"/><path d="M7.3 8.1c-1 .1-1.8 1.2-1.7 2.5.1 1.2 1 2.1 2 2 .9-.1 1.7-1.2 1.6-2.4-.1-1.2-1-2.2-1.9-2.1z"/><path d="M12 4.5c-1.1 0-2 1.1-2 2.5s.9 2.5 2 2.5 2-1.1 2-2.5-.9-2.5-2-2.5z"/><path d="M16.7 8.1c-.9-.1-1.8.9-1.9 2.1-.1 1.2.7 2.3 1.6 2.4 1 .1 1.9-.8 2-2 .1-1.3-.7-2.4-1.7-2.5z"/><path d="M4.8 12.3c-.8.3-1.2 1.4-.9 2.4.3 1 1.2 1.6 2 1.3.8-.3 1.1-1.4.8-2.4-.3-1-1.1-1.6-1.9-1.3z"/><path d="M19.2 12.3c-.8-.3-1.6.3-1.9 1.3-.3 1 0 2.1.8 2.4.8.3 1.7-.3 2-1.3.3-1-.1-2.1-.9-2.4z"/></svg>'+/** 爪印字形(@gravity-ui/icons 无对应图标,随 currentColor 变色)。 */+const PET_PAW_PATHS = [+ 'M12 13.5c-2.7 0-5.5 2-5.5 4.3 0 1.4 1 2.2 2.3 2.2 1 0 1.9-.6 3.2-.6s2.2.6 3.2.6c1.3 0 2.3-.8 2.3-2.2 0-2.3-2.8-4.3-5.5-4.3z',+ 'M7.3 8.1c-1 .1-1.8 1.2-1.7 2.5.1 1.2 1 2.1 2 2 .9-.1 1.7-1.2 1.6-2.4-.1-1.2-1-2.2-1.9-2.1z',+ 'M12 4.5c-1.1 0-2 1.1-2 2.5s.9 2.5 2 2.5 2-1.1 2-2.5-.9-2.5-2-2.5z',+ 'M16.7 8.1c-.9-.1-1.8.9-1.9 2.1-.1 1.2.7 2.3 1.6 2.4 1 .1 1.9-.8 2-2 .1-1.3-.7-2.4-1.7-2.5z',+ 'M4.8 12.3c-.8.3-1.2 1.4-.9 2.4.3 1 1.2 1.6 2 1.3.8-.3 1.1-1.4.8-2.4-.3-1-1.1-1.6-1.9-1.3z',+ 'M19.2 12.3c-.8-.3-1.6.3-1.9 1.3-.3 1 0 2.1.8 2.4.8.3 1.7-.3 2-1.3.3-1-.1-2.1-.9-2.4z',+]-/** 创建入口按钮(绿点常驻 DOM,用 aria-pressed + 类名表达两态)。 */-export function createIconButton(label: string): HTMLButtonElement {- const button = document.createElement('button')- button.type = 'button'- button.className = 'dshp-pet__icon-button'- button.setAttribute(PET_ICON_ATTRIBUTE, '1')- button.setAttribute('data-tip', label)- button.setAttribute('aria-label', label)- button.innerHTML = `${PET_ICON_SVG}<span class="dshp-pet__icon-dot" aria-hidden="true" />`- return button-}--/** 按共享状态同步按钮两态(绿点显隐 + aria-pressed):绿点 = 宠物已开启。 */-export function syncIconState(button: HTMLButtonElement, active: boolean): void {- button.classList.toggle('dshp-pet__icon--on', active)- button.setAttribute('aria-pressed', String(active))+export function PetPawIcon(props: SVGProps<SVGSVGElement>): ReactElement {+ return createElement(+ 'svg',+ { 'viewBox': '0 0 24 24', 'fill': 'currentColor', 'aria-hidden': 'true', ...props },+ PET_PAW_PATHS.map(path => createElement('path', { key: path, d: path })),+ )}/** 触发器是否处于折叠态(Rail 圆形按钮):折叠态保持定宽,不做拉伸修正。 */diff --git a/packages/dsh-tauri-pet/src/client/styles/index.cssr.ts b/packages/dsh-tauri-pet/src/client/styles/index.cssr.tsindex c42c45ba..c9797723 100644--- a/packages/dsh-tauri-pet/src/client/styles/index.cssr.ts+++ b/packages/dsh-tauri-pet/src/client/styles/index.cssr.ts@@ -1,49 +1,171 @@-/**- * styles/index.cssr.ts — 侧栏入口与设置行布局的公共样式(无组件面)。- *- * 入口按钮复刻官方 `.rtSEdW_iconButton`(appearance/color/border-radius/padding/hover/- * focus-visible 与 data-tip 气泡),并叠加右上角绿色激活圆点;设置行布局复刻新版 dsh- * 客户端 SettingsRoot 的 triggerRow(flex 行 + gap)。规则全部拆成单选择器(不依赖- * data-slot 包裹层,由补丁直接给宿主加 `.dshp-pet__settings-row` 并同步内联样式兜底)。- */+/** 设置分区面骨架与侧栏入口补丁的布局样式;通用控件观感全部来自 `dsh-tauri-ui/client`。 */import { cssr } from 'dsh-tauri-ui/client'const { c } = cssrexport default c([- // ── 侧栏入口:官方 iconButton 复刻(插在 .dshp-settings-trigger 右侧)──- c('.dshp-pet__icon-button', {- appearance: 'none',- color: 'var(--dsw-alias-label-tertiary)',+ c('.dshp-pet__page', {+ display: 'flex',+ flexDirection: 'column',+ gap: '12px',+ color: 'var(--dsw-alias-label-primary)',+ }),+ c('.dshp-pet__tabs', {+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ gap: '16px',+ flexWrap: 'wrap',+ margin: '4px 0 0',+ }),+ c('.dshp-pet__tab-tools', { display: 'flex', alignItems: 'center', gap: '6px' }),+ c('.dshp-pet__tab-desc', {+ margin: '0',+ fontSize: '13px',+ lineHeight: '20px',+ color: 'var(--dsw-alias-label-secondary)',+ }),+ c('.dshp-pet__size-row', { display: 'flex', alignItems: 'center', gap: '12px' }),+ c('.dshp-pet__size-label', { flex: 'none', fontWeight: '500' }),+ c('.dshp-pet__size-slider', {+ flex: '1',+ accentColor: 'var(--dsw-alias-brand-primary)',cursor: 'pointer',- background: '0 0',- border: '0',- borderRadius: '7px',+ }),+ c('.dshp-pet__hint', {+ margin: '0',+ fontSize: '12px',+ lineHeight: '18px',+ color: 'var(--dsw-alias-label-secondary)',+ }),+ c('.dshp-pet__empty', {+ padding: '24px 16px',+ textAlign: 'center',+ fontSize: '13px',+ lineHeight: '20px',+ borderRadius: '12px',+ border: '1px dashed var(--dsw-alias-border-weak)',+ color: 'var(--dsw-alias-label-secondary)',+ }),+ c('.dshp-pet__loading', {+ padding: '24px 16px',+ textAlign: 'center',+ fontSize: '13px',+ lineHeight: '20px',+ color: 'var(--dsw-alias-label-secondary)',+ }),+ c('.dshp-pet__error', {+ fontSize: '12px',+ lineHeight: '18px',+ color: 'var(--dsw-alias-state-error-primary)',+ }),++ c('.dshp-pet__cards', { display: 'flex', flexDirection: 'column', gap: '12px' }),+ c('.dshp-pet__card-item', {+ display: 'flex',alignItems: 'center',- padding: '6px',- display: 'inline-flex',+ gap: '12px',+ padding: '12px 14px',+ borderRadius: '12px',+ border: '1px solid var(--dsw-alias-border-weak)',+ background: 'var(--dsw-alias-bg-base)',+ }, [+ c('&:hover', { background: 'var(--dsw-alias-interactive-bg-hover)' }),+ ]),+ c('.dshp-pet__card-thumb', {+ flex: 'none',+ width: '56px',+ height: '56px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ fontSize: '28px',+ borderRadius: '10px',+ background: 'var(--dsw-alias-bg-layer-1)',+ overflow: 'hidden',+ objectFit: 'cover',+ }),+ c('.dshp-pet__card-thumb > img', {+ display: 'block',+ width: '100%',+ height: '100%',+ }),+ // 精灵图缩略图:8 列 × 11 行的雪碧图只露出左上角一帧。+ c('.dshp-pet__card-thumbSprite', {position: 'relative',- pointerEvents: 'auto',}, [- c('&:disabled', { opacity: '0.4', cursor: 'default' }),- c('&:hover:not(:disabled)', {- background: 'var(--dsw-alias-bg-layer-1)',- color: 'var(--dsw-alias-label-primary)',- }),- c('&:focus-visible', {- outline: '2px solid var(--dsw-alias-brand-primary)',- outlineOffset: '-1px',+ c('& > img', {+ position: 'absolute',+ width: '800%',+ height: '1100%',+ maxWidth: 'none',+ objectFit: 'fill',+ left: '0',+ top: '0',}),]),- // data-tip 气泡(同官方 iconButton 的 :after 提示位)。- c('.dshp-pet__icon-button::after', {+ c('.dshp-pet__card-body', {+ flex: '1',+ minWidth: '0',+ display: 'flex',+ flexDirection: 'column',+ gap: '2px',+ }),+ c('.dshp-pet__card-nameRow', {+ display: 'flex',+ alignItems: 'center',+ gap: '6px',+ minWidth: '0',+ }),+ c('.dshp-pet__card-name', {+ fontWeight: '600',+ fontSize: '14px',+ lineHeight: '20px',+ minWidth: '0',+ overflow: 'hidden',+ textOverflow: 'ellipsis',+ whiteSpace: 'nowrap',+ }),+ c('.dshp-pet__card-desc', {+ fontSize: '12px',+ lineHeight: '18px',+ color: 'var(--dsw-alias-label-secondary)',+ }),+ c('.dshp-pet__card-actions', {+ flex: 'none',+ display: 'flex',+ alignItems: 'center',+ gap: '6px',+ }),++ // 旧版客户端触发器是通栏块级元素,补丁给宿主加 flex 行,入口按钮才不会被挤到下一行。+ c('.dshp-pet__settings-row', {+ display: 'flex',+ alignItems: 'center',+ gap: '8px',+ width: '100%',+ }),+ c('.dshp-pet__settings-row > .dshp-settings-trigger:not(.dshp-settings-trigger--rail)', {+ flex: '1 1 auto',+ width: 'auto',+ minWidth: '0',+ }),+ c('.dshp-pet__icon-entry', { flex: 'none', marginRight: '2px' }),+ c('[data-sidebar-collapsed] .dshp-pet__icon-entry', { display: 'none' }),+ c('.dshp-pet__icon-dot', {+ display: 'flex',+ position: 'absolute',+ top: '3px',+ right: '3px',+ }),+ c('.dshp-pet__icon-entry::after', {content: 'attr(data-tip)',position: 'absolute',bottom: 'calc(100% + 6px)',left: '50%',transform: 'translateX(-50%)',background: 'var(--dsw-alias-label-primary)',- color: 'var(--dsw-alias-bg-layer-3, #fff)',+ color: 'var(--dsw-alias-bg-layer-3)',padding: '4px 8px',borderRadius: '6px',fontSize: '12px',@@ -54,40 +176,5 @@ export default c([transition: 'opacity 0.15s ease',zIndex: '10',}),- c('.dshp-pet__icon-button:hover::after, .dshp-pet__icon-button:focus-visible::after', { opacity: '1' }),- // 激活态绿色小圆点(右上角),未激活时隐藏。- c('.dshp-pet__icon-dot', {- position: 'absolute',- top: '6px',- right: '6px',- width: '4px',- height: '4px',- borderRadius: '100%',- background: 'var(--dsw-alias-state-success-primary, #3ddc84)',- display: 'none',- }),- c('.dshp-pet__icon-button.dshp-pet__icon--on .dshp-pet__icon-dot', { display: 'block' }),-- // ── 设置行布局:复刻新版 dsh 客户端 SettingsRoot 的 triggerRow(flex 行)──- // 旧版客户端 sidebar.settings 是通栏块级触发器,图标按钮直接插会被挤到下- // 一行;补丁给触发器宿主加 .dshp-pet__settings-row(并同步内联 display:flex 兜- // 底),触发器占满剩余宽度、图标排右侧,行内 gap 对齐官方排布。- c('.dshp-pet__settings-row', {- display: 'flex',- alignItems: 'center',- gap: '8px',- width: '100%',- }),- c('.dshp-pet__settings-row > .dshp-settings-trigger:not(.dshp-settings-trigger--rail)', {- flex: '1 1 auto',- width: 'auto',- minWidth: '0',- }),- c('.dshp-pet__settings-row > .dshp-pet__icon-button', {- flex: 'none',- marginRight: '2px',- }),- // 侧栏折叠(AppFrame data-sidebar-collapsed)时入口按钮整体隐藏。- c('[data-sidebar-collapsed] .dshp-pet__icon-button', { display: 'none' }),-+ c('.dshp-pet__icon-entry:hover::after, .dshp-pet__icon-entry:focus-visible::after', { opacity: '1' }),])diff --git a/packages/dsh-tauri-rightclick/package.json b/packages/dsh-tauri-rightclick/package.jsonindex 1e6c2e82..ab2c68e2 100644--- a/packages/dsh-tauri-rightclick/package.json+++ b/packages/dsh-tauri-rightclick/package.json@@ -37,7 +37,6 @@"client": {"inject": ["@deepseek-ai/dsh-client-ui-layout",- "@deepseek-ai/dsh-client-ui-primitives","dsh-tauri","dsh-tauri-ui"],@@ -60,12 +59,12 @@},"dependencies": {"dsh-tauri": "workspace:*",- "dsh-tauri-ui": "workspace:*","lodash-es": "catalog:utils"},"devDependencies": {"@types/lodash-es": "catalog:types","dsh-tauri-tsdown": "workspace:*",+ "dsh-tauri-ui": "workspace:*","tsdown": "catalog:cli"}}diff --git a/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.tsx b/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.tsxindex 0346ede2..8d06dc70 100644--- a/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.tsx+++ b/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.tsx@@ -1,5 +1,5 @@import type { ConfirmDialogOptions } from './confirm-dialog.types'-import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'+import { Button, Modal } from 'dsh-tauri-ui/client'import { createRoot } from 'react-dom/client'import { locale } from '../locales'diff --git a/packages/dsh-tauri-rightclick/src/client/register/context-menu.tsx b/packages/dsh-tauri-rightclick/src/client/register/context-menu.tsxindex b7271495..e50cda28 100644--- a/packages/dsh-tauri-rightclick/src/client/register/context-menu.tsx+++ b/packages/dsh-tauri-rightclick/src/client/register/context-menu.tsx@@ -1,9 +1,9 @@-import type { MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'+import type { MenuEntry } from 'dsh-tauri-ui/client'import type { ClientContext } from 'dsh-tauri/client'import type { ReactNode } from 'react'import type { ActionOutcome, SessionsRuntimeLike, WorkspacesRuntimeLike } from '../types'import type { MenuComposer, OfficialSelectOptions } from './context-menu.types'-import { Menu, Toast } from '@deepseek-ai/dsh-client-ui-primitives'+import { Menu, Toast } from 'dsh-tauri-ui/client'import { defineRegister } from 'dsh-tauri/client'import { createRoot } from 'react-dom/client'import { CONTEXT_MENU_EVENT, LINK_SELECTOR, TOAST_DURATION_MS } from '../constants'diff --git a/packages/dsh-tauri-session/package.json b/packages/dsh-tauri-session/package.jsonindex 91af7f61..33c7a8df 100644--- a/packages/dsh-tauri-session/package.json+++ b/packages/dsh-tauri-session/package.json@@ -34,7 +34,6 @@"client": {"inject": ["@deepseek-ai/dsh-client-ui-layout",- "@deepseek-ai/dsh-client-ui-primitives","dsh-tauri","dsh-tauri-ui"],@@ -57,7 +56,6 @@},"dependencies": {"dsh-tauri": "workspace:*",- "dsh-tauri-ui": "workspace:*","hookable": "catalog:utils","lodash-es": "catalog:utils","pathe": "catalog:utils"@@ -65,6 +63,7 @@"devDependencies": {"@types/lodash-es": "catalog:types","dsh-tauri-tsdown": "workspace:*",+ "dsh-tauri-ui": "workspace:*","tsdown": "catalog:cli"}}diff --git a/packages/dsh-tauri-session/src/client/components/archive-panel.cssr.ts b/packages/dsh-tauri-session/src/client/components/archive-panel.layout.tssimilarity index 55%rename from packages/dsh-tauri-session/src/client/components/archive-panel.cssr.tsrename to packages/dsh-tauri-session/src/client/components/archive-panel.layout.tsindex b4eca90e..b0022ce7 100644--- a/packages/dsh-tauri-session/src/client/components/archive-panel.cssr.ts+++ b/packages/dsh-tauri-session/src/client/components/archive-panel.layout.ts@@ -1,4 +1,4 @@-/** Archive page styles generated as css-render nodes. */+// 仅保留包内布局/排版样式;控件外观一律取自 dsh-tauri-ui/client。import { cssr } from 'dsh-tauri-ui/client'const { c } = cssr@@ -23,14 +23,6 @@ export default c([lineHeight: '32px',fontWeight: 600,}),- // 「全部删除」:红字 + hover 透明红底。官方 ghost hover 是单类 + :hover:not()- // 的同特异性选择器,靠样式表顺序不保险,这里叠加双类抬高特异性保证覆盖。- c(`.dshp-session__delete-all`, {- color: 'var(--dsw-alias-state-error-primary, var(--dsw-alias-danger-text, inherit))',- }),- c(`.dshp-session__delete-all.dshp-session__delete-all:hover:not(:disabled)`, {- background: 'var(--dsw-alias-interactive-bg-hover-danger)',- }),c(`.dshp-session__toolbar`, {position: 'sticky',top: 0,@@ -42,41 +34,20 @@ export default c([padding: '8px 0',background: 'var(--dsw-alias-bg-base, var(--dsw-alias-bg-module-platform))',}),- // 官方 Input 自带外观(32px 圆角框、focus 描边),这里只控制弹性宽度。c(`.dshp-session__search`, {flex: '1 1 220px',minWidth: 0,}),- // 官方风格下拉触发器(Chip variant="selector"):对齐官方「通用设置」Select 规格- // (36px 高、全圆角、无边框、bg-module-platform 底、hover 换 interactive 底)。c(`.dshp-session__menu-select`, {- display: 'inline-flex',- alignItems: 'center',- gap: '12px',- boxSizing: 'border-box',- height: '36px',maxWidth: '220px',- padding: '0 14px',- border: 'none',- borderRadius: '18px',- background: 'var(--dsw-alias-bg-module-platform)',- color: 'var(--dsw-alias-label-primary)',- cursor: 'pointer',- fontFamily: 'inherit',- fontSize: '14px',- lineHeight: '22px',- }, [- c('&:hover', { background: 'var(--dsw-alias-interactive-bg-hover)' }),- ]),+ minWidth: 0,+ }),c(`.dshp-session__menu-select-label`, {textOverflow: 'ellipsis',whiteSpace: 'nowrap',overflow: 'hidden',minWidth: 0,}),- c(`.dshp-session__menu-select-chevron`, {- flex: 'none',- }),c(`.dshp-session__groups`, {display: 'flex',flexDirection: 'column',@@ -109,24 +80,6 @@ export default c([color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))',marginLeft: 'auto',}),- c(`.dshp-session__group-menu-trigger`, {- display: 'inline-flex',- alignItems: 'center',- justifyContent: 'center',- width: '20px',- height: '20px',- padding: 0,- border: 'none',- borderRadius: '6px',- background: 'transparent',- color: 'var(--dsw-alias-label-secondary)',- cursor: 'pointer',- fontSize: '18px',- lineHeight: '1',- }, [- c('&:hover', { background: 'var(--dsw-alias-interactive-bg-hover)' }),- ]),- // 重置 ul 默认 margin/padding/标记,行内边距由 .row 自行控制,去掉左侧缩进空白。c(`.dshp-session__list`, {display: 'flex',flexDirection: 'column',@@ -191,32 +144,6 @@ export default c([alignItems: 'center',gap: '8px',}),- // 行内垃圾桶:官方 iconButton 规格(28px 圆角方形、hover 底色)。- c(`.dshp-session__row-delete`, {- display: 'inline-flex',- alignItems: 'center',- justifyContent: 'center',- width: '28px',- height: '28px',- flex: 'none',- padding: 0,- border: 'none',- borderRadius: '6px',- background: 'none',- color: 'var(--dsw-alias-label-secondary)',- cursor: 'pointer',- }, [- c('&:hover', { background: 'var(--dsw-alias-interactive-bg-hover)' }),- ]),- c(`.dshp-session__unarchive`, {- color: 'var(--dsw-alias-label-primary)',- }),- // 删除确认弹窗的「删除」按钮:危险色(浅红底 + 红字)。- c(`.dshp-session__delete-btn`, {- background: 'var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover))',- borderColor: 'var(--dsw-alias-state-error-primary, var(--dsw-alias-border-l2))',- }, [- ]),c(`.dshp-session__empty`, {padding: '32px 0',textAlign: 'center',@@ -232,16 +159,4 @@ export default c([fontSize: '13px',lineHeight: '20px',}),- // 取消归档 toast 里的「查看」:内联链接式动作按钮(官方 Toast 文案槽不支持动作,- // 这里以插件类名渲染内联按钮)。- c(`.dshp-session__toast-view`, {- padding: 0,- border: 'none',- background: 'none',- color: 'var(--dsw-alias-brand-primary)',- font: 'inherit',- cursor: 'pointer',- }, [- c('&:hover', { textDecoration: 'underline' }),- ]),])diff --git a/packages/dsh-tauri-session/src/client/components/archive-panel.tsx b/packages/dsh-tauri-session/src/client/components/archive-panel.tsxindex 2f515b46..e463f843 100644--- a/packages/dsh-tauri-session/src/client/components/archive-panel.tsx+++ b/packages/dsh-tauri-session/src/client/components/archive-panel.tsx@@ -1,9 +1,8 @@-import type { MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'+import type { MenuEntry } from 'dsh-tauri-ui/client'import type { ReactElement } from 'react'import type { ArchiveSort } from '../store/modules/archive.types'import type { ArchivePanelProps, DeleteConfirm } from './archive-panel.types'-import { Button, Input, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives'-import { ChevronDown, Chip, Ellipsis, FolderOpen, Icon, Magnifier, Menu, TrashBin, useMountStyle } from 'dsh-tauri-ui/client'+import { Button, ChevronDown, Chip, Ellipsis, FolderOpen, Icon, IconButton, Input, Magnifier, Menu, Modal, Toast, TrashBin, useMountStyle } from 'dsh-tauri-ui/client'import { isEmpty, useWatchImmediate } from 'dsh-tauri/client'import { useCallback, useState } from 'react'import { SESSION_STYLE_ID } from '../constants'@@ -18,7 +17,7 @@ import {unarchiveSession,} from '../service/archive'import { store } from '../store'-import archivePanelStyle from './archive-panel.cssr'+import archivePanelStyle from './archive-panel.layout'import { formatTime, projectOptions } from './archive-panel.utils'/** 设置页「归档」分区:已归档的聊天列表(搜索 / 排序 / 项目筛选 / 取消归档 / 彻底删除)。 */@@ -74,8 +73,7 @@ export function ArchivePanel(props: ArchivePanelProps): ReactElement | null {<><Button variant="ghost" onClick={() => setConfirm(null)}>{locale.text('cancel')}</Button><Button- variant="outline"- className="dshp-session__delete-btn"+ variant="danger"disabled={ui.pending}onClick={handleConfirmDelete}>@@ -90,14 +88,12 @@ export function ArchivePanel(props: ArchivePanelProps): ReactElement | null {<h1 className="dshp-session__title">{locale.text('archiveTitle')}</h1><Buttontype="button"- variant="ghost"+ variant="danger"icon={<Icon as={TrashBin} />}- className="dshp-session__delete-all"- style={{ color: 'var(--dsw-alias-state-error-primary)' }}disabled={busy}onClick={() => setConfirm({ kind: 'all' })}>- <span className="dshp-session__delete-btn-text">{locale.text('deleteAll')}</span>+ {locale.text('deleteAll')}</Button></div>@@ -129,7 +125,7 @@ export function ArchivePanel(props: ArchivePanelProps): ReactElement | null {aria-haspopup="menu"aria-expanded={openSort}onClick={() => setOpenSort(openState => !openState)}- chevron={<Icon as={ChevronDown} className="dshp-session__menu-select-chevron" />}+ chevron={<Icon as={ChevronDown} />}><span className="dshp-session__menu-select-label">{sortOptions.find(option => option.id === ui.sort)?.label ?? ui.sort}@@ -156,7 +152,7 @@ export function ArchivePanel(props: ArchivePanelProps): ReactElement | null {aria-haspopup="menu"aria-expanded={openProjectFilter}onClick={() => setOpenProjectFilter(openState => !openState)}- chevron={<Icon as={ChevronDown} className="dshp-session__menu-select-chevron" />}+ chevron={<Icon as={ChevronDown} />}><span className="dshp-session__menu-select-label">{projectFilterOptions.find(option => option.id === ui.workspaceId)?.label ?? ui.workspaceId}@@ -205,16 +201,14 @@ export function ArchivePanel(props: ArchivePanelProps): ReactElement | null {portalalign="end"anchor={(- <button- type="button"- className="dshp-session__group-menu-trigger"+ <IconButton+ variant="action"+ icon={<Icon size={12} as={Ellipsis} />}aria-label={locale.text('groupMenuAria')}aria-haspopup="menu"aria-expanded={openGroupMenu === group.id}onClick={() => setOpenGroupMenu(openGroupMenu === group.id ? null : group.id)}- >- <Icon size={12} as={Ellipsis} />- </button>+ />)}/></div>@@ -234,20 +228,17 @@ export function ArchivePanel(props: ArchivePanelProps): ReactElement | null {<span className="dshp-session__row-time">{formatTime(row)}</span></div><div className="dshp-session__row-actions">- <button- type="button"- className="dshp-session__row-delete"+ <IconButton+ variant="action"+ icon={<Icon as={TrashBin} />}aria-label={locale.text('deleteRowAria')}disabled={busy}onClick={() => setConfirm({ kind: 'single', sessionId: row.sessionId })}- >- <Icon as={TrashBin} />- </button>+ /><Buttontype="button"variant="outline"size="sm"- className="dshp-session__unarchive"disabled={busy}onClick={() => void unarchiveSession({ sessionId: row.sessionId, resync })}>diff --git a/packages/dsh-tauri-session/src/client/components/archive-workspace-dialog.tsx b/packages/dsh-tauri-session/src/client/components/archive-workspace-dialog.tsxindex 7c2e7270..744f6f0b 100644--- a/packages/dsh-tauri-session/src/client/components/archive-workspace-dialog.tsx+++ b/packages/dsh-tauri-session/src/client/components/archive-workspace-dialog.tsx@@ -1,5 +1,5 @@import type { ArchiveWorkspaceDialogProps } from './archive-panel.types'-import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'+import { Button, Modal } from 'dsh-tauri-ui/client'import { locale } from '../locales'/** 「归档工作区」二次确认框(由 register 的工作区补丁以 createRoot 挂载)。 */diff --git a/packages/dsh-tauri-session/src/client/constants/index.ts b/packages/dsh-tauri-session/src/client/constants/index.tsindex bbfae914..40f999d9 100644--- a/packages/dsh-tauri-session/src/client/constants/index.ts+++ b/packages/dsh-tauri-session/src/client/constants/index.ts@@ -30,4 +30,3 @@ export const MENU_ITEM_ICON_SELECTOR = '[class*="itemIcon"]'export const ARCHIVE_MENU_ITEM_ATTRIBUTE = 'data-dsh-tauri-session-archive-item'export const ARCHIVE_MENU_PATCH_ATTRIBUTE = 'data-dsh-tauri-session-archive-menu-patched'-export const ARCHIVE_MENU_ITEM_CLASS = 'dshp-session__archive-menu-item'diff --git a/packages/dsh-tauri-session/src/client/register/workspace-patch.utils.ts b/packages/dsh-tauri-session/src/client/register/workspace-patch.utils.tsindex 9d3b51b2..4902b7bc 100644--- a/packages/dsh-tauri-session/src/client/register/workspace-patch.utils.ts+++ b/packages/dsh-tauri-session/src/client/register/workspace-patch.utils.ts@@ -1,7 +1,6 @@import type { SessionsRuntimeLike, WorkspacesRuntimeLike, WorkspaceViewLike } from '../types/runtime'import {ARCHIVE_MENU_ITEM_ATTRIBUTE,- ARCHIVE_MENU_ITEM_CLASS,DELETE_WORKSPACE_LABELS,MENU_ITEM_ICON_SELECTOR,MENU_ITEM_LABEL_SELECTOR,@@ -70,8 +69,7 @@ export function decorateArchiveMenuItem(item: HTMLButtonElement, label: string):if (!labelNode)return falselabelNode.textContent = label- // danger 外观由 `.dshp-session__archive-menu-item` 的 !important 覆盖(见 styles/workspace-menu.cssr)。- item.classList.add(ARCHIVE_MENU_ITEM_CLASS)+ // danger 外观由 `[data-dsh-tauri-session-archive-item]` 的 !important 覆盖(见 styles/workspace-menu.cssr)。item.setAttribute(ARCHIVE_MENU_ITEM_ATTRIBUTE, '1')const icon = item.querySelector<HTMLElement>(MENU_ITEM_ICON_SELECTOR)if (icon)diff --git a/packages/dsh-tauri-session/src/client/styles/workspace-menu.cssr.ts b/packages/dsh-tauri-session/src/client/styles/workspace-menu.cssr.tsindex 12419396..79ca3aa6 100644--- a/packages/dsh-tauri-session/src/client/styles/workspace-menu.cssr.ts+++ b/packages/dsh-tauri-session/src/client/styles/workspace-menu.cssr.ts@@ -1,13 +1,11 @@import { cssr } from 'dsh-tauri-ui/client'+import { ARCHIVE_MENU_ITEM_ATTRIBUTE } from '../constants'const { c } = cssr-/**- * 工作区菜单里克隆出的「归档工作区」条目外观:官方 `.danger` 样式不带 `!important`,- * 这里的同层声明可稳定覆盖,无需 JS hover 监听或内联 !important。- */+// 克隆自官方 danger 条目:以插件属性钩子 + !important 覆盖回中性菜单项外观。export default c([- c(`.dshp-session__archive-menu-item`, {+ c(`[${ARCHIVE_MENU_ITEM_ATTRIBUTE}]`, {color: 'var(--dsw-alias-label-primary) !important',background: 'transparent !important',}, [diff --git a/packages/dsh-tauri-worktree/package.json b/packages/dsh-tauri-worktree/package.jsonindex 249fd6fc..ae0dfe0e 100644--- a/packages/dsh-tauri-worktree/package.json+++ b/packages/dsh-tauri-worktree/package.json@@ -34,7 +34,6 @@"client": {"inject": ["@deepseek-ai/dsh-client-ui-layout",- "@deepseek-ai/dsh-client-ui-primitives","dsh-tauri","dsh-tauri-ui"],@@ -57,7 +56,6 @@},"dependencies": {"dsh-tauri": "workspace:*",- "dsh-tauri-ui": "workspace:*","hookable": "catalog:utils","lodash-es": "catalog:utils","pathe": "catalog:utils",@@ -66,6 +64,7 @@},"devDependencies": {"@types/lodash-es": "catalog:types",+ "dsh-tauri-ui": "workspace:*","dsh-tauri-tsdown": "workspace:*","tsdown": "catalog:cli"}diff --git a/packages/dsh-tauri-worktree/src/client/components/dialog.cssr.ts b/packages/dsh-tauri-worktree/src/client/components/dialog.cssr.tsdeleted file mode 100644index c6d8694a..00000000--- a/packages/dsh-tauri-worktree/src/client/components/dialog.cssr.ts+++ /dev/null@@ -1,38 +0,0 @@-import { cssr } from 'dsh-tauri-ui/client'--const { bem: { b, e } } = cssr--/**- * 工作树对话框只用官方 primitives `Modal` 之外的字段与路径行样式:- * 遮罩、卡片、标题、页脚与关闭行为由 `Modal` 承担。- */-export default b('worktree', [- e('dialog-form', { display: 'flex', flexDirection: 'column', gap: '14px' }),- e('dialog-field', { display: 'flex', flexDirection: 'column', gap: '6px' }),- e('dialog-field-label', { fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))' }),- e('dialog-input-wrap', {- display: 'flex',- alignItems: 'center',- gap: 0,- border: '1px solid var(--dsw-alias-border-weak, rgba(127,127,127,0.25))',- borderRadius: '10px',- overflow: 'hidden',- background: 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,0.06))',- }),- e('dialog-input', {- flex: 1,- minWidth: 0,- height: '36px',- padding: '0 10px',- border: 'none',- background: 'none',- color: 'var(--dsw-alias-label-primary)',- fontFamily: 'inherit',- fontSize: '13px',- outline: 'none',- }),- e('dialog-path-row', { display: 'flex', justifyContent: 'space-between', gap: '12px', fontSize: '12px', lineHeight: '18px' }),- e('dialog-path-key', { flex: 'none', color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))' }),- e('dialog-path-value', { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', fontFamily: 'monospace' }),- e('dialog-error', { fontSize: '12px', lineHeight: '18px', color: '#c0392b' }),-])diff --git a/packages/dsh-tauri-worktree/src/client/components/dialog.tsx b/packages/dsh-tauri-worktree/src/client/components/dialog.tsxindex 8c65ba7b..c93edccd 100644--- a/packages/dsh-tauri-worktree/src/client/components/dialog.tsx+++ b/packages/dsh-tauri-worktree/src/client/components/dialog.tsx@@ -1,10 +1,8 @@import type { ReactElement } from 'react'import type { SessionsRuntime, WorkspacesRuntime } from '../service/session-switch.types'import type { WorktreeDialogProps } from './dialog.types'-import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'-import { useMountStyle } from 'dsh-tauri-ui/client'+import { Button, Input, Modal } from 'dsh-tauri-ui/client'import { find } from 'dsh-tauri/client'-import { DIALOG_STYLE_ID } from '../constants'import { useCurrentSession } from '../hooks/use-current-session'import { useDiscard } from '../hooks/use-discard'import { useWaiter } from '../hooks/use-waiter'@@ -13,11 +11,9 @@ import { locale } from '../locales'import { openSession, waitForSessionListed } from '../service/session-switch'import { checkout } from '../service/worktree'import { store } from '../store'-import dialogStyle from './dialog.cssr'export function WorktreeDialog({ workspacesRuntime, sessionsRuntime }: WorktreeDialogProps): ReactElement | null {locale.useLocale()- useMountStyle(dialogStyle, DIALOG_STYLE_ID)const sessionId = useCurrentSession(sessionsRuntime)const state = useWorktreeSession(sessionId)const discardWorktree = useDiscard(sessionId)@@ -121,15 +117,12 @@ function CheckoutDialog(props: {<div className="dshp-worktree__dialog-form"><div className="dshp-worktree__dialog-field"><label className="dshp-worktree__dialog-field-label" htmlFor="wt-checkout-branch">{locale.text('checkoutBranchLabel')}</label>- <div className="dshp-worktree__dialog-input-wrap">- <input- id="wt-checkout-branch"- className="dshp-worktree__dialog-input"- value={branchName}- placeholder={locale.text('branchPlaceholder')}- onChange={event => updateBranch(event.target.value)}- />- </div>+ <Input+ id="wt-checkout-branch"+ value={branchName}+ placeholder={locale.text('branchPlaceholder')}+ onChange={event => updateBranch(event.target.value)}+ /></div><div className="dshp-worktree__dialog-path-row"><span className="dshp-worktree__dialog-path-key">{locale.text('checkoutCurrentPath')}</span>diff --git a/packages/dsh-tauri-worktree/src/client/components/mode-select.cssr.ts b/packages/dsh-tauri-worktree/src/client/components/mode-select.cssr.tsdeleted file mode 100644index f172b5ff..00000000--- a/packages/dsh-tauri-worktree/src/client/components/mode-select.cssr.ts+++ /dev/null@@ -1,37 +0,0 @@-import { cssr } from 'dsh-tauri-ui/client'--const { c } = cssr--export default c([- c('.dshp-mode-select__trigger', {- boxSizing: 'border-box',- minWidth: 0,- maxWidth: '220px',- height: '28px',- padding: '0 4px 0 8px',- border: 'none',- borderRadius: '24px',- background: 'transparent',- color: 'var(--dsw-alias-label-secondary)',- fontFamily: 'var(--dsw-font-family, inherit)',- fontSize: '13px',- fontWeight: 500,- lineHeight: '20px',- cursor: 'pointer',- outline: 'none',- display: 'inline-flex',- alignItems: 'center',- gap: '4px',- whiteSpace: 'nowrap',- }, [- c('&:hover', { background: 'var(--dsw-alias-interactive-bg-hover)' }),- c('&:focus-visible', { boxShadow: '0 0 0 2px var(--dsw-alias-border-l3)' }),- ]),- c('.dshp-mode-select__trigger.dshp-mode-select__trigger--open', { background: 'var(--dsw-alias-interactive-bg-hover)' }),- c('.dshp-mode-select__label', { minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),- c('.dshp-mode-select__icon', { color: 'var(--dsw-alias-label-secondary)', display: 'inline-flex', flex: 'none' }),- c('.dshp-mode-select__chevron', { color: 'var(--dsw-alias-label-caption)', flex: 'none', transition: 'transform 0.12s' }),- c('.dshp-mode-select__chevron.dshp-mode-select__chevron--open', { transform: 'rotate(180deg)' }),- c('.dshp-mode-select__host', { display: 'inline-flex', alignItems: 'center', flex: 'none' }),- c('.dshp-mode-select__anchor', { display: 'none' }),-])diff --git a/packages/dsh-tauri-worktree/src/client/components/mode-select.tsx b/packages/dsh-tauri-worktree/src/client/components/mode-select.tsxindex 46e11921..79d3e3d2 100644--- a/packages/dsh-tauri-worktree/src/client/components/mode-select.tsx+++ b/packages/dsh-tauri-worktree/src/client/components/mode-select.tsx@@ -1,8 +1,7 @@import type { ReactElement } from 'react'import type { InputActions } from '../service/session-switch.types'import type { ModeSelectProps } from './mode-select.types'-import { Menu } from '@deepseek-ai/dsh-client-ui-primitives'-import { ChevronDown, CircleTree, Icon } from 'dsh-tauri-ui/client'+import { ChevronDown, Chip, CircleTree, Icon, Menu } from 'dsh-tauri-ui/client'import { forEach, get } from 'dsh-tauri/client'import { useEffect, useRef, useState } from 'react'import { createPortal } from 'react-dom'@@ -223,20 +222,18 @@ function WorktreeModeControl({ sessionId, useInput, inputActions, sessionsRuntimconst pending = state.mode === 'pending'const activeLabel = pending ? locale.text('modeNewWorktree') : locale.text('modeLocal')const trigger = (- <button- type="button"+ <Chip+ variant="composerTrigger"aria-label={locale.text('modeLabel')}aria-haspopup="menu"aria-expanded={open}+ open={open}+ icon={<Icon as={CircleTree} size={14} />}+ chevron={<Icon as={ChevronDown} size={14} />}onClick={() => setOpen(value => !value)}- className={open ? 'dshp-mode-select__trigger dshp-mode-select__trigger--open' : 'dshp-mode-select__trigger'}>- <span className="dshp-mode-select__icon">- <Icon as={CircleTree} size={13} />- </span><span className="dshp-mode-select__label">{activeLabel}</span>- <Icon as={ChevronDown} className={open ? 'dshp-mode-select__chevron dshp-mode-select__chevron--open' : 'dshp-mode-select__chevron'} />- </button>+ </Chip>)return (diff --git a/packages/dsh-tauri-worktree/src/client/components/surface.cssr.ts b/packages/dsh-tauri-worktree/src/client/components/surface.cssr.tsdeleted file mode 100644index 53f2abe1..00000000--- a/packages/dsh-tauri-worktree/src/client/components/surface.cssr.ts+++ /dev/null@@ -1,66 +0,0 @@-import { cssr } from 'dsh-tauri-ui/client'--const { bem: { b, e, m } } = cssr--export default b('worktree', [- e('surface', {- boxSizing: 'border-box',- width: 'calc(100% - 2 * var(--dsh-composer-side-clearance) - 4 * var(--dsh-composer-dock-inset))',- maxWidth: 'calc(var(--dsh-composer-card-max-width) - 4 * var(--dsh-composer-dock-inset))',- margin: '0 auto',- alignSelf: 'center',- }),- e('surface-bar', {- boxSizing: 'border-box',- width: '100%',- position: 'relative',- height: '36px',- display: 'flex',- alignItems: 'center',- gap: '10px',- padding: '4px 5px 4px 12px',- margin: '0 auto',- border: '1px solid var(--dsw-alias-border-l1)',- borderRadius: '12px',- background: 'var(--dsw-specific-tip)',- color: 'var(--dsw-alias-label-primary)',- pointerEvents: 'auto',- }),- e('surface-content', { display: 'flex', alignItems: 'center', gap: '5px' }),- e('surface-label', { fontSize: '13px', lineHeight: '20px', fontWeight: 500 }),- e('action', {- height: '26px',- padding: '0 10px',- border: 'none',- borderRadius: '7px',- fontFamily: 'inherit',- fontSize: '12px',- cursor: 'pointer',- color: 'var(--dsw-alias-label-primary)',- background: 'var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,0.08))',- whiteSpace: 'nowrap',- }, [- m('log', { padding: 0, fontSize: '13px', background: 'transparent', textDecoration: 'underline' }),- m('danger', { color: 'var(--dsw-alias-danger-foreground, #c0392b)', background: 'transparent' }),- ]),- e('spacer', { flex: 1 }),- e('logs', {- display: 'grid',- gridTemplateRows: '0fr',- opacity: 0,- transition: 'grid-template-rows 180ms cubic-bezier(.16, 1, .3, 1), opacity 140ms ease',- }, [- m('open', { gridTemplateRows: '1fr', opacity: 1 }),- ]),- e('logs-inner', { minHeight: 0, overflow: 'hidden', marginTop: '6px' }),- e('logs-panel', {- maxHeight: '180px',- overflowY: 'auto',- padding: '10px',- borderRadius: '10px',- border: '1px solid var(--dsw-alias-border-l2)',- background: 'var(--dsw-alias-bg-base)',- zIndex: 30,- }),- e('log-line', { fontSize: '12px', fontFamily: 'cursive', lineHeight: '16px' }),-])diff --git a/packages/dsh-tauri-worktree/src/client/components/surface.tsx b/packages/dsh-tauri-worktree/src/client/components/surface.tsxindex a706f2a0..76973294 100644--- a/packages/dsh-tauri-worktree/src/client/components/surface.tsx+++ b/packages/dsh-tauri-worktree/src/client/components/surface.tsx@@ -1,15 +1,12 @@import type { ReactElement } from 'react'import type { SurfaceBarProps } from './surface.types'-import { CircleTree, Icon, useMountStyle } from 'dsh-tauri-ui/client'+import { CircleTree, GoalBar, GoalBarAction, Icon } from 'dsh-tauri-ui/client'import { useState } from 'react'-import { SURFACE_STYLE_ID } from '../constants'import { useWorktreeSession } from '../hooks/use-worktree-session'import { locale } from '../locales'import { store } from '../store'-import surfaceStyle from './surface.cssr'export function WorktreeSurface({ sessionId }: SurfaceBarProps): ReactElement | null {- useMountStyle(surfaceStyle, SURFACE_STYLE_ID)locale.useLocale()const state = useWorktreeSession(sessionId)const [logOpen, setLogOpen] = useState(false)@@ -26,59 +23,47 @@ export function WorktreeSurface({ sessionId }: SurfaceBarProps): ReactElement |: deleting? locale.text('progressDeleting'): failed- ? `${locale.text('progressError')}${state.error ? `: ${state.error}` : ''}`+ ? locale.text('progressError'): locale.text('surfaceWorktree')return (<div className="dshp-worktree"><div className="dshp-worktree__surface">- <div className="dshp-worktree__surface-bar" data-dsh-worktree-surface={sessionId}>- <Icon as={CircleTree} size={14} />- <div className="dshp-worktree__surface-content">- <span className="dshp-worktree__surface-label">- {label}- {creating && `...`}- </span>- {bound && state.log.length > 0 && (- <button type="button" className={`${'dshp-worktree__action'} ${'dshp-worktree__action--log'}`} onClick={() => setLogOpen(value => !value)}>- {locale.text('progressViewLogs')}- </button>- )}- </div>- <span className="dshp-worktree__spacer" />- {bound && !deleting && (+ <GoalBar+ actions={(<>- <button type="button" className="dshp-worktree__action" onClick={() => store.worktree.patch(sessionId, { checkoutOpen: true, error: '' })}>- {locale.text('surfaceCheckout')}- </button>- <button type="button" className={`${'dshp-worktree__action'} ${'dshp-worktree__action--danger'}`} onClick={() => store.worktree.patch(sessionId, { abandonOpen: true })}>- {locale.text('surfaceAbandon')}- </button>+ {bound && !deleting && (+ <>+ <GoalBarAction onClick={() => store.worktree.patch(sessionId, { checkoutOpen: true, error: '' })}>+ {locale.text('surfaceCheckout')}+ </GoalBarAction>+ <GoalBarAction variant="danger" onClick={() => store.worktree.patch(sessionId, { abandonOpen: true })}>+ {locale.text('surfaceAbandon')}+ </GoalBarAction>+ </>+ )}+ {failed && !bound && (+ <GoalBarAction onClick={() => store.worktree.patch(sessionId, { phase: 'idle', error: '' })}>+ {locale.text('surfaceDismiss')}+ </GoalBarAction>+ )}</>)}- {failed && !bound && (- <button type="button" className="dshp-worktree__action" onClick={() => store.worktree.patch(sessionId, { phase: 'idle', error: '' })}>- {locale.text('surfaceDismiss')}- </button>+ data-dsh-worktree-surface={sessionId}+ error={failed ? state.error : undefined}+ glyph={<Icon as={CircleTree} size={14} />}+ label={`${label}${creating ? '...' : ''}`}+ >+ {bound && state.log.length > 0 && (+ <div className="dshp-worktree__surface-content">+ <GoalBarAction onClick={() => setLogOpen(value => !value)}>+ {locale.text('progressViewLogs')}+ </GoalBarAction>+ </div>)}- </div>+ </GoalBar><Logs log={state.log} open={logOpen} /></div></div>)}--export function Logs({ log, open }: { log: readonly string[], open: boolean }): ReactElement {- return (- <div- aria-hidden={!open}- className={`${'dshp-worktree__logs'} ${open ? 'dshp-worktree__logs--open' : ''}`}- >- <div className="dshp-worktree__logs-inner">- <div className="dshp-worktree__logs-panel">- {log.map((line, index) => <div key={`${index}:${line}`} className="dshp-worktree__log-line">{line}</div>)}- </div>- </div>- </div>- )-}diff --git a/packages/dsh-tauri-worktree/src/client/constants/index.ts b/packages/dsh-tauri-worktree/src/client/constants/index.tsindex 8d77c00b..1232a66d 100644--- a/packages/dsh-tauri-worktree/src/client/constants/index.ts+++ b/packages/dsh-tauri-worktree/src/client/constants/index.ts@@ -31,10 +31,7 @@ export const DISCARD_MAX_POLLS = 120export const HANDOFF_WINDOW_MS = 60_000-export const MODE_SELECT_STYLE_ID = '@deepseek-ai/dsh-tauri-worktree/ModeSelect.module.css'-export const WORKTREE_STYLE_ID = '@deepseek-ai/dsh-tauri-worktree/SurfaceDialog.module.css'-export const SURFACE_STYLE_ID = '@deepseek-ai/dsh-tauri-worktree/Surface.module.css'-export const DIALOG_STYLE_ID = '@deepseek-ai/dsh-tauri-worktree/Dialog.module.css'+export const WORKTREE_STYLE_ID = '@deepseek-ai/dsh-tauri-worktree/Worktree.module.css'export const SESSION_ICON_STYLE_ID = '@deepseek-ai/dsh-tauri-worktree/SessionBranchIcon.module.css'export const SESSION_ICON_ATTRIBUTE = 'data-dsh-worktree-icon'diff --git a/packages/dsh-tauri-worktree/src/client/register/styles.ts b/packages/dsh-tauri-worktree/src/client/register/styles.tsindex bc897290..79d43e27 100644--- a/packages/dsh-tauri-worktree/src/client/register/styles.ts+++ b/packages/dsh-tauri-worktree/src/client/register/styles.ts@@ -1,10 +1,8 @@import { mountStyle } from 'dsh-tauri-ui/client'import { defineRegister } from 'dsh-tauri/client'-import modeSelectStyle from '../components/mode-select.cssr'-import { MODE_SELECT_STYLE_ID, WORKTREE_STYLE_ID } from '../constants'-import worktreeIndexStyle from '../styles/index.cssr'+import { WORKTREE_STYLE_ID } from '../constants'+import worktreeStyle from '../styles/index.cssr'export const stylesFeature = defineRegister((controller) => {- controller.add(mountStyle(modeSelectStyle, MODE_SELECT_STYLE_ID))- controller.add(mountStyle(worktreeIndexStyle, WORKTREE_STYLE_ID))+ controller.add(mountStyle(worktreeStyle, WORKTREE_STYLE_ID))})diff --git a/packages/dsh-tauri-worktree/src/client/styles/index.cssr.ts b/packages/dsh-tauri-worktree/src/client/styles/index.cssr.tsindex b76cfacb..c5a38bc1 100644--- a/packages/dsh-tauri-worktree/src/client/styles/index.cssr.ts+++ b/packages/dsh-tauri-worktree/src/client/styles/index.cssr.ts@@ -15,4 +15,44 @@ export default c([color: 'var(--dsw-alias-label-secondary)',}),c('[role="treeitem"]', { position: 'relative' }),++ c('.dshp-mode-select__host', { display: 'inline-flex', alignItems: 'center', flex: 'none' }),+ c('.dshp-mode-select__anchor', { display: 'none' }),+ c('.dshp-mode-select__label', { minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),++ c('.dshp-worktree', { boxSizing: 'border-box' }),+ c('.dshp-worktree__surface', {+ boxSizing: 'border-box',+ width: 'calc(100% - 2 * var(--dsh-composer-side-clearance) - 4 * var(--dsh-composer-dock-inset))',+ maxWidth: 'calc(var(--dsh-composer-card-max-width) - 4 * var(--dsh-composer-dock-inset))',+ margin: '0 auto',+ alignSelf: 'center',+ }),+ c('.dshp-worktree__surface-content', { display: 'flex', alignItems: 'center', gap: '5px' }),+ c('.dshp-worktree__logs', {+ display: 'grid',+ gridTemplateRows: '0fr',+ opacity: 0,+ transition: 'grid-template-rows 180ms cubic-bezier(.16, 1, .3, 1), opacity 140ms ease',+ }),+ c('.dshp-worktree__logs--open', { gridTemplateRows: '1fr', opacity: 1 }),+ c('.dshp-worktree__logs-inner', { minHeight: 0, overflow: 'hidden', marginTop: '6px' }),+ c('.dshp-worktree__logs-panel', {+ maxHeight: '180px',+ overflowY: 'auto',+ padding: '10px',+ borderRadius: '10px',+ border: '1px solid var(--dsw-alias-border-l2)',+ background: 'var(--dsw-alias-bg-base)',+ zIndex: 30,+ }),+ c('.dshp-worktree__log-line', { fontSize: '12px', fontFamily: 'cursive', lineHeight: '16px' }),++ c('.dshp-worktree__dialog-form', { display: 'flex', flexDirection: 'column', gap: '14px' }),+ c('.dshp-worktree__dialog-field', { display: 'flex', flexDirection: 'column', gap: '6px' }),+ c('.dshp-worktree__dialog-field-label', { fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))' }),+ c('.dshp-worktree__dialog-path-row', { display: 'flex', justifyContent: 'space-between', gap: '12px', fontSize: '12px', lineHeight: '18px' }),+ c('.dshp-worktree__dialog-path-key', { flex: 'none', color: 'var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))' }),+ c('.dshp-worktree__dialog-path-value', { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', fontFamily: 'monospace' }),+ c('.dshp-worktree__dialog-error', { fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-state-error-primary)' }),])diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 8b2a763a..00fcab58 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -716,9 +716,6 @@ importers:dsh-tauri:specifier: workspace:*version: link:../dsh-tauri- dsh-tauri-ui:- specifier: workspace:*- version: link:../dsh-tauri-uihookable:specifier: catalog:utilsversion: 6.1.1@@ -753,6 +750,9 @@ importers:dsh-tauri-tsdown:specifier: workspace:*version: link:../dsh-tauri-tsdown+ dsh-tauri-ui:+ specifier: workspace:*+ version: link:../dsh-tauri-uimarked:specifier: catalog:uiversion: 18.0.11@@ -820,9 +820,6 @@ importers:dsh-tauri:specifier: workspace:*version: link:../dsh-tauri- dsh-tauri-ui:- specifier: workspace:*- version: link:../dsh-tauri-uidevDependencies:'@deepseek-ai/cordis':specifier: catalog:dsh@@ -842,6 +839,9 @@ importers:dsh-tauri-tsdown:specifier: workspace:*version: link:../dsh-tauri-tsdown+ dsh-tauri-ui:+ specifier: workspace:*+ version: link:../dsh-tauri-uireact:specifier: catalog:runtimeversion: 19.2.8@@ -854,9 +854,6 @@ importers:dsh-tauri:specifier: workspace:*version: link:../dsh-tauri- dsh-tauri-ui:- specifier: workspace:*- version: link:../dsh-tauri-uilodash-es:specifier: catalog:utilsversion: 4.18.1@@ -867,6 +864,9 @@ importers:dsh-tauri-tsdown:specifier: workspace:*version: link:../dsh-tauri-tsdown+ dsh-tauri-ui:+ specifier: workspace:*+ version: link:../dsh-tauri-uitsdown:specifier: catalog:cliversion: 0.17.4(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])([email protected])([email protected])@@ -876,9 +876,6 @@ importers:dsh-tauri:specifier: workspace:*version: link:../dsh-tauri- dsh-tauri-ui:- specifier: workspace:*- version: link:../dsh-tauri-uihookable:specifier: catalog:utilsversion: 6.1.1@@ -895,6 +892,9 @@ importers:dsh-tauri-tsdown:specifier: workspace:*version: link:../dsh-tauri-tsdown+ dsh-tauri-ui:+ specifier: workspace:*+ version: link:../dsh-tauri-uitsdown:specifier: catalog:cliversion: 0.17.4(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])([email protected])([email protected])@@ -961,14 +961,35 @@ importers:specifier: catalog:cliversion: 0.17.4(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])([email protected])([email protected])- packages/dsh-tauri-worktree:- dependencies:+ packages/dsh-tauri-ui-playground:+ devDependencies:+ '@deepseek-ai/cordis':+ specifier: catalog:dsh+ version: 4.0.2(@deepseek-ai/[email protected])(@deepseek-ai/[email protected])+ '@deepseek-ai/dsh-client-ui-layout':+ specifier: catalog:dsh+ version: 0.1.7-alpha.1(@deepseek-ai/[email protected])dsh-tauri:specifier: workspace:*version: link:../dsh-tauri+ dsh-tauri-tsdown:+ specifier: workspace:*+ version: link:../dsh-tauri-tsdowndsh-tauri-ui:specifier: workspace:*version: link:../dsh-tauri-ui+ react:+ specifier: catalog:runtime+ version: 19.2.8+ tsdown:+ specifier: catalog:cli+ version: 0.17.4(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])([email protected])([email protected])++ packages/dsh-tauri-worktree:+ dependencies:+ dsh-tauri:+ specifier: workspace:*+ version: link:../dsh-taurihookable:specifier: catalog:utilsversion: 6.1.1@@ -991,6 +1012,9 @@ importers:dsh-tauri-tsdown:specifier: workspace:*version: link:../dsh-tauri-tsdown+ dsh-tauri-ui:+ specifier: workspace:*+ version: link:../dsh-tauri-uitsdown:specifier: catalog:cliversion: 0.17.4(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])([email protected])([email protected])