Commit Graph

24 Commits

Author SHA1 Message Date
Devin
0a533d5119 fix(web): repair index.css braces damaged by Pattern G dedup script
Commit 14398af's strict-duplicate dedup script ate adjacent newlines/
chars when removing identical rules, leaving:

  - Line 1454: missing `}` to close `@media (max-width: 560px)` block
    that contains .trading-sidebar-{logo,avatar} display:none rule
  - Lines 2632-2635: corrupted "@media ... {media ... {ntral shell..."
    text from overlapping deletions of two adjacent @media blocks
  - Line 2649: `}  .trading-sidebar {` collapsed onto one line without
    a closing brace separator

Symptoms: production Vite build failed with
  [@tailwindcss/vite:generate:build] Missing closing } at media
  (max-width: 560px) — file: /app/web/src/index.css

Fix verified by walking the file with a brace-balance checker:
final depth 0, zero extra-close errors. The audit-css.mjs script
should grow a brace-balance check to prevent this regressing.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 19:30:26 +00:00
Devin
14398af792 refactor(web): consolidate duplicate CSS rules (Pattern G)
The audit-css.mjs script's "rules touching this class" metric over-
reported duplication because descendant selectors got counted alongside
true same-selector duplicates. A more precise scan (selector + @media
context + body identical) found 29 dead-code rules in index.css:

  - 5 .trading-sidebar-logo definitions (the example we already knew
    about; lines 353/1550/2640/2924/3044 — three top-level + two inside
    @media queries with overlapping responsibilities). The canonical
    version lives in layout-fixes.css §22 with all the layout +
    visuals.

  - 24 rules with completely identical (selector + context + body)
    where only the LAST occurrence in cascade order has any effect.
    Earliest copies were pure dead code. Affected: .dashboard-main,
    .dashboard-right-panel, .dashboard-content, .dashboard-shell,
    .trading-sidebar, .trading-sidebar-nav, .trading-sidebar-link,
    .trading-sidebar-avatar, .critical-alert-banner across top-level
    and three @media query contexts. These looked like the result of
    a copy-paste of an entire mobile/tablet @media block.

Also drops 28 !important declarations from layout-fixes.css §22 — those
were only needed to fight the now-deleted index.css duplicates of
.trading-sidebar-logo / .trading-sidebar-brand.

Net impact:
  index.css           3082 -> 2896 lines  (-186, -6%)
  !important total     183 -> 149         (-34,  -19%)
  layout-fixes.css      61 -> 33 !imp     (-28,  -46%)

TypeScript + ESLint both clean. No visual regressions expected — every
deleted rule had an identical surviving copy further down the cascade.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 09:50:14 +00:00
Devin
063afdbff6 chore(web): hex-color audit + annotate intentional shadows (UI audit #10)
Extends scripts/audit-css.mjs to also report hardcoded hex colors
outside CSS custom-property defs (`--name: #xxx;`) and outside
`var(--token, #fallback)` token-default fallbacks (which are explicitly
allowed per repo design-system rules).

Initial run reports 4 violations — all intentional pre-cascade body
defaults in :root and html.dark that must be literal hex (no var()) so
the page renders correct colors before the cascade resolves the custom
props. Annotated each with an explanatory comment; values intentionally
mirror --foreground / --background. Future drift surfaces immediately.

UI audit doc §5 #10 updated to reflect the sweep is done and the 4 known
violations are documented.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 09:33:54 +00:00
Devin
1807dc0d30 fix(web): grid minmax(0,1fr) + safer header search width (UI audit #2-4)
- index.css :1230 .right-panel-table-* — wrap all four 1fr/1.2fr/2fr columns
  in minmax(0, ...) so cell content can't push the row past container width
- index.css :1620 .trading-header-search — replace `width: min(42vw, 460px)
  !important` with `flex: 1 1 240px; min-width: 0; max-width: 460px`. vw
  units include the sidebar/scrollbar; flex-basis respects the header's
  actual flex container.
- index.css :1895 .home-preview-stats — repeat(3, minmax(0, 1fr))
- 5 inline gridTemplateColumns '1fr 1fr' in MarketplaceTab (x2),
  MembershipTab (x1), MyStrategiesTab (x2) → 'minmax(0, 1fr) minmax(0, 1fr)'

Addresses Pattern F + Pattern H in docs/ui/UI_AUDIT.md.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 08:59:22 +00:00
root
74400fda70 feat: migrate web to Gitea registry, add /api/devops/info, fix role drift
Backend:
- Fix role drift: /api/me/profile now returns JWT role authoritatively (was reading
  drifting role from trading_users). PATCH strips client-supplied role.
- Add /api/devops/info endpoint backed by @bytelyst/devops/server.
- Dockerfile: bake BYTELYST_COMMIT_SHA / BYTELYST_BUILT_AT / etc. as build args.

Web:
- Migrate from vendor/ + .pnpmfile.cjs to Gitea npm registry (consistency with backend).
- Replace file: refs in web/package.json with semver ranges resolved from Gitea.
- Drop vendor/bytelyst/* tree and .pnpmfile.cjs.
- Add DevOpsTab in Settings using @bytelyst/devops/ui (tabbed: Build/Runtime/Config/Deps/Raw).
- Vite alias: restrict @bytelyst/* catch-all to single-segment names so subpath
  imports (@bytelyst/devops/ui) resolve via package exports map.
- Bake BYTELYST_* metadata into the bundle as VITE_BYTELYST_* env.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 04:57:09 +00:00
94ce743bd0 refactor(ui): replace one-off visual language with shared Badge components
- Replace .stat-chip with Badge in PresetMarketplace, BacktestTab, MembershipTab
- Replace .saved-setup-id-chip with Badge in SimpleView
- Replace .screener-sector-chip with Badge in ScreenerView
- Replace .health-pill with Badge in TradeProfileManager
- Remove CSS definitions for one-off classes from index.css
- All components now use shared Badge from product adapter
- Verify: audit:ui (0 findings), audit:ui:strict (0 findings), typecheck, build
2026-05-09 12:56:52 -07:00
00d8683987 fix(ui): render shared primitives in product shell 2026-05-09 02:29:19 -07:00
217b46e123 refactor(ui): standardize home chart controls 2026-05-09 01:34:41 -07:00
57b8be698d refactor(ui): refine admin console controls 2026-05-09 01:16:06 -07:00
944ae498d2 refactor(ui): polish bot config settings 2026-05-09 01:12:56 -07:00
4f152b4b45 fix(ui): improve watchlist entry feedback 2026-05-09 01:02:10 -07:00
8c5a6d17f1 refactor(ui): modernize market opportunity cards 2026-05-09 00:59:27 -07:00
4d2f18ea45 refactor(ui): systematize screener controls 2026-05-08 21:37:58 -07:00
3375dfcfce fix(ui): polish portfolio operations tables 2026-05-08 21:33:59 -07:00
31d8932067 fix(ui): stabilize responsive shell chrome 2026-05-08 21:25:54 -07:00
1994821acf Polish trading UI and add launch roadmap 2026-05-08 20:58:00 -07:00
root
7375ad66f8 refactor(ui): tokenize operational surfaces 2026-05-07 04:06:21 +00:00
ce85504066 feat(ui): add shared design token aliases 2026-05-06 13:53:56 -07:00
root
76d326c793 refactor(web): normalize secondary ux surfaces 2026-05-06 03:27:52 +00:00
root
266b367322 feat(web): add shared light dark theme system 2026-05-06 02:56:27 +00:00
fce0228992 fix(D9): respect reduced motion preference 2026-05-04 17:59:07 -07:00
a9c33b1c14 fix(D5): add responsive dashboard breakpoints
Move fixed shell dimensions into responsive classes so sub-1024px layouts hide the right panel, turn the sidebar into a bottom nav, and keep dashboard content usable with adaptive grids and horizontal screener scrolling.

Refs: docs/AUDIT_REDESIGN.md item D5.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 16:41:48 -07:00
938ed86044 feat: live data wiring (Alpaca/FMP) + strategy builder + screener
Wires the new dashboard to real market data and adds the strategy
builder & screener UIs that were stubbed in the previous commit.

Frontend (web/src/):
- lib/marketApi.ts: authenticated fetch helpers for chart bars,
  market indices, news, and FMP research endpoints
- views/HomeView.tsx: StockChart now fetches live OHLCV via
  fetchChartBars on symbol/period change with loading/error states;
  ResearchCards replaces the static placeholder with live FMP
  profile/metrics/earnings (next-earnings + last 3 historical)
- components/layout/Header.tsx: live SPY/DIA/QQQ price + change%
  via fetchMarketIndices, refreshing every 60s; removed unused
  static sparkline placeholder
- components/strategy/VisualRuleBuilder.tsx: drag-and-drop IF/THEN
  rule composer using @dnd-kit (RSI/MACD/EMA/Price/Volume,
  above/below/crosses, BUY/SELL with shares or % of capital);
  saves via POST /api/profiles
- components/strategy/CodeStrategyEditor.tsx: Monaco editor with
  JS strategy template; "Run Backtest" posts to /api/backtest and
  renders return/win-rate/Sharpe/drawdown plus trade log
- views/ResearchView.tsx: adds "Visual Builder" and "Code Editor"
  sub-tabs alongside Strategies / Signals / Backtesting
- views/ScreenerView.tsx: live FMP screener with market-cap and
  sector filters, sortable columns, click-to-load-symbol routing
- index.css: light theme background; @keyframes spin for loaders
- App.dom.test.tsx: rewritten for router-based AppShell (was
  asserting on the removed tab UI; fixes 5 prior failures)

Backend (backend/src/services/apiServer.ts):
- /api/chart/bars: detects crypto symbols (contains "/") and
  routes to Alpaca v1beta3/crypto/us/bars; equities use
  v2/stocks/{symbol}/bars with iex feed
- (existing) /api/news, /api/market/indices, /api/research/{
  profile,metrics,earnings}, /api/screener proxy endpoints

Build/config:
- web/vite.config.ts: dedupe react / react/jsx-runtime /
  react-router-dom so the vendored react-auth dist resolves the
  same React instance (fixes "Cannot resolve react/jsx-runtime"
  Rollup error)
- web/tsconfig.app.json: exclude shared/platform-clients.ts and
  shared/platform-mobile.ts (mobile-only, missing RN SDK)
- web/package.json: add react-router-dom, @monaco-editor/react,
  @dnd-kit/core, @dnd-kit/sortable, @dnd-kit/utilities

Verification: `npm run build` in web/ → clean (✓ built in 3s);
backend tsc --noEmit → clean. Test suite: 151/155 pass; the 4
remaining failures are pre-existing (3 useTabFeatureFlags module
cache leaks, 1 EntryForm), not introduced here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:16:46 -07:00
3cbbd6ccaa feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00