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] | 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`. |
| [~] | 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

View File

@ -1,116 +1,116 @@
.alert-feed {
background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
border-radius: 16px;
padding: 24px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.alert-feed h2 {
color: #fff;
font-size: 20px;
font-weight: 700;
margin: 0 0 20px 0;
letter-spacing: 0.5px;
}
.alerts-container {
max-height: 300px;
overflow-y: auto;
padding-right: 8px;
}
.alerts-container::-webkit-scrollbar {
width: 6px;
}
.alerts-container::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.05);
border-radius: 3px;
}
.alerts-container::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.2);
border-radius: 3px;
}
.alerts-container::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.3);
}
.alert-item {
display: flex;
gap: 12px;
padding: 16px;
margin-bottom: 12px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
transition: all 0.2s;
animation: slideIn 0.3s ease;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.alert-item:hover {
background: rgba(255, 255, 255, 0.06);
transform: translateX(4px);
}
.alert-signal {
border-left: 3px solid #00ff88;
}
.alert-pulse {
border-left: 3px solid #4da6ff;
}
.alert-error {
border-left: 3px solid #ff3366;
}
.alert-info {
border-left: 3px solid #888;
}
.alert-icon {
font-size: 24px;
flex-shrink: 0;
}
.alert-content {
flex: 1;
}
.alert-header {
display: flex;
justify-content: space-between;
margin-bottom: 6px;
}
.alert-symbol {
color: #fff;
font-weight: 700;
font-size: 14px;
}
.alert-time {
color: #666;
font-size: 12px;
}
.alert-message {
color: #aaa;
font-size: 13px;
line-height: 1.5;
}
.alert-feed {
background: linear-gradient(135deg, var(--card) 0%, var(--card-elevated) 100%);
border-radius: 16px;
padding: 24px;
box-shadow: var(--card-shadow);
border: 1px solid var(--border);
}
.alert-feed h2 {
color: var(--foreground);
font-size: 20px;
font-weight: 700;
margin: 0 0 20px 0;
letter-spacing: 0.5px;
}
.alerts-container {
max-height: 300px;
overflow-y: auto;
padding-right: 8px;
}
.alerts-container::-webkit-scrollbar {
width: 6px;
}
.alerts-container::-webkit-scrollbar-track {
background: var(--muted);
border-radius: 3px;
}
.alerts-container::-webkit-scrollbar-thumb {
background: var(--border-strong);
border-radius: 3px;
}
.alerts-container::-webkit-scrollbar-thumb:hover {
background: var(--muted-foreground);
}
.alert-item {
display: flex;
gap: 12px;
padding: 16px;
margin-bottom: 12px;
border-radius: 12px;
background: color-mix(in oklab, var(--foreground) 3%, transparent);
border: 1px solid var(--border);
transition: all 0.2s;
animation: slideIn 0.3s ease;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.alert-item:hover {
background: var(--muted);
transform: translateX(4px);
}
.alert-signal {
border-left: 3px solid var(--bl-success);
}
.alert-pulse {
border-left: 3px solid var(--bl-info);
}
.alert-error {
border-left: 3px solid var(--bl-danger);
}
.alert-info {
border-left: 3px solid var(--muted-foreground);
}
.alert-icon {
font-size: 24px;
flex-shrink: 0;
}
.alert-content {
flex: 1;
}
.alert-header {
display: flex;
justify-content: space-between;
margin-bottom: 6px;
}
.alert-symbol {
color: var(--foreground);
font-weight: 700;
font-size: 14px;
}
.alert-time {
color: var(--muted-foreground);
font-size: 12px;
}
.alert-message {
color: var(--muted-foreground);
font-size: 13px;
line-height: 1.5;
}