Commit Graph

51 Commits

Author SHA1 Message Date
324e34d537 feat(ui): migrate trade plan and chat controls 2026-05-06 15:49:04 -07:00
3892093dc4 feat(ui): migrate portfolio and screener controls 2026-05-06 15:47:15 -07:00
root
5cc5c8af37 refactor(plans): centralize route helpers 2026-05-06 20:36:03 +00:00
root
26dfb575be test(plans): harden route navigation coverage 2026-05-06 20:30:16 +00:00
root
11e2837bc9 refactor(plans): extract navigation state hook 2026-05-06 20:22:00 +00:00
root
5d5c1ed2bc refactor(plans): centralize local view state 2026-05-06 20:13:22 +00:00
root
ac353e8de5 feat(plans): make plans route canonical 2026-05-06 18:53:38 +00:00
root
9b6cbc1e67 fix(plans): harden holding selection and deep links 2026-05-06 18:38:00 +00:00
root
36bd21b7cd feat(portfolio): drill into saved trade plans 2026-05-06 18:31:29 +00:00
root
ddf55d8f26 feat(portfolio): link holdings into trade plans 2026-05-06 18:25:35 +00:00
root
1f03bb83cd feat(simple): add manage existing holding flow 2026-05-06 18:13:34 +00:00
root
f51172518e refactor(web): rename simple flow to trade plans 2026-05-06 17:39:34 +00:00
root
a1a63cc945 feat(simple): add long-term hold mode 2026-05-06 17:37:04 +00:00
root
0b526f3499 feat(simple): add setup activity history 2026-05-06 17:23:45 +00:00
root
7de6b236c0 perf(web): lazy-load app routes and heavy surfaces 2026-05-06 17:12:22 +00:00
root
0f4515013b feat(simple): add next-action guidance 2026-05-06 16:19:28 +00:00
root
d7516c440a feat(simple): add setup timeline and id copy 2026-05-06 16:08:23 +00:00
root
beb75c1d89 feat(simple): polish status and market fallback ux 2026-05-06 08:13:41 +00:00
root
fc4d4c85d1 feat(simple): improve setup status and market fallback 2026-05-06 08:10:16 +00:00
root
943cfda6b5 fix(simple): harden form runtime behavior 2026-05-06 07:13:37 +00:00
root
3d505db8d8 feat(simple): add amount sizing and runtime status 2026-05-06 07:04:48 +00:00
root
e01f38c883 fix(simple): allow immediate buy triggers 2026-05-06 06:09:16 +00:00
root
6b2ddeb837 fix(simple): clarify market price fallback copy 2026-05-06 04:33:41 +00:00
root
69e1b12d63 refactor(web): normalize advanced theme surfaces 2026-05-06 04:18:48 +00: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
root
9021df19ad fix(simple): restore form contrast 2026-05-06 02:31:34 +00:00
root
90e733b46c feat(simple): save dip-buy and profit-exit setups 2026-05-06 02:14:32 +00:00
root
0bd46ab43b feat(simple): auto-create dedicated execution profile 2026-05-06 01:29:45 +00:00
root
b33afc6c8c fix(web): require active profile for simple trades 2026-05-06 00:22:07 +00:00
root
feee2028aa feat(web): make simple tab direct trade flow 2026-05-06 00:13:29 +00:00
root
b7044a1eae fix(web): source simple trigger market price 2026-05-06 00:05:28 +00:00
root
00c117321d feat(web): add simple trade trigger tab 2026-05-05 23:57:08 +00:00
root
db29a3f6b9 fix(web): guard admin config from non-admin users 2026-05-05 21:38:56 +00:00
8a8c313ee8 fix(E1): lazy-load code strategy editor 2026-05-04 18:02:46 -07:00
b1f872f54c fix(D8): make empty-state chips market-aware 2026-05-04 17:56:34 -07:00
3bf1ca7d51 fix(D4): highlight selected screener sector 2026-05-04 17:46:52 -07:00
1e502b9f90 fix(D3): derive ticker exchange label from profile 2026-05-04 17:43:20 -07:00
5ca8183efb fix(D2): restore contrast for legacy settings tabs 2026-05-04 17:40:31 -07:00
1cd23f35f2 fix(B8): wire visual builder backtest 2026-05-04 17:17:44 -07:00
27b3d1a1dc fix(B5): derive quick stats from chart bars 2026-05-04 17:13:32 -07:00
311d79c4c4 fix(B4): show latest bar timestamp in ticker header 2026-05-04 17:10:57 -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
0fb1d63cbe fix(D1): add dashboard skeleton loaders
Replace plain loading text in news, research cards, and screener results with stable skeleton layouts so the dashboard holds its shape while market data requests resolve.

Refs: docs/AUDIT_REDESIGN.md item D1.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 16:38:17 -07:00
da79682ca3 fix(B6): persist code strategy saves
Route CodeStrategyEditor saves through the canonical profile API instead of browser localStorage, carrying the active symbol plus ResearchView capital and risk defaults into an inactive saved code strategy profile.

Refs: docs/AUDIT_REDESIGN.md item B6.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 16:34:45 -07:00
412fa5ad7c fix(audit): close agent follow-up gaps
Centralize the HomeView research profile fetch so the ticker header and research cards share one FMP profile request, preserving the B3 company-name behavior without doubling profile traffic. Wire the FMP cache regression into the backend test script and fix the stale API-contract shared import so backend tests can run through the new cache check.

Refs: docs/AUDIT_REDESIGN.md items B2, B3, and C2.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 16:18:21 -07:00
ed8175eb1f fix(B2,B3): wire ticker header actions
Route the ticker header watchlist and alert controls to their existing screens and replace the symbol placeholder with the research profile company name while preserving a symbol fallback.

Refs: docs/AUDIT_REDESIGN.md items B2 and B3.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 16:07:31 -07:00
c54b9f2017 fix(B1): wire RSI MACD Bollinger chart toggles
Compute RSI, MACD, and Bollinger Bands from the OHLCV bars already loaded by StockChart so the redesigned dashboard can expose the planned technical indicators without adding backend calls. Bollinger Bands overlay the price chart while RSI and MACD render in separate panels to preserve scale readability.

Refs: docs/AUDIT_REDESIGN.md item B1.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 15:19:54 -07:00
ddbffb6cd1 fix(audit-A): repair the 5 critical broken integrations
A1+A2 — CodeStrategyEditor backtest call
  Was: POST /api/backtest with { symbol, strategyCode, mode: 'code' }
  Now: POST /api/backtest/run with { symbols: [s], strategyConfig: {
       type: 'code', language: 'javascript', code } }
  The backend route is /api/backtest/run (not /api/backtest), and
  /api/backtest/run validates `symbols[]` and `strategyConfig`, not the
  ad-hoc fields we were sending. Also unwraps the { success, results }
  envelope the engine returns and surfaces success:false errors.

A3 — VisualRuleBuilder save shape
  Was: hand-rolled fetch to /api/profiles with { name, symbol, strategyType,
       visualRules, description } — backend's saveTradeProfileForUser ignored
       all of that and either 400'd or persisted a half-empty row.
  Now: uses the canonical createTradeProfile() helper from lib/profileApi
       with the documented TradeProfilePayload shape. Visual rules go inside
       strategy_config.{type:'visual', version:1, rules:[...]} so the engine
       can fan out to a visual interpreter without conflicting with the
       existing rule-based engine. Allocated capital + risk pct pulled from
       botState.settings so the profile inherits the user's current sizing.
       is_active defaults false so the user activates explicitly.

A4+A5 — RightPanel.NewsFeed auth + runtime
  Was: raw fetch() to import.meta.env.VITE_TRADING_API_URL with no
       Authorization header → 401 on every render in any environment that
       requires auth, and prod-broken where the runtime resolver is the
       only source of truth for the API base URL.
  Now: uses fetchNews() from lib/marketApi which already carries the
       platform Bearer token and routes through tradingRuntime.tradingApiUrl.
       Adds an error state in the UI for visibility instead of silently
       leaving the panel blank.

Verified: web/ tsc --noEmit passes. No behavioural change to non-affected
code paths (RightPanel portfolio summary, ResearchView other tabs, etc.).

Refs: docs/AUDIT_REDESIGN.md items A1–A5.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:23:52 -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