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",
|
||||
"name": "Aegis Wallet",
|
||||
"version": "0.17.0",
|
||||
"version": "0.18.0",
|
||||
"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.",
|
||||
"author": "Silent Mode",
|
||||
|
|
|
|||
|
|
@ -763,10 +763,14 @@
|
|||
the normal Receive view (QR + address) and the Consolidate
|
||||
view (inline picker for sweeping other-wallet balances into
|
||||
this one). Hidden when there is nothing to consolidate. -->
|
||||
<div id="rcvModeToggle" class="modetoggle" hidden>
|
||||
<button data-rcv-mode="receive" class="on" type="button">Receive</button>
|
||||
<button data-rcv-mode="consolidate" type="button">Consolidate <span id="rcvConsolidateCount" class="hint"></span></button>
|
||||
</div>
|
||||
<!-- 0.18.0: the Receive tab's Receive/Consolidate toggle is gone. Two
|
||||
stacked toggle rows (that one, then Address & QR / Assets) was a
|
||||
lot of chrome for a 380px panel, and the two were not the same kind
|
||||
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">
|
||||
<!-- 0.16.0: Address-and-QR and Assets are PEERS, switched by a
|
||||
persistent chip row, instead of one stacked column. Stacking meant
|
||||
|
|
@ -794,6 +798,7 @@
|
|||
</div>
|
||||
<div class="actions" id="addrActions">
|
||||
<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>
|
||||
<!-- Drag the bottom edge to resize the QR. Height persists. -->
|
||||
<div class="qrwrap" id="qrWrap"><canvas id="qr" width="200" height="200"></canvas></div>
|
||||
|
|
@ -810,6 +815,11 @@
|
|||
</div><!-- /rcvNormal -->
|
||||
<!-- Consolidate view (inline, replaces Receive body when active). -->
|
||||
<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>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -2162,8 +2162,6 @@ function paintRcvView() {
|
|||
function paintRcvMode() {
|
||||
const normal = $("rcvNormal"); const cons = $("rcvConsolidate");
|
||||
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";
|
||||
cons.hidden = rcvMode !== "consolidate";
|
||||
if (rcvMode === "consolidate") {
|
||||
|
|
@ -3336,7 +3334,9 @@ function render() {
|
|||
cur && w.chain === cur.chain && w.network === cur.network && w.id !== state.selectedWalletId,
|
||||
);
|
||||
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;
|
||||
wrap.hidden = !showToggle;
|
||||
if (showToggle) {
|
||||
|
|
@ -3967,18 +3967,26 @@ document.querySelectorAll("[data-send-mode]").forEach((b) => b.addEventListener(
|
|||
consolidateInlineHost = null; // force re-render on next switch
|
||||
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.
|
||||
document.querySelectorAll("[data-rcv-view]").forEach((b) => b.addEventListener("click", () => {
|
||||
rcvView = b.dataset.rcvView === "assets" ? "assets" : "address";
|
||||
try { localStorage.setItem("aegis/rcvView", rcvView); } catch (_e) {}
|
||||
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", () => {
|
||||
if (id === "sendAmt" && sendMax) return;
|
||||
if (id === "sendAmt") updateSendFiatPreview();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue