feat(aegis): 0.18.0 — Consolidate becomes an address action, not a second toggle row
The Receive tab carried two stacked toggle rows: Receive/Consolidate above Address & QR/Assets. That is a lot of chrome for a 380px panel, and the two rows were not the same kind of thing — Address and Assets are views of the wallet, while consolidating is an action on its UTXO set. Consolidate now sits with the other address actions, beside "Next unused address", with the sibling count on the button. The old toggle was also the only way out of the consolidate view, so that view gains its own "← Back to address". Entering still resets the inline host so the preview is costed fresh, which is what the toggle did. The Send tab keeps its Send/Consolidate toggle: there, consolidating really is an alternative way to send, so a toggle is the right shape. Removed the two now-dead [data-rcv-mode] blocks rather than leaving selectors that match nothing. Verified by real visibility rather than the hidden attribute — a child of a hidden parent keeps hidden=false, which made a first check look like both panes were showing at once. rcvNormal and the address pane go away while the consolidate pane shows, and Back restores them.
This commit is contained in:
parent
0f3dd6e9ca
commit
ab1451d6b1
3 changed files with 32 additions and 14 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "aegis",
|
"id": "aegis",
|
||||||
"name": "Aegis Wallet",
|
"name": "Aegis Wallet",
|
||||||
"version": "0.17.0",
|
"version": "0.18.0",
|
||||||
"category": "plugin",
|
"category": "plugin",
|
||||||
"description": "Multi-chain wallet (BCH, BTC, TRX, ETH, SOL, SC, DGB) derived from your Theseus vault. Dapps get window.bitcoincash on .x sites; window.tronWeb / window.tronLink / window.ethereum / window.solana on any https page.",
|
"description": "Multi-chain wallet (BCH, BTC, TRX, ETH, SOL, SC, DGB) derived from your Theseus vault. Dapps get window.bitcoincash on .x sites; window.tronWeb / window.tronLink / window.ethereum / window.solana on any https page.",
|
||||||
"author": "Silent Mode",
|
"author": "Silent Mode",
|
||||||
|
|
|
||||||
|
|
@ -763,10 +763,14 @@
|
||||||
the normal Receive view (QR + address) and the Consolidate
|
the normal Receive view (QR + address) and the Consolidate
|
||||||
view (inline picker for sweeping other-wallet balances into
|
view (inline picker for sweeping other-wallet balances into
|
||||||
this one). Hidden when there is nothing to consolidate. -->
|
this one). Hidden when there is nothing to consolidate. -->
|
||||||
<div id="rcvModeToggle" class="modetoggle" hidden>
|
<!-- 0.18.0: the Receive tab's Receive/Consolidate toggle is gone. Two
|
||||||
<button data-rcv-mode="receive" class="on" type="button">Receive</button>
|
stacked toggle rows (that one, then Address & QR / Assets) was a
|
||||||
<button data-rcv-mode="consolidate" type="button">Consolidate <span id="rcvConsolidateCount" class="hint"></span></button>
|
lot of chrome for a 380px panel, and the two were not the same kind
|
||||||
</div>
|
of thing: Address and Assets are views of the wallet, whereas
|
||||||
|
consolidating is an ACTION on its UTXO set. It now sits with the
|
||||||
|
other address actions, next to "Next unused address". The Send tab
|
||||||
|
keeps its own toggle — there, consolidate really is an alternative
|
||||||
|
way to send. -->
|
||||||
<div id="rcvNormal">
|
<div id="rcvNormal">
|
||||||
<!-- 0.16.0: Address-and-QR and Assets are PEERS, switched by a
|
<!-- 0.16.0: Address-and-QR and Assets are PEERS, switched by a
|
||||||
persistent chip row, instead of one stacked column. Stacking meant
|
persistent chip row, instead of one stacked column. Stacking meant
|
||||||
|
|
@ -794,6 +798,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="actions" id="addrActions">
|
<div class="actions" id="addrActions">
|
||||||
<button class="btn sm" id="nextAddr" hidden>Next unused address</button>
|
<button class="btn sm" id="nextAddr" hidden>Next unused address</button>
|
||||||
|
<button class="btn sm" id="rcvConsolidateBtn" hidden title="Sweep this coin's other wallets into this address">⇢ Consolidate <span id="rcvConsolidateCount" class="hint"></span></button>
|
||||||
</div>
|
</div>
|
||||||
<!-- Drag the bottom edge to resize the QR. Height persists. -->
|
<!-- Drag the bottom edge to resize the QR. Height persists. -->
|
||||||
<div class="qrwrap" id="qrWrap"><canvas id="qr" width="200" height="200"></canvas></div>
|
<div class="qrwrap" id="qrWrap"><canvas id="qr" width="200" height="200"></canvas></div>
|
||||||
|
|
@ -810,6 +815,11 @@
|
||||||
</div><!-- /rcvNormal -->
|
</div><!-- /rcvNormal -->
|
||||||
<!-- Consolidate view (inline, replaces Receive body when active). -->
|
<!-- Consolidate view (inline, replaces Receive body when active). -->
|
||||||
<div id="rcvConsolidate" hidden>
|
<div id="rcvConsolidate" hidden>
|
||||||
|
<!-- The toggle used to be the only way out of this view, so removing
|
||||||
|
it means this needs its own way back. -->
|
||||||
|
<div class="actions" style="margin-bottom:8px">
|
||||||
|
<button class="btn sm" id="rcvConsolidateBack" type="button">← Back to address</button>
|
||||||
|
</div>
|
||||||
<div id="rcvConsolidateInline"></div>
|
<div id="rcvConsolidateInline"></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -2162,8 +2162,6 @@ function paintRcvView() {
|
||||||
function paintRcvMode() {
|
function paintRcvMode() {
|
||||||
const normal = $("rcvNormal"); const cons = $("rcvConsolidate");
|
const normal = $("rcvNormal"); const cons = $("rcvConsolidate");
|
||||||
if (!normal || !cons) return;
|
if (!normal || !cons) return;
|
||||||
const buttons = document.querySelectorAll("[data-rcv-mode]");
|
|
||||||
buttons.forEach((b) => b.classList.toggle("on", b.dataset.rcvMode === rcvMode));
|
|
||||||
normal.hidden = rcvMode !== "receive";
|
normal.hidden = rcvMode !== "receive";
|
||||||
cons.hidden = rcvMode !== "consolidate";
|
cons.hidden = rcvMode !== "consolidate";
|
||||||
if (rcvMode === "consolidate") {
|
if (rcvMode === "consolidate") {
|
||||||
|
|
@ -3336,7 +3334,9 @@ function render() {
|
||||||
cur && w.chain === cur.chain && w.network === cur.network && w.id !== state.selectedWalletId,
|
cur && w.chain === cur.chain && w.network === cur.network && w.id !== state.selectedWalletId,
|
||||||
);
|
);
|
||||||
const showToggle = others.length > 0;
|
const showToggle = others.length > 0;
|
||||||
for (const [wrapId, cntId] of [["sendModeToggle", "sendConsolidateCount"], ["rcvModeToggle", "rcvConsolidateCount"]]) {
|
// Send keeps its toggle. Receive's became a button in the address actions
|
||||||
|
// (0.18.0), so it is shown/counted the same way but is not a toggle.
|
||||||
|
for (const [wrapId, cntId] of [["sendModeToggle", "sendConsolidateCount"], ["rcvConsolidateBtn", "rcvConsolidateCount"]]) {
|
||||||
const wrap = $(wrapId); if (!wrap) continue;
|
const wrap = $(wrapId); if (!wrap) continue;
|
||||||
wrap.hidden = !showToggle;
|
wrap.hidden = !showToggle;
|
||||||
if (showToggle) {
|
if (showToggle) {
|
||||||
|
|
@ -3967,18 +3967,26 @@ document.querySelectorAll("[data-send-mode]").forEach((b) => b.addEventListener(
|
||||||
consolidateInlineHost = null; // force re-render on next switch
|
consolidateInlineHost = null; // force re-render on next switch
|
||||||
paintSendMode();
|
paintSendMode();
|
||||||
}));
|
}));
|
||||||
|
// Consolidate, now an address action rather than a view toggle. Entering the
|
||||||
|
// view forces a re-render of the inline host so the preview is costed fresh
|
||||||
|
// each time, the same thing the old toggle did.
|
||||||
|
if ($("rcvConsolidateBtn")) $("rcvConsolidateBtn").addEventListener("click", () => {
|
||||||
|
rcvMode = "consolidate";
|
||||||
|
consolidateInlineHost = null;
|
||||||
|
paintRcvMode();
|
||||||
|
});
|
||||||
|
if ($("rcvConsolidateBack")) $("rcvConsolidateBack").addEventListener("click", () => {
|
||||||
|
rcvMode = "receive";
|
||||||
|
consolidateInlineHost = null;
|
||||||
|
paintRcvMode();
|
||||||
|
paintRcvView();
|
||||||
|
});
|
||||||
// Address & QR / Assets — the persistent pair inside the Receive body.
|
// Address & QR / Assets — the persistent pair inside the Receive body.
|
||||||
document.querySelectorAll("[data-rcv-view]").forEach((b) => b.addEventListener("click", () => {
|
document.querySelectorAll("[data-rcv-view]").forEach((b) => b.addEventListener("click", () => {
|
||||||
rcvView = b.dataset.rcvView === "assets" ? "assets" : "address";
|
rcvView = b.dataset.rcvView === "assets" ? "assets" : "address";
|
||||||
try { localStorage.setItem("aegis/rcvView", rcvView); } catch (_e) {}
|
try { localStorage.setItem("aegis/rcvView", rcvView); } catch (_e) {}
|
||||||
paintRcvView();
|
paintRcvView();
|
||||||
}));
|
}));
|
||||||
document.querySelectorAll("[data-rcv-mode]").forEach((b) => b.addEventListener("click", () => {
|
|
||||||
rcvMode = b.dataset.rcvMode;
|
|
||||||
consolidateInlineHost = null;
|
|
||||||
paintRcvMode();
|
|
||||||
paintRcvView();
|
|
||||||
}));
|
|
||||||
["sendTo", "sendAmt"].forEach((id) => $(id).addEventListener("input", () => {
|
["sendTo", "sendAmt"].forEach((id) => $(id).addEventListener("input", () => {
|
||||||
if (id === "sendAmt" && sendMax) return;
|
if (id === "sendAmt" && sendMax) return;
|
||||||
if (id === "sendAmt") updateSendFiatPreview();
|
if (id === "sendAmt") updateSendFiatPreview();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue