refactor(ui): tokenize alert feed colors

This commit is contained in:
Saravana Achu Mac 2026-05-06 20:29:00 -07:00
parent 0b805bdea3
commit 6091f241d6
2 changed files with 117 additions and 117 deletions

View File

@ -82,7 +82,7 @@ Note: common platform had a pre-existing local modification in `packages/ui/src/
| [x] | 9. Advanced product-specific surfaces | product | Migrated Visual Strategy Builder controls to adapter Select/Input/Button/IconButton primitives while keeping dnd-kit composition and strategy rule logic product-owned. | Passed: `pnpm --filter @bytelyst/trading-web exec vitest run src/components/strategy/VisualRuleBuilder.dom.test.tsx`; `pnpm --filter @bytelyst/trading-web typecheck`; `pnpm run audit:ui`; `git diff --check`. | `bb4efc2b0d5f8e2ebbd7487b5731e0e6446ec4fb` | Audit raw controls reduced from 17 to 13. Charts, rule semantics, and strategy execution remain product-owned. | | [x] | 9. Advanced product-specific surfaces | product | Migrated Visual Strategy Builder controls to adapter Select/Input/Button/IconButton primitives while keeping dnd-kit composition and strategy rule logic product-owned. | Passed: `pnpm --filter @bytelyst/trading-web exec vitest run src/components/strategy/VisualRuleBuilder.dom.test.tsx`; `pnpm --filter @bytelyst/trading-web typecheck`; `pnpm run audit:ui`; `git diff --check`. | `bb4efc2b0d5f8e2ebbd7487b5731e0e6446ec4fb` | Audit raw controls reduced from 17 to 13. Charts, rule semantics, and strategy execution remain product-owned. |
| [x] | 10. Audit tooling hardening | product | Replaced brittle `rg`-based shell counting with a portable Python audit that excludes approved UI/test surfaces and reports non-zero raw controls reliably. | Passed: `pnpm run audit:ui`; `pnpm --filter @bytelyst/trading-web typecheck`; `git diff --check`. | `9ea72f7` | Audit now reports 0 direct `@bytelyst/ui` imports outside the adapter and no false-zero dependency on local `rg`. | | [x] | 10. Audit tooling hardening | product | Replaced brittle `rg`-based shell counting with a portable Python audit that excludes approved UI/test surfaces and reports non-zero raw controls reliably. | Passed: `pnpm run audit:ui`; `pnpm --filter @bytelyst/trading-web typecheck`; `git diff --check`. | `9ea72f7` | Audit now reports 0 direct `@bytelyst/ui` imports outside the adapter and no false-zero dependency on local `rg`. |
| [x] | 11. Remaining raw-control migration | product | Migrated remaining production raw controls in portfolio, screener, simple trade plan, chat, settings, and entries surfaces to adapter primitives while preserving trading workflow behavior. | Passed: `pnpm --filter @bytelyst/trading-web exec vitest run src/tabs/SettingsTab.dom.test.tsx src/tabs/EntriesTab.dom.test.tsx`; `pnpm --filter @bytelyst/trading-web typecheck`; `pnpm run audit:ui`; `git diff --check`. | `324e34d`, `7f5f125` | Audit raw interactive controls outside approved primitives reduced to 0. `EntriesTab.tsx` line endings were normalized to satisfy `git diff --check`. | | [x] | 11. Remaining raw-control migration | product | Migrated remaining production raw controls in portfolio, screener, simple trade plan, chat, settings, and entries surfaces to adapter primitives while preserving trading workflow behavior. | Passed: `pnpm --filter @bytelyst/trading-web exec vitest run src/tabs/SettingsTab.dom.test.tsx src/tabs/EntriesTab.dom.test.tsx`; `pnpm --filter @bytelyst/trading-web typecheck`; `pnpm run audit:ui`; `git diff --check`. | `324e34d`, `7f5f125` | Audit raw interactive controls outside approved primitives reduced to 0. `EntriesTab.tsx` line endings were normalized to satisfy `git diff --check`. |
| [~] | 12. Legacy global cleanup and strict audit | product | Removed unused global `.badge` CSS, removed legacy `SymbolCard` badge selectors, preserved adapter `Badge`/`ProductStatusBadge` usage, tightened legacy-class audit so product token names such as `--bl-surface-card` are not false positives, and tokenized the reset-password auth surface colors. | Passed: `pnpm run audit:ui`; `pnpm --filter @bytelyst/trading-web typecheck`; `pnpm --filter @bytelyst/trading-web lint`; `pnpm --filter @bytelyst/trading-web test`; `pnpm --filter @bytelyst/trading-web exec vitest run src/components/ResetPassword.dom.test.tsx`; `git diff --check`. | `5f38ada`, `e4c4c60` | Audit now reports 0 legacy global surface classes and 508 hardcoded color literals. Strict audit remains deferred for color classification/allowlisting. | | [~] | 12. Legacy global cleanup and strict audit | product | Removed unused global `.badge` CSS, removed legacy `SymbolCard` badge selectors, preserved adapter `Badge`/`ProductStatusBadge` usage, tightened legacy-class audit so product token names such as `--bl-surface-card` are not false positives, tokenized reset-password auth surface colors, and eliminated hardcoded color literals from `App.css` and `AlertFeed.css`. | Passed: `pnpm run audit:ui`; `pnpm --filter @bytelyst/trading-web typecheck`; `pnpm --filter @bytelyst/trading-web lint`; `pnpm --filter @bytelyst/trading-web test`; `pnpm --filter @bytelyst/trading-web exec vitest run src/components/ResetPassword.dom.test.tsx`; `TMPDIR="$PWD/.tmp/vitest" pnpm --filter @bytelyst/trading-web exec vitest run src/App.dom.test.tsx src/views/HomeView.dom.test.tsx src/components/AlertFeed.dom.test.tsx src/components/ComponentsSmoke.test.ts src/tabs/OverviewTab.test.ts`; `git diff --check`. | `5f38ada`, `e4c4c60` | Audit now reports 0 legacy global surface classes and 447 hardcoded color literals. Full suite passed before this slice; during this slice the full suite was blocked by OS temp `ENOSPC`, while typecheck/lint/diff/audit and targeted DOM tests passed. Strict audit remains deferred for color classification/allowlisting. |
## Remaining Work ## Remaining Work

View File

@ -1,13 +1,13 @@
.alert-feed { .alert-feed {
background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%); background: linear-gradient(135deg, var(--card) 0%, var(--card-elevated) 100%);
border-radius: 16px; border-radius: 16px;
padding: 24px; padding: 24px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); box-shadow: var(--card-shadow);
border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid var(--border);
} }
.alert-feed h2 { .alert-feed h2 {
color: #fff; color: var(--foreground);
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
margin: 0 0 20px 0; margin: 0 0 20px 0;
@ -25,17 +25,17 @@
} }
.alerts-container::-webkit-scrollbar-track { .alerts-container::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.05); background: var(--muted);
border-radius: 3px; border-radius: 3px;
} }
.alerts-container::-webkit-scrollbar-thumb { .alerts-container::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.2); background: var(--border-strong);
border-radius: 3px; border-radius: 3px;
} }
.alerts-container::-webkit-scrollbar-thumb:hover { .alerts-container::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.3); background: var(--muted-foreground);
} }
.alert-item { .alert-item {
@ -44,8 +44,8 @@
padding: 16px; padding: 16px;
margin-bottom: 12px; margin-bottom: 12px;
border-radius: 12px; border-radius: 12px;
background: rgba(255, 255, 255, 0.03); background: color-mix(in oklab, var(--foreground) 3%, transparent);
border: 1px solid rgba(255, 255, 255, 0.08); border: 1px solid var(--border);
transition: all 0.2s; transition: all 0.2s;
animation: slideIn 0.3s ease; animation: slideIn 0.3s ease;
} }
@ -63,24 +63,24 @@
} }
.alert-item:hover { .alert-item:hover {
background: rgba(255, 255, 255, 0.06); background: var(--muted);
transform: translateX(4px); transform: translateX(4px);
} }
.alert-signal { .alert-signal {
border-left: 3px solid #00ff88; border-left: 3px solid var(--bl-success);
} }
.alert-pulse { .alert-pulse {
border-left: 3px solid #4da6ff; border-left: 3px solid var(--bl-info);
} }
.alert-error { .alert-error {
border-left: 3px solid #ff3366; border-left: 3px solid var(--bl-danger);
} }
.alert-info { .alert-info {
border-left: 3px solid #888; border-left: 3px solid var(--muted-foreground);
} }
.alert-icon { .alert-icon {
@ -99,18 +99,18 @@
} }
.alert-symbol { .alert-symbol {
color: #fff; color: var(--foreground);
font-weight: 700; font-weight: 700;
font-size: 14px; font-size: 14px;
} }
.alert-time { .alert-time {
color: #666; color: var(--muted-foreground);
font-size: 12px; font-size: 12px;
} }
.alert-message { .alert-message {
color: #aaa; color: var(--muted-foreground);
font-size: 13px; font-size: 13px;
line-height: 1.5; line-height: 1.5;
} }