From f8aacf3a69878ca1096637c191864b7f9d94756a Mon Sep 17 00:00:00 2001 From: wmj Date: Mon, 24 Aug 2026 11:21:55 +0800 Subject: [PATCH] fix: Gemini model -> gemini-2.5-flash, stable DOM player, favicon - Update Gemini API model from deprecated gemini-2.0-flash to gemini-2.5-flash - Remove SidebarPlayer sub-component from inside App() - caused DOM remounts every 250ms (currentTime tick) making Pause/Skip buttons unclickable - Inline player JSX directly in render tree for stable DOM nodes - Add favicon.svg (dark bg + emerald trend line) to fix 404 console errors --- index.html | 2 +- public/favicon.svg | 1 + src/App.jsx | 74 ++++++++++++++++++---------------------------- 3 files changed, 30 insertions(+), 47 deletions(-) create mode 100644 public/favicon.svg diff --git a/index.html b/index.html index 4198bcd..cbb8008 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + Falah Coach Portal diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..fe0aa20 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 61ea359..cb8edad 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -27,7 +27,7 @@ import { ========================================================================== */ const GEMINI_API_KEY = 'AIzaSyDZn7tv1D3n2zuns8uaXIqp_z1FZTeVyKI'; -const GEMINI_URL = `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=${GEMINI_API_KEY}`; +const GEMINI_URL = `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${GEMINI_API_KEY}`; const AI_SYSTEM_PROMPT = `You are a hostile, senior executive playing a roleplay simulation for management consultants at Falah Consulting. Your persona: a hard-nosed C-suite executive (CIO, CFO, or CEO) who is deeply sceptical of consultants and demands hard financial evidence. @@ -606,52 +606,8 @@ export default function App() { setSidebarOpen(false); }; - // ── Audio Player UI (reused in sidebar + mobile strip) ─────────────────── - const progressPct = duration > 0 ? (currentTime / duration) * 100 : 0; - const SidebarPlayer = () => ( - activeTrack ? ( -
-
- - Now Playing - - {formatTime(currentTime)} / {activeTrack.duration} -
-

{activeTrack.title}

-

{activeTrack.author}

- {/* Seekable progress bar */} -
-
-
-
- - - -
-
- ) : ( -
- -

Select an audio brief to begin

-
- ) - ); - // ── Render ──────────────────────────────────────────────────────────────── return ( @@ -705,7 +661,33 @@ export default function App() {
- + {activeTrack ? ( +
+
+ + Now Playing + + {formatTime(currentTime)} / {activeTrack.duration} +
+

{activeTrack.title}

+

{activeTrack.author}

+
+
+
+
+ + + +
+
+ ) : ( +
+ +

Select an audio brief to begin

+
+ )}