diff --git a/apps/desktop/scripts/fixtures/group-review-layout/ui-page.mjs b/apps/desktop/scripts/fixtures/group-review-layout/ui-page.mjs
index 6cd2e1432a1..c3592a4473f 100644
--- a/apps/desktop/scripts/fixtures/group-review-layout/ui-page.mjs
+++ b/apps/desktop/scripts/fixtures/group-review-layout/ui-page.mjs
@@ -78,7 +78,8 @@ export default {
await message.hover();
await message.getByRole('button', { name: await ui.t('chat.messageActionBar.moreActions'), exact: true }).click();
await page.getByRole('menuitem', { name: await ui.t('chat.shareImage.entry'), exact: true }).click();
- const bar = page.getByRole('checkbox', { name: await ui.t('chat.shareImage.selectAll'), exact: true }).locator('..');
+ // The select-all box sits in a label inside the bar; measure the bar itself.
+ const bar = page.getByRole('checkbox', { name: await ui.t('chat.shareImage.selectAll'), exact: true }).locator('xpath=ancestor::div[1]');
const during = await bounds(bar);
await ui.capture('sharing');
assert.deepEqual(during, before, 'image sharing stays aligned with the composer');
diff --git a/apps/desktop/src/renderer/cindy-brain/PluginUiContributions.tsx b/apps/desktop/src/renderer/cindy-brain/PluginUiContributions.tsx
index d20e7d52254..8844fc4eeba 100644
--- a/apps/desktop/src/renderer/cindy-brain/PluginUiContributions.tsx
+++ b/apps/desktop/src/renderer/cindy-brain/PluginUiContributions.tsx
@@ -293,7 +293,7 @@ function EntryControl({ entry, sessionId, clientId, active, appearance }: { entr
;
if (action.kind === 'status') return {title} ;
if (action.kind === 'select') return void run(next)} className="h-7 max-w-48 text-12" />;
+ disabled={pending || state?.disabled} onValueChange={next => void run(next)} size="inline" className="max-w-48 text-12" />;
if (action.presentation === 'popover' && action.view) return
{label}
@@ -390,7 +390,7 @@ function PluginUiBodyChoice({ children, entries, sessionId, clientId, context }:
const entry = entries.find(entry => `${entry.instanceId}:${entry.contribution.id}` === selected);
return <>
-
({
value: `${entry.instanceId}:${entry.contribution.id}`, label: `${entry.contribution.title} · ${entry.ghost.manifest.name}`,
}))]} onValueChange={setSelected} />
diff --git a/apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx b/apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx
index 3e985999083..e498fb68fdb 100644
--- a/apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx
+++ b/apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx
@@ -7,14 +7,13 @@
* 只订阅自己那一条的选中态(useIsMessageSelected):勾选是高频动作,细粒度订阅让
* 一次点击只重渲染这一个按钮,而不是整条消息流(见 shareSelectionStore 文件头)。
*
- * 圆形不违反§5 三档圆角 —— 它是 pill 档(9999px)。自带 `data-share-exclude`,
+ * 用共享 Checkbox(DESIGN.md §4,B-10),外包一层 20px 点击区。自带 `data-share-exclude`,
* 光栅化时会被清洗掉,不会出现在产物图片里。
*/
-import { Check } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { cn } from '@/lib/utils';
+import { Checkbox } from '@/components/ui/checkbox';
import { SHARE_EXCLUDE_ATTR } from '@/lib/shareConversationImage';
import { shareSelectionStore, useIsMessageSelected } from './shareSelectionStore';
@@ -23,31 +22,18 @@ export function ShareMessageCheckbox({ clientId }: { clientId: string }) {
const selected = useIsMessageSelected(clientId);
return (
- {
- e.stopPropagation();
- shareSelectionStore.toggle(clientId);
- }}
- className={cn(
- // 落在 MessageStream 让出的 40px 缩进里(左 8px / 右 12px,20px 框居中偏左);
- // top 微调让圆心对齐消息首行的视觉中线。
- 'absolute -left-8 top-[2px] z-raised flex h-5 w-5 shrink-0 items-center justify-center',
- 'rounded-full transition-colors cursor-pointer',
- 'focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] outline-none',
- selected
- ? 'bg-[var(--accent-cta-bg-pure)] text-[var(--accent-pure-cta-fg)]'
- : cn(
- 'border border-[var(--border-default)] bg-transparent',
- 'hover:border-[var(--text-secondary)]',
- ),
- )}
+ onClick={(e) => e.stopPropagation()}
+ className="absolute -left-8 top-[2px] z-raised flex size-5 shrink-0 cursor-pointer items-center justify-center"
>
- {selected ? : null}
-
+ shareSelectionStore.toggle(clientId)}
+ />
+
);
}
diff --git a/apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx b/apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx
index b43434ea61b..33133352f86 100644
--- a/apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx
+++ b/apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx
@@ -22,7 +22,6 @@ import {
useState,
type CSSProperties,
} from 'react';
-import { Check } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { blobToDataUrl } from '@/lib/annotationBurnIn';
@@ -41,6 +40,7 @@ import { cn } from '@/lib/utils';
import { useBrandLogo } from '@/hooks/useBrandLogo';
import shareCharacterSrc from '@/assets/cindy-share-character.jpg';
import { shareSelectionStore, useShareSelectionCount } from './shareSelectionStore';
+import { Checkbox } from '@/components/ui/checkbox';
const log = createLogger('ShareSelectionBar');
@@ -193,6 +193,7 @@ export function ShareSelectionBar({
}, [busy, toggleAll]);
const disabled = count === 0 || busy !== null;
+ const selectAllDisabled = busy !== null || shareableMessageIds.length === 0;
return (
{/* 部分勾选不等于全选:按钮仍显示未选中,点击后临时补齐全部;只有当前
可选项全部勾上时才显示选中态,再次点击恢复全选前的用户选择。 */}
-
-
- {allSelected ? : null}
-
+
{t('chat.shareImage.selectAll')}
-
+
diff --git a/apps/desktop/src/renderer/components/chat/useDeleteMessage.ts b/apps/desktop/src/renderer/components/chat/useDeleteMessage.ts
index f0d39c58b3e..db4cc18a4a3 100644
--- a/apps/desktop/src/renderer/components/chat/useDeleteMessage.ts
+++ b/apps/desktop/src/renderer/components/chat/useDeleteMessage.ts
@@ -47,6 +47,7 @@ export function useDeleteMessage({
description: t('chat.messageActionBar.deleteConfirmDescription'),
confirmText: t('chat.messageActionBar.deleteConfirm'),
cancelText: t('chat.messageActionBar.deleteCancel'),
+ confirmVariant: 'destructive',
});
if (!ok) return;
diff --git a/apps/desktop/src/renderer/components/cindy-make/CindyMakeContribution.tsx b/apps/desktop/src/renderer/components/cindy-make/CindyMakeContribution.tsx
index 5af86123224..423c170713b 100644
--- a/apps/desktop/src/renderer/components/cindy-make/CindyMakeContribution.tsx
+++ b/apps/desktop/src/renderer/components/cindy-make/CindyMakeContribution.tsx
@@ -21,6 +21,7 @@ import {
type CindyMakeContributionError,
type CindyMakeContributionView,
} from '../../../shared/cindyMakeContribution';
+import { Checkbox } from '@/components/ui/checkbox';
const key = 'cindyMake.contribution';
@@ -355,12 +356,11 @@ export function CindyMakeContributionDialog({
{draft.touchesUi &&
{t(`${key}.dialog.uiNote`)} }
- setSigned(event.target.checked)}
- className="mt-0.5 size-4 shrink-0 accent-[var(--confirm-btn-primary-bg)]"
+ className="mt-0.5"
/>
{t(`${key}.dialog.dco`, { name: name.trim(), email: email.trim() })}
diff --git a/apps/desktop/src/renderer/components/cindy-make/CindyMakeHistoryPanel.tsx b/apps/desktop/src/renderer/components/cindy-make/CindyMakeHistoryPanel.tsx
index c35291e5336..69d80e9b314 100644
--- a/apps/desktop/src/renderer/components/cindy-make/CindyMakeHistoryPanel.tsx
+++ b/apps/desktop/src/renderer/components/cindy-make/CindyMakeHistoryPanel.tsx
@@ -34,6 +34,7 @@ import {
contributionActionKey,
useCindyMakeContributions,
} from './CindyMakeContribution';
+import { Checkbox } from '@/components/ui/checkbox';
type Filter = 'all' | 'pending' | 'integrated' | 'ended';
/** Historical facts and allowed actions come from Main; an old button cannot authorize a write. */
@@ -603,7 +604,8 @@ export function CindyMakeHistoryPanel({
setCheckedIds([]);
}}
disabled={!!pending}
- className="h-8 w-[168px]"
+ size="compact"
+ width="sm"
/>
- {
- if (node)
- node.indeterminate =
- !allChecked && selectable.some((item) => checkedIds.includes(item.runId));
- }}
- className="size-4 accent-[var(--confirm-btn-primary-bg)]"
+ indeterminate={
+ !allChecked && selectable.some((item) => checkedIds.includes(item.runId))
+ }
onChange={() =>
setCheckedIds((previous) =>
allChecked
@@ -767,14 +765,12 @@ export function CindyMakeHistoryPanel({
{selecting && (
- entry.runId === item.runId)}
disabled={!!pending || !item.canSelectForBuild}
aria-label={t('cindyMake.history.batch.selectItem', {
title: formatCindyMakeTitle(item.title, item.runId),
})}
- className="size-4 accent-[var(--confirm-btn-primary-bg)]"
onChange={(event) =>
setCheckedIds((previous) =>
event.target.checked
diff --git a/apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx b/apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx
index 650ab6f1b2d..666e08b2d51 100644
--- a/apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx
+++ b/apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx
@@ -3,11 +3,11 @@
*
* 三个安全上限改用下拉(各含「不限」=null),默认收起。值类型 number | null。
* 预设见下方常量;若当前值不在预设里(历史自定义值),会作为额外一项保留显示。
- * 颜色全走主题 token(规则 16):trigger 用 settings-input,下拉面板用 model-dropdown。
+ * 下拉用共享 Select(紧凑 32px、220px),颜色随共享组件;120px 窄档放不下「不限」的译文。
*/
-import { SelectParts as Select } from '@/components/ui/select';
-import { Check, ChevronDown, ChevronRight } from 'lucide-react';
+import { Select } from '@/components/ui/select';
+import { ChevronDown, ChevronRight } from 'lucide-react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -38,28 +38,15 @@ function formatTokens(n: number): string {
return String(n);
}
-function LimitItem({ value, label }: { value: string; label: string }): React.ReactElement {
- return (
-
- {label}
-
-
-
-
- );
-}
-
function LimitSelect({
+ label,
value,
onChange,
presets,
format,
noLimitLabel,
}: {
+ label: string;
value: number | null;
onChange: (v: number | null) => void;
presets: number[];
@@ -69,42 +56,19 @@ function LimitSelect({
// 当前值不在预设里(历史自定义)→ 作为额外一项前置,避免编辑时丢值。
const nums = value != null && !presets.includes(value) ? [value, ...presets] : presets;
const current = value == null ? UNLIMITED : String(value);
+ // 共享 Select(DESIGN.md §4 Desktop settings controls):紧凑 32px、220px。
return (
- onChange(s === UNLIMITED ? null : Number(s))}>
-
-
-
-
-
-
-
-
-
- {nums.map((n) => (
-
- ))}
-
-
-
-
-
+ ({ value: String(n), label: format(n) })),
+ { value: UNLIMITED, label: noLimitLabel },
+ ]}
+ onValueChange={(s) => onChange(s === UNLIMITED ? null : Number(s))}
+ />
);
}
@@ -149,6 +113,7 @@ export function GoalAdvancedLimits({
onChange({ ...value, maxTurns: v })}
presets={MAX_TURNS_PRESETS}
@@ -158,6 +123,7 @@ export function GoalAdvancedLimits({
onChange({ ...value, budgetTokens: v })}
presets={BUDGET_PRESETS}
@@ -167,6 +133,7 @@ export function GoalAdvancedLimits({
onChange({ ...value, noProgressLimit: v })}
presets={NO_PROGRESS_PRESETS}
diff --git a/apps/desktop/src/renderer/components/settings/AccountDeletionSection.tsx b/apps/desktop/src/renderer/components/settings/AccountDeletionSection.tsx
index 5aa069d30af..8802268315b 100644
--- a/apps/desktop/src/renderer/components/settings/AccountDeletionSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/AccountDeletionSection.tsx
@@ -7,6 +7,7 @@ import { Button } from '@/components/ui/button';
import { useAuth } from '@/contexts/AuthContext';
import type { DesktopAccountDeletionChallenge } from '@/lib/authService';
import { cn } from '@/lib/utils';
+import { Checkbox } from '@/components/ui/checkbox';
/**
* Server-gated personal-account deletion entry and OTP confirmation dialog.
@@ -182,12 +183,12 @@ export function AccountDeletionSection() {
)}
/>
- setAcknowledged(event.target.checked)}
- className="mt-1 size-3.5 shrink-0 cursor-pointer accent-[hsl(var(--destructive))]"
+ className="mt-0.5"
/>
{t('accountDeletion.acknowledgement')}
diff --git a/apps/desktop/src/renderer/components/settings/CindyMakeSection.tsx b/apps/desktop/src/renderer/components/settings/CindyMakeSection.tsx
index 32367e9cb24..c536e1cc79d 100644
--- a/apps/desktop/src/renderer/components/settings/CindyMakeSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/CindyMakeSection.tsx
@@ -733,12 +733,19 @@ function CindyMakeSourceStatusCard({
)}
{onClear && status && !preparing && status.status !== 'missing' && (
+ {/* Clearing deletes the managed checkout, its worktrees and unpackaged
+ changes (main/cindy-make/sourcePreparation.ts clearOnly), so it is
+ destructive (DESIGN.md §4 Destructive actions, C-07).
+ The shared danger tone has no outline; keep the secondary outline
+ here so it pairs with the folder button beside it. */}
void onClear()}
disabled={mergeBlocked}
aria-label={t('settings.cindyMake.source.reset')}
- className="w-8 border-transparent bg-transparent px-0 text-[var(--text-tertiary)]"
+ className="w-8 px-0 [--button-face-border:var(--border-default)]"
>
diff --git a/apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx b/apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx
index 3b34b242ec6..ca2667bcd37 100644
--- a/apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx
@@ -81,6 +81,7 @@ import {
confirmEnableRealProfile,
guideFullDiskAccessAfterReadDenied,
} from './realProfilePermissionGuide';
+import { ResetGroupButton } from '@/components/ui/reset-buttons';
const log = createLogger('ComputerUseSection');
@@ -2194,16 +2195,11 @@ export function ComputerUseSection({ workingDir }: ComputerUseSectionProps) {
>
{t('settings.computerUse.android.adb.save')}
- void handleUseDefaultAndroidAdbPath()}
disabled={androidAdbPathBusy}
- >
- {t('settings.computerUse.android.adb.useDefault')}
-
+ label={t('settings.computerUse.android.adb.useDefault')}
+ />
}
/>
diff --git a/apps/desktop/src/renderer/components/settings/DefaultOverrideControls.tsx b/apps/desktop/src/renderer/components/settings/DefaultOverrideControls.tsx
index 9a4c346443a..205fa21faf3 100644
--- a/apps/desktop/src/renderer/components/settings/DefaultOverrideControls.tsx
+++ b/apps/desktop/src/renderer/components/settings/DefaultOverrideControls.tsx
@@ -1,8 +1,6 @@
-import { RotateCcw } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { Button } from '@/components/ui/button';
-import { Tip } from '@/components/ui/tooltip';
+import { RestoreDefaultButton } from '@/components/ui/reset-buttons';
export function DefaultOverrideControls({
isCustomized,
@@ -31,21 +29,12 @@ export function DefaultOverrideControls({
{t('settings.defaults.customizedBadge')}
) : null}
- {/* Per-setting reset (CONTROLS decision 3): 28px quiet pill icon button on the shared Button. */}
-
-
-
-
-
+ {/* Per-setting reset (CONTROLS decision 3): shared 28px quiet icon button. */}
+
);
}
diff --git a/apps/desktop/src/renderer/components/settings/KeyboardShortcutsSection.tsx b/apps/desktop/src/renderer/components/settings/KeyboardShortcutsSection.tsx
index 7658cbd37b6..7baec051078 100644
--- a/apps/desktop/src/renderer/components/settings/KeyboardShortcutsSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/KeyboardShortcutsSection.tsx
@@ -69,6 +69,7 @@ import {
type GamepadFamily,
} from '../../../shared/xboxGamepad';
import { XboxGamepadEntry, XboxGamepadSettings } from './XboxGamepadSettings';
+import { RestoreDefaultButton } from '@/components/ui/reset-buttons';
const log = createLogger('settings:keyboard-shortcuts');
@@ -498,19 +499,11 @@ export function KeyboardShortcutsSection() {
{/* 单项恢复默认在控件左侧 (CONTROLS decision 3), 仅已自定义时出现 */}
{customized && !isRecording && (
-
- handleResetOne(def.id)}
- className={iconButtonClass}
- aria-label={t('settings.shortcuts.reset')}
- >
-
-
-
+ handleResetOne(def.id)}
+ />
)}
{/* 组合键展示位: 录制中显示提示, 无绑定显示"未设置" */}
diff --git a/apps/desktop/src/renderer/components/settings/LocalProviderImportButton.tsx b/apps/desktop/src/renderer/components/settings/LocalProviderImportButton.tsx
index 142709727da..18726976b23 100644
--- a/apps/desktop/src/renderer/components/settings/LocalProviderImportButton.tsx
+++ b/apps/desktop/src/renderer/components/settings/LocalProviderImportButton.tsx
@@ -12,6 +12,7 @@ import type {
LocalProviderImportItem,
LocalProviderImportScan,
} from '../../../shared/localProviderImport';
+import { Checkbox } from '@/components/ui/checkbox';
const SOURCE_NAMES = {
alma: 'Alma',
@@ -210,10 +211,8 @@ export function LocalProviderImportButton({ onImported }: { onImported: (ids: st
-
diff --git a/apps/desktop/src/renderer/components/settings/McpServersSection.tsx b/apps/desktop/src/renderer/components/settings/McpServersSection.tsx
index 8a490387743..49f961effbd 100644
--- a/apps/desktop/src/renderer/components/settings/McpServersSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/McpServersSection.tsx
@@ -161,6 +161,7 @@ export function McpServersSection() {
description: t('settings.mcp.deleteConfirm.message'),
confirmText: t('settings.mcp.deleteConfirm.confirm'),
cancelText: t('settings.mcp.cancel'),
+ confirmVariant: 'destructive',
});
if (!ok) return;
try {
diff --git a/apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx b/apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx
index f199204782c..1b14ec7fbbc 100644
--- a/apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx
+++ b/apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx
@@ -84,6 +84,7 @@ import { MANAGED_LLAMACPP_PROVIDER_ID, supportsLlamaCppMillionContext, llamaCppM
import { modelBrand } from './modelManagementPresentation';
import { ModelPriceOverrideDialog } from './ModelPriceOverrideDialog';
import type { UnionModelRow } from './UnifiedModelList';
+import { ResetGroupButton } from '@/components/ui/reset-buttons';
const AGENT_LABEL: Record = {
'claude-code': 'Claude Code',
@@ -919,20 +920,14 @@ export function ModelAdvancedDrawer({
);
})}
{visibilityCustomized && !paymentRequired && selectionAvailable && (
- {
if (!await resetModelVisibilities(provider.id, visibilityTargets))
toast.error(t('settings.providers.models.visibilityWriteFailed'));
}}
className="mt-2"
- >
- {t('settings.providers.models.advanced.restoreDefault')}
-
+ label={t('settings.providers.models.advanced.restoreDefault')}
+ />
)}
)}
@@ -974,12 +969,7 @@ export function ModelAdvancedDrawer({
(a) =>
rememberedEffort(a, row.byAgent[a]!.id) !== undefined,
) && (
- {
if (groupRow?.aliasRows) {
@@ -991,9 +981,8 @@ export function ModelAdvancedDrawer({
clearProviderModelEffort(a, provider.id, row.byAgent[a]!.id);
}}
className="mt-2"
- >
- {t('settings.providers.models.advanced.restoreDefault')}
-
+ label={t('settings.providers.models.advanced.restoreDefault')}
+ />
)}
)}
@@ -1065,18 +1054,12 @@ export function ModelAdvancedDrawer({
})}
{ctx.isCustomized && (
-
- {t('settings.providers.models.advanced.restoreDefault')}
-
+ label={t('settings.providers.models.advanced.restoreDefault')}
+ />
)}
{(ctxInvalid || ctx.error || ctx.mixed) && (
diff --git a/apps/desktop/src/renderer/components/settings/ModelGroupRouteExceptions.tsx b/apps/desktop/src/renderer/components/settings/ModelGroupRouteExceptions.tsx
index 678ed95dfba..51f1d763150 100644
--- a/apps/desktop/src/renderer/components/settings/ModelGroupRouteExceptions.tsx
+++ b/apps/desktop/src/renderer/components/settings/ModelGroupRouteExceptions.tsx
@@ -154,7 +154,7 @@ export function ModelGroupRouteExceptions({
value={String(draft.from)}
options={hourOptions}
size="compact"
- className="w-[104px]"
+ width="xs"
onValueChange={(value) => setDraft({ ...draft, from: Number(value) })}
/>
@@ -166,7 +166,7 @@ export function ModelGroupRouteExceptions({
value={String(draft.to)}
options={hourOptions}
size="compact"
- className="w-[104px]"
+ width="xs"
onValueChange={(value) => setDraft({ ...draft, to: Number(value) })}
/>
@@ -179,7 +179,7 @@ export function ModelGroupRouteExceptions({
options={others.map((item) => ({ value: item.id, label: item.name }))}
size="compact"
truncateOptions
- className="w-[180px]"
+ width="sm"
onValueChange={(routeId) => setDraft({ ...draft, routeId })}
/>
diff --git a/apps/desktop/src/renderer/components/settings/ModelGroupsSection.tsx b/apps/desktop/src/renderer/components/settings/ModelGroupsSection.tsx
index 3accd2da61a..ca16ef4c5fd 100644
--- a/apps/desktop/src/renderer/components/settings/ModelGroupsSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/ModelGroupsSection.tsx
@@ -207,6 +207,7 @@ export function ModelGroupsSection() {
description: t('modelGroups.settings.deleteRouteConfirmDescription'),
confirmText: t('modelGroups.settings.delete'),
cancelText: t('modelGroups.settings.cancel'),
+ confirmVariant: 'destructive',
})) return;
if (await save((latest) => ({ ...latest, routes: latest.routes.filter((item) => item.id !== route.id) }))) back();
};
diff --git a/apps/desktop/src/renderer/components/settings/PluginSettingsSection.tsx b/apps/desktop/src/renderer/components/settings/PluginSettingsSection.tsx
index 4a4e573b1ef..eecc46b4eaf 100644
--- a/apps/desktop/src/renderer/components/settings/PluginSettingsSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/PluginSettingsSection.tsx
@@ -4,7 +4,7 @@ import { isGhostHostUiSettingValue, type GhostHostUiSetting } from '@cindy/plugi
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Select } from '@/components/ui/select';
-import { Switch } from '@/components/ui/switch';
+import { Checkbox } from '@/components/ui/checkbox';
import { SettingsCard, SettingsPageHeader, SettingsRow } from '@/components/ui/settings-rows';
import { useAppSettingsRevision } from '@/hooks/useAppSettingsRevision';
import { toast } from '@/lib/toast';
@@ -76,8 +76,9 @@ export function PluginSettingsFields({ instanceId, title, fields }: {
options={field.options.map((option, index) => ({ label: option.label, value: String(index) }))}
disabled={busy} onValueChange={index => setDraft(value => ({ ...value, [field.id]: field.options![Number(index)].value }))} />
: field.type === 'boolean'
- ? setDraft(value => ({ ...value, [field.id]: checked }))} />
+ // Draft field applied by Save: Checkbox, not Switch (DESIGN.md §4 Desktop settings controls).
+ ? { const checked = event.currentTarget.checked; setDraft(value => ({ ...value, [field.id]: checked })); }} />
: void;
}) {
const { t } = useTranslation();
- const label = value === 'all' ? t('settings.sessionImport.allSources') : IMPORT_SOURCE_NAMES[value];
+ // A single-value field is the shared Select, not a menu (DESIGN.md §4 Desktop settings controls).
+ const count = (n: number) => (
+ {n}
+ );
return (
-
-
-
- {value === 'all' ? : }
- {label}
-
-
-
-
- onChange('all')} className="gap-2.5">
- {value === 'all' && }
- {t('settings.sessionImport.allSources')}
- {total}
-
- {counts.length > 0 && }
- {counts.map(([id, n]) => (
- onChange(id)} className="gap-2.5">
- {value === id && }
-
- {IMPORT_SOURCE_NAMES[id]}
- {n}
-
- ))}
-
-
+ ({ value: id, label: IMPORT_SOURCE_NAMES[id], endAdornment: count(n) })),
+ ]}
+ onValueChange={(next) => onChange(next as ImportSourceId | 'all')}
+ />
);
}
diff --git a/apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx b/apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx
index bdb41bb5320..11ca6661f32 100644
--- a/apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx
+++ b/apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx
@@ -27,6 +27,7 @@ import { emitRefresh } from '@/lib/sessionsBus';
import { extractIpcError } from '@/utils/ipcError';
import { getDraft, getFastModeForModel } from '@/state/newMakerDraft';
import appI18n from 'i18next';
+import { Checkbox } from '@/components/ui/checkbox';
const log = createLogger('SessionShareImportWizard');
@@ -383,15 +384,13 @@ export function SessionShareImportWizard({
{t('sessionShare.import.pickWorkdir')}
- {/* 与 confirm-dialog 的 checkbox 约定一致:原生 input + size-3.5 +
- accent 主题 token(项目没有统一 Checkbox 组件,这是现行范式)。 */}
- setUseWorktree(e.target.checked)}
disabled={busy}
- className="mt-[3px] size-3.5 cursor-pointer accent-[var(--confirm-btn-primary-bg)]"
+ className="mt-0.5"
/>
diff --git a/apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx b/apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx
index 6444683b108..d5ee191ed4e 100644
--- a/apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx
+++ b/apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx
@@ -23,6 +23,7 @@ import { X, Copy, Key, KeyRound, Lock, Plus, Server, CheckCircle2, Circle, Unloc
import { toast } from '@/lib/toast';
import { Spinner } from '@/components/ui/spinner';
import { mapIpcErrorToI18nKey } from '@/utils/ipcError';
+import { Checkbox } from '@/components/ui/checkbox';
/** ssh-add failure reasons mirrored from the main-side classification. Kept in
* sync with `AgentFailureReason` in vite-env.d.ts / ssh-keys.ts. */
@@ -531,12 +532,12 @@ function GenerateForm({ generating, onSubmit, onCancel }: GenerateFormProps) {
- setEncrypt(e.target.checked)}
disabled={generating}
- className="mt-0.5 accent-[var(--settings-menu-text-selected)]"
+ className="mt-0.5"
/>
- setBackupEnabled(checked)}
+ onChange={(event) => setBackupEnabled(event.currentTarget.checked)}
aria-label={t('settings.about.storage.dbSlimmingBackupLabel')}
/>
diff --git a/apps/desktop/src/renderer/components/settings/TaskManagementSection.tsx b/apps/desktop/src/renderer/components/settings/TaskManagementSection.tsx
index 3b64fa213b5..55527372399 100644
--- a/apps/desktop/src/renderer/components/settings/TaskManagementSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/TaskManagementSection.tsx
@@ -1,7 +1,6 @@
import { useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useAuth } from '@/contexts/AuthContext';
-import { Button } from '@/components/ui/button';
import { Switch } from '@/components/ui/switch';
import { Select } from '@/components/ui/select';
import { Input } from '@/components/ui/input';
@@ -17,6 +16,7 @@ import { toast } from '@/lib/toast';
import type { TaskArchiveSettings } from '../../../shared/taskManagement';
import { taskManagementSettings } from './TaskManagement.settings-search';
import { useSettingDefinition } from './useSettingDefinition';
+import { ResetGroupButton } from '@/components/ui/reset-buttons';
export function TaskManagementSection() {
const { t } = useTranslation();
@@ -96,16 +96,12 @@ export function TaskManagementSection() {
title={t(taskManagementSettings.page.titleKey)}
description={t(taskManagementSettings.page.descriptionKey)}
action={
- void save(null)}
- >
- {t('taskManagement.reset')}
-
+ label={t('taskManagement.reset')}
+ />
}
>
{error && }
diff --git a/apps/desktop/src/renderer/components/settings/TerminalShellSection.tsx b/apps/desktop/src/renderer/components/settings/TerminalShellSection.tsx
index 1377de1c12f..365b20da77c 100644
--- a/apps/desktop/src/renderer/components/settings/TerminalShellSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/TerminalShellSection.tsx
@@ -18,12 +18,10 @@ import { personalizationDetailsSettings } from './PersonalizationDetails.setting
*/
import { useCallback, useEffect, useMemo, useState } from 'react';
-import { SelectParts as Select } from '@/components/ui/select';
+import { Select } from '@/components/ui/select';
import { SettingsCard, SettingsField, SettingsSection } from '@/components/ui/settings-rows';
-import { Check, ChevronDown, ChevronUp } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { cn } from '@/lib/utils';
import { toast } from '@/lib/toast';
import type { AvailableShell, ShellId } from '../../../shared/terminal-bridge';
import { DefaultOverrideControls } from './DefaultOverrideControls';
@@ -118,91 +116,24 @@ export function TerminalShellSection() {
)}
>
- onChange(value as ShellId)}
disabled={resetting}
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {shells.map((shell) => (
-
- ))}
- {/* 用户上次选的 shell 当前不可用(卸了)时,仍要显示让用户可以切回 auto */}
- {unavailablePref ? (
-
- ) : null}
-
-
-
-
-
-
-
+ width="full"
+ options={[
+ { value: 'auto', label: autoLabel },
+ ...shells.map((shell) => ({ value: shell.id, label: shell.displayName })),
+ // 用户上次选的 shell 当前不可用(卸了)时,仍要显示让用户可以切回 auto
+ ...(unavailablePref
+ ? [{ value: unavailablePref, label: t('settings.terminalShell.unavailable', { shell: unavailablePref }) }]
+ : []),
+ ]}
+ />
);
}
-
-/** Radix shell option row;统一键盘高亮、选中指示、失效提示和主题 token。 */
-function ShellOption({
- value,
- label,
- unavailable = false,
-}: {
- value: ShellId;
- label: string;
- unavailable?: boolean;
-}) {
- return (
-
- {label}
-
-
-
-
- );
-}
diff --git a/apps/desktop/src/renderer/components/settings/WechatBotSection.tsx b/apps/desktop/src/renderer/components/settings/WechatBotSection.tsx
index bccfff8af35..a12b341bd2b 100644
--- a/apps/desktop/src/renderer/components/settings/WechatBotSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/WechatBotSection.tsx
@@ -9,6 +9,7 @@ import { useWechatBot } from '@/hooks/useWechatBot';
import { cn } from '@/lib/utils';
import { ImChannelSettingsCard, useImChannelSettingsSummary } from './ImChannelSettingsCard';
import { ImDefaultSettingsSection } from './ImDefaultSettingsSection';
+import { ResetGroupButton } from '@/components/ui/reset-buttons';
const STATUS_KEYS: Record = {
disconnected: 'settings.wechatBot.status.disconnected',
@@ -120,6 +121,8 @@ export function WechatBotSection({
description: t('settings.wechatBot.unbind.description'),
confirmText: t('settings.wechatBot.unbind.confirm'),
cancelText: t('settings.wechatBot.unbind.cancel'),
+ // 解绑会删除本机微信凭证并清理未完成的执行,不可撤回(DESIGN.md §4 Destructive actions)。
+ confirmVariant: 'destructive',
});
if (accepted) await unbind();
}, [confirm, t, unbind]);
@@ -345,16 +348,12 @@ function WechatWorkingDirectory({
{configured && (
-
- {t('settings.wechatBot.workingDir.reset')}
-
+ label={t('settings.wechatBot.workingDir.reset')}
+ />
)}
{settings && !settings.workingDirAvailable && (
diff --git a/apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx b/apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx
index 0bb224ee7b0..d81e1431b90 100644
--- a/apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx
+++ b/apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx
@@ -14,13 +14,11 @@ import {
BatteryCharging,
ChevronRight,
Keyboard,
- RotateCcw,
Usb,
} from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { Select, type SelectProps } from '@/components/ui/select';
-import { Tip } from '@/components/ui/tooltip';
import { SETTINGS_ROW_LABEL_CLASS, SettingsCard, SettingsPageHeader, SettingsPageScope, SettingsRow, SettingsSection } from '@/components/ui/settings-rows';
import { Switch } from '@/components/ui/switch';
import { useCodexMicroGuard } from '@/hooks/useCodexMicroGuard';
@@ -91,6 +89,7 @@ import {
type WorkLouderCodexState,
type WorkLouderModel,
} from '../../../shared/workLouderCodex';
+import { ResetGroupButton } from '@/components/ui/reset-buttons';
function workLouderCopyKey(model: WorkLouderModel, suffix: string): string {
return model === 'creator-micro-2'
@@ -530,7 +529,8 @@ export function WorkLouderCodexSettings({
onBack={onBack}
backLabel={t('settings.shortcuts.workLouderCodex.back')}
action={
- void resetSettings()}
@@ -609,9 +609,10 @@ export function WorkLouderCodexSettings({
{t('settings.shortcuts.workLouderCodex.layout.keyboard.description')}
-
void setSettings({
@@ -1242,40 +1243,6 @@ function ActionSelect({
);
}
-/**
- * Restore control for this device page.
- * Always a compact icon+label button at the top-right of the unit it resets
- * (page title or section header). Never a text link, never a standalone card.
- */
-function SettingsResetButton({
- label,
- title,
- disabled,
- onClick,
-}: {
- label: string;
- title?: string;
- disabled?: boolean;
- onClick: () => void;
-}) {
- // Page/section reset (CONTROLS decision 3): sm secondary Button, icon + text; extra context in a Tip.
- return (
-
-
-
- {label}
-
-
- );
-}
-
function CreatorKeyRoleChoice({
isTask,
disabled,
diff --git a/apps/desktop/src/renderer/components/settings/__tests__/PluginSettingsSection.test.tsx b/apps/desktop/src/renderer/components/settings/__tests__/PluginSettingsSection.test.tsx
index 73267b46e79..b502017066a 100644
--- a/apps/desktop/src/renderer/components/settings/__tests__/PluginSettingsSection.test.tsx
+++ b/apps/desktop/src/renderer/components/settings/__tests__/PluginSettingsSection.test.tsx
@@ -30,7 +30,7 @@ it('edits declared fields, preserves invalid input locally and restores defaults
expect(screen.getByRole('button', { name: 'pluginUi.save' }).hasAttribute('disabled')).toBe(true);
expect(invoke).toHaveBeenCalledTimes(1);
fireEvent.change(size, { target: { value: '18' } });
- fireEvent.click(screen.getByRole('switch', { name: 'Enabled' }));
+ fireEvent.click(screen.getByRole('checkbox', { name: 'Enabled' }));
fireEvent.click(screen.getByRole('button', { name: 'pluginUi.save' }));
await waitFor(() => expect(invoke).toHaveBeenCalledWith(null, { op: 'plugin-settings', instanceId: 'local__demo', operation: 'update', patch: { size: 18, enabled: false } }));
await waitFor(() => expect(screen.getByRole('button', { name: 'settings.defaults.restore' }).hasAttribute('disabled')).toBe(false));
diff --git a/apps/desktop/src/renderer/components/settings/__tests__/StorageManagementCard.test.tsx b/apps/desktop/src/renderer/components/settings/__tests__/StorageManagementCard.test.tsx
index 31ffae04a3e..5806b7ea3c5 100644
--- a/apps/desktop/src/renderer/components/settings/__tests__/StorageManagementCard.test.tsx
+++ b/apps/desktop/src/renderer/components/settings/__tests__/StorageManagementCard.test.tsx
@@ -753,16 +753,16 @@ describe('StorageManagementCard database cleanup', () => {
]);
fireEvent.click(options[0]!);
expect(
- screen
- .getByRole('switch', { name: 'settings.about.storage.dbSlimmingBackupLabel' })
- .getAttribute('aria-checked'),
- ).toBe('true');
+ (screen.getByRole('checkbox', {
+ name: 'settings.about.storage.dbSlimmingBackupLabel',
+ }) as HTMLInputElement).checked,
+ ).toBe(true);
fireEvent.click(screen.getByText('settings.about.storage.dbSlimmingBackupLabel'));
expect(
- screen
- .getByRole('switch', { name: 'settings.about.storage.dbSlimmingBackupLabel' })
- .getAttribute('aria-checked'),
- ).toBe('false');
+ (screen.getByRole('checkbox', {
+ name: 'settings.about.storage.dbSlimmingBackupLabel',
+ }) as HTMLInputElement).checked,
+ ).toBe(false);
fireEvent.click(screen.getByText('settings.about.storage.dbSlimmingBackupLabel'));
const scanButton = screen.getByRole('button', {
name: 'settings.about.storage.dbSlimmingScanButton',
diff --git a/apps/desktop/src/renderer/components/sidebar/SidebarNavigationCustomize.tsx b/apps/desktop/src/renderer/components/sidebar/SidebarNavigationCustomize.tsx
index cc3398676e4..64e9431186f 100644
--- a/apps/desktop/src/renderer/components/sidebar/SidebarNavigationCustomize.tsx
+++ b/apps/desktop/src/renderer/components/sidebar/SidebarNavigationCustomize.tsx
@@ -1,5 +1,5 @@
import { useState } from 'react';
-import { Check, GripVertical, Puzzle } from 'lucide-react';
+import { GripVertical, Puzzle } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useGhostMainViews } from '@/cindy-brain/ghostMainViews';
@@ -7,7 +7,6 @@ import { useAuth } from '@/contexts/AuthContext';
import { useReducedMotion } from '@/hooks/useReducedMotion';
import { Button } from '@/components/ui/button';
import { Tip } from '@/components/ui/tooltip';
-import { cn } from '@/lib/utils';
import { MAIN_VIEW_ICONS } from './GhostMainViewNavEntries';
import {
@@ -27,6 +26,8 @@ import {
useSidebarNavigationPrefs,
} from './sidebarNavigationPrefs';
import { SortableList } from './SortableList';
+import { Checkbox } from '@/components/ui/checkbox';
+import { ResetGroupButton } from '@/components/ui/reset-buttons';
interface SidebarNavigationCustomizeProps {
onDone: () => void;
@@ -186,34 +187,26 @@ export function SidebarNavigationCustomize({ onDone }: SidebarNavigationCustomiz
}
reducedMotion={reducedMotion}
// Rows drag from their label or handle; only the checkbox stays a plain click.
- filter="[role='checkbox']"
+ filter="input[type='checkbox']"
className="flex flex-col gap-0.5"
renderItem={(id) => {
const visible = isChecked(id);
const Icon = iconFor(id);
return (
- // The whole row toggles; the checkbox stays the focusable control, and its
- // keyboard activation bubbles here as the same click.
+ // The whole row toggles; the shared Checkbox (DESIGN.md §4, B-10) stays the
+ // focusable control and handles its own click and Space, so it stops the bubble.
toggle(id)}
className="group/nav-entry flex h-9 cursor-pointer items-center gap-2 rounded-lg px-1 hover:bg-sidebar-item-hover"
>
-
- {visible && }
-
+
+ event.stopPropagation()}
+ onChange={() => toggle(id)}
+ />
+
- {
setDraft({
@@ -263,9 +252,8 @@ export function SidebarNavigationCustomize({ onDone }: SidebarNavigationCustomiz
});
setResetting(true);
}}
- >
- {t('sidebar.navigation.customize.reset')}
-
+ label={t('sidebar.navigation.customize.reset')}
+ />
);
}
diff --git a/apps/desktop/src/renderer/components/sidebar/__tests__/SidebarNavigationCustomize.test.tsx b/apps/desktop/src/renderer/components/sidebar/__tests__/SidebarNavigationCustomize.test.tsx
index 5c7e3e0333f..c18ad91840e 100644
--- a/apps/desktop/src/renderer/components/sidebar/__tests__/SidebarNavigationCustomize.test.tsx
+++ b/apps/desktop/src/renderer/components/sidebar/__tests__/SidebarNavigationCustomize.test.tsx
@@ -99,7 +99,7 @@ describe('sidebar navigation customization', () => {
it('applies a finished drag and saves only explicit overrides', () => {
render( {}} />);
// Rows drag from anywhere except the checkbox, which stays a plain toggle.
- expect(sortableMock.props?.filter).toBe("[role='checkbox']");
+ expect(sortableMock.props?.filter).toBe("input[type='checkbox']");
act(() => sortableMock.props!.onReorder(['plugins', 'search', 'automations']));
expect(order()).toEqual([
'sidebar.navigation.items.plugins',
@@ -216,9 +216,9 @@ describe('sidebar navigation customization', () => {
'站点',
]);
const sites = screen.getByRole('checkbox', { name: '站点' });
- expect(sites.getAttribute('aria-checked')).toBe('true');
+ expect((sites as HTMLInputElement).checked).toBe(true);
fireEvent.click(sites);
- expect(sites.getAttribute('aria-checked')).toBe('false');
+ expect((sites as HTMLInputElement).checked).toBe(false);
fireEvent.keyDown(
screen.getByRole('button', { name: 'sidebar.navigation.customize.reorder: 站点' }),
{ key: 'ArrowUp' },
@@ -239,9 +239,7 @@ describe('sidebar navigation customization', () => {
mainViewsMock.routeCapable = [SITES];
mainViewsMock.sidebarVisible = [SITES];
render( {}} />);
- expect(screen.getByRole('checkbox', { name: '站点' }).getAttribute('aria-checked')).toBe(
- 'false',
- );
+ expect((screen.getByRole('checkbox', { name: '站点' }) as HTMLInputElement).checked).toBe(false);
});
it.each([
{ label: 'short', namespace: 'acme' },
@@ -256,8 +254,8 @@ describe('sidebar navigation customization', () => {
setSidebarNavigationPrefs(OWNER, { order: [...savedOrder], visible: [...defaults().visible],
appsAtTop: ['app:_root__xd-sites'] });
render( {}} />);
- expect(screen.getByRole('checkbox', { name: 'Root sites' }).getAttribute('aria-checked')).toBe('true');
- expect(screen.getByRole('checkbox', { name: 'Enterprise sites' }).getAttribute('aria-checked')).toBe('false');
+ expect((screen.getByRole('checkbox', { name: 'Root sites' }) as HTMLInputElement).checked).toBe(true);
+ expect((screen.getByRole('checkbox', { name: 'Enterprise sites' }) as HTMLInputElement).checked).toBe(false);
fireEvent.click(screen.getByRole('checkbox', { name: 'Root sites' }));
fireEvent.click(screen.getByRole('checkbox', { name: 'Enterprise sites' }));
fireEvent.click(screen.getByRole('button', { name: 'sidebar.navigation.customize.done' }));
@@ -290,13 +288,9 @@ describe('sidebar navigation customization', () => {
appsAtTop: ['app:xd-sites', 'app:off'],
});
render( {}} />);
- expect(screen.getByRole('checkbox', { name: '站点' }).getAttribute('aria-checked')).toBe(
- 'true',
- );
+ expect((screen.getByRole('checkbox', { name: '站点' }) as HTMLInputElement).checked).toBe(true);
fireEvent.click(screen.getByRole('button', { name: 'sidebar.navigation.customize.reset' }));
- expect(screen.getByRole('checkbox', { name: '站点' }).getAttribute('aria-checked')).toBe(
- 'false',
- );
+ expect((screen.getByRole('checkbox', { name: '站点' }) as HTMLInputElement).checked).toBe(false);
fireEvent.click(screen.getByRole('button', { name: 'sidebar.navigation.customize.done' }));
expect(getSidebarNavigationPrefs(OWNER)).toEqual({
order: ['automations', 'plugins', 'search'],
@@ -320,25 +314,25 @@ describe('sidebar navigation customization', () => {
it('toggles from anywhere in the row except the drag handle', () => {
render( {}} />);
const plugins = screen.getByRole('checkbox', { name: 'sidebar.navigation.items.plugins' });
- expect(plugins.getAttribute('aria-checked')).toBe('true');
+ expect((plugins as HTMLInputElement).checked).toBe(true);
fireEvent.click(screen.getByText('sidebar.navigation.items.plugins'));
- expect(plugins.getAttribute('aria-checked')).toBe('false');
+ expect((plugins as HTMLInputElement).checked).toBe(false);
fireEvent.click(plugins.parentElement!);
- expect(plugins.getAttribute('aria-checked')).toBe('true');
+ expect((plugins as HTMLInputElement).checked).toBe(true);
fireEvent.click(plugins);
- expect(plugins.getAttribute('aria-checked')).toBe('false');
+ expect((plugins as HTMLInputElement).checked).toBe(false);
fireEvent.click(
screen.getByRole('button', {
name: 'sidebar.navigation.customize.reorder: sidebar.navigation.items.plugins',
}),
);
- expect(plugins.getAttribute('aria-checked')).toBe('false');
+ expect((plugins as HTMLInputElement).checked).toBe(false);
});
it('shows each entry with the icon it uses in the sidebar', () => {
mainViewsMock.routeCapable = [SITES];
mainViewsMock.sidebarVisible = [SITES];
render( {}} />);
- const rowOf = (name: string) => screen.getByRole('checkbox', { name }).parentElement!;
+ const rowOf = (name: string) => screen.getByRole('checkbox', { name }).closest('div')!;
expect(
rowOf('sidebar.navigation.items.automations').querySelector('.lucide-timer'),
).not.toBeNull();
diff --git a/apps/desktop/src/renderer/components/sidebar/__tests__/SidebarTopNav.test.tsx b/apps/desktop/src/renderer/components/sidebar/__tests__/SidebarTopNav.test.tsx
index ce2588e8901..16e60f6725f 100644
--- a/apps/desktop/src/renderer/components/sidebar/__tests__/SidebarTopNav.test.tsx
+++ b/apps/desktop/src/renderer/components/sidebar/__tests__/SidebarTopNav.test.tsx
@@ -747,8 +747,8 @@ describe('Plugins joining the sidebar', () => {
,
);
- expect(screen.getByRole('checkbox', { name: 'sidebar.navigation.items.search' }).getAttribute('aria-checked'))
- .toBe('false');
+ expect((screen.getByRole('checkbox', { name: 'sidebar.navigation.items.search' }) as HTMLInputElement).checked)
+ .toBe(false);
fireEvent.click(screen.getByRole('button', { name: 'sidebar.navigation.customize.done' }));
expect(getSidebarNavigationPrefs('owner-2').visible).toEqual(['automations']);
expect(getSidebarNavigationPrefs(OWNER).visible).toEqual(['automations', 'plugins', 'search']);
diff --git a/apps/desktop/src/renderer/components/status/CodexResetAutoUseControl.tsx b/apps/desktop/src/renderer/components/status/CodexResetAutoUseControl.tsx
index b34a04d1354..8a0dbd579d0 100644
--- a/apps/desktop/src/renderer/components/status/CodexResetAutoUseControl.tsx
+++ b/apps/desktop/src/renderer/components/status/CodexResetAutoUseControl.tsx
@@ -6,6 +6,7 @@ import { Button } from '@/components/ui/button';
import { Switch } from '@/components/ui/switch';
import { Select } from '@/components/ui/select';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
+import { Checkbox } from '@/components/ui/checkbox';
/** The closed state occupies one small row; rules stay in a popover. */
export function CodexResetAutoUseControl({ state, providerId, onChanged }: {
@@ -57,13 +58,13 @@ export function CodexResetAutoUseControl({ state, providerId, onChanged }: {
{label('rules')}
- condition('lowQuota', e.target.checked)} />
+ condition('lowQuota', e.target.checked)} />
{label('lowQuota')}
{label('resetDistance')}
({ value: String(n), label: n ? label('days', { count: n }) : label('unlimited') })).concat({ value: 'custom', label: label('custom') })}
onValueChange={value => { setCustom(value === 'custom'); if (value !== 'custom') void save({ minimumDays: Number(value) }); }} />
{(custom || ![0, 1, 2, 3].includes(s.minimumDays)) &&
diff --git a/apps/desktop/src/renderer/components/ui/dropdown-menu.tsx b/apps/desktop/src/renderer/components/ui/dropdown-menu.tsx
index 4ddd019e8f7..56f85d287ae 100644
--- a/apps/desktop/src/renderer/components/ui/dropdown-menu.tsx
+++ b/apps/desktop/src/renderer/components/ui/dropdown-menu.tsx
@@ -177,17 +177,25 @@ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
const DropdownMenuCheckboxItem = React.forwardRef<
React.ComponentRef
,
- React.ComponentPropsWithoutRef
->(({ className, children, checked, ...props }, ref) => {
+ React.ComponentPropsWithoutRef & {
+ /**
+ * `start` (default): the shared leading check column. `none`: the row keeps the
+ * checkbox semantics (menuitemcheckbox + aria-checked) while the caller draws its
+ * own checked mark, e.g. an approved trailing slot (DESIGN.md §4 Select & Dropdown).
+ */
+ indicator?: 'start' | 'none';
+ }
+>(({ className, children, checked, indicator = 'start', ...props }, ref) => {
const row = useRowHighlight(className);
return (
+ {indicator === 'start' && (
+ )}
{withMenuLabels(children)}
);
diff --git a/apps/desktop/src/renderer/components/ui/reset-buttons.tsx b/apps/desktop/src/renderer/components/ui/reset-buttons.tsx
new file mode 100644
index 00000000000..4bed9a0bfb4
--- /dev/null
+++ b/apps/desktop/src/renderer/components/ui/reset-buttons.tsx
@@ -0,0 +1,70 @@
+/**
+ * Restore-default actions (DESIGN.md §4 Desktop settings controls, "Restore default").
+ *
+ * - RestoreDefaultButton: one setting. 28px frameless square icon button with a `Tip`,
+ * placed to the left of the control and only while the value differs from its default
+ * (DefaultOverrideControls adds the "customized" badge in front of it).
+ * - ResetGroupButton: a whole page or section. `secondary` `sm` Button with the RotateCcw
+ * icon and a text label, on the right of the page or section title. An optional `tip`
+ * explains what is reset; `loading` keeps the label width and accessible name.
+ *
+ * Both forward the remaining Button props (data-settings-search-action, data-setting-id,
+ * disabled, loading, className for layout) so callers keep their settings-search contract.
+ */
+
+import * as React from 'react';
+import { RotateCcw } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
+
+import { cn } from '@/lib/utils';
+import { Button, type ButtonProps } from './button';
+import { Tip } from './tooltip';
+
+type ResetButtonBaseProps = Omit;
+
+export interface RestoreDefaultButtonProps extends ResetButtonBaseProps {
+ /** Tooltip and accessible name; defaults to "Restore default". */
+ label?: string;
+}
+
+export const RestoreDefaultButton = React.forwardRef(
+ function RestoreDefaultButton({ label, className, ...props }, ref) {
+ const { t } = useTranslation();
+ const text = label ?? t('settings.defaults.restore');
+ return (
+
+
+
+
+
+ );
+ },
+);
+
+export interface ResetGroupButtonProps extends ResetButtonBaseProps {
+ /** Visible label, e.g. "Restore defaults". */
+ label: string;
+ /** Optional extra context shown in a Tip (what exactly is reset). */
+ tip?: string;
+}
+
+export const ResetGroupButton = React.forwardRef(
+ function ResetGroupButton({ label, tip, ...props }, ref) {
+ return (
+
+
+
+ {label}
+
+
+ );
+ },
+);
diff --git a/apps/desktop/src/renderer/components/ui/select.tsx b/apps/desktop/src/renderer/components/ui/select.tsx
index 212cec7b90c..4ffbc870686 100644
--- a/apps/desktop/src/renderer/components/ui/select.tsx
+++ b/apps/desktop/src/renderer/components/ui/select.tsx
@@ -10,6 +10,8 @@ export interface SelectOption {
label: string;
disabled?: boolean;
title?: string;
+ /** Secondary line under the label in the open list; the trigger shows the label only. */
+ description?: string;
endAdornment?: ReactNode;
}
@@ -33,8 +35,12 @@ export interface SelectProps {
className?: string;
/** Size a compact trigger's menu independently; ordinary fields keep equal width. */
contentClassName?: string;
- /** Trigger height: default 36px; compact 32px for narrow drawers and dense lists. */
- size?: 'default' | 'compact';
+ /**
+ * Trigger height: default 36px; compact 32px for narrow drawers and dense lists; inline
+ * 24px, frameless and in the surrounding text colour, for a value that sits inside a line
+ * of text (plugin UI slots, provider run location, Cindy device picker). DESIGN.md §4.
+ */
+ size?: 'default' | 'compact' | 'inline';
/**
* Trigger width preset: 220px / 320px, full width for stacked fields, or 120px (`xs`) for a
* short value paired inline with another control (DESIGN.md §4 Desktop settings controls).
@@ -50,6 +56,18 @@ export interface SelectProps {
/** Width presets, also for SelectParts triggers that compose their own rows. */
export const SELECT_WIDTHS = { xs: 'w-[120px]', sm: 'w-[220px]', md: 'w-[320px]', full: 'w-full' } as const;
+const SELECT_BUTTON_SIZES = { default: 'lg', compact: 'md', inline: 'xs' } as const;
+
+/** Inline trigger: fits its value, no frame or fill at rest, surrounding text colour;
+ * the secondary hover/pressed fill and focus ring still mark it as a control. */
+const SELECT_INLINE_TRIGGER =
+ 'w-fit gap-1 px-1.5 text-inherit [--button-face-bg:transparent] [--button-face-border:transparent]';
+
+/** An inline trigger is only as wide as its value, so its list fits the options instead:
+ * at least the trigger width, at most 18rem and the space available. */
+const SELECT_INLINE_CONTENT =
+ 'w-max min-w-[var(--radix-select-trigger-width)] max-w-[min(18rem,var(--radix-select-content-available-width))]';
+
/** Desktop single-value field (DESIGN.md §4): standard secondary Button,
* equal-width Radix panel, 12px container / 8px rows and semantic theme colors.
* Use with FormField for a visible label; className sizes the trigger only.
@@ -86,7 +104,14 @@ export function Select({
title={option.title ?? (truncateOptions ? option.label : undefined)}
className="relative flex min-h-8 cursor-pointer select-none items-center rounded-lg py-1 pl-2 pr-6 outline-none [overflow-wrap:anywhere] data-[disabled]:opacity-60"
>
- {truncateOptions ? (
+ {option.description ? (
+
+
+ {option.label}
+
+ {option.description}
+
+ ) : truncateOptions ? (
{option.label}
@@ -113,7 +138,7 @@ export function Select({
data-setting-id={settingId}
data-settings-search-action={searchAction}
variant="secondary"
- size={size === 'compact' ? 'md' : 'lg'}
+ size={SELECT_BUTTON_SIZES[size]}
aria-label={label}
aria-describedby={describedBy}
aria-invalid={error ? true : invalid}
@@ -121,6 +146,7 @@ export function Select({
title={selected?.title ?? selected?.label}
className={cn(
'min-w-0 max-w-full justify-between gap-2 px-3 font-normal [-webkit-app-region:no-drag]',
+ size === 'inline' && SELECT_INLINE_TRIGGER,
width && SELECT_WIDTHS[width],
className,
(error || (invalid !== undefined && invalid !== false && invalid !== 'false')) &&
@@ -132,7 +158,7 @@ export function Select({
{triggerAdornment}
-
+
@@ -145,6 +171,7 @@ export function Select({
collisionPadding={8}
className={cn(
'z-dropdown w-[var(--radix-select-trigger-width)] max-h-[var(--radix-select-content-available-height)] overflow-hidden rounded-xl border border-[var(--border-default)] bg-[var(--surface-elevated)] p-1.5 text-13 text-[var(--text-primary)] [-webkit-app-region:no-drag]',
+ size === 'inline' && SELECT_INLINE_CONTENT,
contentClassName,
)}
>
diff --git a/apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx b/apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx
index e81d11913d8..dce3b9cbe05 100644
--- a/apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx
@@ -7,7 +7,6 @@
*/
import { useEffect, useMemo, useRef, useState, type FormEvent } from 'react';
import * as Dialog from '@radix-ui/react-dialog';
-import { Check } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
@@ -20,6 +19,7 @@ import { BotAvatar } from './BotAvatar';
import { botGroupApi, refreshBotGroups } from './botGroupStore';
import { BOT_GROUP_MAX_MEMBERS, BOT_GROUP_MIN_MEMBERS, botGroupErrorKey } from './botGroupPresentation';
import { useBotProfiles, type BotProfile } from './botStore';
+import { Checkbox } from '@/components/ui/checkbox';
function pickableBots(bots: readonly BotProfile[]): BotProfile[] {
return bots
@@ -87,7 +87,7 @@ export function BotGroupCreateDialog({
const [busy, setBusy] = useState(false);
const busyRef = useRef(false);
const nameInputRef = useRef(null);
- const firstMemberRef = useRef(null);
+ const firstMemberRef = useRef(null);
// Speaking order follows the picker's order, not the click order.
const orderedSelection = privateChatBotId ? [privateChatBotId] : candidates
@@ -241,18 +241,11 @@ export function BotGroupCreateDialog({
const selectable = isSelectable(bot);
const disabled = busy || !selectable || (!checked && atLimit);
return (
- toggle(bot.id)}
className={cn(
- 'flex min-h-10 w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-13 text-[var(--text-primary)] outline-none transition-colors',
- 'focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--focus-ring)]',
- 'enabled:hover:bg-[var(--model-item-hover)] disabled:cursor-not-allowed',
+ 'flex min-h-10 w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-13 text-[var(--text-primary)] transition-colors',
+ disabled ? 'cursor-not-allowed' : 'cursor-pointer hover:bg-[var(--model-item-hover)]',
!selectable && 'opacity-60',
)}
>
@@ -267,18 +260,14 @@ export function BotGroupCreateDialog({
)}
) : null}
-
- {checked ? : null}
-
-
+ {/* Shared Checkbox (DESIGN.md §4, B-10); the row label toggles it. */}
+ toggle(bot.id)}
+ />
+
);
})}
diff --git a/apps/desktop/src/renderer/features/bots/BotGroupLiveStatus.tsx b/apps/desktop/src/renderer/features/bots/BotGroupLiveStatus.tsx
index f490403ff8b..4f7ca52fa4e 100644
--- a/apps/desktop/src/renderer/features/bots/BotGroupLiveStatus.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotGroupLiveStatus.tsx
@@ -227,12 +227,11 @@ function BotGroupSingleProgressStrip({
onStop?.()}
- className="text-[var(--text-danger)]"
title={t('bots.groupChat.progress.stop')}
>
{t('bots.groupChat.progress.stop')}
diff --git a/apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx b/apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx
index f009fc57a35..44c64c29ab5 100644
--- a/apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx
@@ -548,19 +548,19 @@ function BotGroupSettingsBody({ group }: { group: BotGroupSummary }) {
-
- void deleteGroup()}
- className={cn(
- 'flex min-h-11 w-full items-center px-3 py-2 text-left text-13 font-medium text-[var(--text-danger)] outline-none transition-colors',
- 'enabled:hover:bg-[var(--danger-bg-soft)] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--focus-ring)] disabled:opacity-60',
- )}
- >
- {t('bots.groupChat.settings.delete')}
-
-
+ {/* Irreversible: shared Button danger tone (DESIGN.md §4 Destructive actions, C-07). */}
+ void deleteGroup()}
+ className="self-start"
+ >
+ {t('bots.groupChat.settings.delete')}
+
{t('bots.groupChat.settings.deleteNote')}
diff --git a/apps/desktop/src/renderer/features/bots/BotImportForm.tsx b/apps/desktop/src/renderer/features/bots/BotImportForm.tsx
index a91fafc6846..58597452a87 100644
--- a/apps/desktop/src/renderer/features/bots/BotImportForm.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotImportForm.tsx
@@ -6,6 +6,7 @@ import { normalizeBotName } from '../../../shared/botCreation';
import { BOT_PORTRAIT_COUNT, BotPortraitPicker, galleryPortrait } from './BotPortraitPicker';
import { useBotProfiles } from './botStore';
import { extractIpcError } from '../../utils/ipcError';
+import { Checkbox } from '@/components/ui/checkbox';
/** Import only adds a selection step. Identity and all later settings use the normal teammate UI. */
export function BotImportForm({ api = window.electronAPI.companionImport, onBack, onCreated, onBusy }: {
@@ -97,9 +98,8 @@ export function BotImportForm({ api = window.electronAPI.companionImport, onBack
const categoryEntries = preview?.entries.filter(entry => entry.category === category) ?? [];
const filtered = categoryEntries.filter(entry => `${entryLabel(entry)} ${entry.description ?? ''}`.toLocaleLowerCase().includes(query.toLocaleLowerCase()));
const openCategory = (next: CompanionImportCategory) => { setCategory(next); setQuery(''); setPage(0); };
- const checkbox = (ids: string[], checked: boolean, label: string, partial = false) => { if (node) node.indeterminate = partial; }} onChange={event => toggle(ids, event.target.checked)}
- className="h-4 w-4 shrink-0 accent-[var(--text-primary)]" />;
+ const checkbox = (ids: string[], checked: boolean, label: string, partial = false) => toggle(ids, event.target.checked)} />;
if (enterChat) return null;
return
@@ -168,7 +168,7 @@ export function BotImportForm({ api = window.electronAPI.companionImport, onBack
;
})}
- {preview.entries.some(entry => entry.category === 'automations' && selectedSet.has(entry.id)) ? setTakeover(event.target.checked)} className="mt-1 h-4 w-4 shrink-0 accent-[var(--text-primary)]" />{tr('takeover')} : null}
+ {preview.entries.some(entry => entry.category === 'automations' && selectedSet.has(entry.id)) ? setTakeover(event.target.checked)} className="mt-1" />{tr('takeover')} : null}
>}
{(error || duplicate) ? {duplicate ? t('bots.guided.duplicateName') : tr(companionImportReasonKey(error))}
: null}
diff --git a/apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx b/apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx
index fa617468387..654c07a9091 100644
--- a/apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx
@@ -1,4 +1,5 @@
import { Button } from '@/components/ui/button';
+import { Tip } from '@/components/ui/tooltip';
import { Fragment, useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
import { ArrowDown, ArrowUp, Plus, Trash2 } from 'lucide-react';
import { isSharedTaskPeer } from '@cindy/device-link';
@@ -39,6 +40,7 @@ import { MODEL_GROUPS_DEFAULTS, type ModelGroupSelection, type ModelGroupsConfig
import { isPluginEngineEffort } from '../../../shared/pluginEngines';
import { isProviderShareAgentDeviceId } from '../../../shared/providerShare';
import { useBotTranslation } from './botPronounContext';
+import { ResetGroupButton } from '@/components/ui/reset-buttons';
function vendorFor(harness: BotHarness): 'cc' | 'codex' | 'pi' {
return harness === 'claude' ? 'cc' : harness === 'acp' ? 'pi' : harness;
@@ -464,15 +466,19 @@ export function BotModelChainEditor({
{routes.length > 1 ? (
- onChange(routes.filter((_, at) => at !== index))}
- aria-label={t('bots.modelChain.remove')}
- className="rounded-lg p-1.5 hover:bg-[var(--danger-bg-soft)] hover:text-[var(--text-danger)]"
- >
-
-
+
+ onChange(routes.filter((_, at) => at !== index))}
+ aria-label={t('bots.modelChain.remove')}
+ className="w-7 px-0"
+ >
+
+
+
) : null}
@@ -591,19 +597,13 @@ export function BotModelChainEditor({
{t('bots.modelChain.add')}
{onRestoreDefault ? (
- {
if (!disabled) onRestoreDefault();
}}
- >
- {t('bots.model.restoreDefault')}
-
+ label={t('bots.model.restoreDefault')}
+ />
) : null}
diff --git a/apps/desktop/src/renderer/features/bots/ChatGroupNotificationSettings.tsx b/apps/desktop/src/renderer/features/bots/ChatGroupNotificationSettings.tsx
index b1ea9415fcf..c91e69cf336 100644
--- a/apps/desktop/src/renderer/features/bots/ChatGroupNotificationSettings.tsx
+++ b/apps/desktop/src/renderer/features/bots/ChatGroupNotificationSettings.tsx
@@ -37,7 +37,7 @@ export function ChatGroupNotificationSettings({ groupId, mode, disabled }: {
}
return <>
{t(key('saving'))} : undefined}
options={modes.map(value => ({ value, label: t(key(value)) }))} onValueChange={value => void change(value)} />} />
{error && {t(key('saveFailed'))}
}
diff --git a/apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx b/apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx
index a0cc8468640..9a62742b6bd 100644
--- a/apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx
+++ b/apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx
@@ -286,7 +286,7 @@ export function ChatGroupSettings({ group }: { group: BotGroupSummary }) {
}} />} />}
({ value,
label: t(value === 'all' && assistantAnswers ? key('replyModeAssistant') : REPLY_MODE_LABELS[value]) }))}
onValueChange={value => void saveRules({ replyMode: value as typeof replyMode })} />} />
@@ -298,7 +298,7 @@ export function ChatGroupSettings({ group }: { group: BotGroupSummary }) {
{/* Single-speaker servers always answer one teammate at a time, so there is no speaking mode. */}
{!group.singleSpeaker && ({ value, label: t(SPEAKING_MODE_LABELS[value]) }))}
onValueChange={value => void saveRules({ speakingMode: value as typeof speakingMode })} />} />}
diff --git a/apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx b/apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx
index 84bc8068388..382d5ad10f1 100644
--- a/apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx
+++ b/apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx
@@ -3,7 +3,7 @@ import * as Dialog from '@radix-ui/react-dialog';
import { useTranslation } from 'react-i18next';
import { Plus } from 'lucide-react';
import { Button } from '@/components/ui/button';
-import { Switch } from '@/components/ui/switch';
+import { Checkbox } from '@/components/ui/checkbox';
import { Input } from '@/components/ui/input';
import { ConfirmDialog } from '@/components/ui/confirm-dialog';
import { getDataOwnerGeneration, isDataOwnerGenerationCurrent } from '@/contexts/dataOwnerGeneration';
@@ -181,8 +181,10 @@ export function ChatInviteDialog({ groupId, initialLink = '', malformedLink = fa
{!fromLink && (!groupId || link) && { setLink(value); setPreview(null); setError(''); operation.current = crypto.randomUUID(); }} />}
- {!groupId && preview && maskSupported &&
- {t('bots.groupChat.mask.joinSetup')}
+ {!groupId && preview && maskSupported &&
+ {/* Applied only when the user clicks Join: Checkbox, not Switch (DESIGN.md §4). */}
+ setConfigureMask(event.currentTarget.checked)} />
+ {t('bots.groupChat.mask.joinSetup')}
}
{fromLink && !preview && !error && {t(key('loadingInvite'))}
}
{preview &&
diff --git a/apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx b/apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx
index e48b7df4f32..311040950e3 100644
--- a/apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx
+++ b/apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx
@@ -13,7 +13,7 @@ import { useProcessDisclosureScroll } from './useProcessDisclosureScroll';
* 服务器的回复到了原地替换;失败撤掉、文字放回,原因写在输入框上方。
*/
import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
-import { Bell, BellRing, Check, CornerDownRight, MessageSquareShare } from 'lucide-react';
+import { Bell, BellRing, CornerDownRight, MessageSquareShare } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { toast } from '@/lib/toast';
import { cn } from '@/lib/utils';
@@ -49,6 +49,7 @@ import { chatErrorKey, messageReactionRevision } from './ChatServerControls';
import { ThreadPanel, ThreadPanelRoot } from './ThreadPanel';
import type { ThreadPanelResize } from './useThreadPanelResize';
import { ThreadMessageWindow } from './ThreadMessageWindow';
+import { Checkbox } from '@/components/ui/checkbox';
const key = (name: string) => `bots.groupChat.server.${name}`;
const api = () => window.electronAPI.maker.chatServer;
/** Unconfirmed rich replies keep their operation id across panel remounts, isolated by account. */
@@ -777,15 +778,12 @@ export function ChatThreadPanel({ group, rootId, speakers = [], onStop, stopping
running={false}
disabled={readOnly}
footerStart={sending => (
- setAlsoSend(value => !value)}
- className="-ml-1.5 inline-flex min-h-7 min-w-0 select-none items-center gap-2 rounded-full px-1.5 text-13 text-[var(--text-secondary)] outline-none transition-colors duration-[var(--motion-fast)] enabled:hover:bg-[var(--surface-hover)] enabled:hover:text-[var(--text-primary)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] disabled:opacity-50">
-
- {alsoSend ? : null}
-
+ // Applied with the next reply: shared Checkbox in a label row (DESIGN.md §4, B-10).
+
+ setAlsoSend(event.currentTarget.checked)} />
{t(key('thread.alsoSend'))}
-
+
)}
sendReply={sendReply}
onSendStart={onSendStart}
diff --git a/apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx b/apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx
index f08e8b57ced..83f1da0eb3e 100644
--- a/apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx
+++ b/apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx
@@ -24,7 +24,8 @@ export function CindyDevicePicker({
label={t('bots.devicePicker.switchDevice', { device: current.label })}
value={current.key}
truncateOptions
- className={cn('h-6 w-fit max-w-full px-2 text-11', className)}
+ size="inline"
+ className={cn('text-11', className)}
contentClassName="w-64 max-w-[var(--radix-select-content-available-width)]"
triggerAdornment={
otherUnread ? (
diff --git a/apps/desktop/src/renderer/features/bots/GroupMaskSettings.tsx b/apps/desktop/src/renderer/features/bots/GroupMaskSettings.tsx
index 615051bbf94..ecee4bb7b9f 100644
--- a/apps/desktop/src/renderer/features/bots/GroupMaskSettings.tsx
+++ b/apps/desktop/src/renderer/features/bots/GroupMaskSettings.tsx
@@ -13,7 +13,7 @@ import { Reply } from 'lucide-react';
/** A setting row whose choice sits on the right, in the group settings' row look. */
function SelectRow(props: SelectProps) {
- return } />;
+ return } />;
}
const key = (name: string) => `bots.groupChat.mask.${name}`;
diff --git a/apps/desktop/src/renderer/features/bots/TeammatesSection.tsx b/apps/desktop/src/renderer/features/bots/TeammatesSection.tsx
index baa5f9c9dd9..697bb21e4c9 100644
--- a/apps/desktop/src/renderer/features/bots/TeammatesSection.tsx
+++ b/apps/desktop/src/renderer/features/bots/TeammatesSection.tsx
@@ -28,6 +28,7 @@ import { useTranslation } from 'react-i18next';
import { cn } from '@/lib/utils';
import { useAuth } from '@/contexts/AuthContext';
import { Tip } from '@/components/ui/tooltip';
+import { Button } from '@/components/ui/button';
import { Spinner } from '@/components/ui/spinner';
import { SectionCollapse } from '@/features/cc-agent/sidebar/SectionCollapse';
import { SIDEBAR_LIST_ROW_ACTIVE_CLASS, SIDEBAR_LIST_ROW_HEIGHT_CLASS } from '@/features/cc-agent/sidebar/listRowStyle';
@@ -974,14 +975,18 @@ export function TeammatesSection() {
>
- setDeleteTarget(bot)}
- className="mr-1 flex h-7 w-7 items-center justify-center rounded-lg text-[var(--text-danger)] hover:bg-[var(--danger-bg-soft)]"
- aria-label={t('bots.lifecycle.deleteTitle')}
- >
-
-
+
+ setDeleteTarget(bot)}
+ className="mr-1 w-7 px-0"
+ aria-label={t('bots.lifecycle.deleteTitle')}
+ >
+
+
+
))
: null}
@@ -1018,14 +1023,18 @@ export function TeammatesSection() {
{botRosterLabel(bot, bots)}
- setDeleteTarget(bot)}
- className="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg text-[var(--text-danger)] opacity-0 hover:bg-[var(--danger-bg-soft)] group-hover:opacity-100 focus:opacity-100"
- aria-label={t('bots.lifecycle.deleteTitle')}
- >
-
-
+
+ setDeleteTarget(bot)}
+ className="w-7 px-0 opacity-0 group-hover:opacity-100 focus:opacity-100"
+ aria-label={t('bots.lifecycle.deleteTitle')}
+ >
+
+
+
);
})}
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx
index eb92669ab2d..6b3d5c86a92 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx
@@ -4050,7 +4050,7 @@ it('keeps copy/share in the more menu and includes folded human text in exported
const row = document.querySelector(`[data-bot-group-message-id="${id}"]`)!.querySelector('article')!;
expect(prepareShareMessageClone(row)?.textContent).toContain('final export line');
}
- expect(within(article).getByRole('checkbox').getAttribute('aria-checked')).toBe('true');
+ expect((within(article).getByRole('checkbox') as HTMLInputElement).checked).toBe(true);
expect(screen.getByRole('button', { name: 'chat.shareImage.copy' })).toBeTruthy();
fireEvent.click(screen.getByRole('button', { name: 'chat.shareImage.cancel' }));
expect(shareSelectionStore.getActiveSessionId()).toBeNull();
@@ -4960,19 +4960,19 @@ describe('thread previews and posting to the main chat', () => {
await user.click(await screen.findByRole('button', { name: 'bots.groupChat.server.startTopic' }));
const panel = await screen.findByRole('complementary');
const toggle = within(panel).getByRole('checkbox', { name: t('alsoSend') });
- expect(toggle.getAttribute('aria-checked')).toBe('false');
+ expect((toggle as HTMLInputElement).checked).toBe(false);
await user.type(within(panel).getByRole('textbox'), 'thread only{Enter}');
await waitFor(() => expect(mocks.reply).toHaveBeenCalledTimes(1));
expect(mocks.shareToMain).not.toHaveBeenCalled();
await user.click(toggle);
- expect(toggle.getAttribute('aria-checked')).toBe('true');
+ expect((toggle as HTMLInputElement).checked).toBe(true);
mocks.reply.mockResolvedValueOnce({ ok: true, messageId: 'reply-2' });
await user.type(within(panel).getByRole('textbox'), '@咪咪 both{Enter}');
await waitFor(() => expect(mocks.shareToMain).toHaveBeenCalledWith({ groupId: 'g1', messageId: 'reply-2' }));
expect(mocks.reply).toHaveBeenCalledTimes(2);
expect(mocks.reply.mock.calls[1][0]).toMatchObject({ rootId: 'u1', text: '@咪咪 both' });
// Each send starts from the default again.
- await waitFor(() => expect(toggle.getAttribute('aria-checked')).toBe('false'));
+ await waitFor(() => expect((toggle as HTMLInputElement).checked).toBe(false));
});
// Unit, topic latency reproduction: the HTTP receipt arrived seconds before
@@ -5083,7 +5083,7 @@ describe('thread previews and posting to the main chat', () => {
await user.type(within(panel).getByRole('textbox'), 'both{Enter}');
await waitFor(() => expect(mocks.reply).toHaveBeenCalledTimes(1));
expect(mocks.shareToMain).not.toHaveBeenCalled();
- expect(within(panel).getByRole('checkbox', { name: t('alsoSend') }).getAttribute('aria-checked')).toBe('true');
+ expect((within(panel).getByRole('checkbox', { name: t('alsoSend') }) as HTMLInputElement).checked).toBe(true);
await user.click(within(panel).getByRole('button', { name: 'bots.groupChat.server.sendReply' }));
await waitFor(() => expect(mocks.shareToMain).toHaveBeenCalledTimes(1));
expect(mocks.reply.mock.calls[1][0].clientId).toBe(mocks.reply.mock.calls[0][0].clientId);
@@ -5098,7 +5098,7 @@ describe('thread previews and posting to the main chat', () => {
await user.click(within(await screen.findByRole('complementary')).getByRole('checkbox', { name: t('alsoSend') }));
await user.click(second!);
await screen.findByText('Reply to u2');
- expect(within(screen.getByRole('complementary')).getByRole('checkbox', { name: t('alsoSend') }).getAttribute('aria-checked')).toBe('false');
+ expect((within(screen.getByRole('complementary')).getByRole('checkbox', { name: t('alsoSend') }) as HTMLInputElement).checked).toBe(false);
});
it('posts an existing reply, including someone else’s, from its menu', async () => {
@@ -6134,7 +6134,7 @@ it('sends a rich control only to its thread and keeps the thread draft and main-
await waitFor(() => expect(mocks.reply).toHaveBeenCalledWith(expect.objectContaining({ groupId: 'g1', rootId: 'u1', text: 'Reply from the card' })));
expect(mocks.shareToMain).not.toHaveBeenCalled();
expect(composer.value).toBe('Thread draft');
- expect(alsoSend.getAttribute('aria-checked')).toBe('true');
+ expect((alsoSend as HTMLInputElement).checked).toBe(true);
});
it.each(['archived', 'dissolved'])('disables rich answer submissions in %s group history', async state => {
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupCreateDialog.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupCreateDialog.test.tsx
index 006dc92c888..b6dff647bb4 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupCreateDialog.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupCreateDialog.test.tsx
@@ -41,8 +41,8 @@ async function renderDialog() {
return { onOpenChange, onCreated };
}
-function checkbox(name: string): HTMLButtonElement {
- return screen.getByRole('checkbox', { name: new RegExp(name) }) as HTMLButtonElement;
+function checkbox(name: string): HTMLInputElement {
+ return screen.getByRole('checkbox', { name: new RegExp(name) }) as HTMLInputElement;
}
beforeEach(() => {
@@ -135,7 +135,7 @@ describe('BotGroupCreateDialog', () => {
fireEvent.change(screen.getByRole('textbox'), { target: { value: ' 周末出游 ' } });
for (const id of ['f', 'a', 'c', 'b', 'e', 'd']) fireEvent.click(checkbox(`Bot ${id}`));
expect(checkbox('Bot g').disabled).toBe(true);
- expect(checkbox('Bot a').getAttribute('aria-checked')).toBe('true');
+ expect(checkbox('Bot a').checked).toBe(true);
fireEvent.click(screen.getByRole('button', { name: 'bots.groupChat.create.submit' }));
await waitFor(() => expect(onCreated).toHaveBeenCalledWith('g-new'));
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/ChatServerControls.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/ChatServerControls.test.tsx
index dc22d1fbe77..6122c97b3dd 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/ChatServerControls.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/ChatServerControls.test.tsx
@@ -241,7 +241,7 @@ describe('chat interaction controls', () => {
const joined = vi.fn();
render( );
await screen.findByText('Invited group');
- const toggle = screen.queryByRole('switch', { name: 'bots.groupChat.mask.joinSetup' });
+ const toggle = screen.queryByRole('checkbox', { name: 'bots.groupChat.mask.joinSetup' });
expect(!!toggle).toBe(supported);
if (toggle) fireEvent.click(toggle);
fireEvent.click(screen.getByRole('button', { name: k('accept') }));
diff --git a/apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx b/apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx
index 09199524013..5e39ed7d979 100644
--- a/apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx
@@ -3409,6 +3409,7 @@ function ExpandedView({
: ''),
confirmText: t('ccAgent.sidebar.bulkSelection.confirmDelete.confirm'),
cancelText: t('ccAgent.sidebar.bulkSelection.confirmDelete.cancel'),
+ confirmVariant: 'destructive',
});
if (!ok) return;
@@ -3998,6 +3999,7 @@ function ExpandedView({
}
confirmText={t('ccAgent.sidebar.confirmDelete.confirm')}
cancelText={t('ccAgent.sidebar.confirmDelete.cancel')}
+ confirmVariant="destructive"
onConfirm={handleConfirm}
onCancel={handleCancelConfirm}
/>
diff --git a/apps/desktop/src/renderer/features/cc-agent/GhostGrantConfirmCard.tsx b/apps/desktop/src/renderer/features/cc-agent/GhostGrantConfirmCard.tsx
index be964c05b91..1c30b820de1 100644
--- a/apps/desktop/src/renderer/features/cc-agent/GhostGrantConfirmCard.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/GhostGrantConfirmCard.tsx
@@ -24,6 +24,7 @@ import { useTranslation } from 'react-i18next';
import { cn } from '@/lib/utils';
import type { PendingGhostGrantConfirm } from '@/lib/makerChatStore';
+import { Checkbox } from '@/components/ui/checkbox';
interface GhostGrantConfirmCardProps {
pending: PendingGhostGrantConfirm;
@@ -160,11 +161,9 @@ export function GhostGrantConfirmCard({ pending, onRespond }: GhostGrantConfirmC
{pending.lane === 'attachments' ? (
- setAllowDirs(e.target.checked)}
- className="size-3.5 accent-[var(--accent-cta-bg)]"
/>
{t('ghostGrant.confirm.allowDirs')}
diff --git a/apps/desktop/src/renderer/features/cc-agent/InterruptedTasksResumeDialog.tsx b/apps/desktop/src/renderer/features/cc-agent/InterruptedTasksResumeDialog.tsx
index d4126a720ae..88bc192b6d7 100644
--- a/apps/desktop/src/renderer/features/cc-agent/InterruptedTasksResumeDialog.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/InterruptedTasksResumeDialog.tsx
@@ -14,7 +14,7 @@
* 每个窗口生命周期只弹一次;更新说明弹窗打开期间先不弹,关掉后再出现。
*/
-import { useEffect, useMemo, useRef, useState } from 'react';
+import { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useAuth } from '@/contexts/AuthContext';
@@ -30,6 +30,7 @@ import { CONTINUE_AFTER_APP_EXIT_PROMPT } from '../../../shared/interruptedTurn'
import { formatSidebarTime } from './lib/formatSidebarTime';
import { getSessionDisplayTitle } from './lib/sessionDisplayTitle';
import { buildSessionSourceLabelMap } from './lib/sessionSourceLabel';
+import { Checkbox } from '@/components/ui/checkbox';
const log = createLogger('interrupted-tasks-resume');
@@ -125,18 +126,12 @@ function TaskCheckbox({
onChange: (checked: boolean) => void;
ariaLabel?: string;
}) {
- const ref = useRef(null);
- useEffect(() => {
- if (ref.current) ref.current.indeterminate = indeterminate;
- }, [indeterminate]);
return (
- onChange(e.target.checked)}
- className="size-3.5 shrink-0 cursor-pointer accent-[var(--confirm-btn-primary-bg)]"
/>
);
}
diff --git a/apps/desktop/src/renderer/features/cc-agent/SessionBranchTreeDialog.tsx b/apps/desktop/src/renderer/features/cc-agent/SessionBranchTreeDialog.tsx
index 23bdfed29c4..d1ec4d1bd4e 100644
--- a/apps/desktop/src/renderer/features/cc-agent/SessionBranchTreeDialog.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/SessionBranchTreeDialog.tsx
@@ -13,6 +13,7 @@ import { makerChatStore } from '@/lib/makerChatStore';
import { plainTextToTiptapDoc, saveDraft } from '@/lib/composerDraftStore';
import { resolveSessionRoute } from '@/lib/orcaSessionIdentity';
import { Spinner } from '@/components/ui/spinner';
+import { Checkbox } from '@/components/ui/checkbox';
interface Props {
open: boolean;
@@ -267,12 +268,10 @@ export function SessionBranchTreeDialog({
{session.agentKind === 'pi' && (
- setSummarize(event.target.checked)}
disabled={switchingId !== null}
- className="accent-[var(--accent-cta-bg-pure)]"
/>
{t('ccAgent.sidebar.sessionBranches.summarize')}
diff --git a/apps/desktop/src/renderer/features/cc-agent/SessionContentHeader.tsx b/apps/desktop/src/renderer/features/cc-agent/SessionContentHeader.tsx
index c860e6dbf13..b578d78b712 100644
--- a/apps/desktop/src/renderer/features/cc-agent/SessionContentHeader.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/SessionContentHeader.tsx
@@ -516,6 +516,7 @@ export function SessionContentHeader({
(dirtyWorktree ? ' ' + t('ccAgent.sidebar.confirmDelete.dirtyWorktreeWarning') : ''),
confirmText: t('ccAgent.sidebar.confirmDelete.confirm'),
cancelText: t('ccAgent.sidebar.confirmDelete.cancel'),
+ confirmVariant: 'destructive',
});
if (!ok) return;
const visibleSessionIds = getVisibleSidebarSessionIds();
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/MachineSwitcherMenu.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/MachineSwitcherMenu.tsx
index 949eb33674c..19bb595d75c 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/MachineSwitcherMenu.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/MachineSwitcherMenu.tsx
@@ -65,6 +65,7 @@ import { toast } from '@/lib/toast';
import { useActiveMainView } from '@/hooks/useActiveMainView';
import {
DropdownMenu,
+ DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
@@ -333,10 +334,14 @@ function MachineMenuItem({
// 因 isTrusted=false 不会覆盖。onSelect 消费后立即复位。
const modifierHeldRef = useRef(false);
return (
-
{
@@ -447,6 +452,6 @@ function MachineMenuItem({
)}
-
+
);
}
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/NewProjectFromTaskDialog.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/NewProjectFromTaskDialog.tsx
index 044790a2c4a..2ff560494c3 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/NewProjectFromTaskDialog.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/NewProjectFromTaskDialog.tsx
@@ -13,6 +13,7 @@ import type {
CreateProjectFromTaskResult,
PreparedProjectFromTask,
} from '../../../../shared/projectsRoot';
+import { Checkbox } from '@/components/ui/checkbox';
type NameError = 'nameTaken' | 'nameInvalid' | null;
@@ -199,9 +200,7 @@ export function NewProjectFromTaskDialog({
{showRemember && (
- setRemember(event.target.checked)}
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionShareExportDialog.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionShareExportDialog.tsx
index 26e00ac1276..4e122f01780 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionShareExportDialog.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionShareExportDialog.tsx
@@ -22,6 +22,7 @@ import { Tip } from '@/components/ui/tooltip';
import { toast } from '@/lib/toast';
import { createLogger } from '@/lib/logger';
import { extractIpcError } from '@/utils/ipcError';
+import { Checkbox } from '@/components/ui/checkbox';
const log = createLogger('SessionShareExportDialog');
@@ -160,12 +161,11 @@ export function SessionShareExportDialog({
)}
- setEncrypt(e.target.checked)}
disabled={exporting}
- className="mt-0.5 accent-[var(--confirm-btn-primary-bg)]"
+ className="mt-0.5"
/>
{t('sessionShare.export.encryptLabel')}
diff --git a/apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseSidebar.tsx b/apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseSidebar.tsx
index 6e208c89105..a1f996b96b2 100644
--- a/apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseSidebar.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseSidebar.tsx
@@ -454,6 +454,7 @@ export function WorkdirBrowseSidebar({
description: t('ccAgent.workdirBrowse.deleteFile.description', { name: entry.name }),
confirmText: t('ccAgent.workdirBrowse.deleteFile.confirm'),
cancelText: t('ccAgent.workdirBrowse.deleteFile.cancel'),
+ confirmVariant: 'destructive',
});
if (!ok) return;
const res = await fileBrowserApiFor(deviceId).deleteEntry({
diff --git a/apps/desktop/src/renderer/features/provider-group/ProviderGroupAddDialog.tsx b/apps/desktop/src/renderer/features/provider-group/ProviderGroupAddDialog.tsx
index 33bb29189a0..6a5579eb0b1 100644
--- a/apps/desktop/src/renderer/features/provider-group/ProviderGroupAddDialog.tsx
+++ b/apps/desktop/src/renderer/features/provider-group/ProviderGroupAddDialog.tsx
@@ -5,7 +5,7 @@
* 别人分享给你的,与模型列表里的远程供应商同一个来源,勾选即可加入,不需要再申请;
* - 「分享链接」:在组所在电脑走现有申请流程;远程管理时引导去那台电脑申请,避免在查看端领用。
*/
-import { Check } from 'lucide-react';
+
import { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -32,6 +32,7 @@ import {
type ProviderGroupMember,
} from '../../../shared/providerGroup';
import { groupProviderGroupItems } from './providerGroupPresentation';
+import { Checkbox } from '@/components/ui/checkbox';
type Tab = 'available' | 'link';
@@ -291,17 +292,9 @@ function CandidateRow({
const lines = [...detail, member ? t('providerGroup.add.alreadyMember') : null].filter(Boolean);
const content = (
<>
-
- {checked && }
+ {/* Shared Checkbox (DESIGN.md §4, B-10) in a 20px slot that aligns nested rows. */}
+
+
{title}
@@ -312,17 +305,11 @@ function CandidateRow({
>
);
return (
-
>
) : content}
-
+
);
}
diff --git a/apps/desktop/src/renderer/features/provider-group/__tests__/ProviderGroupSection.test.tsx b/apps/desktop/src/renderer/features/provider-group/__tests__/ProviderGroupSection.test.tsx
index 7063e2fd837..6ca0f893f98 100644
--- a/apps/desktop/src/renderer/features/provider-group/__tests__/ProviderGroupSection.test.tsx
+++ b/apps/desktop/src/renderer/features/provider-group/__tests__/ProviderGroupSection.test.tsx
@@ -180,7 +180,7 @@ describe('ProviderGroupSection', () => {
const candidates = await within(dialog).findAllByTestId('provider-group-candidate');
expect(candidates).toHaveLength(2);
// 已在组里的不能再勾选。
- expect((candidates[1] as HTMLButtonElement).disabled).toBe(true);
+ expect((within(candidates[1]).getByRole('checkbox') as HTMLInputElement).disabled).toBe(true);
fireEvent.click(candidates[0]);
fireEvent.click(within(dialog).getByRole('button', { name: 'providerGroup.add.confirm' }));
await waitFor(() => expect(command).toHaveBeenCalledWith(expect.objectContaining({ action: 'save-if-current', expectedConfig: null })));
diff --git a/apps/desktop/src/renderer/features/provider-share/RemoteAgentLimitsSection.tsx b/apps/desktop/src/renderer/features/provider-share/RemoteAgentLimitsSection.tsx
index cf9e0bc35ff..1e722c4f8ee 100644
--- a/apps/desktop/src/renderer/features/provider-share/RemoteAgentLimitsSection.tsx
+++ b/apps/desktop/src/renderer/features/provider-share/RemoteAgentLimitsSection.tsx
@@ -15,6 +15,7 @@ import {
} from '../../../shared/remoteAgentLimits';
import { providerManagementErrorKey, providerShareManagementCommand } from '../provider-group/providerManagement';
import { SETTINGS_SECTION_TITLE_CLASS } from '@/components/ui/settings-rows';
+import { ResetGroupButton } from '@/components/ui/reset-buttons';
type LimitKey = 'perDevice' | 'total' | 'idleMinutes';
@@ -136,7 +137,8 @@ export function RemoteAgentLimitsSection({ deviceId }: { deviceId?: string }) {
{t('providerShare.runLimits.applyHint')}
{t('providerShare.runLimits.save')}
- void save(true)}>{t('providerShare.runLimits.reset')}
+ void save(true)}
+ label={t('providerShare.runLimits.reset')} />
)}
diff --git a/apps/desktop/src/renderer/features/scheduler/components/RunHistoryPane.tsx b/apps/desktop/src/renderer/features/scheduler/components/RunHistoryPane.tsx
index 8ad790d7740..5f846a0aa64 100644
--- a/apps/desktop/src/renderer/features/scheduler/components/RunHistoryPane.tsx
+++ b/apps/desktop/src/renderer/features/scheduler/components/RunHistoryPane.tsx
@@ -164,6 +164,7 @@ export function RunHistoryPane({
description: t('scheduler.confirm.deleteRun.description'),
confirmText: t('scheduler.confirm.deleteRun.confirm'),
cancelText: t('scheduler.confirm.deleteRun.cancel'),
+ confirmVariant: 'destructive',
});
if (!ok) return;
try {
diff --git a/apps/desktop/src/renderer/features/scheduler/components/ScheduleChips.tsx b/apps/desktop/src/renderer/features/scheduler/components/ScheduleChips.tsx
index e07512ff8fd..b617e9074e0 100644
--- a/apps/desktop/src/renderer/features/scheduler/components/ScheduleChips.tsx
+++ b/apps/desktop/src/renderer/features/scheduler/components/ScheduleChips.tsx
@@ -646,7 +646,7 @@ function IntervalMinutesInput({
if (open) onFocus();
}}
onValueChange={(next) => onChange(Number(next))}
- className="w-[88px] px-2 text-center text-13"
+ width="xs"
/>
);
}
diff --git a/apps/desktop/src/renderer/features/setup-migration/SetupMigrationDialog.tsx b/apps/desktop/src/renderer/features/setup-migration/SetupMigrationDialog.tsx
index de7a3c99595..88816842651 100644
--- a/apps/desktop/src/renderer/features/setup-migration/SetupMigrationDialog.tsx
+++ b/apps/desktop/src/renderer/features/setup-migration/SetupMigrationDialog.tsx
@@ -45,6 +45,7 @@ import {
notifySetupMigrationStateChanged,
useSetupMigrationDialog,
} from './setupMigrationStore';
+import { Checkbox } from '@/components/ui/checkbox';
type Phase = 'source' | 'reading' | 'review' | 'permissions' | 'running' | 'done';
type ItemPhase = 'pending' | 'running' | SetupMigrationResult['outcome'];
@@ -83,19 +84,13 @@ function SelectionCheckbox({
onChange: (checked: boolean) => void;
ariaLabel?: string;
}) {
- const ref = useRef(null);
- useEffect(() => {
- if (ref.current) ref.current.indeterminate = indeterminate;
- }, [indeterminate]);
return (
- onChange(event.target.checked)}
- className="size-3.5 shrink-0 cursor-pointer accent-[var(--confirm-btn-primary-bg)] disabled:cursor-default"
/>
);
}
diff --git a/apps/desktop/src/renderer/features/skillhub/PublishDialog.tsx b/apps/desktop/src/renderer/features/skillhub/PublishDialog.tsx
index 7a8f6807a41..53667f9eec5 100644
--- a/apps/desktop/src/renderer/features/skillhub/PublishDialog.tsx
+++ b/apps/desktop/src/renderer/features/skillhub/PublishDialog.tsx
@@ -19,8 +19,7 @@ import { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'r
import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import * as Dialog from '@radix-ui/react-dialog';
-import { SelectParts as Select } from '@/components/ui/select';
-import { X, CloudUpload, Globe, Users, Lock, RefreshCw, CircleAlert, Check, ChevronDown, ChevronUp } from 'lucide-react';
+import { X, CloudUpload, Globe, Users, Lock, RefreshCw, CircleAlert } from 'lucide-react';
import { cn } from '@/lib/utils';
import { toast } from '@/lib/toast';
@@ -316,86 +315,6 @@ function TextareaInput({
);
}
-export function SelectInput({
- value,
- onChange,
- disabled,
- options,
- placeholder,
-}: {
- value: string;
- onChange: (v: string) => void;
- disabled?: boolean;
- options: Array<{ value: string; label: string; disabled?: boolean }>;
- placeholder?: string;
-}) {
- // Radix Select:表单内下拉的业界标准实现。相比手搓 Popover,它 portal 到 body
- // 逃出弹窗 transform(-translate)造成的裁剪,且自带在 modal 弹窗里可用的滚动视口
- // (滚轮 + 上下滚动按钮 + 键盘导航),不受 Dialog 滚动锁影响。
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {options.map((option) => (
-
-
-
-
-
-
- {option.label}
-
- ))}
-
-
-
-
-
-
-
- );
-}
-
// ── Visibility radio card ─────────────────────────────────────────────────────
export function VisibilityCard({
diff --git a/apps/desktop/src/renderer/features/skillhub/hooks/useMarketManagement.tsx b/apps/desktop/src/renderer/features/skillhub/hooks/useMarketManagement.tsx
index b9d6cdb1288..6ef5605835b 100644
--- a/apps/desktop/src/renderer/features/skillhub/hooks/useMarketManagement.tsx
+++ b/apps/desktop/src/renderer/features/skillhub/hooks/useMarketManagement.tsx
@@ -49,6 +49,7 @@ export function useMarketManagement(options: {
description: t('skillhub.marketConfirm.deleteDesc', { name: skillName }),
confirmText: t('skillhub.marketConfirm.deleteConfirm'),
cancelText: t('skillhub.publishDialog.cancel'),
+ confirmVariant: 'destructive',
});
if (!ok) return;
diff --git a/apps/desktop/src/renderer/i18n/locales/de/common.json b/apps/desktop/src/renderer/i18n/locales/de/common.json
index 0cba3f499fc..d310210e9a5 100644
--- a/apps/desktop/src/renderer/i18n/locales/de/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/de/common.json
@@ -3408,6 +3408,7 @@
"description": "Sitzungen aus anderen KI-Programmierwerkzeugen in Cindy übernehmen und weiterarbeiten. Cindy liest die Originale nur und verändert sie nicht.",
"rescan": "Erneut suchen",
"allSources": "Alle Quellen",
+ "sourceFilterAria": "Quelle",
"search": "Sitzungen oder Ordner suchen",
"projectFilter": "Nur {{name}}",
"clearProjectFilter": "Alle Projekte anzeigen",
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index e32e4c8bbc4..ac0b182eb9b 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -3408,6 +3408,7 @@
"description": "Bring sessions from other AI coding tools into Cindy and keep working. Cindy only reads the originals and never changes them.",
"rescan": "Scan Again",
"allSources": "All Sources",
+ "sourceFilterAria": "Source",
"search": "Search sessions or folders",
"projectFilter": "Only {{name}}",
"clearProjectFilter": "Show all projects",
diff --git a/apps/desktop/src/renderer/i18n/locales/es/common.json b/apps/desktop/src/renderer/i18n/locales/es/common.json
index 343d877c474..8258beae777 100644
--- a/apps/desktop/src/renderer/i18n/locales/es/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/es/common.json
@@ -3446,6 +3446,7 @@
"description": "Trae sesiones de otras herramientas de programación con IA a Cindy y sigue trabajando. Cindy solo lee los originales y nunca los modifica.",
"rescan": "Buscar de nuevo",
"allSources": "Todos los orígenes",
+ "sourceFilterAria": "Origen",
"search": "Buscar sesiones o carpetas",
"projectFilter": "Solo {{name}}",
"clearProjectFilter": "Mostrar todos los proyectos",
diff --git a/apps/desktop/src/renderer/i18n/locales/fr/common.json b/apps/desktop/src/renderer/i18n/locales/fr/common.json
index fcfcbad470f..3ea70334968 100644
--- a/apps/desktop/src/renderer/i18n/locales/fr/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/fr/common.json
@@ -3446,6 +3446,7 @@
"description": "Importez dans Cindy des sessions provenant d’autres outils de programmation avec IA et poursuivez votre travail. Cindy lit les originaux sans jamais les modifier.",
"rescan": "Rechercher à nouveau",
"allSources": "Toutes les sources",
+ "sourceFilterAria": "Source",
"search": "Rechercher des sessions ou des dossiers",
"projectFilter": "{{name}} uniquement",
"clearProjectFilter": "Afficher tous les projets",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index fd6f367ea76..acfc724dfcb 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -3378,6 +3378,7 @@
"description": "ほかの AI コーディングツールのセッションを Cindy に取り込んで、そのまま続けられます。元の記録は読み取るだけで、変更しません。",
"rescan": "再スキャン",
"allSources": "すべてのソース",
+ "sourceFilterAria": "ソース",
"search": "セッションまたはフォルダを検索",
"projectFilter": "{{name}} のみ",
"clearProjectFilter": "すべてのプロジェクトを表示",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 62c4fb7d732..0598181af9f 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -3378,6 +3378,7 @@
"description": "다른 AI 코딩 도구의 세션을 Cindy로 가져와 이어서 작업하세요. 원본 기록은 읽기만 하고 변경하지 않습니다.",
"rescan": "다시 스캔",
"allSources": "모든 출처",
+ "sourceFilterAria": "출처",
"search": "세션 또는 폴더 검색",
"projectFilter": "{{name}}만 보기",
"clearProjectFilter": "모든 프로젝트 보기",
diff --git a/apps/desktop/src/renderer/i18n/locales/pt-BR/common.json b/apps/desktop/src/renderer/i18n/locales/pt-BR/common.json
index 67624c8cd9a..1f7c7fbc671 100644
--- a/apps/desktop/src/renderer/i18n/locales/pt-BR/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/pt-BR/common.json
@@ -3446,6 +3446,7 @@
"description": "Traga sessões de outras ferramentas de programação com IA para o Cindy e continue trabalhando. O Cindy apenas lê os originais e nunca os altera.",
"rescan": "Buscar novamente",
"allSources": "Todas as origens",
+ "sourceFilterAria": "Origem",
"search": "Buscar sessões ou pastas",
"projectFilter": "Somente {{name}}",
"clearProjectFilter": "Mostrar todos os projetos",
diff --git a/apps/desktop/src/renderer/i18n/locales/pt-PT/common.json b/apps/desktop/src/renderer/i18n/locales/pt-PT/common.json
index e5ec7ad14bb..cbc25e932d2 100644
--- a/apps/desktop/src/renderer/i18n/locales/pt-PT/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/pt-PT/common.json
@@ -3446,6 +3446,7 @@
"description": "Traga sessões de outras ferramentas de programação com IA para o Cindy e continue a trabalhar. O Cindy apenas lê os originais e nunca os altera.",
"rescan": "Procurar novamente",
"allSources": "Todas as origens",
+ "sourceFilterAria": "Origem",
"search": "Procurar sessões ou pastas",
"projectFilter": "Apenas {{name}}",
"clearProjectFilter": "Mostrar todos os projetos",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 740c5ba5337..e225959169a 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -3378,6 +3378,7 @@
"description": "把其他 AI 编程工具里的任务接到 Cindy 接着做。只读取原记录,不会改动它们。",
"rescan": "重新扫描",
"allSources": "全部来源",
+ "sourceFilterAria": "来源",
"search": "搜索任务或文件夹",
"projectFilter": "只看 {{name}}",
"clearProjectFilter": "显示全部项目",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-Hans-x-lzh/common.json b/apps/desktop/src/renderer/i18n/locales/zh-Hans-x-lzh/common.json
index 489b2c25a55..9e64915f65f 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-Hans-x-lzh/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-Hans-x-lzh/common.json
@@ -3378,6 +3378,7 @@
"description": "将他家 AI 编程工具之差事接入 Cindy,续而为之。唯读原始记录,不改分毫。",
"rescan": "再察",
"allSources": "诸源",
+ "sourceFilterAria": "源",
"search": "寻差事或卷匣",
"projectFilter": "唯览 {{name}}",
"clearProjectFilter": "示诸案",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-Hant-x-lzh/common.json b/apps/desktop/src/renderer/i18n/locales/zh-Hant-x-lzh/common.json
index a4b588f0d66..3fd4d7a4b8a 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-Hant-x-lzh/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-Hant-x-lzh/common.json
@@ -3378,6 +3378,7 @@
"description": "將他家 AI 程式設計工具之差事接入 Cindy,續而為之。唯讀原始記錄,不改分毫。",
"rescan": "再察",
"allSources": "諸源",
+ "sourceFilterAria": "源",
"search": "尋差事或卷匣",
"projectFilter": "唯覽 {{name}}",
"clearProjectFilter": "示諸案",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
index 0b4c4290e6b..ceb4c0e0893 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
@@ -3378,6 +3378,7 @@
"description": "把其他 AI 程式設計工具裡的任務接到 Cindy 接著做。只讀取原始記錄,不會改動它們。",
"rescan": "重新掃描",
"allSources": "全部來源",
+ "sourceFilterAria": "來源",
"search": "搜尋任務或資料夾",
"projectFilter": "只看 {{name}}",
"clearProjectFilter": "顯示全部專案",
diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.md
index 10e05d8d7c2..69d66317a4f 100644
--- a/docs/design-rules/DESIGN.md
+++ b/docs/design-rules/DESIGN.md
@@ -470,10 +470,10 @@ Desktop Settings sections put the 16px/500 section title outside the card. A car
Owner decisions, 2026-11-08. They apply to every Settings page, drawer and settings dialog.
-- **Switch or Checkbox.** A setting that takes effect immediately uses `Switch`. An option inside a form, draft or batch selection that only takes effect on Save or Confirm uses `Checkbox` (`components/ui/checkbox.tsx`: native input, 16px, `--text-primary` accent, focus ring, disabled state, `indeterminate` for partial selection). Do not put a Switch inside a Save-gated form, and do not use a Checkbox for an instant setting. Outside Settings too, a checkbox is the shared `Checkbox` inside a `label` row, not a hand-drawn box (owner decision B-10, 2026-11-11); keep `indeterminate` for partial selection. Remaining hand-drawn boxes migrate when touched.
-- **Select size.** Single-value fields use the shared `Select`; menus are for actions only, and a DropdownMenu radio group is not a field. Trigger height is 36px by default (`size` default) or 32px (`size="compact"`) in narrow drawers and dense lists; widths are 220px (`width="sm"`), 320px (`width="md"`) or full width for stacked fields (`width="full"`). **Narrow width (owner decision C-12, 2026-11-11):** a short value paired inline with another control in the same row (concurrency limit, weight, the Classical Chinese script next to its style) uses 120px (`width="xs"`). No other trigger heights or ad-hoc widths: set height with `size` and width with `width`, never with `className`.
-- **Restore default.** A single setting shows the "customized" badge and a 28px pill icon button with a `Tip` (`DefaultOverrideControls`), always to the left of its control and only while the value differs from the default. A page or group reset is a `Button` `variant="secondary"` `size="sm"` with an icon and text, on the right of the page or section title.
-- **Destructive actions.** Irreversible actions (clear memories or caches, delete, remove an account, dissolve a group) use the danger treatment: `Button` `tone="danger"`, with `danger-solid` reserved for the final confirm button of a confirmation dialog — the shared ConfirmDialog (`confirmVariant="destructive"`) or a hand-built dialog with the same cancel + confirm structure. Hand-built confirmations should migrate to ConfirmDialog first; where they stay hand-built, write the button as `variant="primary" tone="danger-solid"` like ConfirmDialog. Buttons outside a confirmation step use `tone="danger"`, never `danger-solid`. Reversible actions such as Disconnect stay secondary. Destructive rows in a menu always use `variant="danger"`.
+- **Switch or Checkbox.** A setting that takes effect immediately uses `Switch`. An option inside a form, draft or batch selection that only takes effect on Save or Confirm uses `Checkbox` (`components/ui/checkbox.tsx`: native input, 16px, `--text-primary` accent, focus ring, disabled state, `indeterminate` for partial selection). Do not put a Switch inside a Save-gated form, and do not use a Checkbox for an instant setting. Outside Settings too, a checkbox is the shared `Checkbox` inside a `label` row, not a hand-drawn box (owner decision B-10, 2026-11-11); keep `indeterminate` for partial selection. Remaining hand-drawn boxes migrate when touched. Hand-drawn round selection marks (message share selection, sidebar navigation customize, provider group candidates, group member picker, thread "also send") are checkboxes too and use the shared `Checkbox`; its checked colour is `--text-primary` and its size 16px wherever it replaces a CTA-coloured or 14px box (owner decision, 2026-11-23). The login consent control keeps its own registered screen-reader design (§16). A checked mark inside a menu is not a checkbox: use `DropdownMenuCheckboxItem` (Select & Dropdown below).
+- **Select size.** Single-value fields use the shared `Select`; menus are for actions only, and a DropdownMenu radio group is not a field. Trigger height is 36px by default (`size` default) or 32px (`size="compact"`) in narrow drawers and dense lists; widths are 220px (`width="sm"`), 320px (`width="md"`) or full width for stacked fields (`width="full"`). **Narrow width (owner decision C-12, 2026-11-11):** a short value paired inline with another control in the same row (concurrency limit, weight, the Classical Chinese script next to its style) uses 120px (`width="xs"`). **Inline size (owner decision, 2026-11-23):** a value that sits inside a line of text — plugin UI contribution slots, the provider run-location line, the Cindy device picker — uses `size="inline"`: 24px tall, no frame or fill at rest, the surrounding text colour, 6px horizontal padding, a 12px chevron, and the secondary hover/pressed fill and focus ring; it fits its value, and the caller may only cap it with `max-w-*` so long values truncate; its list fits the options instead of matching the trigger (at least the trigger width, at most 18rem). No other trigger heights or ad-hoc widths: set height with `size` and width with `width`, never with `className`. Options that need a second line use the option `description` (12px `--text-secondary` under the label in the list; the trigger shows the label only) instead of a hand-built `SelectParts` list.
+- **Restore default.** A single setting shows the "customized" badge and a 28px pill icon button with a `Tip` (`DefaultOverrideControls`), always to the left of its control and only while the value differs from the default; the icon button alone is `RestoreDefaultButton` (`components/ui/reset-buttons.tsx`) for rows that carry their own customized cue, such as keyboard shortcuts. A page or group reset is `ResetGroupButton` from the same file — `Button` `variant="secondary"` `size="sm"` `compact` with the 14px `RotateCcw` icon and text, an optional `tip` for what is reset, and `loading` — on the right of the page or section title, or in the footer of the form it resets. Not a quiet text button, not a link. Exceptions (owner decision #10, 2026-11-23): the underlined text link inside the composer model flyout stays because the flyout has no room; a "Restore default" option inside a Select's own list and the irreversible usage reset (`tone="danger"`) are not restore-default buttons.
+- **Destructive actions.** Irreversible actions (clear memories or caches, delete, remove an account, dissolve a group) use the danger treatment: `Button` `tone="danger"`, with `danger-solid` reserved for the final confirm button of a confirmation dialog — the shared ConfirmDialog (`confirmVariant="destructive"`) or a hand-built dialog with the same cancel + confirm structure. Hand-built confirmations should migrate to ConfirmDialog first; where they stay hand-built, write the button as `variant="primary" tone="danger-solid"` like ConfirmDialog. Buttons outside a confirmation step use `tone="danger"`, never `danger-solid`. Reversible actions such as Disconnect stay secondary. Unbinding follows what it actually does (2026-11-23): an unbind that deletes local credentials or unfinished work (personal WeChat) is destructive; one that only removes this computer's binding and can be redone (Feishu, Telegram, X, a Slack workspace, a plugin library location) stays default. Destructive rows in a menu always use `variant="danger"`.
- **Same setting, same control.** When one setting appears in two places (for example the provider account strategy), both use the same control with the same option order. Known exception (owner decision, 2026-11-09): the group reply and speaking modes stay a segmented control in local groups and a Select in server-backed groups for now.
### Device access pills
@@ -677,6 +677,7 @@ Question navigation, close/skip, validation, voice finalization and approval sem
- **Trigger**: same as a single-line input — pill (9999px), Card bg, 1px Board border, carrying the current value + a chevron.
- **Panel**: a container — 12px radius, 1px Board border; padding depends on the panel type. Select listbox panels use 6–8px padding, the Card bg (`--surface-elevated`) and the soft, downward `--shadow-menu` elevation in both modes, like the menu panels below (owner decision, 2026-10-18; supersedes their former no-shadow rule and does not authorize shadows on in-page controls). Existing local panel-color aliases remain compatible.
- **Menu and popover panels** (shared defaults in `components/ui/dropdown-menu.tsx` / `popover.tsx`): 12px radius and the registered floating-layer shadow `--shadow-menu` (a §6 token-gated exception) written as `shadow-[shadow:var(--shadow-menu)]` — the untyped `shadow-[var(--shadow-menu)]` is a Tailwind shadow *colour* and renders no shadow. `DropdownMenuContent` / `DropdownMenuSubContent` use `p-1`, `bg-[var(--cmd-palette-bg)]`, `border-[var(--cmd-palette-border)]` and `text-[var(--cmd-palette-item-text)]`; under Cindy themes that surface is glass (`--surface-translucent-overlay` + `blur(6px)`, globals.css), and on Windows (`html[data-platform='win32']`) every `--cmd-palette-bg` surface is opaque with no `backdrop-filter` (§15.12). `PopoverContent` stays opaque `bg-popover`. `DropdownMenuSeparator` uses `--cmd-palette-border`. Row highlights use the 8px inner tier.
+- **Menu checkmarks** (`components/ui/dropdown-menu.tsx`): a row whose check marks membership in a set is `DropdownMenuCheckboxItem` (menuitemcheckbox + `aria-checked`), never a plain item with a hand-drawn ✓. The default shared leading check column applies; a menu with an approved trailing selection slot passes `indicator="none"` and keeps drawing its own mark there — currently only the sidebar machine switcher, whose row click still selects only that computer and whose trailing box toggles multi-select (owner decisions 2026-07 / 2026-08-13).
- **Menu text** (`components/ui/dropdown-menu.tsx`): option rows (Item / CheckboxItem / RadioItem / SubTrigger) are `text-14` / `leading-[1.43]` (32px row with `py-1.5`) on `--cmd-palette-item-text`; shortcuts `text-12` / `leading-[1.33]` / 400 on `--cmd-palette-item-meta`; group labels `text-12` / 500 on `--cmd-palette-item-meta`; destructive rows `variant="danger"` on `--error-fg`; disabled rows 50% opacity. The text colour is the same at rest and on hover. The highlighted (`data-menu-active` / `data-[highlighted]`), checked or open row is 500 (§3 ladder) and its default-stroke Lucide icons go 1.5 → 2, on `--motion-instant` / `--motion-ease-out` (instant under reduced motion). Width never moves: row text and `truncate` spans reserve the 500 width with an invisible zero-height `::after` copy (`content: attr(data-menu-label) / ""`, so `textContent`, typeahead and the accessible name are unchanged), and the shared panels lock their laid-out width (`lockMenuWidth`, re-measured on content, window, image or font changes). A caller's own text colour, weight or inline width wins.
- **Menu hover highlight** (`components/ui/dropdown-menu-highlight.ts`): one `--sidebar-item-hover` surface (8px) per `DropdownMenuContent` / `DropdownMenuSubContent` glides between rows with `transform`; the row nearest the pointer anywhere in the panel wins, and separators do not interrupt the glide. Entering fades in from the checked row (or the target), leaving fades out; keyboard follows Radix's highlighted item, and an open SubTrigger stays highlighted while its submenu is in use. Motion: `transform` / `opacity` on `--motion-instant` / `--motion-ease-out` (fade-out `--motion-ease-in`), size snaps, no slide under reduced motion. Danger rows use the same grey layer. Rows whose caller sets its own `focus:` / `hover:` / `data-[highlighted]:` / `data-[state=open]:` background keep it and get no layer; `hoverHighlight={false}` restores per-row fills. Sidebar menus (`features/cc-agent/sidebar/menuStyles.ts`: `MENU_ITEM_CLASS` / `MENU_ROW_CLASS` = `h-8 gap-2`, triggers `cursor-pointer`) use the same highlight.
- **Form-field Select panel width must bind to the trigger width** — never narrower or wider than the control that opened it, except for the explicitly scoped device-navigation treatment below. Radix Select: `position="popper"` + `width: var(--radix-select-trigger-width)`; other primitives measure the trigger. Ordinary form fields retain this equal-width invariant.
diff --git a/docs/design-rules/design-decision-log.md b/docs/design-rules/design-decision-log.md
index 8035759910c..239c644f721 100644
--- a/docs/design-rules/design-decision-log.md
+++ b/docs/design-rules/design-decision-log.md
@@ -1237,3 +1237,15 @@ Toast 仍在它之上:Toast 不拦截操作、只占角落,盖住阻断提
明确不包含:Codex(ChatGPT)凭证失效提示可以选「稍后」,不属于阻断提示。主进程发起的授权请求(插件确认、插件安装授权、本机 Agent 确认等)同样会被 `modal-raised` 面板压住,被压住时等到超时按拒绝处理;要不要让它们盖过用户正在用的弹窗,另行决定。
现行规则见 `DESIGN.md` §6 层级刻度。落点:`packages/design-tokens`(`z-modal-blocking`)、`confirm-dialog-provider.tsx`、`AuthContext.tsx`;测试 `confirmDialogBlocking.test.tsx`、`modalBlockingLayer.guard.test.ts`。
+
+## 2026-11-23 · 控件用法回到已有规则:危险操作、选框、下拉尺寸、恢复默认(主人裁决,组件库盘点 PR A)
+
+组件库盘点发现四类控件大多是没跟上已有规则,不是缺规则。主人 2026-11-23 定:盘点里「需要主人定的事」全部按建议。本条记下其中落到现行规则的部分。
+
+- **#6 选框**:手画方框和手画圆形选择圈换成共享 `Checkbox` 后,选中色从 CTA 色或专用色变成文字色,14px 变 16px,接受(B-10 已定 Checkbox 是唯一样式)。登录同意框有专门的读屏设计,保留。菜单里的打勾不算选框,走 `DropdownMenuCheckboxItem`;侧栏机器切换菜单保留已批准的右侧勾选位(`indicator="none"`)。
+- **#7 行内下拉**:给 `Select` 加 `size="inline"`(24px、无边框、跟随文字颜色),用于插件 UI 贡献位、运行位置行、伙伴设备选择;没有选强制 32px,因为这几处嵌在一行文字里,32px 会撑高整行。
+- **#10 恢复默认**:设置页内的页面/分组级恢复默认统一成 `ResetGroupButton`(secondary sm + 图标 + 文字);输入框浮层里的下划线文字链接保留(空间小),下拉列表里的「恢复默认」选项和不可恢复的用量清零不算恢复默认按钮。
+- **#11 清理源码**:Cindy Make「清理源码」的 `clear-source` 会删除 Cindy 管理的源码目录、它的 worktree 和尚未打包的修改(`main/cindy-make/sourcePreparation.ts`),属于不可恢复操作,按钮用 `tone="danger"`,不换成还原图标。
+- **解绑**:按实际效果判断。个人微信解绑会删除本机凭证并清理未完成的执行,确认按钮标红;飞书、Telegram、X、Slack workspace 解绑只解除这台电脑的绑定、可以重新绑定,插件作品库「解除自定义位置」不删数据,保持默认。
+
+现行规则见 `DESIGN.md` §4 Desktop settings controls、§4 Select & Dropdown。