Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): 发布前 UI 打磨——会话导入批量选择与全局超长文本溢出修复 (#360)

Chris Zhang6a72dd18ac34
diff --git a/apps/desktop/src/renderer/__tests__/sessionImportAutoScan.test.ts b/apps/desktop/src/renderer/__tests__/sessionImportAutoScan.test.ts
index e9cbd65ab6..07086ed4f8 100644
--- a/apps/desktop/src/renderer/__tests__/sessionImportAutoScan.test.ts
+++ b/apps/desktop/src/renderer/__tests__/sessionImportAutoScan.test.ts
@@ -59,6 +59,25 @@ describe('SessionImportSection initial scan', () => {
expect(source).toContain('return basename(item.projectDir) || item.projectDir;');
});
+ it('offers a select-all control scoped to the visible (filtered) candidates', () => {
+ expect(source).toMatch(
+ /const toggleAllVisible = useCallback\(\(\) => \{[\s\S]*for \(const item of visibleCandidates\)/,
+ );
+ expect(source).toContain(
+ "{t('settings.sessionImport.selectAll', { count: visibleCandidates.length })}",
+ );
+ expect(source).toMatch(
+ /checked=\{visibleCandidates\.length > 0 && visibleSelectedCount === visibleCandidates\.length\}/,
+ );
+ });
+
+ it('surfaces selections hidden by the current filters next to the import button', () => {
+ expect(source).toContain('const hiddenSelectedCount = selectedItems.length - visibleSelectedCount;');
+ expect(source).toMatch(
+ /\{hiddenSelectedCount > 0 && \([\s\S]*selectedOutsideFilter[\s\S]*count: hiddenSelectedCount/,
+ );
+ });
+
it('uses the sidebar time formatter for project and session-row timestamps', () => {
expect(source).toContain(
"import { formatSidebarTime, formatSidebarTimeAbsolute } from '@/features/cc-agent/lib/formatSidebarTime';",
diff --git a/apps/desktop/src/renderer/cindy-brain/GhostPermissionList.tsx b/apps/desktop/src/renderer/cindy-brain/GhostPermissionList.tsx
index 275b9198c6..1e1bf85046 100644
--- a/apps/desktop/src/renderer/cindy-brain/GhostPermissionList.tsx
+++ b/apps/desktop/src/renderer/cindy-brain/GhostPermissionList.tsx
@@ -85,7 +85,9 @@ function PermRow({ item, badge }: { item: GhostPermissionItem; badge?: 'added' |
<div className="min-w-0 flex-1">
<div
className={cn(
- 'text-13 leading-[1.5] text-[var(--confirm-desc)]',
+ // labelArgs 含作者可控 token(域名/工具名等无空格长串),同 hostDetail
+ // 一样必须可断行,否则顶破固定宽度的安装确认弹窗。
+ 'break-words text-13 leading-[1.5] text-[var(--confirm-desc)]',
badge === 'removed' && 'line-through',
)}
>
@@ -219,7 +221,7 @@ export function GhostTrustSummary({ trust }: { trust: GhostTrustInfo }) {
<div className="mt-3 flex items-start gap-2 rounded-xl border border-[var(--border-default)] p-3">
<Icon size={16} className="mt-0.5 shrink-0 text-[var(--text-secondary)]" aria-hidden="true" />
<div className="min-w-0">
- <p className="text-13 font-medium leading-5 text-[var(--confirm-desc)]">
+ <p className="break-words text-13 font-medium leading-5 text-[var(--confirm-desc)]">
{t(`settings.ghosts.trust.${labelKey}`, {
publisher: trust.publisherName ?? t('settings.ghosts.trust.unknownPublisher'),
})}
diff --git a/apps/desktop/src/renderer/components/chat/GhostToolCard.tsx b/apps/desktop/src/renderer/components/chat/GhostToolCard.tsx
index 073ca30ea4..0e73bd118f 100644
--- a/apps/desktop/src/renderer/components/chat/GhostToolCard.tsx
+++ b/apps/desktop/src/renderer/components/chat/GhostToolCard.tsx
@@ -912,7 +912,7 @@ export function GhostToolCard({
参数(审计透明层,与旧 bar 同一承诺)。chip 以下整块交给意识画布。 */}
<button
type="button"
- className="mb-2 flex cursor-pointer items-center gap-1.5 self-start rounded-full border px-2 py-0.5 text-left"
+ className="mb-2 flex max-w-full cursor-pointer items-center gap-1.5 self-start rounded-full border px-2 py-0.5 text-left"
style={{ backgroundColor: 'var(--surface-chip)', borderColor: 'var(--border-default)' }}
onClick={(e) => {
// 展开是"就地看详情":先通知消息流跳过本次高度变化的贴底跟随
@@ -930,7 +930,7 @@ export function GhostToolCard({
<Ghost size={11} style={{ color: 'var(--text-secondary)' }} />
)}
</span>
- <span className="truncate text-[11px] font-medium" style={{ color: 'var(--text-secondary)' }}>
+ <span className="min-w-0 truncate text-[11px] font-medium" style={{ color: 'var(--text-secondary)' }}>
{name}
</span>
<span className="flex h-3.5 w-3.5 items-center justify-center">
@@ -1006,7 +1006,7 @@ export function GhostToolCard({
return (
<div key={s.callId} className="mt-2.5 flex flex-col">
<div
- className="mb-2 flex items-center gap-1.5 self-start rounded-full border px-2 py-0.5"
+ className="mb-2 flex max-w-full items-center gap-1.5 self-start rounded-full border px-2 py-0.5"
style={{ backgroundColor: 'var(--surface-chip)', borderColor: 'var(--border-default)' }}
>
<span className="flex h-[14px] w-[14px] shrink-0 items-center justify-center overflow-hidden rounded-full">
@@ -1016,7 +1016,7 @@ export function GhostToolCard({
<Ghost size={11} style={{ color: 'var(--text-secondary)' }} />
)}
</span>
- <span className="truncate text-[11px] font-medium" style={{ color: 'var(--text-secondary)' }}>
+ <span className="min-w-0 truncate text-[11px] font-medium" style={{ color: 'var(--text-secondary)' }}>
{name}
</span>
<span className="flex h-3.5 w-3.5 items-center justify-center">
diff --git a/apps/desktop/src/renderer/components/chat/SystemCard.tsx b/apps/desktop/src/renderer/components/chat/SystemCard.tsx
index 85be225043..85b884cbd1 100644
--- a/apps/desktop/src/renderer/components/chat/SystemCard.tsx
+++ b/apps/desktop/src/renderer/components/chat/SystemCard.tsx
@@ -773,7 +773,9 @@ function AgentSwitchCard({ data }: { data?: Record<string, unknown> }) {
type="button"
onClick={() => handoff && setExpanded((v) => !v)}
className={cn(
- 'flex shrink-0 items-center gap-1.5 rounded-full border border-[var(--msg-tool-card-border)]',
+ // min-w-0(而非 shrink-0):自定义供应商的模型 id 可以很长,胶囊必须
+ // 能收缩、由内部模型名 truncate 让位,不许把整行顶出卡片宽度。
+ 'flex min-w-0 items-center gap-1.5 rounded-full border border-[var(--msg-tool-card-border)]',
'bg-background/50 px-2.5 py-1 text-[11px] text-muted-foreground',
handoff && 'cursor-pointer hover:bg-[var(--msg-tool-card-bg)]',
)}
@@ -785,7 +787,7 @@ function AgentSwitchCard({ data }: { data?: Record<string, unknown> }) {
{toModel && (
<>
<span className="opacity-50">·</span>
- <span className="font-mono">{toModel}</span>
+ <span title={toModel} className="min-w-0 truncate font-mono">{toModel}</span>
</>
)}
{Boolean(data?.resumed) && (
diff --git a/apps/desktop/src/renderer/components/settings/BuiltinToolsSection.tsx b/apps/desktop/src/renderer/components/settings/BuiltinToolsSection.tsx
index 6dc111159d..6f5aa978df 100644
--- a/apps/desktop/src/renderer/components/settings/BuiltinToolsSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/BuiltinToolsSection.tsx
@@ -402,19 +402,21 @@ function ScopePicker({
<DropdownMenuItem
key={dir}
onClick={() => onPick(dir)}
- className="grid w-full grid-cols-[14px_max-content] items-center gap-x-2.5 pr-4 cursor-pointer"
+ // minmax(0,max-content):菜单仍按内容自适应宽,但路径超过菜单
+ // max-w 上限时列可收缩、由 truncate 出省略号,不再水平溢出。
+ className="grid w-full grid-cols-[14px_minmax(0,max-content)] items-center gap-x-2.5 pr-4 cursor-pointer"
>
<Check
size={14}
className={cn('shrink-0', isCurrent ? 'opacity-100' : 'opacity-0')}
/>
- <div className="flex flex-col gap-0.5">
+ <div className="flex min-w-0 flex-col gap-0.5">
<div className="flex items-center gap-1.5">
- <span className="whitespace-nowrap text-13 font-medium">
+ <span className="truncate text-13 font-medium">
{basename(dir)}
</span>
</div>
- <span className="whitespace-nowrap text-11 text-[var(--settings-section-desc)]">
+ <span title={dir} className="truncate text-11 text-[var(--settings-section-desc)]">
{dir}
</span>
</div>
diff --git a/apps/desktop/src/renderer/components/settings/SessionImportSection.tsx b/apps/desktop/src/renderer/components/settings/SessionImportSection.tsx
index b2380c686e..db599130c1 100644
--- a/apps/desktop/src/renderer/components/settings/SessionImportSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/SessionImportSection.tsx
@@ -127,6 +127,25 @@ export function SessionImportSection() {
});
}, []);
+ const visibleSelectedCount = useMemo(
+ () => visibleCandidates.filter((item) => selected.has(item.key)).length,
+ [selected, visibleCandidates],
+ );
+ const hiddenSelectedCount = selectedItems.length - visibleSelectedCount;
+
+ const toggleAllVisible = useCallback(() => {
+ setSelected((prev) => {
+ const next = new Set(prev);
+ const allSelected =
+ visibleCandidates.length > 0 && visibleCandidates.every((item) => next.has(item.key));
+ for (const item of visibleCandidates) {
+ if (allSelected) next.delete(item.key);
+ else next.add(item.key);
+ }
+ return next;
+ });
+ }, [visibleCandidates]);
+
const importSelected = useCallback(async () => {
if (selectedItems.length === 0) return;
setImporting(true);
@@ -221,99 +240,126 @@ export function SessionImportSection() {
onPlacementChange={setPlacementFilter}
/>
- <div className="flex max-h-[560px] flex-col overflow-y-auto rounded-lg border border-[var(--settings-input-border)]">
- {listItems.length === 0 ? (
- <div className="px-4 py-10 text-center text-12 text-[var(--settings-section-desc)]">
- {t('settings.sessionImport.noCandidates')}
- </div>
- ) : (
- listItems.map((listItem) => {
- if (listItem.type === 'dialogue') {
- const item = listItem.item;
- return (
- <div
- key={listItem.key}
- className="border-b border-[var(--settings-input-border)] last:border-b-0"
- >
- <SessionImportRow
- item={item}
- checked={selected.has(item.key)}
- onToggle={() => toggleItem(item.key)}
- />
- </div>
- );
- }
-
- const group = listItem;
- const isOpen = expanded.has(group.key);
- const selectedCount = group.items.filter((item) => selected.has(item.key)).length;
- const latestUpdatedAt = group.items[0]?.updatedAt;
- return (
- <div key={group.key} className="border-b border-[var(--settings-input-border)] last:border-b-0">
- <div className="grid min-h-14 grid-cols-[16px_20px_minmax(0,1fr)_auto] items-center gap-x-2 px-4 py-2">
- <input
- type="checkbox"
- checked={selectedCount === group.items.length}
- ref={(node) => {
- if (node) node.indeterminate = selectedCount > 0 && selectedCount < group.items.length;
- }}
- onChange={() => toggleGroupSelection(group.items)}
- className="h-4 w-4 accent-[var(--settings-menu-text-selected)]"
- aria-label={t('settings.sessionImport.selectGroup')}
- />
- <button
- type="button"
- onClick={() => toggleGroup(group.key)}
- className="flex h-6 w-5 items-center justify-center rounded-md text-[var(--settings-section-sublabel)] hover:bg-[var(--settings-menu-bg-hover)]"
- aria-label={isOpen ? t('settings.sessionImport.collapse') : t('settings.sessionImport.expand')}
+ <div className="flex flex-col rounded-lg border border-[var(--settings-input-border)]">
+ {listItems.length > 0 && (
+ <label className="flex cursor-pointer items-center gap-2 border-b border-[var(--settings-input-border)] px-4 py-2.5 hover:bg-[var(--settings-menu-bg-hover)]">
+ <input
+ type="checkbox"
+ checked={visibleCandidates.length > 0 && visibleSelectedCount === visibleCandidates.length}
+ ref={(node) => {
+ if (node) {
+ node.indeterminate =
+ visibleSelectedCount > 0 && visibleSelectedCount < visibleCandidates.length;
+ }
+ }}
+ onChange={toggleAllVisible}
+ className="h-4 w-4 accent-[var(--settings-menu-text-selected)]"
+ />
+ <span className="text-12 font-medium text-[var(--settings-section-sublabel)]">
+ {t('settings.sessionImport.selectAll', { count: visibleCandidates.length })}
+ </span>
+ </label>
+ )}
+ <div className="flex max-h-[520px] flex-col overflow-y-auto">
+ {listItems.length === 0 ? (
+ <div className="px-4 py-10 text-center text-12 text-[var(--settings-section-desc)]">
+ {t('settings.sessionImport.noCandidates')}
+ </div>
+ ) : (
+ listItems.map((listItem) => {
+ if (listItem.type === 'dialogue') {
+ const item = listItem.item;
+ return (
+ <div
+ key={listItem.key}
+ className="border-b border-[var(--settings-input-border)] last:border-b-0"
>
- {isOpen ? <ChevronDown size={16} /> : <ChevronRight size={16} />}
- </button>
- <div className="min-w-0 flex-1">
- <p className="truncate text-13 font-medium text-[var(--settings-section-sublabel)]">
- {groupProjectName(group.items[0], t)}
- </p>
- <p className="truncate text-11 text-[var(--settings-section-desc)]">
- {group.items.length} {t('settings.sessionImport.sessions')} · {groupProjectPath(group.items[0], t)}
- </p>
+ <SessionImportRow
+ item={item}
+ checked={selected.has(item.key)}
+ onToggle={() => toggleItem(item.key)}
+ />
</div>
- <div className="flex shrink-0 items-center gap-2">
- {selectedCount > 0 && (
- <span className="text-11 text-[var(--settings-section-desc)]">
- {selectedCount}/{group.items.length}
- </span>
- )}
- <time
- dateTime={latestUpdatedAt}
- title={formatSidebarTimeAbsolute(latestUpdatedAt)}
- className="w-14 truncate text-right text-xs font-medium tabular-nums text-[var(--settings-section-desc)]"
+ );
+ }
+
+ const group = listItem;
+ const isOpen = expanded.has(group.key);
+ const selectedCount = group.items.filter((item) => selected.has(item.key)).length;
+ const latestUpdatedAt = group.items[0]?.updatedAt;
+ return (
+ <div key={group.key} className="border-b border-[var(--settings-input-border)] last:border-b-0">
+ <div className="grid min-h-14 grid-cols-[16px_20px_minmax(0,1fr)_auto] items-center gap-x-2 px-4 py-2">
+ <input
+ type="checkbox"
+ checked={selectedCount === group.items.length}
+ ref={(node) => {
+ if (node) node.indeterminate = selectedCount > 0 && selectedCount < group.items.length;
+ }}
+ onChange={() => toggleGroupSelection(group.items)}
+ className="h-4 w-4 accent-[var(--settings-menu-text-selected)]"
+ aria-label={t('settings.sessionImport.selectGroup')}
+ />
+ <button
+ type="button"
+ onClick={() => toggleGroup(group.key)}
+ className="flex h-6 w-5 items-center justify-center rounded-md text-[var(--settings-section-sublabel)] hover:bg-[var(--settings-menu-bg-hover)]"
+ aria-label={isOpen ? t('settings.sessionImport.collapse') : t('settings.sessionImport.expand')}
>
- {formatSidebarTime(latestUpdatedAt, t)}
- </time>
+ {isOpen ? <ChevronDown size={16} /> : <ChevronRight size={16} />}
+ </button>
+ <div className="min-w-0 flex-1">
+ <p className="truncate text-13 font-medium text-[var(--settings-section-sublabel)]">
+ {groupProjectName(group.items[0], t)}
+ </p>
+ <p
+ title={groupProjectPath(group.items[0], t)}
+ className="truncate text-11 text-[var(--settings-section-desc)]"
+ >
+ {group.items.length} {t('settings.sessionImport.sessions')} · {groupProjectPath(group.items[0], t)}
+ </p>
+ </div>
+ <div className="flex shrink-0 items-center gap-2">
+ {selectedCount > 0 && (
+ <span className="text-11 text-[var(--settings-section-desc)]">
+ {selectedCount}/{group.items.length}
+ </span>
+ )}
+ <time
+ dateTime={latestUpdatedAt}
+ title={formatSidebarTimeAbsolute(latestUpdatedAt)}
+ className="w-14 truncate text-right text-xs font-medium tabular-nums text-[var(--settings-section-desc)]"
+ >
+ {formatSidebarTime(latestUpdatedAt, t)}
+ </time>
+ </div>
</div>
+ {isOpen && (
+ <div className="flex flex-col border-t border-[var(--settings-input-border)]">
+ {group.items.map((item) => (
+ <SessionImportRow
+ key={item.key}
+ item={item}
+ checked={selected.has(item.key)}
+ onToggle={() => toggleItem(item.key)}
+ isProjectChild
+ />
+ ))}
+ </div>
+ )}
</div>
- {isOpen && (
- <div className="flex flex-col border-t border-[var(--settings-input-border)]">
- {group.items.map((item) => (
- <SessionImportRow
- key={item.key}
- item={item}
- checked={selected.has(item.key)}
- onToggle={() => toggleItem(item.key)}
- isProjectChild
- />
- ))}
- </div>
- )}
- </div>
- );
- })
- )}
+ );
+ })
+ )}
+ </div>
</div>
<div className="flex items-center justify-between gap-3">
<p className="text-12 text-[var(--settings-section-desc)]">
{t('settings.sessionImport.selected', { count: selectedItems.length })}
+ {hiddenSelectedCount > 0 && (
+ <span> {t('settings.sessionImport.selectedOutsideFilter', { count: hiddenSelectedCount })}</span>
+ )}
</p>
<button
type="button"
@@ -524,11 +570,16 @@ function SessionImportRow({
{t('settings.sessionImport.filters.dialogue')}
</span>
)}
- <p className="truncate text-13 font-medium text-[var(--settings-section-sublabel)]">
+ <p
+ title={item.title || undefined}
+ className="truncate text-13 font-medium text-[var(--settings-section-sublabel)]"
+ >
{item.title || t('settings.sessionImport.untitled')}
</p>
</div>
- <p className="mt-1 truncate text-11 text-[var(--settings-section-desc)]">{item.cwd}</p>
+ <p title={item.cwd || undefined} className="mt-1 truncate text-11 text-[var(--settings-section-desc)]">
+ {item.cwd}
+ </p>
</div>
<time
dateTime={item.updatedAt}
diff --git a/apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx b/apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx
index 0a3559449e..cee83e569b 100644
--- a/apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx
+++ b/apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx
@@ -345,14 +345,16 @@ export function SessionShareImportWizard({
{needWorkdir && (
<div className="flex flex-col gap-1.5">
- <p className="text-sm text-[var(--confirm-desc)]">
+ {/* originalDir 是他机路径,可能是无空格长串:break-words 防止顶破弹窗宽度 */}
+ <p className="break-words text-sm text-[var(--confirm-desc)]">
{t('sessionShare.import.workdirHint', {
originalDir: preview.originalWorkingDir ?? '-',
})}
</p>
<div className="flex items-center gap-2">
<div
- className="h-8 flex-1 truncate rounded-md border px-2 text-sm leading-8"
+ title={workingDir || undefined}
+ className="h-8 min-w-0 flex-1 truncate rounded-md border px-2 text-sm leading-8"
style={{
borderColor: 'var(--border-default)',
color: workingDir ? 'var(--confirm-title)' : 'var(--text-tertiary)',
diff --git a/apps/desktop/src/renderer/features/plugin/PluginScopePicker.tsx b/apps/desktop/src/renderer/features/plugin/PluginScopePicker.tsx
index ac74ae9107..9067189c37 100644
--- a/apps/desktop/src/renderer/features/plugin/PluginScopePicker.tsx
+++ b/apps/desktop/src/renderer/features/plugin/PluginScopePicker.tsx
@@ -94,15 +94,17 @@ export function PluginScopePicker({
<DropdownMenuItem
key={dir}
onClick={() => onPick(dir)}
- className="grid w-full cursor-pointer grid-cols-[14px_max-content] items-center gap-x-2.5 pr-4"
+ // minmax(0,max-content):菜单仍按内容自适应宽,但路径超过菜单
+ // max-w 上限时列可收缩、由 truncate 出省略号,不再水平溢出。
+ className="grid w-full cursor-pointer grid-cols-[14px_minmax(0,max-content)] items-center gap-x-2.5 pr-4"
>
<Check
size={14}
className={cn('shrink-0', isCurrent ? 'opacity-100' : 'opacity-0')}
/>
- <div className="flex flex-col gap-0.5">
- <span className="whitespace-nowrap text-13 font-medium">{basename(dir)}</span>
- <span className="whitespace-nowrap text-11 text-[var(--text-secondary)]">
+ <div className="flex min-w-0 flex-col gap-0.5">
+ <span className="truncate text-13 font-medium">{basename(dir)}</span>
+ <span title={dir} className="truncate text-11 text-[var(--text-secondary)]">
{dir}
</span>
</div>
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index b9db9a51e7..215a587a56 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -936,8 +936,6 @@
"sessionImport": {
"title": "Local Session Import",
"description": "Read-only scan of local Claude Code and Codex history. Only checked sessions in the list will be imported; skipped internal sessions are hidden and cannot be imported.",
- "linkedTitle": "Local Session Links",
- "linkedDescription": "Read-only scan of local Claude Code and Codex history. Codex sessions are linked to the original thread and resumed without replaying history; Claude sessions are imported as local history.",
"scan": "Scan",
"scanning": "Scanning",
"emptyTitle": "Scan local history first",
@@ -949,9 +947,7 @@
"sessions": "sessions",
"selected": "{{count}} selected",
"importSelected": "Import selected",
- "linkSelected": "Link selected",
"importing": "Importing",
- "linked": "Linked",
"archived": "Archived",
"untitled": "Untitled Session",
"noWorkingDir": "No working directory",
@@ -978,7 +974,9 @@
"scanFailed": "Scan failed",
"importFailed": "Import failed",
"imported": "Import complete: {{inserted}} inserted, {{updated}} updated"
- }
+ },
+ "selectAll": "Select all in current filter ({{count}})",
+ "selectedOutsideFilter": "({{count}} of them outside the current filter)"
},
"connections": {
"codex": {
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index 16987cf528..b9dc1f7fb1 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -934,10 +934,6 @@
}
},
"sessionImport": {
- "linkedTitle": "ローカルセッションのリンク",
- "linkedDescription": "ローカルの Claude Code / Codex 履歴を読み取り専用でスキャンします。Codex セッションは元の thread にリンクされ、履歴を再生せずにそのまま再開できます。Claude セッションはローカル履歴としてインポートされます。",
- "linkSelected": "選択をリンク",
- "linked": "リンク済み",
"title": "ローカルセッションのインポート",
"description": "ローカルの Claude Code / Codex 履歴を読み取り専用でスキャンします。リストでチェックしたセッションのみインポートされ、スキップされた内部セッションは表示されず、インポートもされません。",
"scan": "スキャン",
@@ -978,7 +974,9 @@
"scanFailed": "スキャンに失敗しました",
"importFailed": "インポートに失敗しました",
"imported": "インポート完了:新規 {{inserted}} 件、更新 {{updated}} 件"
- }
+ },
+ "selectAll": "現在の絞り込み結果をすべて選択({{count}}件)",
+ "selectedOutsideFilter": "(うち{{count}}件は現在の絞り込み対象外)"
},
"connections": {
"codex": {
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index e5292f91d8..540243e5a3 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -934,10 +934,6 @@
}
},
"sessionImport": {
- "linkedTitle": "로컬 세션 링크",
- "linkedDescription": "로컬 Claude Code / Codex 기록을 읽기 전용으로 스캔합니다. Codex 세션은 원본 thread에 링크되어 기록 재생 없이 이어서 대화하며, Claude 세션은 로컬 기록으로 가져옵니다.",
- "linkSelected": "선택 항목 링크",
- "linked": "링크됨",
"title": "로컬 세션 가져오기",
"description": "로컬 Claude Code / Codex 기록을 읽기 전용으로 스캔합니다. 목록에서 선택한 세션만 가져오며, 건너뛴 내부 세션은 표시되지 않고 가져올 수 없습니다.",
"scan": "스캔",
@@ -978,7 +974,9 @@
"scanFailed": "스캔 실패",
"importFailed": "가져오기 실패",
"imported": "가져오기 완료: 신규 {{inserted}}개, 업데이트 {{updated}}개"
- }
+ },
+ "selectAll": "현재 필터 결과 모두 선택({{count}}개)",
+ "selectedOutsideFilter": "(그중 {{count}}개는 현재 필터 밖)"
},
"connections": {
"codex": {
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 780b93acfc..021a50d0c5 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -934,10 +934,6 @@
}
},
"sessionImport": {
- "linkedTitle": "本地会话链接",
- "linkedDescription": "只读扫描本机 Claude Code 与 Codex 历史。Codex 会话会链接到原 thread 并直接续聊,不会重放历史;Claude 会话仍作为本地历史导入。",
- "linkSelected": "链接选中",
- "linked": "已链接",
"title": "本地会话导入",
"description": "只读扫描本机 Claude Code 与 Codex 历史。只有列表里勾选的会话会被导入;已跳过的内部会话不会展示,也不会导入。",
"scan": "扫描",
@@ -978,7 +974,9 @@
"scanFailed": "扫描失败",
"importFailed": "导入失败",
"imported": "导入完成:新增 {{inserted}} 条,更新 {{updated}} 条"
- }
+ },
+ "selectAll": "全选当前筛选结果({{count}} 条)",
+ "selectedOutsideFilter": "(其中 {{count}} 条在当前筛选之外)"
},
"connections": {
"codex": {
diff --git a/docs/design-previews/ui-long-text-overflow-polish/index.html b/docs/design-previews/ui-long-text-overflow-polish/index.html
new file mode 100644
index 0000000000..d3d1bf217d
--- /dev/null
+++ b/docs/design-previews/ui-long-text-overflow-polish/index.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>UI 超长文本溢出修复 + 会话导入批量选择 · 预览(fix/ui-long-text-overflow-polish)</title>
+<style>
+ * { margin:0; padding:0; box-sizing:border-box; }
+ body { background:#111; color:#ddd; font-family:-apple-system,'PingFang SC','HarmonyOS Sans SC',sans-serif; padding-bottom:60px; }
+ header { padding:20px 28px 6px; }
+ header h1 { font-size:17px; font-weight:700; color:#eee; }
+ header p { font-size:12px; color:#888; margin-top:6px; line-height:1.7; max-width:820px; }
+ .tabs { display:flex; gap:8px; padding:14px 28px; }
+ .tab { padding:7px 22px; border-radius:9999px; border:1px solid #3a3a3a; background:#1c1c1c; color:#aaa; font-size:13px; cursor:pointer; }
+ .tab.active { background:#eee; color:#111; border-color:#eee; font-weight:700; }
+ .hidden { display:none !important; }
+
+ h2.sec-title { font-size:14px; color:#bbb; padding:26px 28px 10px; font-weight:600; }
+ .pair { display:flex; gap:24px; padding:0 28px; flex-wrap:wrap; align-items:flex-start; }
+ .col { display:flex; flex-direction:column; gap:8px; }
+ .tag { font-size:11px; font-weight:600; width:fit-content; padding:2px 10px; border-radius:9999px; }
+ .tag.before { background:#3d1b1f; color:#e5808d; }
+ .tag.after { background:#16321f; color:#6fcf8e; }
+ .note { font-size:11px; color:#777; max-width:400px; line-height:1.7; }
+
+ /* ── 主题 frame:light/dark 用 Cindy 层色 token 的字面值 ── */
+ .frame { border-radius:12px; padding:16px; overflow:hidden; }
+ .light.frame { background:#f8f8f6; color:#262626; }
+ .dark.frame { background:#1f1f1e; color:#e5e5e3; }
+ .light .card { background:#ffffff; border:1px solid #d7d7d4; }
+ .dark .card { background:#2c2c2a; border:1px solid #3c3c3a; }
+ .light .desc { color:#6f6f6c; }
+ .dark .desc { color:#a3a3a0; }
+ .light .tertiary { color:#8a8a87; }
+ .dark .tertiary { color:#7c7c79; }
+ .mono { font-family:ui-monospace,Menlo,monospace; }
+
+ /* 1. 会话导入:全选表头 + 筛选外提示 */
+ .import-list { width:430px; border-radius:8px; overflow:hidden; font-size:13px; }
+ .import-head { display:flex; align-items:center; gap:8px; padding:9px 14px; font-size:12px; font-weight:500; }
+ .light .import-head { border-bottom:1px solid #d7d7d4; }
+ .dark .import-head { border-bottom:1px solid #3c3c3a; }
+ .import-row { display:flex; align-items:flex-start; gap:10px; padding:10px 14px; }
+ .light .import-row + .import-row { border-top:1px solid #eceae6; }
+ .dark .import-row + .import-row { border-top:1px solid #343432; }
+ .import-row .meta { min-width:0; flex:1; }
+ .import-row .title { font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
+ .import-row .cwd { font-size:11px; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
+ .badge { font-size:10px; border-radius:4px; padding:1px 6px; text-transform:uppercase; }
+ .light .badge { border:1px solid #d7d7d4; color:#8a8a87; }
+ .dark .badge { border:1px solid #3c3c3a; color:#8f8f8c; }
+ .import-foot { display:flex; justify-content:space-between; align-items:center; padding-top:10px; font-size:12px; width:430px; }
+ .btn-primary { border-radius:6px; padding:7px 12px; font-size:13px; font-weight:500; }
+ .light .btn-primary { background:#e5e5e5; color:#262626; border:1px solid #d7d7d4; }
+ .dark .btn-primary { background:#3a3a38; color:#e5e5e3; border:1px solid #4a4a48; }
+
+ /* 2. 分享导入向导 */
+ .dialog { width:400px; border-radius:12px; padding:16px; }
+ .light .dialog { background:#ffffff; box-shadow:0 8px 30px rgba(0,0,0,.12); }
+ .dark .dialog { background:#2c2c2a; box-shadow:0 8px 30px rgba(0,0,0,.5); }
+ .dialog h3 { font-size:15px; font-weight:500; margin-bottom:10px; }
+ .hint { font-size:13px; line-height:1.6; }
+ .hint.overflow-broken { white-space:normal; }
+ .hint.overflow-broken .path { white-space:nowrap; }
+ .hint.fixed { overflow-wrap:break-word; }
+
+ /* 3. scope 下拉 */
+ .menu { width:fit-content; max-width:360px; border-radius:12px; padding:6px; font-size:13px; }
+ .light .menu { background:#ffffff; border:1px solid #d7d7d4; }
+ .dark .menu { background:#2c2c2a; border:1px solid #3c3c3a; }
+ .menu-row { display:grid; grid-template-columns:14px max-content; align-items:center; column-gap:10px; padding:7px 16px 7px 10px; border-radius:8px; }
+ .menu-row.fixed { grid-template-columns:14px minmax(0,max-content); }
+ .menu-row .check { width:14px; }
+ .menu-row .lines { display:flex; flex-direction:column; gap:2px; }
+ .menu-row.fixed .lines { min-width:0; }
+ .menu-row .name { font-weight:500; white-space:nowrap; }
+ .menu-row .dir { font-size:11px; white-space:nowrap; }
+ .menu-row.fixed .name, .menu-row.fixed .dir { overflow:hidden; text-overflow:ellipsis; }
+
+ /* 4. 权限清单 */
+ .perm { width:400px; }
+ .perm-row { display:flex; gap:8px; padding:4px 0; font-size:13px; line-height:1.5; }
+ .perm-row .ico { flex-shrink:0; margin-top:2px; }
+ .perm-row .body-col { min-width:0; flex:1; }
+ .perm-row .label.broken { }
+ .perm-row .label.fixed { overflow-wrap:break-word; }
+
+ /* 5. 胶囊 */
+ .ghost-card { width:340px; }
+ .pill { display:flex; align-items:center; gap:6px; width:fit-content; border-radius:9999px; padding:3px 10px; font-size:11px; font-weight:500; }
+ .light .pill { background:#efeeeb; border:1px solid #d7d7d4; color:#6f6f6c; }
+ .dark .pill { background:#383836; border:1px solid #4a4a48; color:#a3a3a0; }
+ .pill .dot { width:8px; height:8px; border-radius:50%; background:#6fcf8e; flex-shrink:0; }
+ .pill.fixed { max-width:100%; }
+ .pill.fixed .pill-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
+ .pill .pill-name { white-space:nowrap; }
+
+ /* 6. 模型胶囊行 */
+ .switch-row { display:flex; align-items:center; gap:12px; width:360px; }
+ .switch-row .line { height:1px; flex:1; background:#d7d7d4; }
+ .dark .switch-row .line { background:#3c3c3a; }
+ .switch-pill { display:flex; align-items:center; gap:6px; border-radius:9999px; padding:4px 10px; font-size:11px; }
+ .light .switch-pill { border:1px solid #d7d7d4; color:#6f6f6c; background:rgba(255,255,255,.5); }
+ .dark .switch-pill { border:1px solid #3c3c3a; color:#a3a3a0; background:rgba(44,44,42,.5); }
+ .switch-pill.broken { flex-shrink:0; }
+ .switch-pill.fixed { min-width:0; }
+ .switch-pill.fixed .model { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
+ .switch-pill .model { white-space:nowrap; }
+ input[type=checkbox] { accent-color:#525250; }
+</style>
+</head>
+<body>
+<header>
+ <h1>UI 超长文本溢出修复 + 会话导入批量选择 · HTML 预览</h1>
+ <p>分支 fix/ui-long-text-overflow-polish(PR #360)。本页为静态复现:用与实现相同的 CSS 约束语义
+ (break-words / truncate / min-w-0 / max-w-full / minmax(0,max-content))逐项重现「修复前 → 修复后」,
+ 颜色取 DESIGN.md 层色 token 字面值,Light / Dark 双模式可切换。所有「修复前」块即当前 main 上可复现的破版行为。</p>
+</header>
+<div class="tabs">
+ <div class="tab active" data-mode="light">Light</div>
+ <div class="tab" data-mode="dark">Dark</div>
+</div>
+
+<div id="stage"></div>
+
+<template id="tpl">
+ <h2 class="sec-title">1 · 会话导入设置页:新增「全选当前筛选结果」表头 + 筛选外已选提示(新交互,展示修复后)</h2>
+ <div class="pair">
+ <div class="col">
+ <span class="tag after">新增</span>
+ <div class="frame MODE">
+ <div class="card import-list">
+ <label class="import-head"><input type="checkbox" checked> 全选当前筛选结果(37 条)</label>
+ <div class="import-row"><input type="checkbox" checked>
+ <div class="meta"><div><span class="badge">Codex</span> <span class="title">帮我把 mobile 的推送权限弹窗改成首次发送前再请求,并补齐双端埋点……</span></div>
+ <div class="cwd tertiary">/Users/chris/Code/Github/very-long-monorepo-name/apps/mobile/features/notifications</div></div>
+ </div>
+ <div class="import-row"><input type="checkbox">
+ <div class="meta"><div><span class="badge">Claude</span> <span class="title">重构 settings 布局</span></div>
+ <div class="cwd tertiary">/Users/chris/Code/Github/cindy</div></div>
+ </div>
+ </div>
+ <div class="import-foot">
+ <span class="desc">已选择 12 条 (其中 4 条在当前筛选之外)</span>
+ <span class="btn-primary">导入选中</span>
+ </div>
+ </div>
+ <p class="note">表头 checkbox 固定在列表顶部(不随滚动滚走),含半选态,只作用于当前筛选可见候选;底部提示被筛选隐藏的已选数量,避免导入看不见的条目。标题/路径截断处均有悬停 title 可看全。</p>
+ </div>
+ </div>
+
+ <h2 class="sec-title">2 · 分享导入向导:他机原始路径顶破弹窗</h2>
+ <div class="pair">
+ <div class="col">
+ <span class="tag before">修复前</span>
+ <div class="frame MODE"><div class="dialog">
+ <h3>导入分享的会话</h3>
+ <p class="hint desc overflow-broken">原会话目录:<span class="path mono">C:\Users\extraordinarily-long-username\Development\company-projects\frontend-monorepo-workspace\packages\desktop-client</span>,请选择本机对应目录。</p>
+ </div></div>
+ <p class="note">无空格长串不换行,横向顶出 480px 弹窗(此处弹窗已裁切,实际会撑出可视区)。</p>
+ </div>
+ <div class="col">
+ <span class="tag after">修复后</span>
+ <div class="frame MODE"><div class="dialog">
+ <h3>导入分享的会话</h3>
+ <p class="hint desc fixed">原会话目录:<span class="mono">C:\Users\extraordinarily-long-username\Development\company-projects\frontend-monorepo-workspace\packages\desktop-client</span>,请选择本机对应目录。</p>
+ </div></div>
+ <p class="note">break-words:长串按需断行,弹窗宽度稳定。</p>
+ </div>
+ </div>
+
+ <h2 class="sec-title">3 · 目录 scope 下拉(设置·内置工具 / 插件共两处):路径水平溢出菜单</h2>
+ <div class="pair">
+ <div class="col">
+ <span class="tag before">修复前</span>
+ <div class="frame MODE"><div class="menu">
+ <div class="menu-row"><span class="check">✓</span><div class="lines"><span class="name">desktop-client</span><span class="dir tertiary mono">/Users/chris/Development/company-projects/frontend-monorepo-workspace/packages/desktop-client</span></div></div>
+ <div class="menu-row"><span class="check"></span><div class="lines"><span class="name">cindy</span><span class="dir tertiary mono">/Users/chris/Code/Github/cindy</span></div></div>
+ </div></div>
+ <p class="note">列宽 max-content + nowrap:路径超过菜单 max-w 上限后横向溢出,整个菜单破相(此处按实际表现让文本冲出容器)。</p>
+ </div>
+ <div class="col">
+ <span class="tag after">修复后</span>
+ <div class="frame MODE"><div class="menu">
+ <div class="menu-row fixed"><span class="check">✓</span><div class="lines"><span class="name">desktop-client</span><span class="dir tertiary mono">/Users/chris/Development/company-projects/frontend-monorepo-workspace/packages/desktop-client</span></div></div>
+ <div class="menu-row fixed"><span class="check"></span><div class="lines"><span class="name">cindy</span><span class="dir tertiary mono">/Users/chris/Code/Github/cindy</span></div></div>
+ </div></div>
+ <p class="note">minmax(0,max-content) + truncate + 悬停 title:短路径下菜单仍按内容自适应,超长路径省略号收尾。</p>
+ </div>
+ </div>
+
+ <h2 class="sec-title">4 · 插件安装确认弹窗:权限主标签(作者可控域名/工具名)不断行</h2>
+ <div class="pair">
+ <div class="col">
+ <span class="tag before">修复前</span>
+ <div class="frame MODE"><div class="dialog perm">
+ <div class="perm-row"><span class="ico">🌐</span><div class="body-col">
+ <div class="label broken mono">访问网络域名 extremely-long-api-gateway-subdomain.internal-services.example-corporation.com</div>
+ <div class="desc" style="font-size:12px">出站请求仅限声明域名</div>
+ </div></div>
+ </div></div>
+ <p class="note">域名是无空格长串(点号不是 CSS 断行点),主标签行顶破固定宽度弹窗;相邻两行 detail 早有 break-words,唯独主标签漏了。</p>
+ </div>
+ <div class="col">
+ <span class="tag after">修复后</span>
+ <div class="frame MODE"><div class="dialog perm">
+ <div class="perm-row"><span class="ico">🌐</span><div class="body-col">
+ <div class="label fixed mono">访问网络域名 extremely-long-api-gateway-subdomain.internal-services.example-corporation.com</div>
+ <div class="desc" style="font-size:12px">出站请求仅限声明域名</div>
+ </div></div>
+ </div></div>
+ <p class="note">break-words 与相邻行对齐;签名发布者名同批修复。</p>
+ </div>
+ </div>
+
+ <h2 class="sec-title">5 · 聊天插件卡归属胶囊:超长插件名撑出卡片</h2>
+ <div class="pair">
+ <div class="col">
+ <span class="tag before">修复前</span>
+ <div class="frame MODE"><div class="ghost-card">
+ <span class="pill"><span class="dot"></span><span class="pill-name">Extraordinarily Comprehensive Web Automation &amp; Data Extraction Suite Pro Max</span></span>
+ <div class="card" style="margin-top:8px;height:56px;border-radius:12px"></div>
+ </div></div>
+ <p class="note">胶囊 self-start 且无宽度上限,超长插件名把胶囊撑出卡片宽度(340px 卡内,胶囊冲出右缘)。</p>
+ </div>
+ <div class="col">
+ <span class="tag after">修复后</span>
+ <div class="frame MODE"><div class="ghost-card">
+ <span class="pill fixed"><span class="dot"></span><span class="pill-name">Extraordinarily Comprehensive Web Automation &amp; Data Extraction Suite Pro Max</span></span>
+ <div class="card" style="margin-top:8px;height:56px;border-radius:12px"></div>
+ </div></div>
+ <p class="note">max-w-full:胶囊封顶于卡片宽度,插件名省略号收尾。</p>
+ </div>
+ </div>
+
+ <h2 class="sec-title">6 · Agent 切换系统卡:超长模型 id 顶出整行</h2>
+ <div class="pair">
+ <div class="col">
+ <span class="tag before">修复前</span>
+ <div class="frame MODE"><div class="switch-row">
+ <div class="line"></div>
+ <span class="switch-pill broken">⇄ 切换到 Codex <span style="opacity:.5">·</span> <span class="model mono">us.anthropic.claude-sonnet-4-5-20250929-v1:0-custom-gateway</span></span>
+ <div class="line"></div>
+ </div></div>
+ <p class="note">胶囊 shrink-0:自定义供应商长模型 id 直接把整行顶出卡片宽度(360px 行内,胶囊冲出右缘)。</p>
+ </div>
+ <div class="col">
+ <span class="tag after">修复后</span>
+ <div class="frame MODE"><div class="switch-row">
+ <div class="line"></div>
+ <span class="switch-pill fixed">⇄ 切换到 Codex <span style="opacity:.5">·</span> <span class="model mono">us.anthropic.claude-sonnet-4-5-20250929-v1:0-custom-gateway</span></span>
+ <div class="line"></div>
+ </div></div>
+ <p class="note">min-w-0 + 模型名 truncate + 悬停 title:胶囊收缩让位,行宽稳定。</p>
+ </div>
+ </div>
+</template>
+
+<script>
+ const stage = document.getElementById('stage');
+ const tpl = document.getElementById('tpl').innerHTML;
+ function render(mode) {
+ stage.innerHTML = tpl.replaceAll('frame MODE', 'frame ' + mode);
+ }
+ document.querySelectorAll('.tab').forEach((tab) => {
+ tab.addEventListener('click', () => {
+ document.querySelectorAll('.tab').forEach((x) => x.classList.remove('active'));
+ tab.classList.add('active');
+ render(tab.dataset.mode);
+ });
+ });
+ render('light');
+</script>
+</body>
+</html>