Description
Copy actions backed by the shared clipboard helper fail when bb is opened from another device over a plain-HTTP LAN URL, such as http://<host>:38886. Clicking a copy affordance shows Failed to copy and leaves the clipboard unchanged.
Reproduction
- Run bb so the frontend is reachable from the local network.
- Open it from another device using a non-loopback HTTP origin.
- Click any copy action backed by the shared clipboard helper, such as a path or message copy button.
Expected behavior
The selected text is copied to the system clipboard.
Actual behavior
The copy fails and bb displays Failed to copy.
Root cause
Browsers restrict navigator.clipboard.writeText() to secure contexts. A plain-HTTP LAN origin is not considered secure, so the Clipboard API may be unavailable or reject the request. The shared helper currently treats that as a terminal failure even though bb supports this access pattern.
Impact
Because copy affordances share the helper, this affects multiple copy actions throughout the app rather than one specific component.
Proposed fix
Retain the modern Clipboard API on secure origins and fall back to a temporary textarea plus the browser editing copy command when the API is unavailable or rejects. Restore focus and selection after the attempt.
Draft implementation: #1589
AGENT GENERATED: by GPT-5.6 Sol
Description
Copy actions backed by the shared clipboard helper fail when bb is opened from another device over a plain-HTTP LAN URL, such as
http://<host>:38886. Clicking a copy affordance showsFailed to copyand leaves the clipboard unchanged.Reproduction
Expected behavior
The selected text is copied to the system clipboard.
Actual behavior
The copy fails and bb displays
Failed to copy.Root cause
Browsers restrict
navigator.clipboard.writeText()to secure contexts. A plain-HTTP LAN origin is not considered secure, so the Clipboard API may be unavailable or reject the request. The shared helper currently treats that as a terminal failure even though bb supports this access pattern.Impact
Because copy affordances share the helper, this affects multiple copy actions throughout the app rather than one specific component.
Proposed fix
Retain the modern Clipboard API on secure origins and fall back to a temporary textarea plus the browser editing copy command when the API is unavailable or rejects. Restore focus and selection after the attempt.
Draft implementation: #1589