Skip to content

Fix copy buttons on the web build over plain HTTP - #40

Merged
pymq merged 1 commit into
masterfrom
fix/web-copy-buttons
Aug 13, 2026
Merged

pymq merged 1 commit into
masterfrom
fix/web-copy-buttons

Conversation

@pymq

@pymq pymq commented Aug 12, 2026

Copy link
Copy Markdown
Member

Closes anywherelan/awl#200

The engine's only web clipboard strategy is navigator.clipboard, which browsers expose in a secure context alone, so every copy button failed on http://admin.awl. Route copying through a new lib/clipboard_interop/ package: the Clipboard API first, falling back to execCommand, ported from the engine's own strategy removed in flutter/flutter#171427

Also make failure visible. None of the three call sites survived a throw, and the Peer ID button announced success before awaiting the copy, which sent the user off to paste an empty clipboard. All three now catch and report, sharing one message; two regression tests cover it.

Verified by hand on http://admin.awl

The engine's only web clipboard strategy is navigator.clipboard, which
browsers expose in a secure context alone, so every copy button failed on
http://admin.awl. Route copying through a new lib/clipboard_interop/
package: the Clipboard API first, falling back to execCommand, ported from
the engine's own strategy removed in flutter/flutter#171427

Also make failure visible. None of the three call sites survived a throw,
and the Peer ID button announced success before awaiting the copy, which
sent the user off to paste an empty clipboard. All three now catch and
report, sharing one message; two regression tests cover it.

Verified by hand on http://admin.awl
@pymq
pymq merged commit 2e83e32 into master Aug 13, 2026
4 checks passed
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.

Web UI peer id copy button can't copy text

1 participant