mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-07 13:22:54 +00:00
feat(wallet): tuck manual URI under an "Advanced" disclosure (Bitcoin Connect D5)
When FEATURE_BITCOIN_CONNECT is on, "Connect wallet" is the primary path and the raw Wallet Connect URI field collapses under an "Advanced — paste a connection manually" <details> disclosure (backup, de-emphasized). When the flag is off, the controller forces the disclosure open and hides its summary, so the URI field shows plainly exactly as before (no behavior change). Default-zap field stays always visible. Adds a small token-based rotating-caret style for the summary. Still LOCAL (flag ON for testing); not pushed, not deployed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
69e87c6e15
commit
1add0bebec
3 files changed
+62
-17
No files matched your search
@@ -885,15 +885,26 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="space-y-4">
|
||||
<label class="block text-sm text-muted-strong" for="profileWalletUri">
|
||||
<span class="mb-2 block font-medium">Wallet Connect URI</span>
|
||||
<input
|
||||
id="profileWalletUri"
|
||||
type="url"
|
||||
placeholder="nostr+walletconnect://<public-key>?relay=wss://relay.example.com"
|
||||
class="input"
|
||||
/>
|
||||
</label>
|
||||
<details id="profileWalletAdvanced" class="wallet-advanced">
|
||||
<summary
|
||||
id="profileWalletAdvancedSummary"
|
||||
class="wallet-advanced__summary cursor-pointer text-xs font-medium text-muted-strong hover:text-text"
|
||||
>
|
||||
Advanced — paste a connection manually
|
||||
</summary>
|
||||
<label
|
||||
class="mt-3 block text-sm text-muted-strong"
|
||||
for="profileWalletUri"
|
||||
>
|
||||
<span class="mb-2 block font-medium">Wallet Connect URI</span>
|
||||
<input
|
||||
id="profileWalletUri"
|
||||
type="url"
|
||||
placeholder="nostr+walletconnect://<public-key>?relay=wss://relay.example.com"
|
||||
class="input"
|
||||
/>
|
||||
</label>
|
||||
</details>
|
||||
<label class="block text-sm text-muted-strong" for="profileWalletDefaultZap">
|
||||
<span class="mb-2 block font-medium">Default zap amount (sats)</span>
|
||||
<input
|
||||
|
||||
@@ -580,6 +580,25 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* "Advanced — paste a connection manually" disclosure in the Wallet pane
|
||||
(Bitcoin Connect). A subtle rotating caret replaces the default marker. */
|
||||
.wallet-advanced__summary {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.wallet-advanced__summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wallet-advanced__summary::before {
|
||||
content: "▸ ";
|
||||
color: var(--text-subtle);
|
||||
}
|
||||
|
||||
.wallet-advanced[open] > .wallet-advanced__summary::before {
|
||||
content: "▾ ";
|
||||
}
|
||||
|
||||
.popularity-modal__backdrop {
|
||||
z-index: var(--z-overlay-popover);
|
||||
padding: var(--space-md);
|
||||
|
||||
@@ -42,6 +42,8 @@ export class ProfileWalletController {
|
||||
|
||||
this.walletBitcoinConnectRow = null;
|
||||
this.walletBitcoinConnectButton = null;
|
||||
this.walletAdvanced = null;
|
||||
this.walletAdvancedSummary = null;
|
||||
this._bitcoinConnectModulePromise = null;
|
||||
this._bitcoinConnectInitialized = false;
|
||||
}
|
||||
@@ -62,6 +64,10 @@ export class ProfileWalletController {
|
||||
document.getElementById("profileWalletBitcoinConnectRow") || null;
|
||||
this.walletBitcoinConnectButton =
|
||||
document.getElementById("profileWalletBitcoinConnect") || null;
|
||||
this.walletAdvanced =
|
||||
document.getElementById("profileWalletAdvanced") || null;
|
||||
this.walletAdvancedSummary =
|
||||
document.getElementById("profileWalletAdvancedSummary") || null;
|
||||
|
||||
// Backwards compatibility alias if needed by tests/external code
|
||||
this.mainController.profileWalletStatusText = this.walletStatusText;
|
||||
@@ -69,16 +75,25 @@ export class ProfileWalletController {
|
||||
this.applyBitcoinConnectVisibility();
|
||||
}
|
||||
|
||||
// Reveal the "Connect wallet" button only when the deployment enables the flag.
|
||||
// Off ⇒ the row stays hidden and the vendored bundle is never imported.
|
||||
// Bitcoin Connect on ⇒ show the "Connect wallet" button and tuck the manual URI
|
||||
// field under an "Advanced" disclosure (Connect is the primary path, manual the
|
||||
// backup). Off ⇒ hide the button, and force the disclosure open with its summary
|
||||
// hidden so the URI field just shows plainly (unchanged legacy behavior). Off
|
||||
// also means the vendored bundle is never imported.
|
||||
applyBitcoinConnectVisibility() {
|
||||
if (!(this.walletBitcoinConnectRow instanceof HTMLElement)) {
|
||||
return;
|
||||
const enabled = FEATURE_BITCOIN_CONNECT === true;
|
||||
|
||||
if (this.walletBitcoinConnectRow instanceof HTMLElement) {
|
||||
this.walletBitcoinConnectRow.classList.toggle("hidden", !enabled);
|
||||
}
|
||||
|
||||
if (this.walletAdvanced instanceof HTMLElement) {
|
||||
// When disabled, keep the field visible (open) and drop the toggle chrome.
|
||||
this.walletAdvanced.open = !enabled;
|
||||
}
|
||||
if (this.walletAdvancedSummary instanceof HTMLElement) {
|
||||
this.walletAdvancedSummary.classList.toggle("hidden", !enabled);
|
||||
}
|
||||
this.walletBitcoinConnectRow.classList.toggle(
|
||||
"hidden",
|
||||
FEATURE_BITCOIN_CONNECT !== true,
|
||||
);
|
||||
}
|
||||
|
||||
registerEventListeners() {
|
||||
|
||||
Reference in new issue
Block a user