From b49b014089984167a48db4d0fea43f320f6d8338 Mon Sep 17 00:00:00 2001 From: jiangjiang Date: Wed, 15 Apr 2026 17:44:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(sidebar):=20=E4=BF=AE=E5=A4=8D=20Window?= =?UTF-8?q?s=20=E4=B8=8B=E9=9A=90=E8=97=8F=E4=BB=93=E5=BA=93=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=9B=A0=E5=AD=98=E5=82=A8=20key=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E8=80=8C=E5=A4=B1=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit saveRepositorySettings 使用 normalizeWorkspacePathKey(反斜杠转正斜杠), 但 TreeSidebar 过滤时用 normalizePath(保留反斜杠),导致 Windows 上 key 永远匹配不上,隐藏设置形同虚设。统一使用 normalizeWorkspacePathKey。 --- src/renderer/components/layout/TreeSidebar.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/layout/TreeSidebar.tsx b/src/renderer/components/layout/TreeSidebar.tsx index 08a822da..a8365e19 100644 --- a/src/renderer/components/layout/TreeSidebar.tsx +++ b/src/renderer/components/layout/TreeSidebar.tsx @@ -42,6 +42,7 @@ import { getStoredGroupCollapsedState, getStoredRepositorySettings, normalizePath, + normalizeWorkspacePathKey, type RepositorySettings, saveGroupCollapsedState, saveRepositorySettings, @@ -626,7 +627,8 @@ export function TreeSidebar({ // Filter hidden repositories using cached settings filtered = filtered.filter((repo) => { - const settings = repoSettingsMap[normalizePath(repo.path)] || DEFAULT_REPOSITORY_SETTINGS; + const settings = + repoSettingsMap[normalizeWorkspacePathKey(repo.path)] || DEFAULT_REPOSITORY_SETTINGS; return !settings.hidden; }); @@ -676,7 +678,8 @@ export function TreeSidebar({ // Use the same hidden filter as filteredRepos const visibleRepos = repositories.filter((repo) => { - const settings = repoSettingsMap[normalizePath(repo.path)] || DEFAULT_REPOSITORY_SETTINGS; + const settings = + repoSettingsMap[normalizeWorkspacePathKey(repo.path)] || DEFAULT_REPOSITORY_SETTINGS; return !settings.hidden; }); From 301eb225d4749af2956666fe9de95897549081a2 Mon Sep 17 00:00:00 2001 From: jiangjiang Date: Wed, 15 Apr 2026 18:41:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(sidebar):=20=E4=BF=AE=E5=A4=8D=20Reposi?= =?UTF-8?q?torySidebar=20=E7=A7=BB=E5=8A=A8=E5=88=B0=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=97=B6=E4=BC=A0=E5=85=A5=20path=20=E8=80=8C=E9=9D=9E=20id=20?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 与 TreeSidebar (#404) 相同的 bug:handleMoveToGroup 改为按 id 匹配后, RepositorySidebar 仍传入 menuRepo.path,导致分组移动静默失败。 同时补全本地 Repository 接口的 id 字段。 --- src/renderer/components/layout/RepositorySidebar.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/layout/RepositorySidebar.tsx b/src/renderer/components/layout/RepositorySidebar.tsx index 96957053..de287543 100644 --- a/src/renderer/components/layout/RepositorySidebar.tsx +++ b/src/renderer/components/layout/RepositorySidebar.tsx @@ -58,6 +58,7 @@ import { useWorktreeActivityStore } from '@/stores/worktreeActivity'; import { RunningProjectsPopover } from './RunningProjectsPopover'; interface Repository { + id: string; name: string; path: string; groupId?: string; @@ -82,7 +83,7 @@ interface RepositorySidebarProps { onCreateGroup: (name: string, emoji: string, color: string) => RepositoryGroup; onUpdateGroup: (groupId: string, name: string, emoji: string, color: string) => void; onDeleteGroup: (groupId: string) => void; - onMoveToGroup?: (repoPath: string, groupId: string | null) => void; + onMoveToGroup?: (repoId: string, groupId: string | null) => void; onSwitchTab?: (tab: TabId) => void; onSwitchWorktreeByPath?: (path: string) => Promise | void; /** Whether a file is being dragged over the sidebar (from App.tsx global handler) */ @@ -705,7 +706,7 @@ export function RepositorySidebar({ currentGroupId={menuRepo?.groupId} onMove={(groupId) => { if (menuRepo) { - onMoveToGroup(menuRepo.path, groupId); + onMoveToGroup(menuRepo.id, groupId); } }} onClose={() => setMenuOpen(false)}