Replace threshold placeholder link with a real settings panel

Adds a "Loss thresholds" panel to the popup backed by the backend's
new GET/PATCH /me/settings endpoints, converting between the wire's
fractional percentages and whole-number form inputs only at that
boundary.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RTorFQXMR9ZQtCKcMTXLHp
This commit is contained in:
2026-09-08 02:38:46 +02:00
co-authored by claude
parent ac421196e9
commit 7f8270a048
7 changed files with 335 additions and 17 deletions
+9 -2
View File
@@ -1,4 +1,4 @@
import type { ConnectionStatus, LockState } from './types';
import type { ConnectionStatus, LockState, ThresholdSettings } from './types';
/** browser.storage.local key backing the lock state seam in the background script. */
export const LOCK_STATE_STORAGE_KEY = 'nexa:lockState';
@@ -28,7 +28,14 @@ export type NexaMessage =
| { type: 'nexa:switch-account-request' }
// Sign-out / switch account (popup -> background). See entrypoints/popup/App.tsx.
| { type: 'nexa:sign-out' }
| { type: 'nexa:switch-account' };
| { type: 'nexa:switch-account' }
// Loss-threshold settings (popup -> background -> GET/PATCH /me/settings).
// See background/settings-client.ts and entrypoints/popup/App.tsx.
| { type: 'nexa:get-settings' }
| { type: 'nexa:update-settings'; settings: Partial<ThresholdSettings> };
/** Response shape for 'nexa:get-settings'/'nexa:update-settings', returned via sendResponse. */
export type SettingsResult = { settings: ThresholdSettings } | { error: string };
/** Response shape for 'nexa:wallet-sign-request', returned via sendResponse (not a dispatched NexaMessage). */
export type WalletSignResult = { signature: string } | { error: string };