Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

feat(code): show persistent error state for GitHub connect failures - #1998

Merged
k11kirky merged 1 commit into
mainfrom
05-04-feat_code_show_persistent_error_state_for_github_connect_failures
May 4, 2026
Merged

k11kirky merged 1 commit into
mainfrom
05-04-feat_code_show_persistent_error_state_for_github_connect_failures

Conversation

@k11kirky

@k11kirky k11kirky commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When a GitHub connection attempt fails, the error is shown as a toast notification that disappears quickly, leaving users with no clear indication of what went wrong or how to recover. Error codes returned from GitHub's OAuth flow are not translated into human-readable messages, making it difficult for users to understand and resolve the issue.

Changes

  • Adds an "error" state to useGithubUserConnect, replacing the previous behavior of silently resetting to "idle" and firing a toast on failure
  • Exposes the error object and a reset function from useGithubUserConnect so callers can inspect and clear the error
  • Introduces describeGithubConnectError, which maps known GitHub OAuth error codes (e.g. access_denied, invalid_state, installation_not_authorized) to plain-language messages
  • Updates GitHubConnectionBanner to display the human-readable error message inline in the banner with a "Click to try again" prompt, resetting state on click
  • Updates GitIntegrationStep (onboarding) to show the error message in red with "Try again" and "Dismiss" buttons instead of silently failing
  • Passes structured { message, code } error objects through useGitHubIntegrationCallback instead of raw strings, enabling error-code-aware messaging across all connection surfaces

@greptile-apps

greptile-apps Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/inbox/components/list/GitHubConnectionBanner.tsx:44-45
**Redundant retry language in error label**

Most entries in `ERROR_MESSAGES` already end with "Please retry." or "Try again" phrasing. Appending `" Click to try again."` produces doubled retry prompts — e.g. `"GitHub returned an error during sign-in. Please retry. Click to try again."` — which reads awkwardly for the majority of error codes. Consider either stripping the retry CTA from the `ERROR_MESSAGES` strings or removing the suffix from the template literal.

Reviews (1): Last reviewed commit: "feat(code): show persistent error state ..." | Re-trigger Greptile

Comment on lines +44 to +45
const label = hasConnectError
? `${describeGithubConnectError(error)} Click to try again.`

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.

P2 Redundant retry language in error label

Most entries in ERROR_MESSAGES already end with "Please retry." or "Try again" phrasing. Appending " Click to try again." produces doubled retry prompts — e.g. "GitHub returned an error during sign-in. Please retry. Click to try again." — which reads awkwardly for the majority of error codes. Consider either stripping the retry CTA from the ERROR_MESSAGES strings or removing the suffix from the template literal.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/list/GitHubConnectionBanner.tsx
Line: 44-45

Comment:
**Redundant retry language in error label**

Most entries in `ERROR_MESSAGES` already end with "Please retry." or "Try again" phrasing. Appending `" Click to try again."` produces doubled retry prompts — e.g. `"GitHub returned an error during sign-in. Please retry. Click to try again."` — which reads awkwardly for the majority of error codes. Consider either stripping the retry CTA from the `ERROR_MESSAGES` strings or removing the suffix from the template literal.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@k11kirky
k11kirky force-pushed the 05-04-feat_code_show_persistent_error_state_for_github_connect_failures branch from c7a6575 to ed45726 Compare May 4, 2026 14:14
@k11kirky
k11kirky force-pushed the 05-04-feat_code_show_fast-path_github_sign-in_when_current_project_has_team_install branch from a6ca4e0 to 0673016 Compare May 4, 2026 14:14

k11kirky commented May 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

  • May 4, 2:36 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 4, 2:57 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 4, 3:04 PM UTC: @k11kirky merged this pull request with Graphite.

@k11kirky
k11kirky changed the base branch from 05-04-feat_code_show_fast-path_github_sign-in_when_current_project_has_team_install to graphite-base/1998 May 4, 2026 14:47
@k11kirky
k11kirky changed the base branch from graphite-base/1998 to main May 4, 2026 14:55
@k11kirky
k11kirky force-pushed the 05-04-feat_code_show_persistent_error_state_for_github_connect_failures branch from ed45726 to aa4423a Compare May 4, 2026 14:56
@k11kirky
k11kirky merged commit f0775fd into main May 4, 2026
16 checks passed
@k11kirky
k11kirky deleted the 05-04-feat_code_show_persistent_error_state_for_github_connect_failures branch May 4, 2026 15:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants