UX: Move key backup into Accounts section; remove standalone Key Backup & Recovery panel #44

Closed
opened 2026-04-26 16:46:02 +00:00 by icub3d · 0 comments
Owner

Migrated from GitHub issue icub3d/decentcom#58
Original Author: @icub3d
Original Date: 2026-04-16T19:18:40Z


UX: Move key backup into Accounts section; remove standalone Key Backup & Recovery panel

Overview

The user settings panel currently shows three separate sections: Accounts, Profile, Key Backup & Recovery, and Theme. The Key Backup & Recovery section duplicates a concern that belongs to account management. This feature removes the standalone KeyBackupPanel and adds a per-account backup button directly inside the Accounts section. Clicking it opens a modal with the existing KeyExport component. Import is already handled by the "+ Add Account" button, which opens the Setup modal with the "Restore from Backup File" flow.

Background

The KeyBackupPanel (client/src/components/backup/KeyBackupPanel.tsx) is rendered in ServerSidebar.tsx inside the user-settings flyout panel. It wraps KeyExport and KeyImport side-by-side. Since KeyImport is already accessible via the setup flow ("+ Add Account" → "Restore from Backup File"), the only missing piece is a convenient per-account export shortcut integrated into the AccountSwitcher.

Requirements

  • Remove the KeyBackupPanel component from the user settings flyout in ServerSidebar.tsx
  • Add a backup button (e.g. 💾 or similar icon) next to each account row in AccountSwitcher.tsx
  • Clicking the backup button opens a modal containing KeyExport scoped to that account (the active account is exported — no account switching is required since KeyExport always exports the active key; clicking backup on a non-active account should switch to it first, or the button should only appear on the active account)
  • The modal can be dismissed without exporting
  • KeyBackupPanel.tsx is deleted once no longer referenced
  • Import flow is unchanged ("+ Add Account" → Setup modal → "Restore from Backup File")

Design

API / Interface Changes

No server or Tauri IPC changes required. KeyExport is reused as-is.

Data Model Changes

None.

Component Changes

  • client/src/components/layout/ServerSidebar.tsx — remove KeyBackupPanel import and usage from the user-settings panel
  • client/src/components/accounts/AccountSwitcher.tsx — add per-account backup button; manage a backupFor: string | null modal state; render a Modal containing KeyExport when set
  • client/src/components/backup/KeyBackupPanel.tsx — delete (no longer used)
  • client/src/components/backup/KeyExport.tsx — no changes; reused inside the new modal
  • client/src/components/backup/KeyImport.tsx — no changes; remains used by Setup via the restore flow

Task List

  • Remove KeyBackupPanel from ServerSidebar.tsx (remove import and the JSX element in the user-settings panel)
  • Add backupFor state to AccountSwitcher.tsx; add a 💾 backup icon button next to each account row (alongside the existing 🗑 delete button)
  • Clicking backup on a non-active account: decide behavior (see Open Questions); implement accordingly
  • Render a Modal in AccountSwitcher containing KeyExport when backupFor is set; dismiss on close
  • Delete client/src/components/backup/KeyBackupPanel.tsx
  • Update tests in AccountSwitcher.test.tsx: verify backup button renders, modal opens on click, modal closes on dismiss

Test List

  • Unit test: backup button renders next to each account row in AccountSwitcher
  • Unit test: clicking the backup button opens the KeyExport modal
  • Unit test: closing the modal hides KeyExport
  • Manual test: open user settings → confirm Key Backup & Recovery section is gone
  • Manual test: click 💾 next to an account → export modal opens → export a .dckb file successfully

Open Questions

  • Should the backup button appear on all accounts or only the active one? The key_export IPC command always exports the currently active key. If the button appears on non-active accounts, we should either (a) switch to that account before opening the modal, or (b) disable the button on non-active accounts with a tooltip explaining why. A simple starting point: show the button only on the active account.
**Migrated from GitHub issue icub3d/decentcom#58** **Original Author:** @icub3d **Original Date:** 2026-04-16T19:18:40Z --- # UX: Move key backup into Accounts section; remove standalone Key Backup & Recovery panel ## Overview The user settings panel currently shows three separate sections: Accounts, Profile, Key Backup & Recovery, and Theme. The Key Backup & Recovery section duplicates a concern that belongs to account management. This feature removes the standalone `KeyBackupPanel` and adds a per-account backup button directly inside the Accounts section. Clicking it opens a modal with the existing `KeyExport` component. Import is already handled by the "+ Add Account" button, which opens the `Setup` modal with the "Restore from Backup File" flow. ## Background The `KeyBackupPanel` (`client/src/components/backup/KeyBackupPanel.tsx`) is rendered in `ServerSidebar.tsx` inside the user-settings flyout panel. It wraps `KeyExport` and `KeyImport` side-by-side. Since `KeyImport` is already accessible via the setup flow ("+ Add Account" → "Restore from Backup File"), the only missing piece is a convenient per-account export shortcut integrated into the `AccountSwitcher`. ## Requirements - [ ] Remove the `KeyBackupPanel` component from the user settings flyout in `ServerSidebar.tsx` - [ ] Add a backup button (e.g. 💾 or similar icon) next to each account row in `AccountSwitcher.tsx` - [ ] Clicking the backup button opens a modal containing `KeyExport` scoped to that account (the active account is exported — no account switching is required since `KeyExport` always exports the active key; clicking backup on a non-active account should switch to it first, or the button should only appear on the active account) - [ ] The modal can be dismissed without exporting - [ ] `KeyBackupPanel.tsx` is deleted once no longer referenced - [ ] Import flow is unchanged ("+ Add Account" → Setup modal → "Restore from Backup File") ## Design ### API / Interface Changes No server or Tauri IPC changes required. `KeyExport` is reused as-is. ### Data Model Changes None. ### Component Changes - **`client/src/components/layout/ServerSidebar.tsx`** — remove `KeyBackupPanel` import and usage from the user-settings panel - **`client/src/components/accounts/AccountSwitcher.tsx`** — add per-account backup button; manage a `backupFor: string | null` modal state; render a `Modal` containing `KeyExport` when set - **`client/src/components/backup/KeyBackupPanel.tsx`** — delete (no longer used) - **`client/src/components/backup/KeyExport.tsx`** — no changes; reused inside the new modal - **`client/src/components/backup/KeyImport.tsx`** — no changes; remains used by `Setup` via the restore flow ## Task List - [ ] Remove `KeyBackupPanel` from `ServerSidebar.tsx` (remove import and the JSX element in the user-settings panel) - [ ] Add `backupFor` state to `AccountSwitcher.tsx`; add a 💾 backup icon button next to each account row (alongside the existing 🗑 delete button) - [ ] Clicking backup on a non-active account: decide behavior (see Open Questions); implement accordingly - [ ] Render a `Modal` in `AccountSwitcher` containing `KeyExport` when `backupFor` is set; dismiss on close - [ ] Delete `client/src/components/backup/KeyBackupPanel.tsx` - [ ] Update tests in `AccountSwitcher.test.tsx`: verify backup button renders, modal opens on click, modal closes on dismiss ## Test List - [ ] Unit test: backup button renders next to each account row in `AccountSwitcher` - [ ] Unit test: clicking the backup button opens the `KeyExport` modal - [ ] Unit test: closing the modal hides `KeyExport` - [ ] Manual test: open user settings → confirm Key Backup & Recovery section is gone - [ ] Manual test: click 💾 next to an account → export modal opens → export a .dckb file successfully ## Open Questions - Should the backup button appear on all accounts or only the active one? The `key_export` IPC command always exports the currently active key. If the button appears on non-active accounts, we should either (a) switch to that account before opening the modal, or (b) disable the button on non-active accounts with a tooltip explaining why. A simple starting point: show the button only on the active account.
icub3d 2026-04-26 16:46:02 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
icub3d/decentcom#44
No description provided.