learning_ai_invt_trdg/web
root 46a357c0f1 fix(web): trade plans page — clipped chips, action buttons, cramped layout
The Plans page (/plans) had multiple known overflow / clipping bugs:

1. .saved-setup-card { overflow: hidden } clipped the right-side action
   buttons (Edit, Delete) on cards with long content.
2. .saved-setup-meta-grid chips used white-space: nowrap + overflow: hidden
   + text-overflow: ellipsis, which truncated each chip awkwardly instead
   of wrapping. Long Trade ID and Order ID badges blew out the card.
3. .saved-setup-topline used a CSS Grid with auto column for actions, so
   actions could push the title block off-screen at narrow widths.
4. .saved-setup-timeline used 5 fixed-min-width columns that caused
   horizontal overflow on cards <440px wide.
5. The outer two-column grid forced minmax(380px, ...) on the saved-setups
   column which squeezed the form on 1280–1440px screens.
6. The critical alert banner used a loud high-contrast red background and
   uppercase letterspaced text — visually inconsistent with the rest of
   the app.

Fixes applied in web/src/layout-fixes.css (extends existing layout fixes):

- saved-setup-card → overflow visible, never clip children.
- saved-setup-topline → flexbox with flex-wrap, title flexes to 320px
  before actions wrap below to a new row.
- saved-setup-actions → flex-wrap with right-justified items.
- saved-setup-meta-grid chips → real wrapping (white-space: normal,
  overflow visible, max-width 100%, line-height tightened, padding
  expanded slightly for readability).
- Trade-id badges → break-all so long IDs wrap inside their pill.
- saved-setup-timeline → overflow-x: auto so progression scrolls
  inside the card on narrow widths instead of pushing the layout.
- Outer grid → single column below 1440px, two-column 1.15fr/0.85fr
  above. Form gets adequate width on common laptop sizes.
- Alert banner → soft tinted background using card+destructive mix,
  normal weight, no uppercase, integrated with the app shell aesthetic.
- saved-setups-header, asset-row, form sections → flex-wrap + min-width: 0
  so nothing forces horizontal scroll.

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

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 07:36:56 +00:00
..
.storybook test(ui): add Playwright and Storybook testing infrastructure 2026-05-09 13:19:14 -07:00
e2e test(ui): add comprehensive Playwright E2E test suite 2026-05-09 13:28:20 -07:00
src fix(web): trade plans page — clipped chips, action buttons, cramped layout 2026-05-10 07:36:56 +00:00
.dockerignore feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
.env.example chore: add env configuration files 2026-05-09 14:06:28 -07:00
.env.local chore: add env configuration files 2026-05-09 14:06:28 -07:00
.gitignore feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
ADMIN_TRADE_CONTROL_UI.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
backtesting.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
dashboard-metrics-contract.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
Dockerfile feat: migrate web to Gitea registry, add /api/devops/info, fix role drift 2026-05-10 04:57:09 +00:00
eslint.config.js test(ui): add Playwright and Storybook testing infrastructure 2026-05-09 13:19:14 -07:00
guided-strategy-builder.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
index.html feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
LIVE_PULSE_TICKER.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
metric-validation-runbook.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
NAVIGATION_ACCESS_CONTROL.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
nginx.conf chore(infra): vendored @bytelyst/* packages, Docker healthcheck, compose merge 2026-04-29 19:35:35 -04:00
package.json fix(web): global layout fixes for overlap, clipping, responsive reflow 2026-05-10 07:14:50 +00:00
playwright.config.ts fix(test): fix JSON generation and disable auto webServer 2026-05-09 13:36:22 -07:00
pre-deploy.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
README.md refactor: remove live web supabase dependency 2026-04-04 18:03:49 -07:00
schema_reference.sql feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
tsconfig.app.json Polish trading UI and add launch roadmap 2026-05-08 20:58:00 -07:00
tsconfig.json feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
tsconfig.node.json feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
vite.config.ts feat(devops): admin-only info, public version, dep checks, role hardening 2026-05-10 05:52:48 +00:00
vite.svg feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
vitest.full.config.ts feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00
vitest.shims.d.ts test(ui): add Playwright and Storybook testing infrastructure 2026-05-09 13:19:14 -07:00
workspace-system-scan-2026-02-21.md feat: scaffold trading monorepo foundation 2026-04-04 11:18:21 -07:00

Bytelyst Trading Dashboard

Real-time trading dashboard for the Bytelyst Trading Platform. Built with React 19, TypeScript, Tailwind CSS 4, and Supabase.

Features

  • AI Strategy Assistant — Chat-based profile creation using natural language (powered by Perplexity/OpenAI/Gemini). Floating robot icon available on all pages with quick-action suggestions, profile preview, and apply/cancel workflow
  • Live Market Data — Real-time price updates via Socket.IO from the bot service
  • Strategy Profile Management — Create, edit, delete, and activate/deactivate trading profiles with per-profile rule configuration. Elevated 2D card design with embedded metrics table and color-coded rule icons
  • 7-Rule Pipeline Visualization — View the strategy rule pipeline in the Admin tab
  • Position Tracking — Hybrid view of manual entries and bot-managed positions with profile attribution
  • Trade History — Complete trade ledger filtered by profile, with P&L metrics and win rate
  • Signal Monitor — Live rule-by-rule signal analysis per symbol
  • Global Config — Edit bot configuration from the dashboard
  • User Settings — Manage exchange API keys, thresholds, and preferences
  • Auth — Supabase Authentication with email/password and password reset
  • Role-Based Access — Admin tab only visible and accessible to admin users

Tech Stack

Layer Technology
Framework React 19
Language TypeScript 5.9
Build Vite 7
Styling Tailwind CSS 4
Charts Recharts
Icons Lucide React
Real-time Socket.IO Client
Database Supabase (PostgreSQL)
Auth Supabase Auth

Quick Start

Prerequisites

Installation

git clone https://github.com/saravanakumardb/bytelyst-trading-dashboard-web.git
cd bytelyst-trading-dashboard-web
npm install

Configuration

Create a .env file in the project root:

VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=eyJ...your-anon-key
VITE_API_URL=http://localhost:5000

Run

# Development
npm run dev

# Production build
npm run build

# Preview production build
npm run preview

Project Structure

src/
├── components/
│   ├── AuthContext.tsx           # Supabase auth provider + user profile
│   ├── Login.tsx                # Login / signup form
│   ├── ResetPassword.tsx        # Password reset flow
│   ├── TradeProfileManager.tsx  # Strategy profile CRUD + rule config (elevated 2D cards)
│   ├── ChatControl.tsx          # AI Strategy Assistant (floating robot + chat panel)
│   ├── GlobalConfigManager.tsx  # Bot config editor
│   ├── EntryForm.tsx            # Manual trade entry form
│   ├── SymbolCard.tsx           # Symbol price card with indicators
│   ├── PriceChart.tsx           # Recharts price history chart
│   ├── AlertFeed.tsx            # Real-time alert feed
│   ├── MarketTicker.tsx         # Horizontal price ticker
│   └── MarketOpportunities.tsx  # Market opportunity scanner
├── tabs/
│   ├── OverviewTab.tsx          # Dashboard home with symbol cards
│   ├── SignalsTab.tsx           # Live rule-by-rule signal analysis
│   ├── PositionsTab.tsx         # Active positions (manual + bot)
│   ├── HistoryTab.tsx           # Trade history with profile filter
│   ├── EntriesTab.tsx           # Manual watchlist entries
│   ├── AdminTab.tsx             # Admin panel (rules, profiles, config)
│   ├── ConfigTab.tsx            # Global bot config editor
│   └── SettingsTab.tsx          # User settings + API keys
├── hooks/
│   └── useWebSocket.ts         # Socket.IO hook for real-time data
├── lib/
│   ├── authSession.ts          # Platform-service session bootstrap + token refresh
│   └── const.ts                # Table names + constants
├── App.tsx                      # Main app layout + tab navigation
├── main.tsx                     # React entry point
└── index.css                    # Tailwind CSS imports + custom styles

Environment Variables

Variable Required Description
VITE_PLATFORM_URL Yes Platform-service API base URL
VITE_TRADING_API_URL Yes Trading backend API base URL
VITE_PRODUCT_ID No Product identifier override
VITE_SOCKET_PATH No Custom Socket.IO path

Dashboard Tabs

Overview

Main dashboard showing live market data for all tracked symbols. Each symbol card displays price, 24h change, session, signal status, indicators (EMA, RSI), and active position P&L.

Signals

Detailed rule-by-rule breakdown for each symbol showing which strategy rules pass/fail in the current market context.

Positions

Hybrid view merging manual entries and bot-managed positions. Positions are tagged as BOT (with profile name) or MANUAL. Filters by profile.

History

Complete trade ledger with:

  • Profile filter dropdown
  • Metrics bar (total P&L, win rate, trade count, avg P&L)
  • Per-trade detail: symbol, side, entry/exit price, P&L, reason

Strategy Clusters (main tab)

Elevated 2D profile cards with:

  • Aggregate stats header (total profiles, capital, P&L, trades)
  • Per-profile metrics panel (Capital, P&L, Risk) with column dividers
  • Embedded details table (active rules with color-coded icons, max daily loss, max open trades, order type, cooldown)
  • Win rate progress bar with gradient fill
  • Edit drawer with General / Rules / Risk & Execution tabs
  • AI chat-created profiles appear instantly

Admin (admin-only)

Three sub-sections:

  • Strategy Pipeline — Read-only pipeline view of the 7 strategy rules
  • Global Config — Edit bot key-value configuration
  • Debug — Dashboard environment variables and bot configuration display (fetched from /api/config)

Settings

User account settings: name, exchange API keys (paper + live), trading thresholds, and notification preferences.

Database Tables

The dashboard reads/writes these Supabase tables (defined in lib/const.ts):

Constant Table Usage
tableNameStocks entries Manual watchlist entries
tableNameTransactions trade_history Completed trades
tableNameOrders orders Active/pending orders
tableNameProfiles trade_profiles Strategy profiles
tableNameUsers users User accounts
tableNameBotConfig bot_config Global configuration

Connecting to Bot Service

The dashboard connects to the bot service via:

  1. Socket.IO — Real-time updates (prices, signals, positions, alerts)
  2. REST API — Status checks, manual trades, config reads

Set VITE_API_URL to point to your bot service instance. The connection status is shown in the header.

License

Private