Skip to content

Commit ca5fde1

Browse files
fix(desktop): clarify identity key button when key exists (#2357)
## Summary - backing out of the backup step and clicking the CTA again reuses the existing key - the button still said "Create a new identity key", which is misleading for a security-sensitive action - when a key is already loaded, label it "Continue with existing identity key" Closes #2318 ## Test plan - [ ] first-run: button still says "Create a new identity key" - [ ] create key → backup → back: button says "Continue with existing identity key" and shows the same key Made with [Cursor](https://cursor.com) --------- Signed-off-by: Taksh <[email protected]> Co-authored-by: Cursor <[email protected]>
1 parent bcd15f6 commit ca5fde1

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎desktop/src/features/onboarding/ui/MachineOnboardingFlow.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ export function MachineOnboardingFlow({
171171
onClick={() => void loadFreshIdentity()}
172172
type="button"
173173
>
174-
{isPending ? "Saving identity…" : "Create a new identity key"}
174+
{isPending
175+
? "Loading identity…"
176+
: selectedPubkey
177+
? "Continue setup"
178+
: "Create a new identity key"}
175179
</Button>
176180
<Button
177181
className="h-9 rounded-full bg-foreground/10 px-5 hover:bg-foreground/15"
@@ -180,7 +184,9 @@ export function MachineOnboardingFlow({
180184
type="button"
181185
variant="ghost"
182186
>
183-
Use an existing key
187+
{selectedPubkey
188+
? "Use a different key instead"
189+
: "Use an existing key"}
184190
</Button>
185191
</div>
186192
<IdentityKeyHelpDialog />

‎desktop/tests/e2e/onboarding-backup.spec.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,13 @@ test("backup step back button returns to machine identity choice", async ({
8585
await expect(page.getByTestId("onboarding-page-backup")).toBeVisible();
8686
await page.getByTestId("onboarding-back").click();
8787

88+
// Backing out preserves the loaded key — primary CTA continues setup rather
89+
// than minting another identity (#2318).
8890
await expect(
89-
page.getByRole("button", { name: "Create a new identity key" }),
91+
page.getByRole("button", { name: "Continue setup" }),
92+
).toBeVisible();
93+
await expect(
94+
page.getByRole("button", { name: "Use a different key instead" }),
9095
).toBeVisible();
9196
});
9297

0 commit comments

Comments
 (0)