From fa26c5fc56ec0a497aa970babb5d44e7ee3fd62b Mon Sep 17 00:00:00 2001 From: archipelago Date: Sun, 2 Aug 2026 07:36:25 -0400 Subject: [PATCH] fix(wallet): gate lightning on node STATE, gate send too, add a shared CopyButton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three defects from testing the previous commit on archi-dev-box: 1. The gate keyed on `id in packages`, which is not "installed and usable" — package-data carries an entry for a Lightning app that is known but not running. On a box with no lnd container at all the gate passed and the raw error came through as "Operation failed. Check server logs for details." Now keyed on PackageState.Running. 2. Because installed-but-stopped is a real and different situation, the modal has two modes: absent offers the install choices, stopped says the node isn't running and offers "Open My Apps". Neither dead-ends in an error. 3. Lightning SEND let you walk all the way to confirm-send with no node. The gate now runs in review(), before the confirm step — failing at submit after a review screen is the defect, not a smaller version of it. Also adds CopyButton, the start of one consistent copy affordance: icon + label, an emerald tick held 1.6s, a fixed box so the width never jumps, and a document.execCommand fallback so copy still works over plain http on a LAN IP (navigator.clipboard rejects on insecure origins, which is how a lot of nodes are reached). Converted the wallet's own copies — the lightning invoice the user reported, plus the on-chain/Ark addresses and the payment hash/txid. 20 of 25 copy sites across 15 other files still use ad-hoc markup; converting them is mechanical but was not attempted here rather than half-done. Verified: 5 gate tests; npm run build clean. Co-Authored-By: Claude Opus 5 (1M context) --- neode-ui/src/components/CopyButton.vue | 141 ++++++++++++++++++ .../src/components/LightningRequiredModal.vue | 29 +++- .../src/components/ReceiveBitcoinModal.vue | 11 +- neode-ui/src/components/SendBitcoinModal.vue | 25 +--- .../__tests__/useLightningRequired.test.ts | 29 +++- .../src/composables/useLightningRequired.ts | 65 +++++--- 6 files changed, 240 insertions(+), 60 deletions(-) create mode 100644 neode-ui/src/components/CopyButton.vue diff --git a/neode-ui/src/components/CopyButton.vue b/neode-ui/src/components/CopyButton.vue new file mode 100644 index 00000000..8e39bf31 --- /dev/null +++ b/neode-ui/src/components/CopyButton.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/neode-ui/src/components/LightningRequiredModal.vue b/neode-ui/src/components/LightningRequiredModal.vue index 805c1df7..3d9d9ab8 100644 --- a/neode-ui/src/components/LightningRequiredModal.vue +++ b/neode-ui/src/components/LightningRequiredModal.vue @@ -5,18 +5,23 @@ same reasoning as ExternalExplorerModal. --> -

- Creating a Lightning invoice needs a Lightning node running on this - Archipelago node. You don't have one installed yet — pick an - implementation below and it'll be installed for you. +

+ Lightning payments need a Lightning node that's actually running. Yours is + installed but isn't running right now — start it from My Apps and try + again. +

+

+ Lightning payments need a Lightning node running on this Archipelago + node. You don't have one installed yet — pick an implementation below and + it'll be installed for you.

-
+
{{ installing ? 'Close' : 'Not now' }} +
@@ -68,6 +78,7 @@