feat(upload): non-blocking dialog, concurrency queue, honest states#49
Merged
Nic-dorman merged 4 commits intomainfrom Apr 23, 2026
Merged
feat(upload): non-blocking dialog, concurrency queue, honest states#49Nic-dorman merged 4 commits intomainfrom
Nic-dorman merged 4 commits intomainfrom
Conversation
- 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) <noreply@anthropic.com>
…roof The previous watch used a single getter returning a fresh array every tick, which Vue compared by reference and so the callback always fired — but the dependency tracking on array elements got tangled: after the first file's quoting finished, the scheduler sometimes didn't see the quotingCount drop and the second queued file never got promoted. watchEffect tracks every reactive read automatically, which is the right tool for this job. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ant-core's estimate_upload_cost deliberately returns storage_cost_atto="0" and estimated_gas_cost_wei="0" when every sampled chunk of a file is already on the network (chunk_count <= 5, sampled == chunk_count). The old UI rendered that as "0 ANT" and "+ 0.000000 ETH gas", which is indistinguishable from a suspiciously cheap quote. - New alreadyStored flag on FileEntry, set in beginQuoting when both cost fields are "0" and chunk_count > 0. - Dialog cost box shows a green "Already stored on the network -- free" banner when every entry is stored, plus per-entry "Already stored" badges in the file list. Mixed batches get a note on the cost card. - Uploads table cost cell reads "Free -- already stored" for those rows. - The "estimated from a single network quote" disclaimer is hidden for the all-stored case (no estimate to vary). The upload flow itself is unchanged -- start_upload returns payment_required=false and confirm_upload runs as a no-op on already- stored chunks, so Approve still does the right thing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Already-stored entries now skip awaiting_approval entirely — the store
routes them directly into queued_for_upload, the scheduler drives them
through to complete, and the confirm dialog auto-dismisses when every
selected entry is in that state.
- Row status collapses all the intermediate no-op states (queued_for_upload,
the second-time quoting inside startRealUpload, paying, uploading) to
a single honest "Saving datamap…" label. User sees a clean
Obtaining quote… -> Saving datamap… -> Complete sequence instead of
a confusing flash through Paying / Uploading for a free file.
- Dialog canApprove, readyCount, and button label now count only
non-stored entries, so a mixed batch (some stored, some not) behaves
correctly: stored entries process in the background while the user
approves the rest.
- Dialog auto-closes with a toast ("N files already stored — saving
datamap") when every selected entry is alreadyStored. No ceremonial
click required for a free, no-decision-needed operation.
- StatusBadge has an entry for the new "Saving datamap…" label so it
doesn't fall back to ?.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
queued_for_quote,quoting,awaiting_approval,queued_for_upload— without cancelling the underlying job. PiniaFileEntryholds the quote state; the dialog is a thin view bound tofileIds. Clicking a pending row in the uploads table reopens the dialog for that entry.upload_concurrencysetting under Settings -> Advanced (default1, range1-8). Queued rows show "Queued: quoting" or "Queued: uploading" instead of blasting the network in parallel. Approve is gated on every entry being ready; button pluralises to "Approve N Uploads".bytes / MiB * 0.05 ANTheuristic and the size-derived payment-mode fallback. Both dialogs now show an explicit "Not connected to the Autonomi network -- cost estimate unavailable" with a Retry button, checked before any spinner so the user is never left watching one that will never resolve.StatusBadgeentries so they don't fall back to?.[Close] [Cancel Upload]on the left,[Approve Upload]isolated on the right -- a fat-finger on dismiss can no longer accidentally spend ANT.filesandsettingsstores nowacceptHMRUpdateso getter/state changes don't require a full dev-server restart.Test plan
awaiting_approval, Approve enables and reads "Approve 3 Uploads".?for any unexpected label.🤖 Generated with Claude Code