Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/cloud-agent-next/CloudSidebarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,17 @@ export function CloudSidebarLayout({ organizationId, children }: CloudSidebarLay

const recentProjects = useMemo(() => {
if (!recentReposData?.repositories) return [];
const seen = new Set<string>();
return recentReposData.repositories
.map(r => ({
gitUrl: r.gitUrl,
displayName: extractRepoFromGitUrl(r.gitUrl) ?? r.gitUrl,
}))
.filter(r => r.displayName);
.filter(r => {
if (!r.displayName || seen.has(r.displayName)) return false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Deduplicating by displayName here makes the project filter incomplete

projectFilter still stores the raw gitUrl, and useSidebarSessions passes that through to unifiedSessions.list/search, where git_url is matched with =. If https://github.com/Org/repo and https://github.com/Org/repo.git collapse into one menu item, selecting it only shows sessions for whichever variant happened to be kept here; sessions stored under the other URL disappear from the filtered list. The filter key also needs to be normalized, or a single display name needs to map to all equivalent URLs.

seen.add(r.displayName);
return true;
});
}, [recentReposData?.repositories]);
const queryClient = useQueryClient();
const deleteSessionFromStore = useSetAtom(deleteSessionFromStoreAtom);
Expand Down
Loading