Skip to content

Commit c1bee70

Browse files
MarkShawn2020claude
andcommitted
refactor(dashboard): 项目 Dashboard 从 Features 改为 Sessions 视图
- 点击侧边栏项目名称时导航到 Dashboard - Dashboard 主区域显示该项目的 Claude Code sessions 列表 - 支持 resume session 和下拉菜单操作 - GitHistory 的 features prop 改为可选 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2b901ce commit c1bee70

5 files changed

Lines changed: 334 additions & 154 deletions

File tree

src/components/GlobalHeader/GlobalHeader.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ export function GlobalHeader({
7272
icon={<img src="/logo.svg" alt="Lovcode" className="w-4 h-4" />}
7373
label="Lovcode"
7474
/>
75-
<NavButton
76-
isActive={primaryFeature === "features"}
77-
onClick={() => handleMainNavClick("features")}
78-
icon={<LayersIcon className="w-4 h-4" />}
79-
label="Features"
80-
/>
8175
<NavButton
8276
isActive={primaryFeature === "workspace"}
8377
onClick={() => handleMainNavClick("workspace")}
8478
icon={<RocketIcon className="w-4 h-4" />}
85-
label="Workspace"
79+
label="Dashboard"
80+
/>
81+
<NavButton
82+
isActive={primaryFeature === "features"}
83+
onClick={() => handleMainNavClick("features")}
84+
icon={<LayersIcon className="w-4 h-4" />}
85+
label="Configuration"
8686
/>
8787
<NavButton
8888
isActive={primaryFeature === "chat"}

src/components/GlobalHeader/VerticalFeatureTabs.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ function ProjectSessionsGroup({
143143
const handleSelectProject = async () => {
144144
if (!workspace) return;
145145

146-
const activeFeatureId = project.active_feature_id;
147-
const mode = project.view_mode || "features";
148-
navigate({ type: "workspace", projectId: project.id, featureId: activeFeatureId, mode });
149-
150-
if (workspace.active_project_id === project.id) return;
146+
// Always navigate to dashboard when clicking project name
147+
navigate({ type: "workspace", projectId: project.id, mode: "dashboard" });
151148

152149
const newWorkspace: WorkspaceData = {
153150
...workspace,
154151
active_project_id: project.id,
152+
projects: workspace.projects.map((p) =>
153+
p.id === project.id ? { ...p, view_mode: "dashboard" as const } : p
154+
),
155155
};
156156
setWorkspace(newWorkspace);
157157
await invoke("workspace_save", { data: newWorkspace });

src/views/Workspace/GitHistory.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ import type { CommitInfo, Feature } from "./types";
2424

2525
interface GitHistoryProps {
2626
projectPath: string;
27-
features: Feature[];
27+
features?: Feature[];
2828
onRefresh?: () => void;
2929
embedded?: boolean;
3030
}
3131

3232
type ViewMode = "feats" | "timeline";
3333

34-
export function GitHistory({ projectPath, features, onRefresh, embedded = false }: GitHistoryProps) {
34+
export function GitHistory({ projectPath, features = [], onRefresh, embedded = false }: GitHistoryProps) {
3535
const [commits, setCommits] = useState<CommitInfo[]>([]);
3636
const [loading, setLoading] = useState(true);
3737
const [viewMode, setViewMode] = useState<ViewMode>("feats");

0 commit comments

Comments
 (0)