From 4802f028fa27fd4d28bb6b4e950c837af5d0ffe8 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 May 2026 05:27:40 +0000 Subject: [PATCH] refactor(ui): tokenize home and shell status colors --- web/src/components/layout/Header.tsx | 4 ++-- web/src/components/layout/RightPanel.tsx | 6 +++--- web/src/components/layout/Sidebar.tsx | 6 +++--- web/src/views/HomeView.tsx | 11 +++++++---- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/web/src/components/layout/Header.tsx b/web/src/components/layout/Header.tsx index 6c00f1a..8e10f16 100644 --- a/web/src/components/layout/Header.tsx +++ b/web/src/components/layout/Header.tsx @@ -144,7 +144,7 @@ export function Header() { {signStr}{idx.changePct.toFixed(2)}% @@ -171,7 +171,7 @@ export function Header() { width: 7, height: 7, borderRadius: '50%', - background: connected ? '#22C55E' : 'var(--destructive)', + background: connected ? 'var(--bl-success)' : 'var(--destructive)', display: 'inline-block', flexShrink: 0, }} /> diff --git a/web/src/components/layout/RightPanel.tsx b/web/src/components/layout/RightPanel.tsx index 3f468c6..ad62dd5 100644 --- a/web/src/components/layout/RightPanel.tsx +++ b/web/src/components/layout/RightPanel.tsx @@ -39,7 +39,7 @@ function PortfolioSummary() {
{pnlPos ? '+' : ''}{fmt$(totalPnl)} unrealized
@@ -79,7 +79,7 @@ function PortfolioSummary() { }}> {pos.symbol} {pos.currentPrice?.toFixed(2) ?? '—'} - + {pos_ ? '+' : ''}{pct.toFixed(2)}% {fmt$(pos.marketValue ?? 0)} @@ -210,7 +210,7 @@ function NewsFeed() { {loading && } {!loading && error && ( -
{error}
+
{error}
)} {!loading && !error && news.length === 0 && ( diff --git a/web/src/components/layout/Sidebar.tsx b/web/src/components/layout/Sidebar.tsx index 3a48443..cccc0c0 100644 --- a/web/src/components/layout/Sidebar.tsx +++ b/web/src/components/layout/Sidebar.tsx @@ -31,7 +31,7 @@ export function Sidebar() { width: 40, height: 40, borderRadius: 10, - background: 'linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 70%, #1d4ed8 30%))', + background: 'linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 70%, var(--bl-info-strong) 30%))', display: 'flex', alignItems: 'center', justifyContent: 'center', @@ -96,7 +96,7 @@ export function Sidebar() { display: 'flex', alignItems: 'center', justifyContent: 'center', - color: '#fff', + color: 'var(--primary-foreground)', fontSize: 12, fontWeight: 700, cursor: 'pointer', @@ -113,7 +113,7 @@ export function Sidebar() { width: 9, height: 9, borderRadius: '50%', - background: '#22C55E', + background: 'var(--bl-success)', border: '2px solid var(--card)', }} /> diff --git a/web/src/views/HomeView.tsx b/web/src/views/HomeView.tsx index ae5f168..99544be 100644 --- a/web/src/views/HomeView.tsx +++ b/web/src/views/HomeView.tsx @@ -45,6 +45,9 @@ interface ResearchProfile { const EQUITY_EMPTY_STATE_SYMBOLS = ['AAPL','MSFT','GOOGL','AMZN','NVDA']; const CRYPTO_EMPTY_STATE_SYMBOLS = ['BTC/USDT','ETH/USDT','SOL/USDT','ADA/USDT','DOGE/USDT']; const CRYPTO_BASES = new Set(['BTC','ETH','SOL','ADA','DOGE','XRP','LTC','DOT','AVAX','MATIC','BNB']); +const homePositiveText = 'var(--bl-success)'; +const homeNegativeText = 'var(--bl-danger)'; +const homeNegativeMuted = 'color-mix(in oklab, var(--bl-danger) 38%, var(--background))'; function uniqueSymbols(symbols: string[]) { return Array.from(new Set(symbols.map(s => s.trim().toUpperCase()).filter(Boolean))); @@ -267,7 +270,7 @@ export function TickerHeader({ {price > 0 ? price.toFixed(2) : '—'}
{price > 0 && ( - + {positive ? '+' : ''}{change.toFixed(2)} ({positive ? '+' : ''}{changePct.toFixed(2)}%) )} @@ -446,9 +449,9 @@ function StockChart({ ) : error ? (
- + {error}
) : chartData.length < 2 ? ( @@ -770,7 +773,7 @@ function ResearchCards({ {earnings.slice(0,3).map((e, i) => (
{fmtDate(e.date)} - = (e.epsEstimated ?? e.eps) ? '#16A34A' : '#DC2626' }}> + = (e.epsEstimated ?? e.eps) ? homePositiveText : homeNegativeText }}> EPS {e.eps != null ? `$${e.eps.toFixed(2)}` : '—'}