feat(aegis): 0.25.0 — balance first, one network control, status last
The header read bottom-up. The balance sat under a row of connection detail, and the network you were on was reported in that status row while the control that could actually change it was a chip row buried in the picker's coin drilldown — two places for one idea, with the useful half two clicks deep and only reachable from inside a wallet list. Reordered to match what people open the panel for: 1. wallet label 2. balance and portfolio 3. network selector 4. connection status and the per-wallet verbs (Explorer, Faucet) The selector and the indicator are now the same control: a chip per network this coin has wallets on, the active one marked, always present while a wallet is selected. Switching picks a wallet on that network and keeps the picker's per-chain network memory in step, so the two views cannot disagree. A single-network chain still renders its one chip. It is the indicator the status row used to carry, and hiding it would make the header height jump as you move between chains. A testnet whose label already says so (Chipnet testnet) no longer also gets a TEST tag; Nile and Sepolia still do.
This commit is contained in:
parent
0b4ddee8c5
commit
a04eb5406a
3 changed files with 88 additions and 33 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "aegis",
|
"id": "aegis",
|
||||||
"name": "Aegis Wallet",
|
"name": "Aegis Wallet",
|
||||||
"version": "0.24.0",
|
"version": "0.25.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",
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,26 @@
|
||||||
one row now: [network] [state] ........ [Explorer] [Faucet], above the
|
one row now: [network] [state] ........ [Explorer] [Faucet], above the
|
||||||
balance. The whole row hides together when there is no wallet context,
|
balance. The whole row hides together when there is no wallet context,
|
||||||
which is the only case the old .netrow hid in. */
|
which is the only case the old .netrow hid in. */
|
||||||
.netrow { display: flex; align-items: center; gap: 7px; margin-top: 8px;
|
/* 0.25.0: the network chip left this row to become the selector below the
|
||||||
|
balance, so what remains is purely connection state plus the per-wallet
|
||||||
|
verbs. */
|
||||||
|
.netrow { display: flex; align-items: center; gap: 7px; margin-top: 6px;
|
||||||
padding: 0 2px; min-width: 0; }
|
padding: 0 2px; min-width: 0; }
|
||||||
|
/* Network selector — indicator and switch in one control, directly under
|
||||||
|
the balance and present whenever a wallet is. The active chip IS the
|
||||||
|
"you are here" marker the status row used to carry. */
|
||||||
|
.netsel { display: flex; gap: 6px; margin-top: 12px; padding: 0 2px; flex-wrap: wrap; }
|
||||||
|
.netsel[hidden] { display: none; }
|
||||||
|
.netselchip { background: transparent; border: 1px solid var(--line); color: var(--mut);
|
||||||
|
border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px;
|
||||||
|
line-height: 1.15; cursor: pointer; display: inline-flex; align-items: center;
|
||||||
|
gap: 6px; white-space: nowrap; }
|
||||||
|
.netselchip:hover { border-color: var(--acid, #d6ff3d); color: var(--acid, #d6ff3d); }
|
||||||
|
.netselchip.on { background: rgb(from var(--acid, #d6ff3d) r g b / .14);
|
||||||
|
border-color: rgb(from var(--acid, #d6ff3d) r g b / .50);
|
||||||
|
color: var(--ink); font-weight: 600; cursor: default; }
|
||||||
|
.netselchip .cnt { color: var(--dim); font-size: 10.5px; font-weight: 400; }
|
||||||
|
.netselchip.on .cnt { color: var(--mut); }
|
||||||
/* Only the hostname may shrink. Without this the flexbox took width off
|
/* Only the hostname may shrink. Without this the flexbox took width off
|
||||||
the network chip first, clipping "Chipnet testnet" to "Chipnet" — the
|
the network chip first, clipping "Chipnet testnet" to "Chipnet" — the
|
||||||
one label on the row that must never be ambiguous, since it is what
|
one label on the row that must never be ambiguous, since it is what
|
||||||
|
|
@ -722,11 +740,24 @@
|
||||||
<button type="button" id="hAdd" class="chip" title="Add or import a wallet">+</button>
|
<button type="button" id="hAdd" class="chip" title="Add or import a wallet">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 0.8.4: network picker is its own row below the coin label so it
|
<!-- 0.25.0 header order: balance, then the network selector, then status.
|
||||||
reads as "the network I'm on right now" instead of a tiny suffix
|
The number you came to see is first; the control you act with is next;
|
||||||
next to the wallet name. Click cycles / opens the network menu. -->
|
the connection detail that only matters when something is wrong is
|
||||||
|
last. -->
|
||||||
|
<div class="bal">
|
||||||
|
<div class="big">
|
||||||
|
<span id="balMain">—</span><small id="balTicker">—</small>
|
||||||
|
<span id="balFiat" class="fiat" hidden></span>
|
||||||
|
</div>
|
||||||
|
<div id="portfolio" class="portfolio" hidden></div>
|
||||||
|
</div>
|
||||||
|
<!-- Network indicator and network switch are the same control. Until now
|
||||||
|
the indicator sat in the status row while the actual selector was a
|
||||||
|
chip row buried in the picker's coin drilldown — two places for one
|
||||||
|
idea, and the half that could change anything was two clicks deep.
|
||||||
|
This row is always present while a wallet is selected. -->
|
||||||
|
<div class="netsel" id="hNetSel" hidden></div>
|
||||||
<div class="netrow" id="hNetRow" hidden>
|
<div class="netrow" id="hNetRow" hidden>
|
||||||
<button type="button" class="netchip" id="hNet" title="Switch network"></button>
|
|
||||||
<span class="net"><span class="dot" id="dot"></span></span>
|
<span class="net"><span class="dot" id="dot"></span></span>
|
||||||
<!-- Not just a hostname: this line is also where "connecting…",
|
<!-- Not just a hostname: this line is also where "connecting…",
|
||||||
"· syncing", "· <n> unconfirmed" and the walletd setup prompt are
|
"· syncing", "· <n> unconfirmed" and the walletd setup prompt are
|
||||||
|
|
@ -743,13 +774,6 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="drop" hidden></div>
|
<div id="drop" hidden></div>
|
||||||
<div class="bal">
|
|
||||||
<div class="big">
|
|
||||||
<span id="balMain">—</span><small id="balTicker">—</small>
|
|
||||||
<span id="balFiat" class="fiat" hidden></span>
|
|
||||||
</div>
|
|
||||||
<div id="portfolio" class="portfolio" hidden></div>
|
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
<nav>
|
<nav>
|
||||||
<button data-tab="receive" class="on">Receive</button>
|
<button data-tab="receive" class="on">Receive</button>
|
||||||
|
|
|
||||||
|
|
@ -473,16 +473,52 @@ $("hFull") && $("hFull").addEventListener("click", async (e) => {
|
||||||
try { await S.invoke("openFullScreen"); }
|
try { await S.invoke("openFullScreen"); }
|
||||||
catch (err) { showErr(cleanErr(err)); }
|
catch (err) { showErr(cleanErr(err)); }
|
||||||
});
|
});
|
||||||
$("hNet").addEventListener("click", (e) => {
|
// Network indicator and network switch, merged into one always-visible
|
||||||
|
// control under the balance. Before this, the indicator was a chip in the
|
||||||
|
// status row and the real selector was a chip row inside the picker's coin
|
||||||
|
// drilldown: the half that told you where you were and the half that could
|
||||||
|
// move you were in different places, and the useful half was two clicks deep.
|
||||||
|
//
|
||||||
|
// A chain with a single network still renders its one chip. That chip is the
|
||||||
|
// indicator, and dropping it would make the header height jump as the user
|
||||||
|
// moves between chains.
|
||||||
|
function paintNetSelector(s) {
|
||||||
|
const host = $("hNetSel");
|
||||||
|
if (!host) return;
|
||||||
|
const chain = s && s.chain;
|
||||||
|
if (!chain) { host.hidden = true; host.innerHTML = ""; return; }
|
||||||
|
const mine = (state?.wallets || []).filter((w) => w.chain === chain);
|
||||||
|
const nets = orderNetworks(Array.from(new Set(mine.map((w) => w.network))));
|
||||||
|
if (!nets.length) { host.hidden = true; host.innerHTML = ""; return; }
|
||||||
|
host.hidden = false;
|
||||||
|
host.innerHTML = nets.map((n) => {
|
||||||
|
const peers = mine.filter((w) => w.network === n);
|
||||||
|
const lbl = networkLabelFor(chain, n, n);
|
||||||
|
// "Chipnet testnet TEST" says it twice. Only tag a testnet whose own
|
||||||
|
// label doesn't already announce it (Nile, Sepolia, devnet, signet).
|
||||||
|
const isTestnet = !!peers.find((w) => w.testnet) && !/test/i.test(lbl);
|
||||||
|
return `<button type="button" class="netselchip ${n === s.network ? "on" : ""}" data-netsel="${esc(n)}"
|
||||||
|
title="${n === s.network ? "You are on " + esc(lbl) : "Switch to " + esc(lbl)} — ${peers.length} wallet${peers.length === 1 ? "" : "s"}">
|
||||||
|
${esc(lbl)}${isTestnet ? " " + testnetTag() : ""}<span class="cnt">${peers.length}</span>
|
||||||
|
</button>`;
|
||||||
|
}).join("");
|
||||||
|
host.querySelectorAll("[data-netsel]").forEach((b) => b.addEventListener("click", async (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
const w = (state?.wallets || []).find((x) => x.id === state?.selectedWalletId);
|
const net = b.dataset.netsel;
|
||||||
if (!w) return;
|
if (net === s.network) return;
|
||||||
pickerTab = "browse:" + w.chain;
|
const peers = mine.filter((w) => w.network === net);
|
||||||
const d = $("drop");
|
if (!peers.length) return;
|
||||||
positionDropBelowTabs(d);
|
// Keep the picker's own per-chain network memory in step, so the two
|
||||||
d.hidden = false;
|
// views never disagree about which network this chain is showing.
|
||||||
fillPicker();
|
activeNetworkByChain.set(chain, net);
|
||||||
});
|
persistActiveNetworks();
|
||||||
|
try {
|
||||||
|
state = await S.invoke("selectWallet", { id: peers[0].id });
|
||||||
|
settingsFilled = false;
|
||||||
|
render();
|
||||||
|
} catch (err) { aegisAlert("Could not switch network: " + cleanErr(err)); }
|
||||||
|
}));
|
||||||
|
}
|
||||||
// + Add and ⋯ More chips moved from the wallet strip into the header
|
// + Add and ⋯ More chips moved from the wallet strip into the header
|
||||||
// (0.6.31). Same handlers as before — fillPicker for the Add-only picker,
|
// (0.6.31). Same handlers as before — fillPicker for the Add-only picker,
|
||||||
// openMoreMenu for Import/Connect/About. Each stopsPropagation so the
|
// openMoreMenu for Import/Connect/About. Each stopsPropagation so the
|
||||||
|
|
@ -3421,16 +3457,11 @@ function render() {
|
||||||
// <wallet label> <coin · network + optional TEST tag>
|
// <wallet label> <coin · network + optional TEST tag>
|
||||||
$("hBadge").innerHTML = s?.meta?.logo ? logoSvg(s.meta.logo, 22) : logoSvg(null, 22);
|
$("hBadge").innerHTML = s?.meta?.logo ? logoSvg(s.meta.logo, 22) : logoSvg(null, 22);
|
||||||
$("hLabel").textContent = s?.label || "Aegis Wallet";
|
$("hLabel").textContent = s?.label || "Aegis Wallet";
|
||||||
// 0.8.4: hNet is a chip on its own row. Show only the network name
|
// 0.25.0: the network name moved out of this row into the selector chips
|
||||||
// (coin name is already in hLabel above); hide the row when we don't
|
// under the balance. What is left here is connection state, which only
|
||||||
// have any wallet-context to describe yet.
|
// earns attention when it is bad.
|
||||||
if (s?.meta) {
|
$("hNetRow").hidden = !s?.meta;
|
||||||
$("hNet").innerHTML = `${esc(s.meta.networkLabel)}${s.meta.testnet ? " " + testnetTag() : ""}`;
|
paintNetSelector(s);
|
||||||
$("hNetRow").hidden = false;
|
|
||||||
} else {
|
|
||||||
$("hNet").innerHTML = "";
|
|
||||||
$("hNetRow").hidden = true;
|
|
||||||
}
|
|
||||||
if (showLock) {
|
if (showLock) {
|
||||||
renderLockScreen(phase);
|
renderLockScreen(phase);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue