From 75a3ac4ecf235aaac141c27b0268035f64b49fd1 Mon Sep 17 00:00:00 2001 From: Saravana Achu Mac Date: Tue, 5 May 2026 22:20:58 -0700 Subject: [PATCH] refactor(web): normalize entry form theme surface --- docs/UX_THEME_NORMALIZATION_HANDOFF.md | 2 +- web/src/components/EntryForm.tsx | 75 +++++++++++++++----------- 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/docs/UX_THEME_NORMALIZATION_HANDOFF.md b/docs/UX_THEME_NORMALIZATION_HANDOFF.md index 1e97be4..395f376 100644 --- a/docs/UX_THEME_NORMALIZATION_HANDOFF.md +++ b/docs/UX_THEME_NORMALIZATION_HANDOFF.md @@ -99,7 +99,7 @@ Current public bundle: - [x] Normalize `web/src/components/StrategyWizard.tsx` - [x] Normalize `web/src/tabs/ReconciliationAuditPanel.tsx` - [x] Normalize `web/src/components/GlobalConfigManager.tsx` -- [ ] Normalize `web/src/components/EntryForm.tsx` +- [x] Normalize `web/src/components/EntryForm.tsx` - [ ] Normalize remaining old admin/config surfaces - [ ] Remove remaining dark-only bespoke surface systems - [ ] Replace remaining one-off controls with shared primitives where practical diff --git a/web/src/components/EntryForm.tsx b/web/src/components/EntryForm.tsx index 1f2e250..cf5d82e 100644 --- a/web/src/components/EntryForm.tsx +++ b/web/src/components/EntryForm.tsx @@ -5,12 +5,18 @@ import { tradingRuntime } from '../lib/runtime'; import { createManualEntry, updateManualEntry } from '../lib/manualEntriesApi'; import { getPlatformAccessToken } from '../lib/authSession'; import { createRequestId } from '../../../shared/request-id.js'; +import { Button } from './ui/button'; +import { Input } from './ui/input'; interface EntryFormProps { onSuccess: () => void; initialData?: any; } +const tableInputClass = 'h-9 rounded border-[var(--border)] bg-[var(--input)] px-2 py-1 text-sm'; +const numericInputClass = `${tableInputClass} font-mono text-right`; +const checkboxLabelClass = 'flex cursor-pointer items-center text-[10px] text-[var(--muted-foreground)] hover:text-[var(--foreground)]'; + export function EntryForm({ onSuccess, initialData }: EntryFormProps) { const { user } = useAuth(); const [formData, setFormData] = useState({ @@ -106,7 +112,7 @@ export function EntryForm({ onSuccess, initialData }: EntryFormProps) { // Remove temp fields from DB payload delete (payload as any).execute_order; - // --- 🚀 REAL TRADE EXECUTION --- + // --- REAL TRADE EXECUTION --- if (formData.execute_order && !initialData) { if (!Number.isFinite(payload.quantity) || !payload.symbol.trim()) { alert('Symbol and a valid quantity are required to execute a trade.'); @@ -125,7 +131,7 @@ export function EntryForm({ onSuccess, initialData }: EntryFormProps) { tp: payload.gain_threshold_for_sell }; - const confirmTrade = window.confirm(`🚀 EXECUTE LIVE TRADE (via Bot)?\n(Note: Uses currently configured Bot account)\n\nSymbol: ${payload.symbol}\nSide: BUY\nQty: ${payload.quantity}`); + const confirmTrade = window.confirm(`EXECUTE LIVE TRADE (via Bot)?\n(Note: Uses currently configured Bot account)\n\nSymbol: ${payload.symbol}\nSide: BUY\nQty: ${payload.quantity}`); if (!confirmTrade) return; const apiUrl = tradingRuntime.tradingApiUrl; @@ -145,7 +151,7 @@ export function EntryForm({ onSuccess, initialData }: EntryFormProps) { throw new Error(`Execution Failed: ${resData.error}`); } - alert(`✅ Trade Executed! Order ID: ${resData.orderId}`); + alert(`Trade Executed! Order ID: ${resData.orderId}`); } if (initialData?.stock_instance_id) { @@ -185,6 +191,8 @@ export function EntryForm({ onSuccess, initialData }: EntryFormProps) { Qty Stop Loss Take Profit + Buy Time + Exit Price Actions @@ -192,33 +200,33 @@ export function EntryForm({ onSuccess, initialData }: EntryFormProps) { {/* Symbol */} - {/* Label */} - {/* Options (Real/Crypto) */}
-