From f88416880dde6f5d795dc562a87aa6419cbbf0e8 Mon Sep 17 00:00:00 2001 From: Nic-dorman Date: Wed, 22 Apr 2026 15:21:54 +0100 Subject: [PATCH 1/4] feat(upload): non-blocking dialog, concurrency queue, honest states - Dialog is a thin view bound to FileEntry ids; Pinia store holds quote state so the dialog can be closed/reopened at any pre-payment stall without cancelling the underlying job. Row click on a pending entry reopens the dialog for that entry. - New upload_concurrency setting (Settings -> Advanced, default 1, range 1-8). Queued rows show "Queued: quoting" or "Queued: uploading" until a slot opens. Approve is gated on every entry being awaiting_approval and the button pluralises to "Approve N Uploads". - Removed the bytes/MiB * 0.05 ANT cost heuristic and the size-derived payment-mode fallback. Both dialogs now show an explicit "Not connected" error with a Retry button instead of any fake value. - Row status is connection-aware: "Connecting to network...", "Obtaining quote...", or "Network unavailable" instead of the ambiguous "Preparing upload...". - Button row grouped by intent: [Close] [Cancel Upload] on the left, [Approve Upload] isolated on the right so a fat-finger on dismiss can no longer spend ANT. - Pinia stores acceptHMRUpdate so getter changes don't require a full dev-server restart. Co-Authored-By: Claude Opus 4.7 (1M context) --- components/StatusBadge.vue | 6 + components/files/CostEstimateDialog.vue | 77 ++++--- components/files/UploadConfirmDialog.vue | 219 ++++++++++++------- pages/files.vue | 265 +++++++++++++---------- pages/settings.vue | 32 ++- src-tauri/src/config.rs | 11 + stores/files.ts | 123 ++++++++++- stores/settings.ts | 24 +- utils/constants.ts | 2 - 9 files changed, 526 insertions(+), 233 deletions(-) diff --git a/components/StatusBadge.vue b/components/StatusBadge.vue index 1bada8f..272b901 100644 --- a/components/StatusBadge.vue +++ b/components/StatusBadge.vue @@ -19,6 +19,12 @@ const statusMap: Record = // File transfer statuses Pending: { dot: '○', label: 'Pending', color: 'text-autonomi-muted' }, Quoting: { dot: '◐', label: 'Quoting', color: 'text-autonomi-warning' }, + 'Queued: quoting': { dot: '○', label: 'Queued: quoting', color: 'text-autonomi-muted' }, + 'Queued: uploading': { dot: '○', label: 'Queued: uploading', color: 'text-autonomi-muted' }, + 'Connecting to network…': { dot: '◐', label: 'Connecting to network…', color: 'text-autonomi-warning' }, + 'Obtaining quote…': { dot: '◐', label: 'Obtaining quote…', color: 'text-autonomi-warning' }, + 'Network unavailable': { dot: '✖', label: 'Network unavailable', color: 'text-autonomi-error' }, + 'Ready to approve': { dot: '●', label: 'Ready to approve', color: 'text-autonomi-blue' }, Paying: { dot: '◐', label: 'Paying', color: 'text-autonomi-warning' }, Uploading: { dot: '●', label: 'Uploading', color: 'text-autonomi-blue' }, Downloading: { dot: '●', label: 'Downloading', color: 'text-autonomi-blue' }, diff --git a/components/files/CostEstimateDialog.vue b/components/files/CostEstimateDialog.vue index 57fe47c..dee741d 100644 --- a/components/files/CostEstimateDialog.vue +++ b/components/files/CostEstimateDialog.vue @@ -12,7 +12,11 @@

Estimating cost...

-
+
+ No files selected +
+ +
{{ file.name }}
- {{ file.size ? formatBytes(file.size) : '-' }} - - {{ file.cost ? file.cost : `~${estimateCost(file.size)} ANT` }} - + {{ formatBytes(file.size) }} + {{ file.cost }} + + {{ file.gas_cost }} gas
-
-
- Total -
- {{ totalSize ? formatBytes(totalSize) : '-' }} - ~{{ estimateCost(totalSize) }} ANT + +
+ + +
-

- {{ hasRealCosts ? 'Costs queried from the Autonomi network.' : 'Estimates are approximate and may vary based on network conditions.' }} - Gas fees (ETH) apply on top of storage costs. +

+ Costs queried from the Autonomi network. Gas fees (ETH) apply on top of storage costs.

-
- No files selected -
-