Skip to content

Add or clone: org chips that scale to any number of orgs - #315

Merged
Mpdreamz merged 3 commits into
mainfrom
fix/add-repo-org-chips
Nov 20, 2026
Merged

Mpdreamz merged 3 commits into
mainfrom
fix/add-repo-org-chips

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

With ~15 orgs, the org tabs in the Add or clone dialog were one row of capsules with no line limit, so SwiftUI squeezed every chip until its label wrapped one character per line (tall vertical pills).

  • Chips never wrap: one line each, a compact count (1.2K), a 210 pt cap with an ellipsis for very long names (the tooltip carries the full name and exact count).
  • At most two rows, "Your GitHub" first, then orgs by repo count; whatever does not fit goes behind a dashed +N more chip that opens a searchable list (click or ⌃o; ↓ ↑ ⌃n ⌃p move, ↩ chooses). The chosen org then shows as a selected chip. The selected tab is always visible.
  • The layout is a pure tested function (AddRepoChips.layout), not SwiftUI.
  • Keys: ⌃o is new (dialog-local, free everywhere). ⇥ / ⇧⇥ still walk every tab, visible or not, but now in the order the chips are shown (counts descending) instead of the old tab-array order. ⎋ closes the list first, then the dialog; ⇥ ⇧⇥ ⌘↩ ⌃r ⌃t close the list and act as usual. The list is drawn inside the dialog, not as a popover, so keys stay with the form's own handling.
  • Docs: a paragraph and shots in docs/worktrees/repos.md; new shots worktrees/add-repo-many-orgs, -picked, -menu, -narrow (16 orgs, one with 40 characters); the existing add-repo shots and landing/t-repos.png regenerated.

Verified

mise run lint, swift build, mise run text-check, mise run bundle, scripts/tutor-check.sh (0 problems), the docs build; 21 new AddRepoChipsTests (33 AddRepo tests in all); three mutations (drop the selected chip, stop vs skip at the first chip that does not fit, ignore the gap) each fail the tests; the new shots read: clean one-line chips in two rows, "+9 more", the long org cut with an ellipsis.

Not tested

Live resize, real key events and clicking the chips or the list. Chip widths are estimated from character counts (about 7 pt a character), not measured, so a chip can sit a few points off its predicted spot. While counts are still loading the chips can reorder once.

Note: ACPClientTests.sendingToAnAgentThatExitedSaysItClosed failed locally on one Mac (ACP transport, untouched here); main's CI passes it, so CI on this PR is the check.

🤖 Generated with Claude Code

Mpdreamz and others added 3 commits November 20, 2026 21:37
The tab chips are placed by a pure function over their widths: at most two rows, the
chosen tab always shown, the rest behind a +N more chip. The form orders orgs by repo
count, walks them with tab in that order, and opens the rest with ctrl-o.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The tab chips were one HStack of Text, so with many orgs each label was squeezed until it
wrapped a character per line. Chips are now one line each (long names cut, tooltip has the
whole), placed by AddRepoChips in at most two rows, with the rest in a +N more list opened
by click or ctrl-o. Shots and docs for sixteen orgs.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions github-actions Bot added the bug Something isn't working label Nov 20, 2026
@Mpdreamz
Mpdreamz merged commit e9f87d4 into main Nov 20, 2026
6 checks passed
@Mpdreamz
Mpdreamz deleted the fix/add-repo-org-chips branch November 20, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant