Skip to content

fix(sidebar): deduplicate projects in filter dropdown#1769

Closed
eshurakov wants to merge 1 commit intomainfrom
eshurakov/gilded-wednesday
Closed

fix(sidebar): deduplicate projects in filter dropdown#1769
eshurakov wants to merge 1 commit intomainfrom
eshurakov/gilded-wednesday

Conversation

@eshurakov
Copy link
Copy Markdown
Contributor

Summary

Deduplicate projects in the sidebar project filter dropdown. The same repository can be stored with different git_url formats across cli_sessions and cli_sessions_v2 (e.g., https://github.com/Org/repo vs https://github.com/Org/repo.git). The SQL query groups by exact git_url, but extractRepoFromGitUrl() normalizes both to the same display name, resulting in visually identical duplicate entries in the filter.

The fix deduplicates by displayName after mapping, keeping the first (most recently used) entry since the query results are already ordered by last_used_at DESC.

Verification

  • pnpm typecheck — passed
  • Manual verification of the project filter dropdown

Visual Changes

Before After
Duplicate project entries in sidebar filter dropdown Each project appears once

Reviewer Notes

The deduplication is done client-side in the useMemo that builds recentProjects. An alternative would be normalizing git_url in the SQL query before grouping, but the client-side approach is simpler and doesn't risk breaking other consumers of the raw git_url data.

}))
.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.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Mar 31, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/components/cloud-agent-next/CloudSidebarLayout.tsx 76 Deduplicating by display name keeps only one raw gitUrl, so the project filter still hides sessions saved under the other equivalent URL variant.
Other Observations (not in diff)

N/A

Files Reviewed (1 files)
  • src/components/cloud-agent-next/CloudSidebarLayout.tsx - 1 issue

Fix these issues in Kilo Cloud


Reviewed by gpt-5.4-20260305 · 303,809 tokens

@eshurakov eshurakov closed this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant