chore(aegis): 0.9.3 — one row shape, assets for every coin
Address row is now icon · label · amount · one button. ✎ and 🗑 were two
controls for what is really one idea ("change this wallet"), and the
manage modal already holds rename, derivation path AND remove — so a
single ⋯ opens it. That also stops Remove sitting one stray click away
from Rename. Default/legacy wallets show a lock instead.
The per-address amount is back unconditionally: 0.9.2 hid it when a coin
had one address, but the row reads as a breakdown and the gap looked
like missing data. The duplicate that actually mattered — the drilldown
subtitle — stays gone.
The Assets card only ever had branches for SOL, BCH and TRX, so ETH fell
through to a hidden card despite the adapter returning tokens in the
same shape. The generic branch is now keyed on the DATA rather than a
list of chain ids: any chain whose snapshot carries `tokens` renders,
which means ETH works today and a chain added later works for free. Only
the label ("TRC20" / "ERC20" / "Tokens") varies by chain.
Dropped the "Pick a coin" title row from the coin picker — the search
field's own placeholder already says what the pane is, so the title was
a line of chrome restating it and pushing the list down. Search and
close now share the top row.
Token history stays in History despite the request coming from tokens
being mistaken for transactions: a wallet that had only ever moved USDT
still showed an empty history without it.
This commit is contained in:
parent
1be352dad6
commit
4956f8f6c1
3 changed files with 38 additions and 42 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "aegis",
|
||||
"name": "Aegis Wallet",
|
||||
"version": "0.9.2",
|
||||
"version": "0.9.3",
|
||||
"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",
|
||||
|
|
|
|||
|
|
@ -102,6 +102,9 @@
|
|||
.netchip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
|
||||
/* Currency-picker search + all-coins catalogue (0.8.4). */
|
||||
#drop .pickersearch { padding: 8px; border-bottom: 1px solid var(--line); }
|
||||
/* Search + close share the top row now that the title row is gone. */
|
||||
#drop .pickersearch-top { display: flex; align-items: center; gap: 6px; }
|
||||
#drop .pickersearch-top input { flex: 1; min-width: 0; }
|
||||
#drop .pickersearch input { width: 100%; box-sizing: border-box; background: rgba(255,255,255,.04);
|
||||
border: 1px solid var(--line); color: var(--ink); border-radius: 7px;
|
||||
padding: 7px 10px; font: inherit; font-size: 12.5px; outline: none; }
|
||||
|
|
|
|||
|
|
@ -573,13 +573,15 @@ function fillPicker() {
|
|||
</div>`);
|
||||
}
|
||||
}
|
||||
// 0.9.3: the "Pick a coin" title row is gone — the search field's
|
||||
// own placeholder already says what this pane is, so the title was
|
||||
// a line of chrome restating it and pushing the list down.
|
||||
d.innerHTML = `
|
||||
<div class="droptabs">
|
||||
<span style="flex:1;font-size:12.5px;color:var(--dim);padding-left:10px">Pick a coin</span>
|
||||
<div class="pickersearch pickersearch-top">
|
||||
<input id="pickerSearch" type="search" autocomplete="off" spellcheck="false"
|
||||
placeholder="Search coins by name or ticker…" value="${esc(q)}">
|
||||
<button class="closex" id="pickerClose" title="Close">✕</button>
|
||||
</div>
|
||||
<div class="pickersearch"><input id="pickerSearch" type="search" autocomplete="off" spellcheck="false"
|
||||
placeholder="Search coins by name or ticker…" value="${esc(q)}"></div>
|
||||
<div class="droppane" style="padding:6px">
|
||||
${ownedRows.length ? `<div class="catgroup">Your wallets</div>${ownedRows.join("")}` : ""}
|
||||
${otherRows.length ? `<div class="catgroup" style="margin-top:6px">Add a new wallet</div>${otherRows.join("")}` : ""}
|
||||
|
|
@ -2463,7 +2465,8 @@ function wireStripDragDrop(el, chainGroups) {
|
|||
// Inline replacement for the modal address list. Rendered directly into
|
||||
// the wallet strip element when stripView.mode === "addresses". Header
|
||||
// row has a back arrow (returns to the coins summary) and the coin's
|
||||
// name/logo; body rows show one wallet each with an inline ✎ / 🗑.
|
||||
// name/logo; each body row is icon · label · copy · amount · one ⋯ that
|
||||
// opens the manage modal (rename / path / remove).
|
||||
// Assets live in the Receive tab's Assets card, not here — see 0.9.2.
|
||||
function renderInlineCoinList(el, groupKey, group) {
|
||||
const { meta, wallets: gw } = group;
|
||||
|
|
@ -2504,24 +2507,21 @@ function renderInlineCoinList(el, groupKey, group) {
|
|||
// Receive, and a shortened copy here was a second, less useful
|
||||
// rendering of the same string. The row now carries identity (name)
|
||||
// and, only when there is more than one address to compare, balance.
|
||||
const canRemoveRow = !(w.isDefault || w.isLegacy);
|
||||
const rowRemove = canRemoveRow
|
||||
? `<button class="wact wactdel" data-lpremove="${esc(w.id)}" title="Remove this wallet from Aegis">🗑</button>`
|
||||
: `<span class="wact" title="Default wallet — cannot be removed" style="opacity:.35;cursor:not-allowed">🔒</span>`;
|
||||
// With a single address the amount is identical to the header's
|
||||
// balance two rows up; showing it a third time is noise.
|
||||
const amountCell = multiAddr
|
||||
? `<span class="waamt"><span>${esc(bal)}</span><span class="watkr">${esc(meta.ticker)}</span></span>`
|
||||
: `<span class="waamt"></span>`;
|
||||
// 0.9.3: one row, one shape — icon · label · amount · one button.
|
||||
// ✎ and 🗑 were two controls for what is really one idea ("change
|
||||
// this wallet"), and the manage modal already holds rename,
|
||||
// derivation path AND remove. A single ⋯ opens it, which also stops
|
||||
// Remove sitting one stray click away from Rename.
|
||||
const locked = w.isDefault || w.isLegacy;
|
||||
const rowMenu = locked
|
||||
? `<span class="wact" title="Default wallet — protects legacy funds; cannot be removed" style="opacity:.35;cursor:not-allowed">🔒</span>`
|
||||
: `<button class="wact" data-lpedit="${esc(w.id)}" title="Rename, derivation path, or remove this wallet">⋯</button>`;
|
||||
return `<div class="warow ${on}" data-listpick="${esc(w.id)}" title="${esc(w.label || fullAddr)}">
|
||||
<span class="wcell">${logoSvg(meta.logo, 14)}</span>
|
||||
<span class="walabel walabel-wide" title="${esc(w.label || "")}">${esc(w.label || shortName || "—")}</span>
|
||||
${fullAddr ? `<button class="wacopy" data-lpcopy="${esc(fullAddr)}" title="Copy full address (${esc(fullAddr)})">📋</button>` : `<span></span>`}
|
||||
${amountCell}
|
||||
<span style="display:inline-flex;gap:2px;justify-self:end;align-items:center">
|
||||
<button class="wact" data-lpedit="${esc(w.id)}" title="Rename / derivation path / remove">✎</button>
|
||||
${rowRemove}
|
||||
</span>
|
||||
<span class="waamt"><span>${esc(bal)}</span><span class="watkr">${esc(meta.ticker)}</span></span>
|
||||
<span style="display:inline-flex;gap:2px;justify-self:end;align-items:center">${rowMenu}</span>
|
||||
</div>`;
|
||||
}).join("");
|
||||
// Surface any adapter errors from the wallets in this group. If a fetch
|
||||
|
|
@ -2605,20 +2605,11 @@ function renderInlineCoinList(el, groupKey, group) {
|
|||
const w = (state?.wallets || []).find((x) => x.id === b.dataset.lpedit);
|
||||
if (w) openWalletManageModal(w);
|
||||
}));
|
||||
el.querySelectorAll("[data-lpremove]").forEach((b) => b.addEventListener("click", async (e) => {
|
||||
e.stopPropagation();
|
||||
try {
|
||||
const gone = await removeWalletWithConfirm(b.dataset.lpremove);
|
||||
// Removing the last address under this coin leaves the drilldown
|
||||
// pointing at an empty group — fall back to the coin list.
|
||||
if (gone) {
|
||||
const left = (state?.wallets || []).filter((w) => w.id !== b.dataset.lpremove && group.wallets.some((g) => g.id === w.id));
|
||||
if (!left.length) stripView = { mode: "coins", groupKey: null };
|
||||
renderWalletStrip();
|
||||
}
|
||||
} catch (er) { showErr(cleanErr(er)); }
|
||||
}));
|
||||
// Per-address asset list toggle.
|
||||
// Removing a wallet now happens inside the manage modal (the row's ⋯),
|
||||
// so the row no longer emits its own remove button. The modal calls
|
||||
// render() itself, which redraws the strip — including falling back to
|
||||
// the coin list when the last address under a coin goes away.
|
||||
|
||||
el.querySelector("#stripAddMore").addEventListener("click", async () => {
|
||||
// Add another wallet of the same coin+network directly, without
|
||||
// opening the picker sheet — the user is already inside this coin's
|
||||
|
|
@ -3078,14 +3069,18 @@ function renderTokens() {
|
|||
}).catch(() => {});
|
||||
return;
|
||||
}
|
||||
// TRX wallets: TRC20 balances. Read-only — Aegis has no TRC20 spend
|
||||
// path yet, so there's no Send button here (unlike SPL above).
|
||||
if (chain() === "trx") {
|
||||
// Every other account-model chain (TRX, ETH, and anything added later)
|
||||
// renders from the same `tokens` shape the adapters already return, so
|
||||
// this is keyed on the DATA rather than on a list of chain ids — a new
|
||||
// chain gets the asset list for free instead of silently falling
|
||||
// through to a hidden card the way ETH did until 0.9.3.
|
||||
{
|
||||
const tokens = s?.tokens || [];
|
||||
card.hidden = tokens.length === 0;
|
||||
const hintEl = $("tokensHint");
|
||||
if (hintEl) hintEl.textContent = "TRC20 tokens held by this wallet. Read-only in this build — use the explorer link to move them.";
|
||||
if (!tokens.length) { card.hidden = true; return; }
|
||||
card.hidden = false;
|
||||
const hintEl = $("tokensHint");
|
||||
const kindLabel = chain() === "trx" ? "TRC20" : chain() === "eth" ? "ERC20" : "Tokens";
|
||||
if (hintEl) hintEl.textContent = `${kindLabel} tokens held by this wallet. Read-only in this build — open the explorer from the header to move them.`;
|
||||
// A symbol claimed by more than one contract is the lookalike pattern:
|
||||
// spam mints borrow a trusted ticker so a careless send lands on the
|
||||
// wrong contract. We can't tell which is genuine, so we don't guess —
|
||||
|
|
@ -3121,9 +3116,7 @@ function renderTokens() {
|
|||
<div class="amt2 in" style="align-self:center;text-align:right">${amount}</div>
|
||||
</div>`;
|
||||
}).join("");
|
||||
return;
|
||||
}
|
||||
card.hidden = true;
|
||||
}
|
||||
// Same shape as index.js's fmtTokenAmount — string-safe for u64 SPL amounts.
|
||||
function fmtTokenAmount(rawStr, decimals) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue