Skip to content

fix(desktop): show Continue when a raw nsec is loaded in the backup restore dialog - #6649

Open
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:fix/desktop-backup-restore-raw-nsec
Open

BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:fix/desktop-backup-restore-raw-nsec

Conversation

@BradGroux

Copy link
Copy Markdown
Contributor

Note: This is a replacement for PR #5308, which was accidentally closed when branches were force-pushed after a commit identity rewrite. The changes are identical, rebased onto the latest main.

Summary

The backup-file restore dialog accepts .key files containing a raw nsec1 private key. The file parser loads the key and displays "Nostr identity found" with the derived npub, but the submit button only rendered when mode === "key" or isPasswordStage (ncryptsec). A raw nsec in mode="backup" satisfies neither condition, so the user sees a recognized identity with no Continue button — a dead end with no forward action.

Add isValid to the submit button's render guard so a valid raw nsec shows the Continue button regardless of mode. The button's existing disabled={!isValid} check prevents submission of invalid input, and keyImportSubmitEnabled already validates the nsec by deriving its npub.

Related issue

Fixes #5261.

Testing

  • Desktop Biome, file-size, text-size, and pubkey-truncation checks passed.
  • TypeScript typecheck and production Vite build passed.
  • Full Tauri test suite passed: 2,270 tests, 0 failures, 14 ignored.
  • Desktop JS test suite passed.

@BradGroux

Copy link
Copy Markdown
Contributor Author

This is a replacement for #5308, which was accidentally closed when branches were force-pushed after a commit identity rewrite. Prior review comments and feedback are preserved on the old PR:

#5308

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 12e1e78 to 1f9c2ff Compare August 25, 2026 19:16
@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main (was 36 commits behind). The branch applied cleanly. The backup restore dialog still lacks a Continue button for raw nsec keys on current main, so this fix is still needed.

No review comments on this PR. CI will verify the build and test gate.

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 1f9c2ff to 9f0c62d Compare August 29, 2026 16:15
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 213092074c269bee90c87163672f9c2b8d714cfe...59f8056adb3525777869b8a1bb6ce3192ce68197.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 59f8056adb3525777869b8a1bb6ce3192ce68197 to authorize a new review.
Any previous review applies only to its recorded range.

@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main (was 62 commits behind at f249710, now at 00e61ea). The branch applies cleanly with all tests passing.

Still-needed assessment: No upstream commits in the 62-commit window address the same issue. This PR remains needed.

Review requests: buzz-oss-team review request is active from the previous pass.

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 9f0c62d to 50bc7a1 Compare September 2, 2026 17:30
@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebased onto current block:main (2af9773d6) — 38 new commits since the last rebase pass (Aug 29, 00e61eafa). Rebased cleanly with no conflicts.

Still needed: Checked all 38 new upstream commits for overlap with this PR's topic. None of the upstream changes address the issue this PR fixes. The PR remains relevant.

Verification:

  • Branch is 0 commits behind block:main, mergeable on GitHub
  • All commits authored as Brad Groux (3053586+BradGroux noreply)
  • DCO signoff preserved on all commits

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 50bc7a1 to 8857a7d Compare September 3, 2026 17:18
@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebase and review — 2026-09-03

Base commit: 752cbfc03 (latest main)
Mergeable: Yes
Conflicts: None — rebased cleanly.

Accuracy review: The Continue button is still not shown when a raw nsec is loaded in the backup restore dialog.
Continued relevance: Still needed.

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 8857a7d to dfb66df Compare September 3, 2026 17:46
@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebase and review update — Sep 3, 2026

Rebased onto latest main (88687876f). No conflicts.

Accuracy review: Main's backup restore dialog does not show a Continue button when a raw nsec is loaded. The NostrKeyImportForm validates input but the backup mode doesn't render a submit button when only the nsec is present (no passphrase). The PR's fix to show Continue when a valid raw nsec is loaded is still needed.

Mergeable status: Confirmed MERGEABLE on GitHub after force-push.

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from dfb66df to 0800e85 Compare September 5, 2026 04:59
@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebase pass — Sep 5, 2025

Rebased onto current upstream main (f038cbbb0). Main moved 62 commits since the Sep 2 rebase pass (2af9773d6).

Rebase result

Rebased cleanly onto current main. No conflicts.

Still-needed assessment

Checked all 62 new main commits for overlap with this PR's topic. None obsoleted:

Verification

  • PR confirmed MERGEABLE on GitHub
  • All commits authored as Brad Groux (3053586+BradGroux noreply)
  • DCO signoff preserved on all commits
  • Review requests to buzz-oss-team still active from the Aug 24 recovery pass

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 0800e85 to 60997ea Compare September 9, 2026 05:49
@BradGroux

BradGroux commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Restoration note — Sep 16, 2026: The original text of this comment was accidentally overwritten when the Sep 16 rebase pass posted its follow-up with an edit flag instead of as a new comment. What follows is a faithful reconstruction from the session record; the byte-exact original remains in this comment's GitHub edit history (hover the edited marker on this comment).

Rebase pass — Sep 9, 2026

Rebased onto current upstream main (c045321a7). Main moved 8 commits since the Sep 5 rebase pass (f038cbbb0).

Rebase result

Rebased cleanly onto current main. No conflicts.

Still-needed assessment

Checked all 8 new main commits for overlap with this PR's topic. None obsoleted. None of the 8 new main commits touch the key-import form's Continue gating.

Verification

  • PR confirmed MERGEABLE on GitHub
  • All commits authored as Brad Groux (3053586+BradGroux noreply)
  • DCO signoff preserved on all commits
  • Review requests to buzz-oss-team still active from the Aug 24 recovery pass

…estore dialog

The backup-file restore dialog (mode="backup") accepts .key files
containing a raw nsec1 key. The file parser loads the key and shows
"Nostr identity found" with the derived npub, but the submit button
only rendered when mode === "key" or isPasswordStage (ncryptsec). A
raw nsec in backup mode satisfies neither condition, so the user sees
a recognized identity with no forward action — a dead end.

Add isValid to the render guard so a valid raw nsec shows the Continue
button regardless of mode. The button's disabled={!isValid} check
already prevents submission of invalid input.

Closes block#5261.

Co-authored-by: Brad Groux <brad@digitalmeld.com>
Signed-off-by: Brad Groux <brad@digitalmeld.com>
Signed-off-by: dm-builder <f01486f036641ccb52c11bb1e0ff2346ea89a8b4e3b49cd772249948f6fcbae6@digitalmeld.communities.buzz.xyz>
Signed-off-by: Brad Groux <bradgroux@hotmail.com>
Signed-off-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 60997ea to 59f8056 Compare September 16, 2026 18:09
@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebase pass — Sep 16, 2026

Rebased onto current upstream main (213092074). Main moved 37 commits since the Sep 9 rebase pass (c045321a7).

Rebase result

Conflict resolved in desktop/src/features/onboarding/ui/MachineOnboardingFlow.tsx — upstream's onboarding refresh (#7528, #7659) replaced the overlay Dialogs with inline key-import pages. Kept upstream's new inline structure and re-applied this PR's copy changes (Import from a file heading, import-from-file button, and the broader file-description wording) to the new backup sub-page. The core isValid render guard in NostrKeyImportForm.tsx applied cleanly.

Still-needed assessment

#7528 (refresh onboarding flow) and #7659 (fix onboarding regressions) rewrote the surrounding flow but the raw-nsec Continue gap is still present on main: mode === "key" || isPasswordStage still gates the submit button without isValid.

Verification

  • PR confirmed MERGEABLE on GitHub
  • All commits authored as Brad Groux (3053586+BradGroux noreply)
  • DCO signoff preserved on all commits
  • buzz-oss-team review request still active

What was not done

No local test suites were run. The rebase only repositions commits; conflict resolutions carry the same logical changes forward (CI will verify builds).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop: backup-file restore accepts raw .key/nsec but renders no Continue action

1 participant