feat(code): GitHub settings page + cloud-mode missing-integration warning#2027
Conversation
3296b3d to
0bfc805
Compare
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
apps/code/src/renderer/features/task-detail/components/CloudGithubMissingNotice.tsx:13-16
`timed-out` state silently swallowed — no feedback to the user
When a GitHub connection attempt times out after 5 minutes (`POLL_TIMEOUT_MS = 300_000`), `state` becomes `"timed-out"`, but neither `isConnecting` (`state === "connecting"`) nor `hasError` (`state === "error"`) covers this case. The component falls back to the default "Connect your personal GitHub…" message and an enabled button with no indication that anything went wrong. The same issue exists in `GitHubSettings.tsx` where neither `isConnecting` nor `hasConnectError` handles `timed-out`. Consider treating `"timed-out"` similarly to an error, mapping it to a descriptive message like "Connection timed out — please try again."
### Issue 2 of 2
apps/code/src/renderer/features/settings/components/sections/GitHubSettings.tsx:49-55
The local `openInBrowser` function is identical to the private `openUrlInBrowser` already defined in `useGithubUserConnect.ts`. Having two copies of the same try/catch-then-`window.open` pattern violates OnceAndOnlyOnce. Consider exporting `openUrlInBrowser` from the hook file (or a shared `browser.ts` utility) and importing it here.
```suggestion
// Import openUrlInBrowser from a shared utility instead of duplicating here
export async function openInBrowser(url: string) {
try {
await trpcClient.os.openExternal.mutate({ url });
} catch {
window.open(url, "_blank", "noopener,noreferrer");
}
}
```
Reviews (1): Last reviewed commit: "feat(code): GitHub settings page and clo..." | Re-trigger Greptile |
|
|
||
| const isConnecting = state === "connecting"; | ||
| const hasError = state === "error"; | ||
| const canConnect = projectId != null && cloudRegion != null; |
There was a problem hiding this comment.
timed-out state silently swallowed — no feedback to the user
When a GitHub connection attempt times out after 5 minutes (POLL_TIMEOUT_MS = 300_000), state becomes "timed-out", but neither isConnecting (state === "connecting") nor hasError (state === "error") covers this case. The component falls back to the default "Connect your personal GitHub…" message and an enabled button with no indication that anything went wrong. The same issue exists in GitHubSettings.tsx where neither isConnecting nor hasConnectError handles timed-out. Consider treating "timed-out" similarly to an error, mapping it to a descriptive message like "Connection timed out — please try again."
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/task-detail/components/CloudGithubMissingNotice.tsx
Line: 13-16
Comment:
`timed-out` state silently swallowed — no feedback to the user
When a GitHub connection attempt times out after 5 minutes (`POLL_TIMEOUT_MS = 300_000`), `state` becomes `"timed-out"`, but neither `isConnecting` (`state === "connecting"`) nor `hasError` (`state === "error"`) covers this case. The component falls back to the default "Connect your personal GitHub…" message and an enabled button with no indication that anything went wrong. The same issue exists in `GitHubSettings.tsx` where neither `isConnecting` nor `hasConnectError` handles `timed-out`. Consider treating `"timed-out"` similarly to an error, mapping it to a descriptive message like "Connection timed out — please try again."
How can I resolve this? If you propose a fix, please make it concise.…arning Adds a new "GitHub" settings category that lists every personal GitHub installation linked to the user's account, each individually disconnectable, with a single Connect / Connect-another button. Adds an amber callout below the task input in cloud mode when the user has no personal GitHub integration, prompting them to connect. The cloud repo picker stays user-only — no team-integration fallback — so PRs are always authored as the user. Generated-By: PostHog Code Task-Id: 955e2a44-cbb3-4ab8-9ba4-21deae8ffe19
0bfc805 to
2b4e596
Compare
| <Flex direction="column" gap="3"> | ||
| <Flex align="center" justify="between" gap="3" wrap="wrap"> | ||
| <Text className="text-(--gray-11) text-[13px]"> | ||
| Personal GitHub installations linked to your PostHog account. Cloud |
There was a problem hiding this comment.
general question (out of the scope of this PR) - how do we handle integration selection when multiple integrations have access to a repo?
There was a problem hiding this comment.
If 2 integrations expose same repo we pick whichever resolve first. Kinda good enough, but we could in future extend the picker and allow users choose which integration they would like to use
| <Text size="1"> | ||
| {hasError | ||
| ? describeGithubConnectError(error) | ||
| : "Connect your personal GitHub to create cloud tasks. Cloud PRs are authored as you."} |
There was a problem hiding this comment.
we can probably drop "cloud PRs are authored as you" - since this is the default experience users would expect
Generated-By: PostHog Code Task-Id: 955e2a44-cbb3-4ab8-9ba4-21deae8ffe19
Problem
Two adjacent gaps in the personal-GitHub UX for cloud tasks:
Solution
useGithubUserConnecthook).Combines the spirit of #1989 and #2009 with adjustments: drop the team fallback, keep the warning, extend the settings page to handle multiple installations.
Test plan
Created with PostHog Code