Skip to content

feat: account import/export (encrypted) + dismissible modals#24

Merged
DGINXREAL merged 24 commits into
mainfrom
feat/account-import-export
Jun 16, 2026
Merged

feat: account import/export (encrypted) + dismissible modals#24
DGINXREAL merged 24 commits into
mainfrom
feat/account-import-export

Conversation

@noidee-dev

Copy link
Copy Markdown
Contributor

Summary

  • Account export/import — export one, several, or all accounts to a portable string, optionally password-encrypted (scrypt + AES-256-GCM). Copy or download the string; import by pasting it or loading a file.
  • Import preview — the app detects in the background whether a pasted blob is encrypted, shows the password field only when needed, and previews the accounts (label + provider) before importing. The Import button is gated on a valid preview.
  • Name collisions — when an imported account name already exists, a warning + chooser lets you skip, import as copies, or replace the existing account (one choice for all collisions). Colliding rows are flagged in the preview.
  • Dismissible modals — a shared Modal wrapper makes all 10 dialogs close via Esc and backdrop click (also resolves the ROADMAP "Escape-to-close" a11y item).

How it works

  • Pure node:crypto module (src/main/accounts/accountTransfer.ts): authenticated encryption, fail-closed on wrong/missing password. No new npm dependency.
  • IPC: accounts:export, accounts:import (with onDuplicate), accounts:importPreview (dry-run, returns only label+provider — never secrets), plus generic util:saveTextFile/util:openTextFile.
  • Renderer: useAccountTransfer hooks; ExportAccountsDialog / ImportAccountsDialog; entry points in the Accounts screen; ui/Modal.
  • i18n added across all 6 locales.
  • Security: secrets leave the OS keychain only inside the (optionally encrypted) export string; import is all-or-nothing in a single DB transaction; preview never returns secrets.

Design + plans under docs/superpowers/specs|plans/2026-06-16-*.

Test Plan

  • npm test — 533 passing (unit/IPC/UI/integration incl. crypto round-trip, duplicate modes, preview, Modal Esc/backdrop)
  • npx tsc --noEmit clean · npm run lint 0 errors
  • Manual: export with/without password, copy + download; import via paste and via file; encrypted preview after password; name-collision skip/copy/replace; Esc + backdrop close every dialog
  • Reviewer: confirm no secret is ever written to a log or returned by the preview

🤖 Generated with Claude Code

noidee-dev and others added 24 commits June 16, 2026 09:30
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Map TransferError codes to the existing transfer.* i18n keys so import errors are shown in the user's language instead of raw English.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reworks ImportAccountsDialog with a debounced background preview (350 ms),
conditional password field for encrypted exports, an account preview list,
and a gated Import button (disabled until accounts are previewed). Adds
previewCount, encryptedHint, and checking i18n keys to all 6 locales.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@noidee-dev noidee-dev requested a review from DGINXREAL June 16, 2026 09:31
@DGINXREAL DGINXREAL merged commit e54102f into main Jun 16, 2026
1 check passed
@DGINXREAL DGINXREAL deleted the feat/account-import-export branch June 16, 2026 11:15
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.

2 participants