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(bots): 飞书列表归档沿用任务行内确认交互

xdb6b5816052f8
diff --git a/apps/desktop/scripts/fixtures/wechat-companion/ui-page.mjs b/apps/desktop/scripts/fixtures/wechat-companion/ui-page.mjs
index 01d77cce7c..27ac4f06c1 100644
--- a/apps/desktop/scripts/fixtures/wechat-companion/ui-page.mjs
+++ b/apps/desktop/scripts/fixtures/wechat-companion/ui-page.mjs
@@ -93,6 +93,14 @@ export default {
await row.evaluate((el) => el.blur());
const collapse = page.getByRole('button', { name: await ui.t('bots.channels.lanes.collapse', { platform }), exact: true });
await ui.capture('tasks-expanded');
+ const archive = page.getByRole('button', { name: await ui.t('bots.channels.lanes.archiveAria', { lane: '拉拉, 徐紫旎, 姚刘浏' }), exact: true });
+ await archive.click();
+ const inlineConfirm = page.getByRole('button', { name: await ui.t('ccAgent.sidebar.sessionMenu.archived'), exact: true });
+ await inlineConfirm.waitFor({ state: 'visible' });
+ await ui.capture('tasks-archive-confirm');
+ await page.mouse.click(1, 1);
+ await archive.waitFor({ state: 'visible' });
+ assert.equal(await inlineConfirm.isVisible(), false, 'outside click cancels inline archive without a write');
await collapse.click();
await row.waitFor({ state: 'hidden' });
assert.equal(await row.isVisible(), false, 'task records collapse without invoking a write');
diff --git a/apps/desktop/src/renderer/features/bots/BotChannelsPage.tsx b/apps/desktop/src/renderer/features/bots/BotChannelsPage.tsx
index 9240ccd197..8b10cff143 100644
--- a/apps/desktop/src/renderer/features/bots/BotChannelsPage.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotChannelsPage.tsx
@@ -26,6 +26,7 @@ import { Select } from '@/components/ui/select';
import { Spinner } from '@/components/ui/spinner';
import { WechatBotSection } from '@/components/settings/WechatBotSection';
import { cn } from '@/lib/utils';
+import { toast } from '@/lib/toast';
import { formatRelative } from '@/hooks/useRelativeTime';
import { extractIpcError } from '@/utils/ipcError';
import type {
@@ -368,6 +369,8 @@ function ConnectionLanes({ connectionId, botId, botName, platform }: { connectio
const { confirm } = useConfirmDialog();
const [expanded, setExpanded] = useState(false);
const contentId = useId();
+ const [archivePendingId, setArchivePendingId] = useState<string | null>(null);
+ const archiveConfirmRef = useRef<HTMLButtonElement>(null);
const [lanes, setLanes] = useState<BotImConnectionLane[] | null>(null);
const [loadFailed, setLoadFailed] = useState(false);
const [resettingId, setResettingId] = useState<string | null>(null);
@@ -403,6 +406,26 @@ function ConnectionLanes({ connectionId, botId, botName, platform }: { connectio
};
}, [connectionId, reloadToken]);
+ // Match SessionItem's inline archive confirmation: 4s or an outside click dismisses it.
+ useEffect(() => {
+ if (!archivePendingId) return;
+ if (!expanded) {
+ setArchivePendingId(null);
+ return;
+ }
+ const dismiss = () => setArchivePendingId(null);
+ const timer = setTimeout(dismiss, 4000);
+ const onMouseDown = (event: MouseEvent) => {
+ if (event.target instanceof Node && archiveConfirmRef.current?.contains(event.target)) return;
+ dismiss();
+ };
+ document.addEventListener('mousedown', onMouseDown, true);
+ return () => {
+ clearTimeout(timer);
+ document.removeEventListener('mousedown', onMouseDown, true);
+ };
+ }, [archivePendingId, expanded]);
+
const laneName = (lane: BotImConnectionLane) =>
lane.kind === 'owner-dm' ? t('bots.channels.lanes.ownerName') : lane.name || lane.chatId || '';
@@ -411,28 +434,38 @@ function ConnectionLanes({ connectionId, botId, botName, platform }: { connectio
mutatingRef.current = true;
loadGeneration.current += 1;
const name = laneName(lane);
+ const previousLanes = lanes;
try {
- const ok = await confirm({
- title: t(`bots.channels.lanes.${action}Confirm.title`, { lane: name }),
- description: t(
- action === 'reset' && lane.kind === 'owner-dm'
- ? 'bots.channels.lanes.resetConfirm.ownerDescription'
- : `bots.channels.lanes.${action}Confirm.description`,
- { name: botName },
- ),
- confirmText: t(`bots.channels.lanes.${action}Confirm.confirm`),
- cancelText: t('bots.channels.lanes.resetConfirm.cancel'),
- });
- if (!ok) return;
+ if (action === 'reset') {
+ const ok = await confirm({
+ title: t('bots.channels.lanes.resetConfirm.title', { lane: name }),
+ description: t(
+ lane.kind === 'owner-dm'
+ ? 'bots.channels.lanes.resetConfirm.ownerDescription'
+ : 'bots.channels.lanes.resetConfirm.description',
+ { name: botName },
+ ),
+ confirmText: t('bots.channels.lanes.resetConfirm.confirm'),
+ cancelText: t('bots.channels.lanes.resetConfirm.cancel'),
+ });
+ if (!ok) return;
+ }
if (action === 'reset') setResettingId(lane.sessionId);
- else setArchivingId(lane.sessionId);
+ else {
+ setArchivePendingId(null);
+ setArchivingId(lane.sessionId);
+ setLanes((current) => current?.filter((row) => row.sessionId !== lane.sessionId) ?? null);
+ }
setNotice(null);
const payload = await (action === 'reset' ? resetBotImConnectionLane : archiveBotImConnectionLane)(connectionId, lane.sessionId);
setLanes(payload.lanes);
setNow(Date.now());
- setNotice({ tone: 'done', text: t(`bots.channels.lanes.${action}Done`, { lane: name }) });
+ if (action === 'reset') setNotice({ tone: 'done', text: t('bots.channels.lanes.resetDone', { lane: name }) });
} catch {
- setNotice({ tone: 'failed', text: t(`bots.channels.lanes.${action}Failed`) });
+ if (action === 'archive') {
+ setLanes(previousLanes);
+ toast.error(t('bots.channels.lanes.archiveFailed'));
+ } else setNotice({ tone: 'failed', text: t('bots.channels.lanes.resetFailed') });
setReloadToken((value) => value + 1);
} finally {
mutatingRef.current = false;
@@ -513,15 +546,34 @@ function ConnectionLanes({ connectionId, botId, botName, platform }: { connectio
</button>
<div className="flex shrink-0 items-center gap-1">
{botImConnectionLaneArchiveSupported() ? (
- <ChromeIconButton
- className="shrink-0 text-[var(--text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]"
- aria-label={t('bots.channels.lanes.archiveAria', { lane: name })}
- tooltip={t('bots.channels.lanes.archive')}
- disabled={archivingId !== null || resettingId !== null}
- onClick={() => void mutate(lane, 'archive')}
- >
- {archivingId === lane.sessionId ? <Spinner size={14} /> : <Archive size={14} strokeWidth={2} aria-hidden />}
- </ChromeIconButton>
+ <div className="relative flex h-7 w-7 shrink-0 items-center justify-end">
+ {archivePendingId === lane.sessionId ? (
+ <Button
+ ref={archiveConfirmRef}
+ type="button"
+ variant="secondary"
+ tone="danger-surface"
+ size="xs"
+ compact
+ className="absolute right-0 top-1/2 w-max min-w-14 -translate-y-1/2 whitespace-nowrap"
+ aria-label={t('ccAgent.sidebar.sessionMenu.archived')}
+ disabled={archivingId !== null || resettingId !== null}
+ onClick={() => void mutate(lane, 'archive')}
+ >
+ {t('ccAgent.sidebar.sessionMenu.archived')}
+ </Button>
+ ) : (
+ <ChromeIconButton
+ className="shrink-0 text-[var(--text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]"
+ aria-label={t('bots.channels.lanes.archiveAria', { lane: name })}
+ tooltip={t('ccAgent.sidebar.sessionMenu.archived')}
+ disabled={archivingId !== null || resettingId !== null}
+ onClick={() => setArchivePendingId(lane.sessionId)}
+ >
+ <Archive size={14} strokeWidth={2} aria-hidden />
+ </ChromeIconButton>
+ )}
+ </div>
) : null}
<Button
type="button"
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/botChannelsPage.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/botChannelsPage.test.tsx
index b34737098c..65a369e5ce 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/botChannelsPage.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/botChannelsPage.test.tsx
@@ -12,8 +12,11 @@ import type { BotProfile } from '../botStore';
const mocks = vi.hoisted(() => ({
confirm: vi.fn(async () => true),
navigate: vi.fn(),
+ toastError: vi.fn(),
}));
+vi.mock('@/lib/toast', () => ({ toast: { error: mocks.toastError } }));
+
vi.mock('react-router-dom', () => ({ useNavigate: () => mocks.navigate }));
// The shared-quota rail observes auth; this component fixture has no auth host.
vi.mock('@/contexts/AuthContext', () => ({ useOptionalAuthUser: () => null }));
@@ -92,6 +95,7 @@ let lanesApi: {
beforeEach(() => {
mocks.navigate.mockClear();
+ mocks.toastError.mockClear();
mocks.confirm.mockReset();
mocks.confirm.mockResolvedValue(true);
groupsApi = {};
@@ -186,39 +190,69 @@ describe('BotChannelsPage', () => {
);
});
- // 已确认的归档功能:真实列表按钮应调用本连接的归档 IPC,成功移出、失败与取消保留。
+ // 已确认的归档功能:真实列表按钮应调用本连接的归档 IPC,行内二次确认后移出、失败恢复,不打开确认窗。
// 现有测试只有 reset;最小输入一条专线。unit:可观察列表结果和错误提示。
- it.each(['done', 'cancel', 'failed'] as const)('archives a channel task with %s outcome', async (outcome) => {
+ it.each(['done', 'failed'] as const)('archives a channel task with %s outcome', async (outcome) => {
const lanes = [{ sessionId: 's-topic', kind: 'topic', chatId: 'group', threadId: 'topic', name: 'Release room', state: 'idle', lastActivityAt: null, contextMessageCount: 0 }];
- mocks.confirm.mockResolvedValue(outcome !== 'cancel');
+ mocks.confirm.mockResolvedValue(false);
+ let finishArchive!: (value: { connectionId: string; lanes: typeof lanes }) => void;
+ let failArchive!: (error: Error) => void;
lanesApi = {
listLanes: vi.fn(async () => ({ connectionId: 'a1b2c3d4e5f6', lanes })),
resetLane: vi.fn(),
- archiveLane: vi.fn(async () => {
- if (outcome === 'failed') throw new Error('unavailable');
- return { connectionId: 'a1b2c3d4e5f6', lanes: [] };
- }),
+ archiveLane: vi.fn(() => new Promise((resolve, reject) => {
+ finishArchive = resolve;
+ failArchive = reject;
+ })),
};
installApi({ connections: [connection({ channel: 'feishu' })] });
render(<BotChannelsPage bot={mia} />);
await expandTaskList();
fireEvent.click(await screen.findByRole('button', { name: 'bots.channels.lanes.archiveAria:{"lane":"Release room"}' }));
- if (outcome === 'cancel') {
- await waitFor(() => expect(mocks.confirm).toHaveBeenCalled());
- expect(lanesApi.archiveLane).not.toHaveBeenCalled();
+ expect(lanesApi.archiveLane).not.toHaveBeenCalled();
+ fireEvent.click(screen.getByRole('button', { name: 'ccAgent.sidebar.sessionMenu.archived' }));
+ await waitFor(() => expect(lanesApi.archiveLane).toHaveBeenCalledWith({ id: 'a1b2c3d4e5f6', sessionId: 's-topic' }));
+ expect(screen.queryByRole('button', { name: /^Release room/ })).toBeNull();
+ await act(async () => {
+ if (outcome === 'failed') failArchive(new Error('unavailable'));
+ else finishArchive({ connectionId: 'a1b2c3d4e5f6', lanes: [] });
+ });
+ if (outcome === 'done') await waitFor(() => expect(screen.queryByRole('button', { name: /^Release room/ })).toBeNull());
+ else {
+ await waitFor(() => expect(mocks.toastError).toHaveBeenCalledWith('bots.channels.lanes.archiveFailed'));
expect(await screen.findByRole('button', { name: /^Release room/ })).toBeTruthy();
- } else {
- await waitFor(() => expect(lanesApi.archiveLane).toHaveBeenCalledWith({ id: 'a1b2c3d4e5f6', sessionId: 's-topic' }));
- if (outcome === 'done') await waitFor(() => expect(screen.queryByRole('button', { name: /^Release room/ })).toBeNull());
- else {
- expect(await screen.findByText('bots.channels.lanes.archiveFailed')).toBeTruthy();
- expect(await screen.findByRole('button', { name: /^Release room/ })).toBeTruthy();
- }
}
+ expect(mocks.confirm).not.toHaveBeenCalled();
expect(lanesApi.resetLane).not.toHaveBeenCalled();
expect(mocks.navigate).not.toHaveBeenCalled();
});
+ // SessionItem 的行内确认合同:误触不写入,4s 超时 / 点击外部撤销,允许列表归档失败后恢复。
+ it.each(['outside', 'timeout'] as const)('dismisses inline archive confirmation on %s without changing the task', async (reason) => {
+ const lanes = [{ sessionId: 's-topic', kind: 'topic', chatId: 'group', threadId: 'topic', name: 'Release room', state: 'idle', lastActivityAt: null, contextMessageCount: 0 }];
+ lanesApi = {
+ listLanes: vi.fn(async () => ({ connectionId: 'a1b2c3d4e5f6', lanes })),
+ archiveLane: vi.fn(),
+ resetLane: vi.fn(),
+ };
+ installApi({ connections: [connection({ channel: 'feishu' })] });
+ render(<BotChannelsPage bot={mia} />);
+ await expandTaskList();
+ const archive = await screen.findByRole('button', { name: 'bots.channels.lanes.archiveAria:{"lane":"Release room"}' });
+ vi.useFakeTimers();
+ try {
+ fireEvent.click(archive);
+ expect(screen.getByRole('button', { name: 'ccAgent.sidebar.sessionMenu.archived' })).toBeTruthy();
+ if (reason === 'timeout') act(() => { vi.advanceTimersByTime(4000); });
+ else fireEvent.mouseDown(document.body);
+ expect(screen.queryByRole('button', { name: 'ccAgent.sidebar.sessionMenu.archived' })).toBeNull();
+ expect(screen.getByRole('button', { name: 'bots.channels.lanes.archiveAria:{"lane":"Release room"}' })).toBeTruthy();
+ expect(lanesApi.archiveLane).not.toHaveBeenCalled();
+ expect(lanesApi.resetLane).not.toHaveBeenCalled();
+ expect(mocks.confirm).not.toHaveBeenCalled();
+ } finally { vi.useRealTimers(); }
+ });
+
// 归档与既有 20 秒轮询竞态;最小输入为归档期间迟到的旧列表,旧测试没有在途读取。
it('does not restore an archived task when an older list request arrives late', async () => {
const lanes = [{ sessionId: 's-topic', kind: 'topic', chatId: 'group', threadId: 'topic', name: 'Release room', state: 'idle', lastActivityAt: null, contextMessageCount: 0 }];
@@ -239,6 +273,7 @@ describe('BotChannelsPage', () => {
const archive = screen.getByRole('button', { name: 'bots.channels.lanes.archiveAria:{"lane":"Release room"}' });
await act(async () => { vi.advanceTimersByTime(20_000); });
await act(async () => { fireEvent.click(archive); });
+ await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'ccAgent.sidebar.sessionMenu.archived' })); });
expect(screen.queryByRole('button', { name: /^Release room/ })).toBeNull();
await act(async () => { finishOldRead({ connectionId: 'a1b2c3d4e5f6', lanes }); });
expect(screen.queryByRole('button', { name: /^Release room/ })).toBeNull();
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index 5e9c1c850c..258afceb8c 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -10133,7 +10133,7 @@
"title": "{{platform}} tasks",
"expand": "Expand {{platform}} tasks",
"collapse": "Collapse {{platform}} tasks",
- "hint": "Each group, topic, and DM from someone else has its own task. If one gets stuck or goes off track, start it over. Its history is kept.",
+ "hint": "Each group, topic, and DM from someone else has its own task. If one gets stuck or goes off track, start it over. Its history is kept. Archiving only hides the list entry; the task keeps running with its context and history. New messages bring it back.",
"ownerName": "Your DM",
"kind": {
"ownerDm": "Main task",
@@ -10161,14 +10161,7 @@
"resetFailed": "Couldn’t start it over. Try again later.",
"loadFailed": "Couldn’t load tasks",
"empty": "No groups or DMs from others yet. They show up here once someone talks to {{name}} in a group or a DM.",
- "archive": "Archive task",
"archiveAria": "Archive “{{lane}}”",
- "archiveConfirm": {
- "title": "Archive “{{lane}}”?",
- "description": "Hide this conversation from this list. Its task, context, history and current reply stay unchanged. New messages bring it back to the list.",
- "confirm": "Archive"
- },
- "archiveDone": "“{{lane}}” archived from the list. Its task and history are kept.",
"archiveFailed": "Could not archive the task"
},
"add": {
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index dc3980ea6e..8206533961 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -10099,7 +10099,7 @@
"title": "{{platform}}のタスク",
"expand": "{{platform}}のタスクを展開",
"collapse": "{{platform}}のタスクを折りたたむ",
- "hint": "グループ、トピック、ほかの人からの DM ごとにタスクがあります。止まったり話がかみ合わなくなったりしたら、やり直せます。履歴は残ります。",
+ "hint": "グループ、トピック、ほかの人からの DM ごとにタスクがあります。止まったり話がかみ合わなくなったりしたら、やり直せます。履歴は残ります。アーカイブは一覧の項目を非表示にするだけで、タスクの実行、コンテキスト、履歴には影響しません。新しいメッセージがあると再び表示されます。",
"ownerName": "あなたとの DM",
"kind": {
"ownerDm": "メインタスク",
@@ -10126,14 +10126,7 @@
"resetFailed": "やり直せませんでした。しばらくしてからもう一度お試しください",
"loadFailed": "タスクを読み込めませんでした",
"empty": "グループやほかの人からの DM はまだありません。グループや DM で誰かが {{name}} に話しかけると、ここに表示されます。",
- "archive": "タスクをアーカイブ",
"archiveAria": "「{{lane}}」をアーカイブ",
- "archiveConfirm": {
- "title": "「{{lane}}」をアーカイブしますか?",
- "description": "この一覧からのみ非表示にします。元のタスク、コンテキスト、履歴、進行中の返信は変わりません。新しいメッセージがあると再び表示されます。",
- "confirm": "アーカイブ"
- },
- "archiveDone": "「{{lane}}」を一覧からアーカイブしました。元のタスクと履歴は保持されています。",
"archiveFailed": "タスクをアーカイブできませんでした"
},
"add": {
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 9792a7c3a4..20f63f3ad8 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -10099,7 +10099,7 @@
"title": "{{platform}} 작업",
"expand": "{{platform}} 작업 펼치기",
"collapse": "{{platform}} 작업 접기",
- "hint": "그룹, 토픽, 다른 사람이 보낸 DM마다 작업이 하나씩 있습니다. 멈추거나 엉뚱한 답을 하면 다시 시작할 수 있으며, 기록은 유지됩니다.",
+ "hint": "그룹, 토픽, 다른 사람이 보낸 DM마다 작업이 하나씩 있습니다. 멈추거나 엉뚱한 답을 하면 다시 시작할 수 있으며, 기록은 유지됩니다. 보관은 목록에서 항목만 숨기며 작업 실행, 컨텍스트, 기록에는 영향을 주지 않습니다. 새 메시지가 오면 다시 표시됩니다.",
"ownerName": "나와의 DM",
"kind": {
"ownerDm": "기본 작업",
@@ -10126,14 +10126,7 @@
"resetFailed": "다시 시작하지 못했어요. 잠시 후 다시 시도해 주세요",
"loadFailed": "작업을 불러오지 못했습니다",
"empty": "아직 그룹이나 다른 사람이 보낸 DM이 없습니다. 그룹이나 DM에서 누군가 {{name}}에게 말을 걸면 여기에 표시됩니다.",
- "archive": "작업 보관",
"archiveAria": "「{{lane}}」 보관",
- "archiveConfirm": {
- "title": "「{{lane}}」을(를) 보관할까요?",
- "description": "이 목록에서만 숨깁니다. 원래 작업, 컨텍스트, 기록 및 진행 중인 답장은 그대로 유지됩니다. 새 메시지가 있으면 목록에 다시 표시됩니다.",
- "confirm": "보관"
- },
- "archiveDone": "「{{lane}}」을(를) 목록에서 보관했습니다. 원래 작업과 기록은 유지됩니다.",
"archiveFailed": "작업을 보관하지 못했습니다"
},
"add": {
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 2609f28230..375ca1899a 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -10099,7 +10099,7 @@
"title": "{{platform}}任务",
"expand": "展开{{platform}}任务",
"collapse": "收起{{platform}}任务",
- "hint": "每个群、话题和其他人的私聊各有一条任务。卡住或答非所问,可以让它重新开始,记录会保留。",
+ "hint": "每个群、话题和其他人的私聊各有一条任务。卡住或答非所问,可以让它重新开始,记录会保留。归档只收起列表记录,不影响任务运行、上下文和历史;有新消息时会重新出现。",
"ownerName": "你的私聊",
"kind": {
"ownerDm": "主任务",
@@ -10126,14 +10126,7 @@
"resetFailed": "没能重新开始,请稍后再试",
"loadFailed": "未能读取任务",
"empty": "还没有群或其他人的私聊。有人在群里或私聊里和 {{name}} 说话后,会出现在这里。",
- "archive": "归档任务",
"archiveAria": "归档「{{lane}}」",
- "archiveConfirm": {
- "title": "归档「{{lane}}」?",
- "description": "只从这份列表中收起,记录会保留,原任务、上下文和正在进行的回复不变。有新消息时会重新出现在列表中。",
- "confirm": "归档"
- },
- "archiveDone": "「{{lane}}」已从列表归档,原任务和记录保留。",
"archiveFailed": "未能归档任务"
},
"add": {
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 72ff28fd81..b611ff8279 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
@@ -10099,7 +10099,7 @@
"title": "{{platform}}任務",
"expand": "展開{{platform}}任務",
"collapse": "收起{{platform}}任務",
- "hint": "每個群組、話題和其他人的私聊各有一條任務。哪條卡住或答非所問,可以讓它重新開始,記錄會保留。",
+ "hint": "每個群組、話題和其他人的私聊各有一條任務。哪條卡住或答非所問,可以讓它重新開始,記錄會保留。歸檔只收起清單記錄,不影響任務執行、上下文和歷史;有新訊息時會重新出現。",
"ownerName": "你的私聊",
"kind": {
"ownerDm": "主任務",
@@ -10126,14 +10126,7 @@
"resetFailed": "未能重新開始,請稍後再試",
"loadFailed": "無法讀取任務",
"empty": "還沒有群組或其他人的私聊。有人在群組或私聊裡和 {{name}} 說話後,會出現在這裡。",
- "archive": "歸檔任務",
"archiveAria": "歸檔「{{lane}}」",
- "archiveConfirm": {
- "title": "歸檔「{{lane}}」?",
- "description": "只從這份清單收起,記錄會保留,原任務、上下文和進行中的回覆不變。有新訊息時會重新出現在清單中。",
- "confirm": "歸檔"
- },
- "archiveDone": "「{{lane}}」已從清單歸檔,原任務和記錄保留。",
"archiveFailed": "無法歸檔任務"
},
"add": {
diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.md
index 813ab46cb6..50d9a465b6 100644
--- a/docs/design-rules/DESIGN.md
+++ b/docs/design-rules/DESIGN.md
@@ -660,7 +660,7 @@ chevron and localized Tip name the next action. Each listed conversation, includ
quiet archive action immediately before the unchanged restart Button, with a 4px
action gap. Reuse the sidebar task archive glyph (`Archive`, 14px, stroke width 2).
Both new actions keep the ordinary pill frame, semantic colors and keyboard focus;
-existing record typography, card, spacing and restart treatment stay unchanged.
+existing record typography, card, spacing and restart treatment stay unchanged. Archive follows SessionItem's inline two-step interaction: replace the icon with the existing compact secondary danger-surface Button and sidebar archive label (xs, 24px high, minimum 56px wide to fit localized labels), overlaid at the same right edge within the original 28px action slot so record wrapping and restart position stay unchanged, dismiss after 4 seconds or an outside click, then remove the row immediately when confirmed and restore it with the shared error toast if persistence fails. No archive confirmation dialog or success notice; explain its list-only effect and return on new messages in the existing section hint. Restart keeps its confirmation.
Keyboard focus uses the theme-invariant `--focus-ring` as a `focus-visible` box-shadow
diff --git a/docs/product-rules/cindy-bots-runtime.md b/docs/product-rules/cindy-bots-runtime.md
index 1b31c59ecc..f21cfc6e4f 100644
--- a/docs/product-rules/cindy-bots-runtime.md
+++ b/docs/product-rules/cindy-bots-runtime.md
@@ -159,7 +159,8 @@ Discord 传输层只放行主人,钉钉群里被 @ 时成员也能触发(成
不改变连接和任务状态。列出这条连接名下的主人私聊(伙伴主任务)与各群 / 话题 / 外部用户私聊
专线,每条可「重新开始」——复用伙伴已有的 `restartBotCanonicalRuntime` 交接(同一条任务、记录与记忆不删,下一条消息
换干净的原生会话),不另写换会话逻辑,见 `im/shared/botImLaneRuntime.ts`。
-每条记录(包括「你的私聊」)可从当前连接的任务列表归档。这里的归档只保存连接名下的列表显示状态,
+每条记录(包括「你的私聊」)归档交互沿用普通任务行:点图标后在行内显示红色「归档」按钮,再点执行;4 秒超时或点外部撤回,不弹确认窗。确认后立即从当前连接列表收起,写入失败恢复并用既有 toast 提示;标题下的说明交代归档行为。
+「重新开始」仍需确认。这里的归档只保存连接名下的列表显示状态,
不修改 `sessions.status` 或 `bot_session_links`,不停止回复、不换任务、不重建上下文;历史、记忆与文件保留。
有新消息时,原任务重新出现在列表中并继续使用同一个 session。主人私聊和桌面伙伴仍共用长期主任务,
从飞书列表归档不会归档或停用这个主任务。旧 preload 没有归档接口时保留查看与重新开始能力。