Skip to content

fix(desktop): try navigator.clipboard before arboard for npub/nsec copy - #3513

Open
JoeJoeflyn wants to merge 1 commit into
block:mainfrom
JoeJoeflyn:fix/member-npub-copy
Open

fix(desktop): try navigator.clipboard before arboard for npub/nsec copy#3513
JoeJoeflyn wants to merge 1 commit into
block:mainfrom
JoeJoeflyn:fix/member-npub-copy

Conversation

@JoeJoeflyn

Copy link
Copy Markdown

Summary

  • Try navigator.clipboard.writeText before the Tauri/arboard path in MembershipDenied and NsecMaskedDisplay copy buttons.
  • Implement the text-selection fallback in MembershipDenied that the catch block only commented about before.

Root cause

arboard without wayland-data-control writes to the XWayland clipboard, which Wayland-native apps never see. set_text returns Ok so the checkmark fires with an empty clipboard.

Verification

  • pnpm run typecheck
  • just desktop-standalone → copy npub and nsec → paste in a Wayland-native app → text present

Closes #2896

@JoeJoeflyn
JoeJoeflyn requested a review from a team as a code owner July 29, 2026 10:39
- Add copyTextWithFallback helper in shared/lib/clipboard that tries
  navigator.clipboard.writeText first, falling back to the Tauri/arboard
  path.
- Use it in MembershipDenied and NsecMaskedDisplay copy buttons.
- Implement the text-selection fallback in MembershipDenied that the
  catch block only commented about before.

arboard without wayland-data-control writes to the XWayland clipboard,
which Wayland-native apps never see. set_text returns Ok so the
checkmark fires with an empty clipboard.

- `pnpm run typecheck`
- `just desktop-standalone` → copy npub and nsec → paste in a
  Wayland-native app → text present

Closes block#2896

Signed-off-by: JoeJoeflyn <thaitainguyen336@gmail.com>
@JoeJoeflyn
JoeJoeflyn force-pushed the fix/member-npub-copy branch from 49d4e2e to 205d6f4 Compare July 29, 2026 10:43
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.

[Bug] Invite dialog "Copy link" reports success but leaves the clipboard empty on Linux/Wayland

1 participant