Commit Graph
3 Commits
Author SHA1 Message Date
Zoltan Papp 50197c7355 [client] Fix file drop delivery and refine the files UI
Seed the delivery directory from the IPC caller when the active profile
carries no username, so the default profile gets a destination instead of
failing every incoming transfer. Deliver text-only offers without requiring
a destination directory at all.

In the UI, drop the status label from the send picker rows, keep the dot,
and give the transfer list per-kind icons: a quote for text, a file with an
up or down arrow for files.
2026-09-05 19:12:43 +02:00
Zoltán Papp 2be390f426 [client] Fix the Files tab layout and add sending from the Files page
The Files rows overflowed the fixed-width panel instead of truncating.
Radix wraps ScrollArea.Viewport children in a div carrying an inline
`min-width:100%; display:table`, and a table box is shrink-to-fit, so it
grew to the widest row's intrinsic width and never gave `truncate` a
finite bound. Since overflowX is hidden when only the vertical scrollbar
is enabled, the result was clipped content rather than a scrollbar. A
scoped `.nb-scroll-clamp` rule overrides that display (the inline style
needs `!important`), leaving other ScrollAreas untouched.

Each transfer row is now three lines -- file name, to/from peer, then
time and size -- with the file name and the peer label both truncating
and revealing the full text on hover via TruncatedText. The status label
keeps its own right-hand column, vertically centred against the block,
so a refusal or failure stays scannable.

The Files page could not start a transfer at all: the send buttons lived
only on the peer detail panel, and an empty history replaced the whole
page, hiding the header. The header now always renders and carries one
primary Send button opening a two-step picker -- payload first, then the
peer list with search. One entry point means the peer list is built in
one place instead of two, and one button leaves the search field room to
survive the longer translations.

Clipboard sends showed nothing before leaving the machine. Both the
picker and the peer panel now preview the text first, and both send the
previewed string rather than re-reading the clipboard, which could have
changed between the preview and the confirmation. The picker disables
its clipboard entry when the clipboard is empty, so the failure surfaces
before the recipient is chosen. PeerSendActions is keyed on the peer so
a staged confirmation cannot carry over to a different recipient.

Deleting a history entry now asks first, reusing the app-wide useConfirm
hook. The wording states that received files stay on disk, matching what
DeleteTransfer does -- it drops the history record and cancels a live
transfer, and never touches delivered files. The dropdown is
modal={false} because DropdownMenuItem calls preventDefault, which keeps
a modal menu's focus trap alive against the dialog.
2026-09-01 14:25:28 +02:00
Zoltán Papp 73cffdb702 Add peer-to-peer file drop
Files move directly between peers over the overlay, with no server in the
path. The receiver listens on the WireGuard address only, so the port is
unreachable from outside the tunnel, and every offer is matched to a known
peer before anything is read.

Consent is the default: an offer carries metadata alone, and no payload
moves until the receiver accepts. Policy is per profile and device-local —
off, ask, or auto-accept, with per-sender exceptions on top.

Policy and history live in the profile's preferences, so removing a profile
takes its file drop state with it. Transfers interrupted by a restart are
settled on load; nothing survives to finish them, and left alone they would
sit in the log as permanently pending.

The Android bindings pull payload bytes through a chunk-returning stream:
gomobile copies a []byte argument into a fresh Java array and never copies
it back, so a fill-my-buffer method would hand back the right length with
no data.
2026-08-16 22:04:38 +02:00