Skip to content

fix(ui): disable public upload option until backend is wired - #12

Merged
Nic-dorman merged 1 commit into
mainfrom
fix/disable-public-upload-option
Apr 15, 2026
Merged

fix(ui): disable public upload option until backend is wired#12
Nic-dorman merged 1 commit into
mainfrom
fix/disable-public-upload-option

Conversation

@Nic-dorman

@Nic-dorman Nic-dorman commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR blocks the Public upload option in the ant-gui UI. The Public button in the upload-confirm dialog becomes disabled and labelled "Coming soon". Users can still upload files — every upload is now unambiguously private, which is exactly what Public was doing under the hood anyway.

Why block it

Before this PR, the dialog offered a Public/Private toggle that had no backend support:

  • Frontend drops the flag silently. stores/files.ts:235-240 accepts options.visibility in startRealUpload but the parameter is never referenced in the function body.
  • Backend has no public path. src-tauri/src/autonomi_ops.rs never calls client.data_map_store(), so the serialized DataMap is never published as a public chunk on the Autonomi network.
  • The displayed "address" is a lie. For every upload, the backend returns Sha256::digest(data_map_json) computed locally (autonomi_ops.rs:305, :358). That's a fingerprint of the local data map JSON, not a retrievable network address. Sharing that address would give the recipient nothing.

Picking Public today gives the user a false sense of having published the file. The data never actually leaks — the data map stays on the uploader's disk — but the UX promise is broken, and a toggle that silently does nothing is worse than no toggle at all.

Why not implement public here

Public uploads need an external-signer-compatible way to store the serialized DataMap as an additional paid chunk. That does not exist in WithAutonomi/ant-client today:

  • client.data_map_store internally calls pay_for_storage, which hard-requires a wallet. ant-gui has no wallet on the Rust side — all payments go via WalletConnect / direct-wallet on the frontend (external-signer flow).
  • The chunk-storage plumbing needed to hand-roll it (store_paid_chunks, chunk_put_to_close_group, merkle_upload_chunks) is pub(crate), so external callers cannot use it.

An upstream PR is in flight on WithAutonomi/ant-client to add a Visibility argument to file_prepare_upload, bundling the serialized DataMap into the existing payment batch as one additional chunk. Once that lands and we bump the git dep, a follow-up PR on this repo will re-enable the Public button and thread the visibility flag through start_upload / confirm_upload.

Changes

  • components/files/UploadConfirmDialog.vue — Public button becomes a real <button disabled>, with reduced opacity, cursor-not-allowed, a "Coming soon" pill, and explanatory subtext. Private remains selectable and is the only emitted value; the visibility ref resets to 'private' on every dialog open.

Test plan

  • npx nuxi typecheck passes
  • npm run test:run — 19/19 pass (no existing tests cover this component)
  • Manual: open an upload, Public button is greyed and unclickable
  • Manual: complete a private upload end-to-end — behaviour unchanged

The backend has no public upload path implemented — data_map_store is
never called, and the "visibility" flag passed from the dialog is
silently ignored in stores/files.ts. Selecting "public" produced the
same private upload while the returned address is a local SHA256 of
the data map JSON (not a network-retrievable chunk address), so any
shared address would be unresolvable by recipients.

Grey out the Public button and mark it "Coming soon" until the backend
wiring (data_map_store + visibility threading through start_upload /
finalize_upload) lands on its own branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Nic-dorman
Nic-dorman merged commit 852e764 into main Apr 15, 2026
4 checks passed
Nic-dorman added a commit that referenced this pull request Apr 15, 2026
Notable changes since v0.5.0:
- Disable public upload option in the UI until external-signer backend
  support lands (#12)
- Bump evmlib from 0.4 to 0.8 (#11)
- Add Vitest test suite + PR CI checks (typecheck, vitest, cargo
  fmt/clippy) (#8, #9)
- Parallel CI builds with pre-built sidecar binaries (#8)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman mentioned this pull request Apr 15, 2026
2 tasks
@Nic-dorman
Nic-dorman deleted the fix/disable-public-upload-option branch April 17, 2026 08:31
jacderida pushed a commit to jacderida/ant-ui that referenced this pull request Apr 27, 2026
Implements the GUI side of merkle batch payments (ant-client PR WithAutonomi#12).
Files with 64+ chunks now auto-select merkle payment (single tx) instead
of wave-batch (per-batch txs), reducing gas costs for large uploads.

Backend: match on ExternalPaymentInfo enum, serialize merkle params,
add confirm_upload_merkle command. Frontend: payForMerkleTree() via
unified PaymentVault contract, branch upload flow on payment mode.
Updates contract ABI and address to evmlib 0.8.0 unified vault.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant