From 90fa66bd39573592cae1f8ca34d45fe2f1114d79 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Sun, 12 Apr 2026 08:39:55 +0000 Subject: [PATCH] feat: add refresh button to simulation page User can now click 'Refresh' to update simulation data (portfolio, signals, trade log) without reloading the page. --- .../src/routes/bot/[id]/simulate/+page.svelte | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/frontend/src/routes/bot/[id]/simulate/+page.svelte b/src/frontend/src/routes/bot/[id]/simulate/+page.svelte index 478a194..cebdc4e 100644 --- a/src/frontend/src/routes/bot/[id]/simulate/+page.svelte +++ b/src/frontend/src/routes/bot/[id]/simulate/+page.svelte @@ -11,6 +11,7 @@ let tokenAddress = $state(''); let klineInterval = $state('1m'); let isRunning = $state(false); + let isRefreshing = $state(false); onMount(async () => { if (!$isAuthenticated && !$isLoading) { @@ -42,6 +43,7 @@ } async function loadSimulations() { + isRefreshing = true; try { const simulations = await api.simulate.list(botId); @@ -58,6 +60,8 @@ } } catch (e) { console.error('Failed to load simulations:', e); + } finally { + isRefreshing = false; } } @@ -105,6 +109,18 @@ ← Back to Chat

Simulation

+
+ {#if $simulationStore.currentSimulation} + + {/if} +
@@ -224,6 +240,42 @@ padding: 2rem; } + header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 1rem; + } + + .header-right { + display: flex; + gap: 0.5rem; + } + + .refresh-btn { + background: rgba(255, 255, 255, 0.1); + border: 1px solid rgba(255, 255, 255, 0.2); + color: #fff; + padding: 0.5rem 1rem; + border-radius: 6px; + cursor: pointer; + font-size: 0.875rem; + display: flex; + align-items: center; + gap: 0.5rem; + transition: all 0.2s; + } + + .refresh-btn:hover { + background: rgba(255, 255, 255, 0.15); + border-color: rgba(255, 255, 255, 0.3); + } + + .refresh-btn.refreshing { + opacity: 0.7; + cursor: not-allowed; + } + header { margin-bottom: 1.5rem; }