Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
merge(main): 再合入主干并保留隐藏任务焦点检查
xuzini-xzn0cf634c0651c
diff --cc apps/desktop/scripts/fixtures/wechat-companion/ui-page.mjsindex 05a1d6e213,1e5d4b8668..3c2bd89600--- a/apps/desktop/scripts/fixtures/wechat-companion/ui-page.mjs+++ b/apps/desktop/scripts/fixtures/wechat-companion/ui-page.mjs@@@ -11,32 -9,119 +11,143 @@@ export defaultexisting: { about: 'Reuse the already authorized personal WeChat connection', data: { bound: true } },assigned: { about: 'Connected teammate and remove-link action', data: { bound: true, companionBotId: 'fixture-cindy' } },other: { about: 'Another teammate owns this connection', data: { bound: true, companionBotId: 'fixture-other' } },+ 'feishu-hidden-tasks': { about: 'Clickable hidden IM records and independent restart action', data: { hiddenIm: true } },+ 'feishu-hidden-tasks-narrow': { about: 'Hidden IM records in a narrow window', data: { hiddenIm: true }, viewport: { width: 360, height: 900 } },+ 'sidebar-394': {+ about: '#6706: 394px card in a wide window',+ viewport: { width: 1280, height: 900 },+ data: { bound: true, companionBotId: 'fixture-cindy', botName: 'Alfred', cardWidth: 394 },+ },+ 'sidebar-320': {+ about: '320px card keeps summary, status and chevron visible',+ viewport: { width: 1280, height: 900 },+ data: { bound: true, companionBotId: 'fixture-cindy', cardWidth: 320 },+ },+ 'wide-settings': {+ about: '760px settings card keeps a compact horizontal header',+ viewport: { width: 1280, height: 900 },+ data: { bound: true, companionBotId: 'fixture-cindy', cardWidth: 760 },+ },+ 'long-name': {+ about: 'Long unbroken teammate name wraps without hiding the connected status',+ viewport: { width: 1280, height: 1000 },+ data: { bound: true, companionBotId: 'fixture-cindy', cardWidth: 394, botName: 'AlfredResearchAndEngineeringCompanionWithAVeryLongName' },+ },+ 'header-action': {+ about: 'Independent sibling-channel switch and long route summary at 320px',+ viewport: { width: 1280, height: 1100 },+ data: { bound: true, companionBotId: 'fixture-cindy', cardWidth: 320, headerAction: true, summary: 'Claude Code · ALongUnbrokenProviderAndModelRouteSummaryForTheChannel' },+ },+ 'header-action-empty': {+ about: 'Independent switch without a route summary in a wide settings card',+ viewport: { width: 1280, height: 900 },+ data: { cardWidth: 760, headerAction: true },+ },+ 'sidebar-empty-320': {+ about: 'Review #6729: empty summary keeps status and chevron at the right edge after wrapping',+ viewport: { width: 1280, height: 900 },+ data: { cardWidth: 320 },+ },+ 'header-action-empty-320': {+ about: 'Empty summary with an independent switch at 320px',+ viewport: { width: 1280, height: 900 },+ data: { cardWidth: 320, headerAction: true },+ },+ 'header-action-empty-394': {+ about: 'Empty summary with an independent switch at 394px',+ viewport: { width: 1280, height: 900 },+ data: { cardWidth: 394, headerAction: true },+ },},+ // Browser/e2e regression for #6706. The existing jsdom unit test covers+ // accordion semantics but cannot detect flex shrink or viewport breakpoints.+ // Minimal failure: 394px assigned WeChat card inside a 1280px viewport.+ // Review regression: null summary at 320px; checking visibility alone misses+ // the wrapped status group jumping to the left. Measure the chevron's edge.async check(page, ui) {+ if (ui.data.hiddenIm) {+ await page.locator('[title="拉拉, 徐紫旎, 姚刘浏"]').waitFor({ state: 'visible' });+ const row = page.locator('button').filter({ hasText: '8c9b5c' });+ await row.waitFor({ state: 'visible' });+ const resting = await row.evaluate((el) => getComputedStyle(el).boxShadow);+ assert.equal(resting, 'none', 'hidden record stays frameless at rest');+ // Programmatic focus does not match :focus-visible; request the keyboard treatment.+ await row.evaluate((el) => el.focus({ focusVisible: true }));+ const focused = await row.evaluate((el) => {+ const style = getComputedStyle(el);+ return {+ visible: el.matches(':focus-visible'),+ boxShadow: style.boxShadow,+ outlineStyle: style.outlineStyle,+ };+ });+ assert.equal(focused.visible, true, 'keyboard focus must match :focus-visible');+ assert.notEqual(focused.boxShadow, 'none', 'focus ring must survive the global outline suppression');+ assert.equal(focused.outlineStyle, 'none');+ await row.evaluate((el) => el.blur());- } else {- await page.locator('#companion-im-wechat-trigger').click();++ return;++ }+ const trigger = page.locator('#companion-im-wechat-trigger');+ await trigger.getByRole('status').waitFor();+ if (ui.data.companionBotId === 'fixture-cindy') {+ await trigger.getByText(ui.data.botName ?? 'Cindy', { exact: true }).waitFor({ state: 'attached' });+ }+ const measureHeader = async (button) => button.evaluate((element) => {+ const text = element.firstElementChild;+ const title = text.firstElementChild;+ const range = document.createRange();+ range.selectNodeContents(title);+ const status = element.querySelector('[role=status]');+ const chevron = element.querySelector('svg');+ const bounds = element.getBoundingClientRect();+ const visible = (node) => {+ const rect = node.getBoundingClientRect();+ return rect.width > 0 && rect.height > 0 && rect.left >= bounds.left && rect.right <= bounds.right;+ };+ const summary = text.nextElementSibling.firstElementChild;+ return {+ textWidth: text.getBoundingClientRect().width,+ titleLines: range.getClientRects().length,+ statusVisible: visible(status),+ chevronVisible: visible(chevron),+ summaryVisible: summary.contains(status) || summary === status || (visible(summary) && summary.scrollWidth <= summary.clientWidth + 1),+ textTop: text.getBoundingClientRect().top,+ statusTop: status.getBoundingClientRect().top,+ textBottom: text.getBoundingClientRect().bottom,+ trailingGap: bounds.right - parseFloat(getComputedStyle(element).paddingRight) - chevron.getBoundingClientRect().right,+ };+ });+ const assertHeader = async (button) => {+ const metrics = await measureHeader(button);+ if (metrics.textWidth < 160 || metrics.titleLines !== 1 || !metrics.statusVisible || !metrics.chevronVisible || !metrics.summaryVisible || Math.abs(metrics.trailingGap) > 1) {+ throw new Error(`Unreadable channel header: ${JSON.stringify(metrics)}`);+ }+ return metrics;+ };+ await ui.capture('collapsed');+ const metrics = await assertHeader(trigger);+ if (ui.case === 'wide-settings' && metrics.statusTop >= metrics.textBottom) {+ throw new Error('Wide settings card unnecessarily stacks its header');+ }+ await trigger.click();+ await page.locator('#companion-im-wechat-panel').waitFor();+ await assertHeader(trigger);+ await ui.capture('expanded');+ await trigger.click();+ if (await trigger.getAttribute('aria-expanded') !== 'false') throw new Error('Card did not collapse');+ if (ui.data.headerAction) {+ const actionTrigger = page.locator('#fixture-action-trigger');+ if (ui.data.summary) await actionTrigger.getByText(ui.data.summary, { exact: true }).waitFor({ state: 'attached' });+ const action = page.getByRole('switch', { name: 'Enable Slack' });+ await action.click();+ if (await action.getAttribute('aria-checked') !== 'true' || await actionTrigger.getAttribute('aria-expanded') !== 'false') {+ throw new Error('Independent header switch toggled the accordion or failed to enable');+ }+ await assertHeader(actionTrigger);+ await actionTrigger.click();+ await page.locator('#fixture-action-panel').waitFor();+ await assertHeader(actionTrigger);+ await ui.capture('header-action-expanded');}},};diff --cc apps/desktop/scripts/fixtures/wechat-companion/wechat-companion-fixture.tsxindex ab8f2a09c0,74ed002b32..a9c25265ec--- a/apps/desktop/scripts/fixtures/wechat-companion/wechat-companion-fixture.tsx+++ b/apps/desktop/scripts/fixtures/wechat-companion/wechat-companion-fixture.tsx@@@ -1,23 -1,34 +1,46 @@@+ import { useState } from 'react';+import { BotChannelsPage } from '../../../src/renderer/features/bots/BotChannelsPage';import type { BotProfile } from '../../../src/renderer/features/bots/botStore';+ import { ImChannelSettingsCard } from '../../../src/renderer/components/settings/ImChannelSettingsCard';+ import { Switch } from '../../../src/renderer/components/ui/switch';import { mountPage, subscription, forbid } from '../../ui-page/harness';+ function HeaderActionCard({ summary }: { summary: string | null }) {+ const [expanded, setExpanded] = useState(false);+ const [enabled, setEnabled] = useState(false);+ return (+ <ImChannelSettingsCard+ id="fixture-action"+ title="Slack"+ description="Cindy channel"+ routeSummary={summary}+ status={<span role="status">Connected</span>}+ headerAction={<Switch aria-label="Enable Slack" checked={enabled} onCheckedChange={setEnabled} />}+ expanded={expanded}+ onToggle={() => setExpanded((value) => !value)}+ >+ <span>Channel settings</span>+ </ImChannelSettingsCard>+ );+ }+mountPage({+ route: '/bots/fixture-cindy?settings=1&settingsPage=channels',host: (ctx) => ({botImConnection: {- list: async () => ({ connections: [] }),+ list: async () => ({ connections: ctx.data.hiddenIm ? [{+ id: 'fixture-feishu', botId: 'fixture-cindy', channel: 'feishu', createdAt: 1,+ botContextId: 'cli_aa53dc2c', status: { kind: 'connected', appId: 'cli_aa53dc2c' },+ identity: { ownerUserId: 'owner' },+ }] : [] }),+ listLanes: async () => ({ connectionId: 'fixture-feishu', lanes: [+ { sessionId: 'fixture-main', kind: 'owner-dm', name: null, chatId: null, threadId: null,+ state: 'idle', lastActivityAt: Date.now() - 3600000, contextMessageCount: 0 },+ { sessionId: 'fixture-topic', kind: 'topic', name: '拉拉, 徐紫旎, 姚刘浏', chatId: 'group', threadId: '8c9b5c',+ state: 'running', lastActivityAt: Date.now() - 300000, contextMessageCount: 11 },+ ] }),+ resetLane: forbid('botImConnection.resetLane'),onChanged: subscription('connections'),},maker: {diff --cc docs/design-rules/design-decision-log.mdindex fbedce2ef5,ed867d81b7..53012bada9--- a/docs/design-rules/design-decision-log.md+++ b/docs/design-rules/design-decision-log.md@@@ -12,8 -12,8 +12,10 @@@## 2026-10+ - **10-22 伙伴输入框双按钮切换**——用户审核交互原型后确认:空输入保留听写与语音对话两个按钮,有可发送内容后在同一槽位显示发送。初稿缩放不明显,按用户反馈扩大到图标 55% ↔ 100%,保留 250ms;按钮壳和命中区固定,不弹跳。只用于本机一对一伙伴,录音、停止、排队和编辑待发内容沿用现有语义。现行依据见 `DESIGN.md §14.4`,实现为 `ChatInput` / `SendButton`,真实组件回归与单页验证随 [#6768](https://github.com/makecindy/cindy/pull/6768) 交付。++- **10-22 消息平台隐藏任务记录登记为无框文字点击层**——用户要求点击记录进入只读详情,并保留列表原有样式;中国大陆版 macOS 测试包已验收。现行:`BotChannelsPage` 的记录名称与摘要是一处窄口径无框文字控件,静止、悬停和按下都不加底、边框或圆角;「重新开始」仍是已登记的紧凑次要按钮,不属于该豁免。键盘焦点用 `--focus-ring` 的 box-shadow ring,因为全局规则会抹掉非输入控件的 outline。这不是设置页其他操作的通用豁免,也不新增键盘焦点的实机截图结论。落点:DESIGN.md §4 Desktop hidden channel records、§5 已登记无框按钮例外。+- **10-21 群聊话题未读沿用伙伴未读蓝点**——用户确认 r4 独立话题原型(话题入口「N 条新回复」「@你」、输入框上方右下角的话题提示与本群话题列表、话题面板「新回复」分隔线)。原型里未读字用蓝色;为守住「近乎全灰」规则,实现只把伙伴未读 token `--bot-unread-bg` 用在 6px 圆点上,旁边文字保持 `--text-primary` 中粗。`DESIGN.md §2 Bot Unread Badge` 的作用域加上这四处话题未读标记,仅限圆点、不作文字色。提示是普通按钮(胶囊档)、列表是普通容器(12px、行 8px),不新增登记形状。现行规则见 `bot-group-chat.md §10「话题未读与提示」`。- **10-20 Desktop 群聊进行中胶囊登记**——[#6549](https://github.com/makecindy/cindy/pull/6549) 的群聊设计采用输入框上方居中、按内容宽的进行中胶囊,展开过程时转为面板。补齐 `DESIGN.md §5` 的具体形状登记与 §4 组件条目,使其与 `bot-group-chat.md §5` 一致:登记仅覆盖 `BotGroupProgressStrip` 收起时承载状态与独立操作的外层可见框;展开面板、内部按钮和其它工具栏不继承此例外。本次只补文档,不改变实现或视觉,也不新增实机验收结论。