From 50716e7ac7b0b5aff01ecfd504b5c5e510c416a9 Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Fri, 17 Jul 2026 08:01:09 +0000
Subject: [PATCH] Add loading spinners to async buttons in Home view
Replaces text-based loading states with the unified Spinner component for better feedback. Applies to "Add Deck" buttons, the "Run Simulations" button, the deck delete button, and the initial deck loading state.
---
frontend/src/pages/Home.tsx | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx
index e24fa9c0..56b22e23 100644
--- a/frontend/src/pages/Home.tsx
+++ b/frontend/src/pages/Home.tsx
@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom';
import { getApiBase, fetchWithAuth } from '../api';
import { getRuntimeConfig } from '../config';
import { useAuth } from '../contexts/AuthContext';
+import { Spinner } from '../components/Spinner';
import { ColorIdentity } from '../components/ColorIdentity';
import { SliderWithInput } from '../components/SliderWithInput';
import { LoginButton } from '../components/LoginButton';
@@ -399,13 +400,13 @@ function SimulationForm() {
type="button"
onClick={handleSaveDeck}
disabled={isSaving || !deckUrl.trim()}
- className={`px-4 py-2 rounded-md ${
+ className={`px-4 py-2 rounded-md flex items-center justify-center ${
isSaving || !deckUrl.trim()
? 'bg-gray-600 text-gray-400 cursor-not-allowed'
: 'bg-green-600 text-white hover:bg-green-700'
}`}
>
- {isSaving ? 'Adding...' : 'Add Deck'}
+ {isSaving ? <>