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): 项目行远程图标紧跟项目名,设备段头去掉条数

Dash270573ab7c85
diff --git a/apps/desktop/src/renderer/__tests__/sidebarRemoteProjectIcon.test.ts b/apps/desktop/src/renderer/__tests__/sidebarRemoteProjectIcon.test.ts
index fef0b9194e..f9298de4b9 100644
--- a/apps/desktop/src/renderer/__tests__/sidebarRemoteProjectIcon.test.ts
+++ b/apps/desktop/src/renderer/__tests__/sidebarRemoteProjectIcon.test.ts
@@ -72,6 +72,23 @@ describe('sidebar remote project icon', () => {
);
expect(sessionItemSource).not.toContain('<span className="min-w-0 flex-1 truncate">');
expect(sessionCardSource).not.toContain("'min-w-0 flex-1 truncate'");
+ // 项目行同规(2026-08-12 用户裁决):项目名 shrink 而非 flex-1,远程图标紧跟
+ // 名字而不是被推到行尾。
+ expect(projectNodeSource).toContain(
+ '<span className="min-w-0 max-w-full shrink truncate">{project.displayName}</span>',
+ );
+ expect(projectNodeSource).not.toContain(
+ '<span className="min-w-0 flex-1 truncate">{project.displayName}</span>',
+ );
+ });
+
+ // 2026-08-12 用户裁决:设备段头的条数去掉——它数的是顶层条目(项目行 + 散排对话
+ // + 对话组)而非任务数,读起来只会误导;「离线」标签接手 ml-auto 保持靠右。
+ it('drops the entry count from the device group header', () => {
+ expect(projectsSectionSource).not.toContain('{section.entries.length}');
+ expect(projectsSectionSource).toContain(
+ '<span className="ml-auto shrink-0 text-xs text-[var(--cmd-palette-item-meta)]">',
+ );
});
// 2026-08-12 用户裁决:按设备分组时列表已按设备切段、段头写着设备名,项目行不再
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/sections/ProjectNode.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/sections/ProjectNode.tsx
index 9ff3436414..2db8f90075 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/sections/ProjectNode.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/sections/ProjectNode.tsx
@@ -333,7 +333,9 @@ export function ProjectNode({
)}
/>
) : (
- <span className="min-w-0 flex-1 truncate">{project.displayName}</span>
+ // shrink 而非 flex-1:让远程图标紧跟项目名,不被推到行尾
+ // (2026-08-12 用户裁决,与会话行的标题 + 远程图标同款)。
+ <span className="min-w-0 max-w-full shrink truncate">{project.displayName}</span>
)}
{!isEditingName && isDeviceLink ? (
<Tip text={remoteIdentity?.displayLabel ?? project.deviceLinkDeviceId ?? ''}>
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/sections/ProjectsSection.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/sections/ProjectsSection.tsx
index fc5960d839..369b16699e 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/sections/ProjectsSection.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/sections/ProjectsSection.tsx
@@ -729,11 +729,11 @@ export function ProjectsSection({
online ? 'bg-[var(--card-status-done)]' : 'bg-[var(--text-tertiary)]',
)}
/>
- <span className="ml-auto shrink-0 text-xs text-[var(--cmd-palette-item-meta)]">
- {section.entries.length}
- </span>
+ {/* 条数已去掉(2026-08-12 用户裁决):它数的是顶层条目
+ (项目行 + 散排对话 + 对话组),不是任务数,读起来只会误导;
+ 段展开后内容本身就是答案。「离线」接手 ml-auto 保持靠右。 */}
{!online && (
- <span className="shrink-0 text-xs text-[var(--cmd-palette-item-meta)]">
+ <span className="ml-auto shrink-0 text-xs text-[var(--cmd-palette-item-meta)]">
{t('ccAgent.sidebar.deviceGroup.offline')}
</span>
)}