WIP improve UX [snapshot task 2]

This commit is contained in:
Schluffe committed 2026-10-16 15:39:31 +02:00
1 parent 3ae47dde8e
commit cd66321ea6
13 files changed
+703 -87

No files matched your search

+32 -14
View File
@@ -10,7 +10,7 @@ explicit opt-in by both people; no relay is configured automatically.
## How it works
1. The sender picks one file and configures STUN (PageQuit by default, Google,
1. The person starting the connection selects one or more files and configures STUN (PageQuit by default, Google,
Cloudflare, a custom provider, or None). They create a code and send it
privately to the intended receiver through an authenticated channel. Normal
messenger copy/paste is supported; there is no need to transcribe codes.
@@ -40,22 +40,34 @@ explicit opt-in by both people; no relay is configured automatically.
available storage limits apply. Byte counts must remain safe JavaScript integers
(at most 2^53 − 1 bytes). Files above 120 MiB have not been tested end to end.
Cancel, reset, changing the selected file, or switching Send/Receive closes the
connection and aborts unfinished disk writes. Keep the tab open until receipt is
confirmed. A completed memory download is discarded when you reset or switch.
Switching browser tabs or apps to copy/paste does not explicitly cancel the
session, although a browser or mobile OS can suspend a background page.
Once both people verify, either person can add files without new codes or another
fingerprint comparison. Each side can queue up to 32 files (including its active
outgoing file). Each direction transfers one file at a time; sending and receiving
can happen simultaneously. Each file has its own progress, receipt and explicit
receiver acceptance. **Remove** drops a waiting local queue item; **Decline file**
rejects an incoming offer and lets the sender's queue continue.
**Disconnect** ends the entire session, drops waiting files and aborts unfinished
disk writes. To cancel an already active transfer, disconnect; cancelling only an
active file is not supported. Completed memory downloads remain available after
disconnect. Save a previous memory download before accepting another file;
acceptance replaces it. **Reset** discards the memory download and returns to
setup. Send/Receive chooses who starts the connection and is locked during the
session. Both people can send using the session's file picker.
Keep both tabs open. Switching browser tabs or apps does not explicitly cancel
the session, although browsers and mobile operating systems can suspend pages.
Pending verification/acceptance expires after five minutes; stalled transfers
expire after one minute. The two peers must use this protocol version (v2);
legacy connection codes are rejected.
expire after one minute. Idle verified sessions stay open. Lost connections need
fresh codes. Both peers must use protocol **v3**; older connection codes are
rejected before connecting. The local HTML supports the same manual flow.
If an answer is rejected as invalid, correct the pasted answer and click Connect
again; the sender keeps its existing offer while it is still awaiting an answer.
After a connection actually closes or fails, use Reset and exchange a **new offer
and new answer**. Old codes refer to the closed connection and cannot reopen it.
Reset returns the page to its initial ready state. For a local test, open two
separate browser tabs or windows; switching Send/Receive inside one page cancels
that page's previous connection. Use the specific error shown in red to diagnose
separate browser tabs or windows; use Disconnect before changing the setup role. Use the specific error shown in red to diagnose
failures; if a configured STUN server is unreachable, try None for a local test.
### Connection diagnostics and first-version comparison
@@ -115,7 +127,7 @@ different relay manually.
TURN credentials stay in the current component's memory; the app does not persist
them or include them in codes. The relay receives its authentication exchange and
can observe addresses, timing and traffic volume, and may charge for bandwidth.
Resetting, cancelling, completing or failing a connection clears TURN consent;
Resetting, cancelling or ending a connection clears TURN consent;
check the option again before creating another relayed connection.
File traffic remains DTLS encrypted through the relay. The web host, DNS resolver,
and code-exchange service are also relevant third parties.
@@ -136,8 +148,9 @@ The app does not upload files to its web host in this implementation; that is a
property of this code, not a guarantee against a host serving different code.
The protocol accepts one ordered, reliable data channel, bounded metadata and
messages, an exact declared byte count, and a single file. It rejects unexpected
states, excess data and duplicate metadata. An acknowledged 1 MiB send window
messages, exact declared byte counts, and at most one accepted file per direction.
Monotonic per-direction file IDs bind offers, data, and receipts to their files. It rejects unexpected
states, excess data and duplicate metadata. An acknowledged 1 MiB send window per transfer
and a bounded receive queue limit buffering during disk writes. Files are treated
as opaque downloads; metadata is not rendered as HTML. Encryption does not make
a file safe to open. These limits reduce denial-of-service exposure but do not
@@ -208,7 +221,7 @@ bun run dev # open the printed localhost URL in two tabs
Pick a file in the sender tab, choose Receive in the other, and check **Allow a
TURN relay** in both tabs. Leave **Use the configured relay with temporary
credentials** checked. Exchange codes and compare fingerprints as usual. Reset,
failure or completion clears consent, so check it again for each connection.
failure or disconnect clears consent, so check it again for each connection.
STUN defaults to the local server; TURN remains opt-in, with direct routes preferred.
```sh
@@ -308,3 +321,8 @@ Browser compatibility, network connectivity and storage availability vary.
## License
MIT — see `LICENSE`.
## UX roadmap
See [the hosted-first UX roadmap](docs/ux-roadmap.md) for repeat transfers, file
queues and bidirectional sessions, remembered devices, invitations, and guided setup.