Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(working-sidebar): redesign the Overview card (#19487)

Inneifd68b25ae101
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index d7664748a42..eb60b432421 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -2514,20 +2514,26 @@
"workingPanel.overview.branch.detached": "Detached HEAD",
"workingPanel.overview.changes": "Changes",
"workingPanel.overview.changes.none": "No changes",
- "workingPanel.overview.ci.failure": "Checks failed",
- "workingPanel.overview.ci.pending": "Checks running",
+ "workingPanel.overview.ci.failure": "Failed",
+ "workingPanel.overview.ci.pending": "Running",
"workingPanel.overview.empty": "Workspace activity and outputs will appear here as the agent works.",
"workingPanel.overview.emptyTitle": "Ready to work",
"workingPanel.overview.environmentError": "Could not load the repository status",
"workingPanel.overview.execution.device": "Connected device",
"workingPanel.overview.execution.local": "This device",
+ "workingPanel.overview.files": "Files",
"workingPanel.overview.outputs": "Outputs",
- "workingPanel.overview.sync.pull": "Pull incoming commits",
- "workingPanel.overview.sync.push": "Push unpushed commits",
+ "workingPanel.overview.sync.ahead_one": "{{count}} commit ahead",
+ "workingPanel.overview.sync.ahead_other": "{{count}} commits ahead",
+ "workingPanel.overview.sync.behind_one": "{{count}} commit behind",
+ "workingPanel.overview.sync.behind_other": "{{count}} commits behind",
+ "workingPanel.overview.sync.pull": "Pull",
+ "workingPanel.overview.sync.push": "Push",
"workingPanel.overview.title": "Overview",
"workingPanel.overview.viewAll": "View all",
"workingPanel.overview.workspace.empty": "No workspace selected",
"workingPanel.overview.workspace.emptyDesc": "Choose a working directory from the runtime bar",
+ "workingPanel.overview.worktree.of": "Worktree of {{name}}",
"workingPanel.progress": "Progress",
"workingPanel.progress.allCompleted": "All tasks completed",
"workingPanel.resources": "Resources",
diff --git a/locales/en-US/device.json b/locales/en-US/device.json
index c123310b94a..45bdc4a2782 100644
--- a/locales/en-US/device.json
+++ b/locales/en-US/device.json
@@ -13,6 +13,7 @@
"workingDirectory.branchesLoadFailed": "Failed to load branches",
"workingDirectory.branchesLoading": "Loading branches…",
"workingDirectory.branchesNoMatch": "No matching branches",
+ "workingDirectory.branchesTruncated": "{{count}} more — type to filter",
"workingDirectory.browseDescription": "Choose a folder on the connected device.",
"workingDirectory.browseFolders": "Browse folders",
"workingDirectory.cancel": "Cancel",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index 8f2c88c9fcb..eeba0a63c35 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -2514,20 +2514,26 @@
"workingPanel.overview.branch.detached": "游离 HEAD",
"workingPanel.overview.changes": "变更",
"workingPanel.overview.changes.none": "无改动",
- "workingPanel.overview.ci.failure": "检查失败",
- "workingPanel.overview.ci.pending": "检查中",
+ "workingPanel.overview.ci.failure": "失败",
+ "workingPanel.overview.ci.pending": "运行中",
"workingPanel.overview.empty": "Agent 开始工作后,工作区活动和产物会显示在这里。",
"workingPanel.overview.emptyTitle": "准备就绪",
"workingPanel.overview.environmentError": "无法加载仓库状态",
"workingPanel.overview.execution.device": "已连接设备",
"workingPanel.overview.execution.local": "此设备",
+ "workingPanel.overview.files": "文件",
"workingPanel.overview.outputs": "产物",
- "workingPanel.overview.sync.pull": "拉取落后的提交",
- "workingPanel.overview.sync.push": "推送未上传的提交",
+ "workingPanel.overview.sync.ahead_one": "领先 {{count}} 个提交",
+ "workingPanel.overview.sync.ahead_other": "领先 {{count}} 个提交",
+ "workingPanel.overview.sync.behind_one": "落后 {{count}} 个提交",
+ "workingPanel.overview.sync.behind_other": "落后 {{count}} 个提交",
+ "workingPanel.overview.sync.pull": "拉取",
+ "workingPanel.overview.sync.push": "推送",
"workingPanel.overview.title": "概览",
"workingPanel.overview.viewAll": "查看全部",
"workingPanel.overview.workspace.empty": "尚未选择工作区",
"workingPanel.overview.workspace.emptyDesc": "请从运行时栏中选择工作目录",
+ "workingPanel.overview.worktree.of": "{{name}} 的工作树",
"workingPanel.progress": "进度",
"workingPanel.progress.allCompleted": "所有任务已完成",
"workingPanel.resources": "资源",
diff --git a/locales/zh-CN/device.json b/locales/zh-CN/device.json
index 8ae2dc9d042..79e632c5f0a 100644
--- a/locales/zh-CN/device.json
+++ b/locales/zh-CN/device.json
@@ -13,6 +13,7 @@
"workingDirectory.branchesLoadFailed": "分支加载失败",
"workingDirectory.branchesLoading": "加载分支中…",
"workingDirectory.branchesNoMatch": "没有匹配的分支",
+ "workingDirectory.branchesTruncated": "还有 {{count}} 个,输入关键字筛选",
"workingDirectory.browseDescription": "选择已连接设备上的文件夹。",
"workingDirectory.browseFolders": "浏览文件夹",
"workingDirectory.cancel": "取消",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index ba22b391ac5..b9fac8294bf 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -2655,21 +2655,27 @@ export default {
'workingPanel.overview.branch.detached': 'Detached HEAD',
'workingPanel.overview.changes': 'Changes',
'workingPanel.overview.changes.none': 'No changes',
- 'workingPanel.overview.ci.failure': 'Checks failed',
- 'workingPanel.overview.ci.pending': 'Checks running',
+ 'workingPanel.overview.ci.failure': 'Failed',
+ 'workingPanel.overview.ci.pending': 'Running',
'workingPanel.overview.empty':
'Workspace activity and outputs will appear here as the agent works.',
'workingPanel.overview.emptyTitle': 'Ready to work',
'workingPanel.overview.environmentError': 'Could not load the repository status',
'workingPanel.overview.execution.device': 'Connected device',
'workingPanel.overview.execution.local': 'This device',
+ 'workingPanel.overview.files': 'Files',
'workingPanel.overview.outputs': 'Outputs',
- 'workingPanel.overview.sync.pull': 'Pull incoming commits',
- 'workingPanel.overview.sync.push': 'Push unpushed commits',
+ 'workingPanel.overview.sync.ahead_one': '{{count}} commit ahead',
+ 'workingPanel.overview.sync.ahead_other': '{{count}} commits ahead',
+ 'workingPanel.overview.sync.behind_one': '{{count}} commit behind',
+ 'workingPanel.overview.sync.behind_other': '{{count}} commits behind',
+ 'workingPanel.overview.sync.pull': 'Pull',
+ 'workingPanel.overview.sync.push': 'Push',
'workingPanel.overview.title': 'Overview',
'workingPanel.overview.viewAll': 'View all',
'workingPanel.overview.workspace.empty': 'No workspace selected',
'workingPanel.overview.workspace.emptyDesc': 'Choose a working directory from the runtime bar',
+ 'workingPanel.overview.worktree.of': 'Worktree of {{name}}',
'workingPanel.progress': 'Progress',
'workingPanel.progress.allCompleted': 'All tasks completed',
'workingPanel.resources': 'Resources',
diff --git a/packages/locales/src/default/device.ts b/packages/locales/src/default/device.ts
index 76eb64a06f5..56f012bfea7 100644
--- a/packages/locales/src/default/device.ts
+++ b/packages/locales/src/default/device.ts
@@ -27,6 +27,7 @@ export default {
'workingDirectory.branchesLoadFailed': 'Failed to load branches',
'workingDirectory.branchesLoading': 'Loading branches…',
'workingDirectory.branchesNoMatch': 'No matching branches',
+ 'workingDirectory.branchesTruncated': '{{count}} more — type to filter',
'workingDirectory.cancel': 'Cancel',
'workingDirectory.checkoutAction': 'Checkout',
'workingDirectory.checkoutFailed': 'Checkout failed',
diff --git a/src/features/ChatInput/ControlBar/BranchSwitcher.tsx b/src/features/ChatInput/ControlBar/BranchSwitcher.tsx
index 728d8d31831..0795f1dc5d6 100644
--- a/src/features/ChatInput/ControlBar/BranchSwitcher.tsx
+++ b/src/features/ChatInput/ControlBar/BranchSwitcher.tsx
@@ -45,6 +45,9 @@ import { openRenameBranchModal } from './RenameBranchModal';
import { useSwitchWorktree } from './useSwitchWorktree';
import { findWorktreeForBranch, getPathName } from './worktreeHelpers';
+// ponytail: each row mounts three Tooltips, so 800+ branches take seconds to open; cap and let search reach the rest
+const BRANCH_RENDER_CAP = 100;
+
const styles = createStaticStyles(({ css }) => ({
branchLabel: css`
overflow: hidden;
@@ -283,7 +286,7 @@ const BranchSwitcher = memo<BranchSwitcherProps>(
} = useSWR(
open ? deviceKeys.gitBranches(deviceId ?? 'local', path) : null,
() => gitService.listGitBranches({ deviceId, path }),
- { revalidateOnFocus: false, shouldRetryOnError: false },
+ { keepPreviousData: true, revalidateOnFocus: false, shouldRetryOnError: false },
);
const { data: workingStatus, mutate: mutateWorkingStatus } = useFetchGitWorkingTreeStatus(
deviceId,
@@ -340,6 +343,8 @@ const BranchSwitcher = memo<BranchSwitcherProps>(
if (!query) return branches;
return branches.filter((b) => b.name.toLowerCase().includes(query));
}, [branches, search]);
+ const visibleBranches = filtered.slice(0, BRANCH_RENDER_CAP);
+ const hiddenCount = filtered.length - visibleBranches.length;
const handleCheckout = useCallback(
async (branch: string, create = false) => {
@@ -537,7 +542,7 @@ const BranchSwitcher = memo<BranchSwitcherProps>(
</div>
)}
- {filtered.map((branch) => {
+ {visibleBranches.map((branch) => {
const isCurrent = branch.name === currentBranch;
const isBusy = busyBranch === branch.name;
// A branch another worktree holds can't be checked out here
@@ -615,6 +620,11 @@ const BranchSwitcher = memo<BranchSwitcherProps>(
</DropdownMenuItem>
);
})}
+ {hiddenCount > 0 && (
+ <div className={styles.emptyState}>
+ {t('workingDirectory.branchesTruncated', { count: hiddenCount })}
+ </div>
+ )}
</div>
<div className={styles.createItemWrapper}>
diff --git a/src/features/Conversation/WorkingSidebar/Overview/OverviewHeader.tsx b/src/features/Conversation/WorkingSidebar/Overview/OverviewHeader.tsx
new file mode 100644
index 00000000000..d484f9591e4
--- /dev/null
+++ b/src/features/Conversation/WorkingSidebar/Overview/OverviewHeader.tsx
@@ -0,0 +1,128 @@
+import { Github } from '@lobehub/icons';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { createStaticStyles, cssVar, cx } from 'antd-style';
+import { FolderGit2Icon, FolderIcon } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+const styles = createStaticStyles(({ css, cssVar }) => ({
+ dot: css`
+ flex-shrink: 0;
+
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+
+ background: ${cssVar.colorSuccess};
+ `,
+ header: css`
+ cursor: pointer;
+ flex-shrink: 0;
+ padding-block: 14px 2px;
+ padding-inline: 16px 14px;
+ `,
+ identity: css`
+ overflow: hidden;
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: 1px;
+
+ min-width: 0;
+ `,
+ name: css`
+ overflow: hidden;
+
+ font-size: 14px;
+ font-weight: 600;
+ line-height: 18px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ `,
+ sub: css`
+ overflow: hidden;
+ display: flex;
+ gap: 6px;
+ align-items: center;
+
+ font-size: 12px;
+ line-height: 16px;
+ color: ${cssVar.colorTextTertiary};
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ `,
+ subText: css`
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ `,
+ tile: css`
+ display: grid;
+ flex-shrink: 0;
+ place-items: center;
+
+ width: 32px;
+ height: 32px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: 9px;
+
+ color: ${cssVar.colorText};
+
+ background: ${cssVar.colorFillTertiary};
+ `,
+}));
+
+interface OverviewHeaderProps {
+ deviceId?: string;
+ error?: boolean;
+ name: string;
+ onClick?: () => void;
+ path: string;
+ repoType?: string;
+}
+
+const OverviewHeader = memo<OverviewHeaderProps>(
+ ({ deviceId, error, name, onClick, path, repoType }) => {
+ const { t } = useTranslation('chat');
+ const dotColor = error ? cssVar.colorError : deviceId ? cssVar.colorInfo : undefined;
+
+ return (
+ <Flexbox
+ horizontal
+ align={'center'}
+ className={styles.header}
+ gap={10}
+ role={'button'}
+ title={path}
+ onClick={onClick}
+ >
+ <span className={styles.tile}>
+ {repoType === 'github' ? (
+ <Github size={18} />
+ ) : (
+ <Icon icon={repoType ? FolderGit2Icon : FolderIcon} size={18} />
+ )}
+ </span>
+ <span className={styles.identity}>
+ <span className={styles.name}>{name}</span>
+ <span className={styles.sub}>
+ <i className={cx(styles.dot)} style={dotColor ? { background: dotColor } : undefined} />
+ <span className={styles.subText}>
+ {t(
+ deviceId
+ ? 'workingPanel.overview.execution.device'
+ : 'workingPanel.overview.execution.local',
+ )}
+ {' · '}
+ {path}
+ </span>
+ </span>
+ </span>
+ </Flexbox>
+ );
+ },
+);
+
+OverviewHeader.displayName = 'OverviewHeader';
+
+export default OverviewHeader;
diff --git a/src/features/Conversation/WorkingSidebar/Overview/OverviewRow.tsx b/src/features/Conversation/WorkingSidebar/Overview/OverviewRow.tsx
new file mode 100644
index 00000000000..dd2fd930691
--- /dev/null
+++ b/src/features/Conversation/WorkingSidebar/Overview/OverviewRow.tsx
@@ -0,0 +1,153 @@
+import { Flexbox, Icon, type IconProps } from '@lobehub/ui';
+import { createStaticStyles, cx } from 'antd-style';
+import { ChevronRightIcon, ChevronsUpDownIcon } from 'lucide-react';
+import { memo, type ReactNode } from 'react';
+
+export const rowStyles = createStaticStyles(({ css, cssVar }) => ({
+ changeAdditions: css`
+ font-variant-numeric: tabular-nums;
+ color: ${cssVar.colorSuccess};
+ `,
+ changeDeletions: css`
+ font-variant-numeric: tabular-nums;
+ color: ${cssVar.colorError};
+ `,
+ icon: css`
+ flex-shrink: 0;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ num: css`
+ margin-inline-end: 5px;
+
+ font-family: ${cssVar.fontFamilyCode};
+ font-size: 12px;
+ font-weight: 500;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ row: css`
+ cursor: pointer;
+
+ flex-shrink: 0;
+
+ min-height: 32px;
+ padding-block: 5px;
+ padding-inline: 8px;
+ border-radius: 8px;
+
+ transition: background-color 0.12s ease;
+
+ &:hover {
+ background: ${cssVar.colorFillTertiary};
+ }
+ `,
+ rowAction: css`
+ font-size: 12px;
+ font-weight: 500;
+ color: ${cssVar.colorTextSecondary};
+ `,
+ rowStatic: css`
+ cursor: default;
+
+ &:hover {
+ background: transparent;
+ }
+ `,
+ rowTrailing: css`
+ display: flex;
+ flex-shrink: 0;
+ gap: 6px;
+ align-items: center;
+
+ font-size: 12px;
+ font-variant-numeric: tabular-nums;
+ line-height: 18px;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ rowValue: css`
+ overflow: hidden;
+ flex: 1;
+
+ min-width: 0;
+
+ font-size: 13px;
+ line-height: 20px;
+ color: ${cssVar.colorText};
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ `,
+ rowValueDanger: css`
+ color: ${cssVar.colorError};
+ `,
+ rowValueWeak: css`
+ font-size: 12.5px;
+ color: ${cssVar.colorTextSecondary};
+ `,
+}));
+
+export interface OverviewRowProps {
+ danger?: boolean;
+ icon?: IconProps['icon'];
+ iconColor?: string;
+ iconNode?: ReactNode;
+ iconSize?: number;
+ interactive?: boolean;
+ onClick?: () => void;
+ title?: string;
+ trailing?: ReactNode;
+ value: ReactNode;
+ weak?: boolean;
+}
+
+export const OverviewRow = memo<OverviewRowProps>(
+ ({
+ danger,
+ icon,
+ iconColor,
+ iconNode,
+ iconSize = 16,
+ interactive,
+ onClick,
+ title,
+ trailing,
+ value,
+ weak,
+ }) => (
+ <Flexbox
+ horizontal
+ align={'center'}
+ className={cx(rowStyles.row, !onClick && !interactive && rowStyles.rowStatic)}
+ gap={10}
+ role={onClick || interactive ? 'button' : undefined}
+ onClick={onClick}
+ >
+ {iconNode ?? (
+ <Icon
+ className={rowStyles.icon}
+ icon={icon!}
+ size={iconSize}
+ style={iconColor ? { color: iconColor } : undefined}
+ />
+ )}
+ <span
+ title={title}
+ className={cx(
+ rowStyles.rowValue,
+ danger && rowStyles.rowValueDanger,
+ weak && rowStyles.rowValueWeak,
+ )}
+ >
+ {value}
+ </span>
+ {trailing ? <span className={rowStyles.rowTrailing}>{trailing}</span> : null}
+ </Flexbox>
+ ),
+);
+
+OverviewRow.displayName = 'OverviewRow';
+
+export const PickerGlyph = () => (
+ <Icon icon={ChevronsUpDownIcon} size={13} style={{ opacity: 0.6 }} />
+);
+export const ChevronRight = () => (
+ <Icon icon={ChevronRightIcon} size={14} style={{ opacity: 0.6 }} />
+);
diff --git a/src/features/Conversation/WorkingSidebar/Overview/index.tsx b/src/features/Conversation/WorkingSidebar/Overview/index.tsx
index d57b35142aa..947227b978e 100644
--- a/src/features/Conversation/WorkingSidebar/Overview/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/Overview/index.tsx
@@ -1,22 +1,23 @@
'use client';
-import { Empty, Flexbox, Icon, type IconProps, Tooltip } from '@lobehub/ui';
-import { ActionIcon, Button, Skeleton, toast } from '@lobehub/ui/base-ui';
+import { Empty, Flexbox, Icon, Tooltip } from '@lobehub/ui';
+import { Button, Skeleton, toast } from '@lobehub/ui/base-ui';
import { SkillsIcon } from '@lobehub/ui/icons';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import {
ArrowDownIcon,
ArrowUpIcon,
BoxesIcon,
- ChevronDownIcon,
ClipboardListIcon,
+ FilesIcon,
FileTextIcon,
GitBranchIcon,
GitForkIcon,
LaptopIcon,
RefreshCwIcon,
+ TriangleAlertIcon,
} from 'lucide-react';
-import { memo, type ReactNode, useCallback, useMemo, useState } from 'react';
+import { memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import RingLoadingIcon from '@/components/RingLoading';
@@ -26,7 +27,6 @@ import {
PR_STATE_VISUAL,
} from '@/features/AgentSidebar/Topic/List/Item/metaCardData';
import BranchSwitcher from '@/features/ChatInput/ControlBar/BranchSwitcher';
-import DirIcon from '@/features/ChatInput/ControlBar/DirIcon';
import WorktreeSwitcher from '@/features/ChatInput/ControlBar/WorktreeSwitcher';
import { getAllWorkSummaries } from '@/features/Conversation/store/slices/data/workSummaries';
import WorkSummaryCard from '@/features/Work/WorkSummaryCard';
@@ -46,187 +46,69 @@ import {
import ProgressSection from '../ProgressSection';
import { collectChangeStats, isLinkedWorktreeCheckout, shouldShowCiLabel } from './overviewData';
+import OverviewHeader from './OverviewHeader';
+import { ChevronRight, OverviewRow, PickerGlyph, rowStyles } from './OverviewRow';
const styles = createStaticStyles(({ css, cssVar }) => ({
body: css`
overflow-y: auto;
- padding-block: 4px 10px;
- padding-inline: 8px;
- `,
- changeAdditions: css`
- font-variant-numeric: tabular-nums;
- color: ${cssVar.colorSuccess};
`,
- changeDeletions: css`
- font-variant-numeric: tabular-nums;
- color: ${cssVar.colorError};
+ emptyWorkspace: css`
+ padding-block: 28px 30px;
+ padding-inline: 20px;
`,
- divider: css`
- flex-shrink: 0;
+ pill: css`
+ display: inline-flex;
+ gap: 4px;
+ align-items: center;
- height: 1px;
- margin-block: 6px;
- margin-inline: 8px;
+ height: 20px;
+ padding-inline: 7px;
+ border-radius: 6px;
- background: ${cssVar.colorBorderSecondary};
- `,
- icon: css`
- flex-shrink: 0;
- color: ${cssVar.colorTextTertiary};
+ font-size: 11.5px;
+ font-weight: 500;
+ line-height: 20px;
`,
- row: css`
- cursor: pointer;
-
+ section: css`
flex-shrink: 0;
-
- min-height: 32px;
- padding-block: 5px;
+ padding-block: 8px;
padding-inline: 8px;
- border-radius: 6px;
-
- transition: background-color 0.12s ease;
-
- &:hover {
- background: ${cssVar.colorFillTertiary};
- }
- `,
- rowStatic: css`
- cursor: default;
- &:hover {
- background: transparent;
+ & + & {
+ border-block-start: 1px solid ${cssVar.colorBorderSecondary};
}
`,
- rowTrailing: css`
- display: flex;
- flex-shrink: 0;
- gap: 6px;
- align-items: center;
-
- font-size: 12px;
- font-variant-numeric: tabular-nums;
- line-height: 18px;
- color: ${cssVar.colorTextTertiary};
- `,
- rowValue: css`
- overflow: hidden;
- flex: 1;
-
- min-width: 0;
-
- font-size: 13px;
- line-height: 20px;
- color: ${cssVar.colorText};
- text-overflow: ellipsis;
- white-space: nowrap;
- `,
- rowValueDanger: css`
- color: ${cssVar.colorError};
- `,
sectionHeader: css`
- padding-block: 4px 6px;
- padding-inline: 10px;
+ padding-block: 0 4px;
+ padding-inline: 8px;
`,
sectionTitle: css`
font-size: 10.5px;
font-weight: 600;
- color: ${cssVar.colorTextSecondary};
+ color: ${cssVar.colorTextTertiary};
text-transform: uppercase;
letter-spacing: 0.08em;
`,
skeleton: css`
padding-block: 4px;
- padding-inline: 10px;
- `,
- weakLabel: css`
- font-size: 12px;
- line-height: 18px;
- `,
- weakRow: css`
- cursor: pointer;
-
- flex-shrink: 0;
-
- min-height: 28px;
- padding-block: 3px;
padding-inline: 8px;
- border-radius: 6px;
-
- color: ${cssVar.colorTextSecondary};
-
- transition: background-color 0.12s ease;
-
- &:hover {
- color: ${cssVar.colorText};
- background: ${cssVar.colorFillTertiary};
- }
`,
}));
interface OverviewProps {
active: boolean;
- /** Enables the branch / worktree switchers; without it those rows are read-only. */
agentId?: string;
deviceId?: string;
environmentAvailable: boolean;
onOpenTab: (tab: string) => void;
repoType?: string;
- /** The repo the conversation is anchored to (worktrees hang off it). */
sourcePath?: string;
workingDirectory?: string;
}
const pathBasename = (path: string) => path.replaceAll('\\', '/').split('/').findLast(Boolean);
-interface OverviewRowProps {
- danger?: boolean;
- icon?: IconProps['icon'];
- iconColor?: string;
- /** Pre-rendered leading node (e.g. DirIcon) used instead of a lucide `icon`. */
- iconNode?: ReactNode;
- /** Row LOOKS clickable but the click is handled by a wrapping dropdown trigger. */
- interactive?: boolean;
- onClick?: () => void;
- title?: string;
- trailing?: ReactNode;
- value: ReactNode;
-}
-
-/**
- * The panel's single row grammar: `icon + value + trailing`. The value column is
- * the fact itself (branch name, PR title), never a noun label describing it; the
- * trailing column holds exactly one of a number, a status, or a chevron.
- */
-const OverviewRow = memo<OverviewRowProps>(
- ({ danger, icon, iconColor, iconNode, interactive, onClick, title, trailing, value }) => (
- <Flexbox
- horizontal
- align={'center'}
- className={cx(styles.row, !onClick && !interactive && styles.rowStatic)}
- gap={10}
- role={onClick || interactive ? 'button' : undefined}
- onClick={onClick}
- >
- {iconNode ?? (
- <Icon
- className={styles.icon}
- icon={icon!}
- size={16}
- style={iconColor ? { color: iconColor } : undefined}
- />
- )}
- <span className={cx(styles.rowValue, danger && styles.rowValueDanger)} title={title}>
- {value}
- </span>
- {trailing ? <span className={styles.rowTrailing}>{trailing}</span> : null}
- </Flexbox>
- ),
-);
-
-OverviewRow.displayName = 'OverviewRow';
-
-const Chevron = () => <Icon icon={ChevronDownIcon} size={14} style={{ opacity: 0.6 }} />;
-
const Overview = memo<OverviewProps>(
({
active,
@@ -290,6 +172,7 @@ const Overview = memo<OverviewProps>(
const isGitLoading = branchLoading || reviewLoading;
const visibleWorks = works.slice(0, 3);
const directoryName = workingDirectory ? pathBasename(workingDirectory) : undefined;
+ const hasWorkspace = environmentAvailable && !!workingDirectory;
const isLinkedWorktree = isLinkedWorktreeCheckout(workingDirectory, worktrees);
@@ -367,14 +250,22 @@ const Overview = memo<OverviewProps>(
icon={GitBranchIcon}
interactive={!detached && !!agentId && !!workingDirectory}
title={detached ? tDevice('workingDirectory.detachedHead', { sha: branch ?? '' }) : branch}
- trailing={!detached && agentId ? <Chevron /> : undefined}
- value={branch}
+ trailing={!detached && agentId ? <PickerGlyph /> : undefined}
+ value={
+ detached ? (
+ <>
+ <span className={rowStyles.num}>{branch}</span>
+ {t('workingPanel.overview.branch.detached')}
+ </>
+ ) : (
+ branch
+ )
+ }
/>
);
const gitRows = (
<>
- {/* Branch: the value owns the main column; switching happens in place. */}
{branch &&
(!detached && agentId && workingDirectory ? (
<BranchSwitcher
@@ -398,7 +289,39 @@ const Overview = memo<OverviewProps>(
branchRow
))}
- {/* Worktree: only when the checkout actually is a linked worktree. */}
+ {showBehind && (
+ <OverviewRow
+ icon={ArrowDownIcon}
+ iconColor={cssVar.colorError}
+ iconSize={14}
+ value={t('workingPanel.overview.sync.behind', { count: aheadBehind!.behind })}
+ trailing={
+ pulling ? (
+ <RingLoadingIcon size={12} />
+ ) : (
+ <span className={rowStyles.rowAction}>{t('workingPanel.overview.sync.pull')}</span>
+ )
+ }
+ onClick={syncBusy ? undefined : handlePull}
+ />
+ )}
+ {showAhead && (
+ <OverviewRow
+ icon={ArrowUpIcon}
+ iconColor={cssVar.colorInfo}
+ iconSize={14}
+ value={t('workingPanel.overview.sync.ahead', { count: aheadBehind!.ahead })}
+ trailing={
+ pushing ? (
+ <RingLoadingIcon size={12} />
+ ) : (
+ <span className={rowStyles.rowAction}>{t('workingPanel.overview.sync.push')}</span>
+ )
+ }
+ onClick={syncBusy ? undefined : handlePush}
+ />
+ )}
+
{isLinkedWorktree && branch && workingDirectory && agentId && (
<WorktreeSwitcher
agentId={agentId}
@@ -415,22 +338,23 @@ const Overview = memo<OverviewProps>(
<OverviewRow
interactive
icon={GitForkIcon}
- title={workingDirectory}
- trailing={<Chevron />}
- value={pathBasename(workingDirectory)}
+ title={sourcePath ?? workingDirectory}
+ trailing={<PickerGlyph />}
+ value={t('workingPanel.overview.worktree.of', {
+ name: pathBasename(sourcePath ?? workingDirectory),
+ })}
/>
</WorktreeSwitcher>
)}
- {/* Changes: the ±N numbers are the value — no sentence about them. */}
<OverviewRow
icon={ClipboardListIcon}
value={t('workingPanel.overview.changes')}
trailing={
changeStats.files > 0 ? (
<>
- <span className={styles.changeAdditions}>+{changeStats.additions}</span>
- <span className={styles.changeDeletions}>−{changeStats.deletions}</span>
+ <span className={rowStyles.changeAdditions}>+{changeStats.additions}</span>
+ <span className={rowStyles.changeDeletions}>−{changeStats.deletions}</span>
</>
) : (
t('workingPanel.overview.changes.none')
@@ -439,43 +363,29 @@ const Overview = memo<OverviewProps>(
onClick={() => onOpenTab('review')}
/>
- {/* Sync: the row is the action, one action per row. */}
- {showBehind && (
- <OverviewRow
- icon={ArrowDownIcon}
- iconColor={cssVar.colorError}
- trailing={pulling ? <RingLoadingIcon size={12} /> : aheadBehind!.behind}
- value={t('workingPanel.overview.sync.pull')}
- onClick={syncBusy ? undefined : handlePull}
- />
- )}
- {showAhead && (
- <OverviewRow
- icon={ArrowUpIcon}
- iconColor={cssVar.colorInfo}
- trailing={pushing ? <RingLoadingIcon size={12} /> : aheadBehind!.ahead}
- value={t('workingPanel.overview.sync.push')}
- onClick={syncBusy ? undefined : handlePush}
- />
- )}
-
- {/* Linked PR with its CI rollup as trailing status — passing is the
- steady state, so only failure / pending earn a text label. */}
{pullRequest && prVisual && ci && (
<Tooltip title={`#${pullRequest.number} ${pullRequest.title}`}>
<div>
<OverviewRow
icon={prVisual.icon}
iconColor={prVisual.color}
- value={`#${pullRequest.number} ${pullRequest.title}`}
trailing={
- <>
- <Icon icon={ci.icon} size={14} style={{ color: ci.color }} />
+ <span
+ className={styles.pill}
+ style={{ background: `color-mix(in srgb, 12%, transparent)`, color: ci.color }}
+ >
+ <Icon icon={ci.icon} size={12} />
{shouldShowCiLabel(ciStatus)
? t(
`workingPanel.overview.ci.${ciStatus as 'failure' | 'pending'}` as 'workingPanel.overview.ci.failure',
)
: null}
+ </span>
+ }
+ value={
+ <>
+ <span className={rowStyles.num}>#{pullRequest.number}</span>
+ {pullRequest.title}
</>
}
onClick={
@@ -490,61 +400,68 @@ const Overview = memo<OverviewProps>(
</>
);
+ const workspaceSection = repoType ? (
+ isGitLoading ? (
+ <div className={styles.skeleton}>
+ <Skeleton.Text rows={3} />
+ </div>
+ ) : gitError ? (
+ <OverviewRow
+ danger
+ icon={TriangleAlertIcon}
+ iconColor={cssVar.colorError}
+ value={t('workingPanel.overview.environmentError')}
+ trailing={
+ <Button
+ icon={<Icon icon={RefreshCwIcon} size={12} />}
+ size={'small'}
+ onClick={() => void refreshGit()}
+ >
+ {tCommon('retry')}
+ </Button>
+ }
+ />
+ ) : (
+ gitRows
+ )
+ ) : (
+ <OverviewRow
+ icon={FilesIcon}
+ trailing={<ChevronRight />}
+ value={t('workingPanel.overview.files')}
+ onClick={() => onOpenTab('files')}
+ />
+ );
+
return (
- <Flexbox className={styles.body} gap={10}>
- {environmentAvailable && (
- <Flexbox>
- <OverviewRow
- icon={workingDirectory ? undefined : LaptopIcon}
- title={workingDirectory}
- value={directoryName || t('workingPanel.overview.workspace.empty')}
- iconNode={
- workingDirectory ? (
- <DirIcon repoType={isGithub ? 'github' : repoType ? 'git' : undefined} />
- ) : undefined
- }
- trailing={
- workingDirectory
- ? t(
- deviceId
- ? 'workingPanel.overview.execution.device'
- : 'workingPanel.overview.execution.local',
- )
- : undefined
- }
- onClick={workingDirectory ? () => onOpenTab('files') : undefined}
+ <Flexbox className={styles.body}>
+ {hasWorkspace && (
+ <>
+ <OverviewHeader
+ deviceId={deviceId}
+ error={!!gitError}
+ name={directoryName!}
+ path={workingDirectory}
+ repoType={repoType}
+ onClick={() => onOpenTab('files')}
/>
+ <Flexbox className={styles.section}>{workspaceSection}</Flexbox>
+ </>
+ )}
- {repoType && workingDirectory && isGitLoading ? (
- <div className={styles.skeleton}>
- <Skeleton.Text rows={2} />
- </div>
- ) : gitError ? (
- // A failed probe is one row, not a panel-bending error block.
- <OverviewRow
- danger
- icon={GitBranchIcon}
- iconColor={cssVar.colorError}
- value={t('workingPanel.overview.environmentError')}
- trailing={
- <ActionIcon
- icon={RefreshCwIcon}
- size={'small'}
- title={tCommon('retry')}
- onClick={() => void refreshGit()}
- />
- }
- />
- ) : repoType && workingDirectory ? (
- gitRows
- ) : null}
- </Flexbox>
+ {environmentAvailable && !workingDirectory && (
+ <Empty
+ className={cx(styles.section, styles.emptyWorkspace)}
+ description={t('workingPanel.overview.workspace.emptyDesc')}
+ icon={LaptopIcon}
+ title={t('workingPanel.overview.workspace.empty')}
+ />
)}
- <ProgressSection />
+ <ProgressSection className={styles.section} />
{visibleWorks.length > 0 && (
- <Flexbox>
+ <Flexbox className={styles.section}>
<Flexbox
horizontal
align={'center'}
@@ -552,7 +469,12 @@ const Overview = memo<OverviewProps>(
justify={'space-between'}
>
<span className={styles.sectionTitle}>{t('workingPanel.overview.outputs')}</span>
- <Button size={'small'} type={'text'} onClick={() => onOpenTab('works')}>
+ <Button
+ outdent={'end'}
+ size={'small'}
+ type={'text'}
+ onClick={() => onOpenTab('works')}
+ >
{t('workingPanel.overview.viewAll')}
</Button>
</Flexbox>
@@ -562,44 +484,35 @@ const Overview = memo<OverviewProps>(
</Flexbox>
)}
- {/* Resource entries: kept, but demoted — same row grammar, lower weight. */}
- <Flexbox>
- {environmentAvailable && <div className={styles.divider} />}
- <Flexbox
- horizontal
- align={'center'}
- className={styles.weakRow}
- gap={10}
- role={'button'}
- onClick={() => onOpenTab('skills')}
- >
- <Icon className={styles.icon} icon={SkillsIcon} size={14} />
- <span className={styles.weakLabel}>{t('workingPanel.resources.filter.skills')}</span>
- </Flexbox>
- {!isHetero && (
- <Flexbox
- horizontal
- align={'center'}
- className={styles.weakRow}
- gap={10}
- role={'button'}
- onClick={() => onOpenTab('documents')}
- >
- <Icon className={styles.icon} icon={FileTextIcon} size={14} />
- <span className={styles.weakLabel}>
- {t('workingPanel.resources.filter.documents')}
- </span>
- </Flexbox>
- )}
- </Flexbox>
-
- {!topicId && visibleWorks.length === 0 && !workingDirectory && (
+ {!environmentAvailable && !topicId && visibleWorks.length === 0 && (
<Empty
+ className={styles.section}
description={t('workingPanel.overview.empty')}
icon={BoxesIcon}
title={t('workingPanel.overview.emptyTitle')}
/>
)}
+
+ <Flexbox className={styles.section}>
+ <OverviewRow
+ weak
+ icon={SkillsIcon}
+ iconSize={15}
+ trailing={<ChevronRight />}
+ value={t('workingPanel.resources.filter.skills')}
+ onClick={() => onOpenTab('skills')}
+ />
+ {!isHetero && (
+ <OverviewRow
+ weak
+ icon={FileTextIcon}
+ iconSize={15}
+ trailing={<ChevronRight />}
+ value={t('workingPanel.resources.filter.documents')}
+ onClick={() => onOpenTab('documents')}
+ />
+ )}
+ </Flexbox>
</Flexbox>
);
},
diff --git a/src/features/Conversation/WorkingSidebar/ProgressSection/index.tsx b/src/features/Conversation/WorkingSidebar/ProgressSection/index.tsx
index 9b03fd490ed..f818cbbcf12 100644
--- a/src/features/Conversation/WorkingSidebar/ProgressSection/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/ProgressSection/index.tsx
@@ -123,7 +123,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
`,
}));
-const ProgressSection = memo(() => {
+const ProgressSection = memo<{ className?: string }>(({ className }) => {
const { t } = useTranslation('chat');
const [expanded, setExpanded] = useState(true);
const context = useAgentContext();
@@ -158,7 +158,7 @@ const ProgressSection = memo(() => {
const ringOffset = RING_CIRCUM * (1 - progress.completionPercent / 100);
return (
- <div data-testid="workspace-progress">
+ <div className={className} data-testid="workspace-progress">
<Flexbox
horizontal
align="center"
diff --git a/src/features/Conversation/WorkingSidebar/__tests__/index.test.tsx b/src/features/Conversation/WorkingSidebar/__tests__/index.test.tsx
index 8ce94494dca..bd1c790280e 100644
--- a/src/features/Conversation/WorkingSidebar/__tests__/index.test.tsx
+++ b/src/features/Conversation/WorkingSidebar/__tests__/index.test.tsx
@@ -729,7 +729,7 @@ describe('AgentWorkingSidebar — tab strip', () => {
render(<AgentWorkingSidebar />);
- expect(screen.getByRole('complementary')).toHaveTextContent('workingPanel.overview.title');
+ expect(screen.getByRole('complementary')).toHaveTextContent('Open Review from Overview');
expect(screen.getByTestId('right-panel')).not.toBeVisible();
expect(
screen.queryByRole('button', { name: 'workingPanel.resources.filter.skills' }),
@@ -756,7 +756,7 @@ describe('AgentWorkingSidebar — tab strip', () => {
render(<AgentWorkingSidebar />);
- expect(screen.getByRole('complementary')).toHaveTextContent('workingPanel.overview.title');
+ expect(screen.getByRole('complementary')).toHaveTextContent('Open Review from Overview');
expect(screen.getByRole('button', { name: 'workingPanel.openMenu.title' })).toBeInTheDocument();
expect(screen.getByTestId('params-loading')).toBeInTheDocument();
});
diff --git a/src/features/Conversation/WorkingSidebar/index.tsx b/src/features/Conversation/WorkingSidebar/index.tsx
index dd0d4ca418d..c07f3e9ba58 100644
--- a/src/features/Conversation/WorkingSidebar/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/index.tsx
@@ -118,11 +118,6 @@ const styles = createStaticStyles(({ css }) => ({
overflow-y: auto;
min-height: 0;
`,
- overviewHeader: css`
- flex-shrink: 0;
- padding-block: 6px;
- padding-inline: 12px 8px;
- `,
overviewPanel: css`
overflow: hidden;
display: flex;
@@ -132,7 +127,7 @@ const styles = createStaticStyles(({ css }) => ({
max-height: calc(100% - 32px);
margin: 16px;
border: 1px solid ${cssVar.colorBorderSecondary};
- border-radius: 20px;
+ border-radius: 16px;
background: ${cssVar.colorBgContainer};
box-shadow: ${cssVar.boxShadowTertiary};
@@ -149,15 +144,6 @@ const styles = createStaticStyles(({ css }) => ({
padding-block-start: 44px;
}
`,
- overviewTitle: css`
- overflow: hidden;
- flex: 1;
-
- font-size: 14px;
- font-weight: 600;
- text-overflow: ellipsis;
- white-space: nowrap;
- `,
tabs: css`
overflow-anchor: none;
scrollbar-width: none;
@@ -952,9 +938,6 @@ const AgentWorkingSidebar = memo<AgentWorkingSidebarProps>(({ availableWidth })
style={{ transformOrigin: 'top right', width: overviewWidth }}
transition={OVERVIEW_CARD_TRANSITION}
>
- <Flexbox horizontal align={'center'} className={styles.overviewHeader} gap={8}>
- <span className={styles.overviewTitle}>{t('workingPanel.overview.title')}</span>
- </Flexbox>
<Flexbox className={styles.overviewBody}>
<Overview
active
diff --git a/src/features/HomeSidebar/Body/Project/index.tsx b/src/features/HomeSidebar/Body/Project/index.tsx
index 21f03999a3c..699a4dc09bc 100644
--- a/src/features/HomeSidebar/Body/Project/index.tsx
+++ b/src/features/HomeSidebar/Body/Project/index.tsx
@@ -1,14 +1,14 @@
'use client';
-import { AccordionItem, Flexbox } from '@lobehub/ui';
+import { AccordionItem } from '@lobehub/ui';
import { ActionIcon, Text } from '@lobehub/ui/base-ui';
import { ArrowRightIcon, PlusIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import NavItem from '@/features/NavPanel/components/NavItem';
+import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import { openCreateProjectModal } from '@/features/Projects/CreateProjectModal';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import { useCurrentProjectList, useProjectStore } from '@/store/project';
@@ -52,9 +52,7 @@ const Project = memo<ProjectProps>(({ itemKey }) => {
{error ? (
<AsyncError error={error} variant="inline" onRetry={() => mutate()} />
) : isLoading ? (
- <Flexbox align="center" padding={12}>
- <NeuralNetworkLoading size={18} />
- </Flexbox>
+ <SkeletonList rows={3} />
) : projects.length === 0 ? (
<NavItem
icon={PlusIcon}