fix(code): Limit combobox items to 50 in branch and repo pickers#1800
Merged
VojtechBartos merged 1 commit intomainfrom Apr 22, 2026
Merged
fix(code): Limit combobox items to 50 in branch and repo pickers#1800VojtechBartos merged 1 commit intomainfrom
VojtechBartos merged 1 commit intomainfrom
Conversation
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx
Line: 221-225
Comment:
**`CREATE_BRANCH_ACTION` silently cut off at 50+ branches**
In non-cloud mode `allItems = [...branches, CREATE_BRANCH_ACTION]`, so when `branches.length >= 50` the sentinel string is at index ≥ 50 and the `limit={50}` prop on `<Combobox items={allItems}>` will drop it — the "Create new branch" button disappears from the picker with no indication to the user. The footer condition `branches.length > COMBOBOX_LIMIT` also misses the edge case at exactly 50 branches (where `allItems.length` is 51 and limiting is already active).
The limit and footer condition should be applied to `allItems.length`, and the `CREATE_BRANCH_ACTION` sentinel should be excluded from the items fed to the `limit` prop — e.g. pass only `branches` (or the cloud branch list) as `items`, and render the create-branch footer outside the limited list.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx
Line: 21
Comment:
**Duplicated constant — violates OnceAndOnlyOnce**
`COMBOBOX_LIMIT = 50` is defined identically in both `BranchSelector.tsx` and `GitHubRepoPicker.tsx`. It should live in a single shared location (e.g. a `constants.ts` file under the renderer) so a future change only needs to happen in one place.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(code): Limit combobox items to 50 in..." | Re-trigger Greptile |
| import { useMutation, useQuery } from "@tanstack/react-query"; | ||
| import { type RefObject, useEffect, useRef, useState } from "react"; | ||
|
|
||
| const COMBOBOX_LIMIT = 50; |
There was a problem hiding this comment.
Duplicated constant — violates OnceAndOnlyOnce
COMBOBOX_LIMIT = 50 is defined identically in both BranchSelector.tsx and GitHubRepoPicker.tsx. It should live in a single shared location (e.g. a constants.ts file under the renderer) so a future change only needs to happen in one place.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx
Line: 21
Comment:
**Duplicated constant — violates OnceAndOnlyOnce**
`COMBOBOX_LIMIT = 50` is defined identically in both `BranchSelector.tsx` and `GitHubRepoPicker.tsx`. It should live in a single shared location (e.g. a `constants.ts` file under the renderer) so a future change only needs to happen in one place.
How can I resolve this? If you propose a fix, please make it concise.
skoob13
approved these changes
Apr 22, 2026
5a73a1e to
9c45fe0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR #1588 added performance optimizations to the branch and repo picker comboboxes — capping rendered items at 50 and showing a "type to filter" hint when truncated. PR #1725 rewrote the Combobox from the custom compound component to
@posthog/quill, but dropped these optimizations in the process. All items now render to the DOM, causing noticeable lag when opening the picker on repos with hundreds of branches.Solution
Pass
limit={50}to the quill Combobox in bothBranchSelectorandGitHubRepoPicker, and show a "Showing 50 of N — type to filter" footer when the list is truncated.Showcase
code-perf.mov