feat(market): settings gear, options modal & distinct portfolio styles

Add a settings-gear modal (portfolio layout / chart style / fetch prices) and persist the portfolio style. Redesign the three row styles into distinct purposes: Table (borderless grid + column header + % pill), Cards (glass card + muted label/shadow value + shielded/transparent split bar), Spotlight (heavy tile + enlarged direction-coloured hero value + delta chip). Dim empty groups. Add data::SumPortfolioSplit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-17 22:35:03 -05:00
parent 0a43742897
commit 818c29fca7
2 changed files with 284 additions and 73 deletions

View File

@@ -31,6 +31,19 @@ inline double SumPortfolioBalance(const std::vector<std::string>& entryAddresses
return sum;
}
// Shielded/transparent breakdown of an entry's balance (for the per-group Z/T split bar). Pure.
struct PortfolioSplit { double shielded = 0.0; double transparent = 0.0; };
inline PortfolioSplit SumPortfolioSplit(const std::vector<std::string>& entryAddresses,
const std::vector<AddressInfo>& walletAddresses)
{
PortfolioSplit s;
if (entryAddresses.empty()) return s;
std::unordered_set<std::string> want(entryAddresses.begin(), entryAddresses.end());
for (const auto& a : walletAddresses)
if (want.count(a.address)) { if (a.isShielded()) s.shielded += a.balance; else s.transparent += a.balance; }
return s;
}
// Whether `address` is part of the entry's address group.
inline bool PortfolioEntryContains(const std::vector<std::string>& entryAddresses,
const std::string& address)