mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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 <takshkothari09@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -171,7 +171,11 @@ export function MachineOnboardingFlow({
|
||||
onClick={() => void loadFreshIdentity()}
|
||||
type="button"
|
||||
>
|
||||
{isPending ? "Saving identity…" : "Create a new identity key"}
|
||||
{isPending
|
||||
? "Loading identity…"
|
||||
: selectedPubkey
|
||||
? "Continue setup"
|
||||
: "Create a new identity key"}
|
||||
</Button>
|
||||
<Button
|
||||
className="h-9 rounded-full bg-foreground/10 px-5 hover:bg-foreground/15"
|
||||
@@ -180,7 +184,9 @@ export function MachineOnboardingFlow({
|
||||
type="button"
|
||||
variant="ghost"
|
||||
>
|
||||
Use an existing key
|
||||
{selectedPubkey
|
||||
? "Use a different key instead"
|
||||
: "Use an existing key"}
|
||||
</Button>
|
||||
</div>
|
||||
<IdentityKeyHelpDialog />
|
||||
|
||||
@@ -85,8 +85,13 @@ test("backup step back button returns to machine identity choice", async ({
|
||||
await expect(page.getByTestId("onboarding-page-backup")).toBeVisible();
|
||||
await page.getByTestId("onboarding-back").click();
|
||||
|
||||
// Backing out preserves the loaded key — primary CTA continues setup rather
|
||||
// than minting another identity (#2318).
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Create a new identity key" }),
|
||||
page.getByRole("button", { name: "Continue setup" }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Use a different key instead" }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user