Skip to content

fix(github): make the branch picker usable on repos with 100+ branches - #884

Merged
Hydralerne merged 1 commit into
oblien:feat/bugfix-integration-2026-09-15from
abdelrhmanehab10:fix/870-branch-selector-pagination
Sep 15, 2026
Merged

Hydralerne merged 1 commit into
oblien:feat/bugfix-integration-2026-09-15from
abdelrhmanehab10:fix/870-branch-selector-pagination

Conversation

@abdelrhmanehab10

Copy link
Copy Markdown
Contributor

Summary

  • Fixes [Bug]: Branch selector on "Link Repository" is unusable #870 — the branch selector on "Link Repository" silently truncated to GitHub's first 100 (alphabetically-sorted) branches, so on repos with more branches the default main branch could be missing entirely and unselectable.
  • Backend listBranches now fetches lazily by page (page/hasMore) instead of truncating, and downstream callers (project creation/validation, deploy prep) were updated for the new paginated contract.
  • The branch dropdown (CustomSelect) now actually scrolls — its inner option list previously never resolved a constrained height (a max-h-full percentage-height quirk), so it just silently clipped past the first screenful with no visible scrollbar, independent of the backend truncation bug.
  • Scrolling near the bottom of the dropdown now lazily loads the next page (infinite scroll), with a translated "Loading branches..." indicator.
  • Added a type-to-filter search input to the branch picker.

Test plan

  • API unit tests: apps/api/src/modules/github/github.branches.test.ts covers the new page-based listBranches contract (single page, hasMore on a full page).
  • Manually reproduced the original bug and verified the fix live against the public kanbn/kan repo (158 branches, main originally sorted ~53 branches past the old 100-item cutoff):
    • Dropdown now scrolls (clientHeight clamped vs. scrollHeight), confirmed via DOM measurement and screenshots.
    • Scrolling to the bottom fires a real GET /branches?page=2 request and all 158 branches load.
    • Search input correctly filters the loaded branches (e.g. fix/kan → 8 matches).
    • "Loading branches..." indicator appears while a page is in flight.

Load the first branch page during preparation and fetch later pages as the picker scrolls. Preserve current main behavior while keeping the selected branch available.
@Hydralerne

Hydralerne commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Incorporated this PR into feat/bugfix-integration-2026-09-15 via b2cd7842, preserving the original commits and adapting the fix to the current architecture.

Integrate PR #884 with pagination in both the migration wizard and deploy picker, preserving the platform/SDK architecture.

GitHub now records this contributor PR as merged into the integration branch. The integrated changes are tested and awaiting merge to main.

Validation:

  • Five DOM interaction regressions pass, covering later-page search, current/main branch retention, existing-project operations, stale repository responses, error/retry, and existing description filtering.
  • 17 affected GitHub/project API tests and 34 SDK project-control tests pass; API and dashboard type checks pass. Native/HTTP tests cover page metadata and cross-tenant denial.

@Hydralerne Hydralerne closed this Sep 15, 2026
@Hydralerne Hydralerne reopened this Sep 15, 2026
@Hydralerne
Hydralerne changed the base branch from main to feat/bugfix-integration-2026-09-15 September 15, 2026 18:25
@Hydralerne
Hydralerne merged commit b2cd784 into oblien:feat/bugfix-integration-2026-09-15 Sep 15, 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.

[Bug]: Branch selector on "Link Repository" is unusable

2 participants