Skip to content

Group the GitHub setup dialog's repositories by organization - #48351

Merged
AmethystLiang merged 7 commits into
mainfrom
AmethystLiang/github-connector-b
Nov 24, 2026
Merged

AmethystLiang merged 7 commits into
mainfrom
AmethystLiang/github-connector-b

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The "Add a bot to GitHub" dialog was a wall of text. Now it lists each organization once with its repo count, shows who can ask as chips, and uses short buttons.

Files Added Deleted Net
Test 0 0 0 0
Prod 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1036 $\color{#cf222e}{\Huge{\mathbf{−}}}$​314 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​722

What Changed

  • Repositories: one row per account or organization with N repos, which expands to that org's repos (click, Enter or Space). The list is capped at about six rows and scrolls. A whole-account install shows All repos.
  • Who can ask: chips (You, then each person), with + Add on the label row and the outsiders rule behind an ⓘ. Once someone else is added, one warning line shows ("They act as you on this computer."). It is keyboard-focusable, and its tooltip and screen-reader text carry the full sentence.
  • Header: a bare GitHub mark, Add <bot>, and @login · Not you? on one line. With several linked logins, it lists them, truncated, with no "Not you?". The status line under the title stays on one line with …, and the full text is its tooltip.
  • Buttons: Cancel / Add (was Close / Turn on ), and Install app.
  • Corner button: × ends setup like Cancel. It is Minimize while setup still follows GitHub: connect, waiting, install, or a pending install trip in either browser, including after a failed read and on the sign-in screens setup can fall back to. A pending install is never dropped by the corner.
  • Copy: the repository-scope labels and the dialog's "Who can ask" caption are protected copy, so a plugin language pack cannot restate them in this trust dialog. Unused strings were removed.

Why

The old dialog repeated the org name on every repo, packed repos into a comma-joined block, and explained sharing risk in long paragraphs, which made a trust decision hard to read. Checked against how comparable products handle this.

Visual Proof

Component fixtures with invented data.

Two organizations (440px, light) One organization expanded (440px, dark)
Two organizations One organization expanded
People added, 340px, light People added, 340px, dark
People added, light People added, dark

Testing

  • I manually tested these changes locally. In component fixtures in Chromium, at 340px and 440px, light and dark:
    • expand and collapse by click, Enter and Space
    • scrolling a 30-repo org
    • Tab to the warning line and its tooltip
    • the people picker
    • ×, Minimize, Cancel and Escape, including a pending install after a failed read and on the sign-in fallbacks
  • Automated tests added/updated, or explained why not below. No committed tests: this is UI behavior, per the repo's testing rule. A scripted fixture run instead checked the corner and pill lifecycle, protected copy through the real language-pack parser, and narrow-width text containment; each check failed with its fix reverted.
  • Every added test fails without this change and avoids the test anti-patterns (none added)

macOS. Web typecheck, oxfmt, oxlint and the localization catalog checks pass locally.

Performance

None, because this only renders while the GitHub setup dialog is open. Org rows render their repos only when expanded, and the list is height-capped. No new polling, IPC or disk work.

Risk

Level: Low. Renderer-only. The riskiest part is the corner button: if its Minimize condition were wrong, × could end a setup still following GitHub, or leave a pill after a real end. Back out with a plain revert.

The Add <bot> to GitHub dialog lists one row per account or organization with
its repository count, folded open on click, instead of a comma-joined block.
Who can ask is a row of chips with the outsiders rule behind an info icon, and
one warning line shows once someone else is added. Labels are shorter (Cancel,
Add, Install app) and the corner button is a normal close.

The corner button ends setup unless the setup waits on GitHub in the browser,
where it minimizes. The dialog opens with focus on itself, an expanded
organization scrolls past six and a half rows, and the warning line takes
keyboard focus.
…eral linked logins in a fixture

The screen-reader "Signed in as" text was positioned against the dialog, so a
long login widened the dialog's scroll width past its box. Its truncating line
now contains it. Adds 440px and 340px fixtures with three linked GitHub logins,
one 48 characters long.
…s safe in the setup dialog

- The corner stays Minimize while setup still follows an install trip in either
  browser, including after a failed read, so it cannot drop the pending install.
  Cancel still ends setup.
- The repository list's scope labels (All repos, N repos, New) are protected
  copy again, so a language pack cannot restate them in this trust dialog.
- The status line under the title wraps a long name with no spaces instead of
  overflowing at narrow widths.

Fixtures: the review shots move to github-setup-dialog-shots.fixture.tsx, with a
shared stub module, plus states for a failed read during an in-app install,
checking and failed with a long name, and every scope label.
A long name in the line under the title (checking, failed and connect steps)
now ends in an ellipsis, with the whole line as its tooltip, instead of
wrapping mid-word. Only the compact header changes; other setup headers still
wrap.
…tate

- "Who can ask" above the people in the GitHub setup is its own protected
  string, so a language pack cannot relabel who gets access. Other places that
  show the list keep the shared, translatable caption.
- The sign-in screens the setup can fall back to (this computer's sign-in
  lapsed, or Orca Cloud signed out) keep the Minimize button while an install
  is still followed on GitHub. With nothing followed they look as before.
- The compact status line shows one plain string and uses the same string as
  its tooltip, so what you hover is what you see, whatever the translation.

Fixtures: signed-out states with and without a pending install, and the
compact header for a paired server's bot with names that need escaping.
…tatus line

The plain text the compact setup header shows (and uses as its tooltip) kept
only ordinary spaces at its ends: a translation's leading or trailing no-break
space was dropped, and two paragraphs ran together. Now only HTML whitespace
collapses or drops, and a paragraph edge reads as a space, like a line break.
@AmethystLiang
AmethystLiang marked this pull request as draft November 24, 2026 14:59
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The GitHub setup dialog now has updated header and action controls, compact bot-access details, and grouped repository listings with expandable account rows. Shared fixtures and screenshot scenarios cover setup states, repository layouts, and narrow dialog sizes. Translation strings and protected-copy keys are updated for the revised interface.

Merge Risk: Minimal · up to 5d5b7

This change regroups the GitHub setup dialog's repositories by organization and updates its controls. No concrete merge-blocking risk was found, and the change is easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: repositories in the GitHub setup dialog are now grouped by organization. The description and file summaries show one expandable row per account or organization with re…
Description check Passed The description follows the template well. It has ELI5, What Changed, Why, Visual Proof with before/after-style fixture images, Testing with a checklist, Performance, and Risk with a level and rollbac…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: repositories in the GitHub setup dialog are now grouped by organization. The description and file summaries show one expandable row per account or organization with repo counts, which matches the title. The title is short, specific, and does not use vague terms.

Full details: Description check

Explanation

The description follows the template well. It has ELI5, What Changed, Why, Visual Proof with before/after-style fixture images, Testing with a checklist, Performance, and Risk with a level and rollback plan. The Linked Issue section is missing: 'Fixes #' is left blank and no issue is linked. The AI Disclosure section is blank, which is allowed for internal contributors. The Review, Agent skill upstream boundary, and Notes sections are not filled in, and the Checklist is not ticked. The Visual Proof section uses images, not a true before/after pair. These gaps are minor relative to the overall completeness, so the check passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b3b26ca-a7a8-4e27-ae93-37cce4d99c8f
Commits

Reviewing files that changed from the base of the PR and between 5d3d302 and 5d5b7c2.

Files selected for processing: 1

  • src/renderer/src/components/bots/github/github-setup-dialog.test-fixture.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@coderabbitai coderabbitai Bot left a comment

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.

Nitpick comments: 1

src/renderer/src/components/bots/github/github-setup-dialog.test-fixture.tsx: 1

180-180: Trivial · Maintainability & Code Quality · Quick win

Report missing fixture interaction targets.

If either helper exhausts its 80 polls, it returns as if the click succeeded. Callers can then capture a collapsed dialog or continue without starting an install trip.

Add a timeout error after each loop. Include the requested text or selector in the error. This will make missing controls and selector drift visible in fixture runs.

Also applies to: 193-193

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 551b5f36-d64d-4645-b884-e4eb6630eb3c
Commits

Reviewing files that changed from the base of the PR and between cd5c7e7 and 5d3d302.

Files selected for processing: 17

  • src/renderer/src/components/bots/BotAccessWarningLine.tsx
  • src/renderer/src/components/bots/BotWhoCanAskList.tsx
  • src/renderer/src/components/bots/bot-connector-people.tsx
  • src/renderer/src/components/bots/connector-connect-parts.tsx
  • src/renderer/src/components/bots/github/BotGitHubSetupDialog.tsx
  • src/renderer/src/components/bots/github/github-install-dialog.fixture.tsx
  • src/renderer/src/components/bots/github/github-install-trip.tsx
  • src/renderer/src/components/bots/github/github-repository-groups.tsx
  • src/renderer/src/components/bots/github/github-setup-dialog-shots.fixture.tsx
  • src/renderer/src/components/bots/github/github-setup-dialog.test-fixture.tsx
  • src/renderer/src/components/bots/github/github-setup-header.tsx
  • src/renderer/src/components/bots/orca-cloud-sign-in.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/bots/bot-access-copy.ts
  • src/shared/plugins/languages/protected-copy-keys.json
Files with no reviewable changes: 1

  • src/renderer/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@AmethystLiang
AmethystLiang marked this pull request as ready for review November 24, 2026 15:17
The fixture click helpers returned quietly after polling, so a fixture could
capture a state it never reached. They now wait up to 10 s and throw, naming
the missing control.
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai The nitpick about the fixture click helpers in github-setup-dialog.test-fixture.tsx is fixed in 5d5b7c2. clickWhenShown and clickAddRepositories now poll for up to 10 s, then throw an error naming the missing control, so a fixture fails instead of capturing a state it never reached.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -euo pipefail
file=$(fd -t f -F 'github-setup-dialog.test-fixture.tsx' . | head -n 1)
if [ -z "$file" ]; then
  echo "Fixture file not found"
  exit 1
fi
echo "File: $file"
ast-grep outline "$file" --items all --match 'clickWhenShown|clickAddRepositories' || true
rg -n -A 35 -B 5 'function (clickWhenShown|clickAddRepositories)\b' "$file"

Length of output: 2938


@AmethystLiang Thanks for fixing this. I checked the current code: both helpers poll for 10 seconds and throw an error naming the missing button. I did not run the fixtures.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

@AmethystLiang
AmethystLiang merged commit e89b3a3 into main Nov 24, 2026
57 checks passed
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