Skip to content

feat: allow user to use existing integration to connect in PC#1946

Open
k11kirky wants to merge 3 commits intomainfrom
04-29-feat_allow_user_to_use_existing_integration_to_connect_in_pc
Open

feat: allow user to use existing integration to connect in PC#1946
k11kirky wants to merge 3 commits intomainfrom
04-29-feat_allow_user_to_use_existing_integration_to_connect_in_pc

Conversation

@k11kirky
Copy link
Copy Markdown
Contributor

@k11kirky k11kirky commented Apr 29, 2026

Problem

Changes

@k11kirky k11kirky added the Create release This will trigger a new release label Apr 29, 2026 — with Graphite App
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@k11kirky k11kirky marked this pull request as ready for review April 29, 2026 20:58
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 29, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/onboarding/components/GitIntegrationStep.tsx
Line: 521-531

Comment:
**"Connect a different GitHub org" should be disabled while linking**

While `linkExistingMutation` is pending this button is still enabled, so a user who clicks "Reuse" and then immediately clicks "Connect a different GitHub org" can kick off a new OAuth flow while the link request is in flight. Consider disabling or hiding it when `linkExistingMutation.isPending`.

```suggestion
                            <Button
                              size="1"
                              variant="ghost"
                              color="gray"
                              loading={isConnecting}
                              disabled={linkExistingMutation.isPending}
                              onClick={() => void handleConnectGitHub()}
                            >
                              Connect a different GitHub org
                              <ArrowSquareOut size={12} />
                            </Button>
```

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

---

This is a comment left during a code review.
Path: apps/code/src/renderer/features/onboarding/components/GitIntegrationStep.tsx
Line: 109

Comment:
**`alternativeSourceIntegrationId` is redundant**

`alternativeSourceIntegrationId` is just `alternativeSource?.id ?? null`. Since `alternativeSource` already exposes `id`, this extra variable violates OnceAndOnlyOnce — callers can use `alternativeSource?.id ?? null` directly or check `alternativeSource !== null` to gate the "Reuse" button.

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

Reviews (1): Last reviewed commit: "feat: allow user to use existing integra..." | Re-trigger Greptile

Comment on lines +521 to +531
<Button
size="1"
variant="ghost"
color="gray"
loading={isConnecting}
onClick={() => void handleConnectGitHub()}
>
Connect a different GitHub org
<ArrowSquareOut size={12} />
</Button>
</Flex>
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 "Connect a different GitHub org" should be disabled while linking

While linkExistingMutation is pending this button is still enabled, so a user who clicks "Reuse" and then immediately clicks "Connect a different GitHub org" can kick off a new OAuth flow while the link request is in flight. Consider disabling or hiding it when linkExistingMutation.isPending.

Suggested change
<Button
size="1"
variant="ghost"
color="gray"
loading={isConnecting}
onClick={() => void handleConnectGitHub()}
>
Connect a different GitHub org
<ArrowSquareOut size={12} />
</Button>
</Flex>
<Button
size="1"
variant="ghost"
color="gray"
loading={isConnecting}
disabled={linkExistingMutation.isPending}
onClick={() => void handleConnectGitHub()}
>
Connect a different GitHub org
<ArrowSquareOut size={12} />
</Button>
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/onboarding/components/GitIntegrationStep.tsx
Line: 521-531

Comment:
**"Connect a different GitHub org" should be disabled while linking**

While `linkExistingMutation` is pending this button is still enabled, so a user who clicks "Reuse" and then immediately clicks "Connect a different GitHub org" can kick off a new OAuth flow while the link request is in flight. Consider disabling or hiding it when `linkExistingMutation.isPending`.

```suggestion
                            <Button
                              size="1"
                              variant="ghost"
                              color="gray"
                              loading={isConnecting}
                              disabled={linkExistingMutation.isPending}
                              onClick={() => void handleConnectGitHub()}
                            >
                              Connect a different GitHub org
                              <ArrowSquareOut size={12} />
                            </Button>
```

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

githubAccountName: source.config?.account?.name ?? null,
};
}, [alternativeConnectedProject]);
const alternativeSourceIntegrationId = alternativeSource?.id ?? null;
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 alternativeSourceIntegrationId is redundant

alternativeSourceIntegrationId is just alternativeSource?.id ?? null. Since alternativeSource already exposes id, this extra variable violates OnceAndOnlyOnce — callers can use alternativeSource?.id ?? null directly or check alternativeSource !== null to gate the "Reuse" button.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/onboarding/components/GitIntegrationStep.tsx
Line: 109

Comment:
**`alternativeSourceIntegrationId` is redundant**

`alternativeSourceIntegrationId` is just `alternativeSource?.id ?? null`. Since `alternativeSource` already exposes `id`, this extra variable violates OnceAndOnlyOnce — callers can use `alternativeSource?.id ?? null` directly or check `alternativeSource !== null` to gate the "Reuse" button.

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 04-29-feat_allow_user_to_use_existing_integration_to_connect_in_pc branch from 8d5fc9a to 4ed00cc Compare April 29, 2026 21:29
Aligns with the matching backend change in PostHog #57029, which
switched from accepting an integration row id to accepting a sibling
team id. The team id is already collected in availableInstallations,
so this just renames the parameter and drops the now-unused
sourceIntegrationId field from the dedupe map.

Generated-By: PostHog Code
Task-Id: f5372c83-7ea4-41dd-8f04-71191dff5782
Copy link
Copy Markdown
Contributor

@jonathanlab jonathanlab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The graphite comment does raise a valid point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Create release This will trigger a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants