diff --git a/web/src/views/SimpleView.tsx b/web/src/views/SimpleView.tsx index 25ffa05..720b466 100644 --- a/web/src/views/SimpleView.tsx +++ b/web/src/views/SimpleView.tsx @@ -385,6 +385,37 @@ function formatTimelineStepLabel(step: SimpleRuntimeSnapshot['stage']) { } } +function describeNextAction( + entry: ManualEntryPayload, + runtimeSnapshot: SimpleRuntimeSnapshot | null, +): string { + const side = normalizeSetupSide(entry.simple_side); + const symbol = String(entry.symbol || '').trim().toUpperCase() || 'This symbol'; + + if (!runtimeSnapshot) { + return side === 'buy' + ? `${symbol} is saved and waiting for the configured buy trigger.` + : `${symbol} is saved and waiting for an eligible holding to manage.`; + } + + switch (runtimeSnapshot.stage) { + case 'armed': + return side === 'buy' + ? `${symbol} is waiting for the configured drop trigger before sending an entry order.` + : `${symbol} is waiting for the configured profit exit trigger.`; + case 'entry_submitted': + return `${symbol} entry order has been submitted and is waiting for exchange fill confirmation.`; + case 'filled': + return `${symbol} entry is filled. The setup is now monitoring for the configured profit exit.`; + case 'exit_submitted': + return `${symbol} exit order has been submitted and is waiting for exchange fill confirmation.`; + case 'closed': + return `${symbol} setup is complete. The linked position has been closed.`; + default: + return `${symbol} runtime state is syncing.`; + } +} + function formatSetupUpdatedAt(entry: ManualEntryPayload): string | null { const raw = String(entry.sell_time || entry.buy_time || '').trim(); if (!raw) return null; @@ -1059,6 +1090,7 @@ export function SimpleView() { const side = normalizeSetupSide(entry.simple_side); const isEditing = editingSetupId === entryId; const runtimeSnapshot = deriveRuntimeSnapshot(entry, runtimeOrders, simpleHoldings); + const nextActionText = describeNextAction(entry, runtimeSnapshot); const updatedAt = formatSetupUpdatedAt(entry); return (
@@ -1175,6 +1207,11 @@ export function SimpleView() { ); })}
+ +
+ Next action:{' '} + {nextActionText} +
); })}