🐛 GRIMOIRE TAB: Permanently stuck on "Loading grimoire..." — loaded state never set to true #172

Closed
opened 2026-05-27 17:28:15 +02:00 by Anexim · 1 comment
Owner

Bug

The Grimoire tab doesn't load. It permanently shows "Loading grimoire..." and never displays the spell content.

Root Cause

In src/app/components/GrimoireTab.tsx:12-13:

const [grimoireSpells, setGrimoireSpells] = useState<[string, SpellDef][]>([]);
const [loaded, _setLoaded] = useState(false);

The loaded state variable is initialized to false, and _setLoaded is never called (the underscore prefix signals "intentionally unused").

At line 22:

if (!loaded) {
  return <div className="p-4 text-center text-gray-400">Loading grimoire...</div>;
}

Since loaded is always false, the component permanently renders the loading message. The spell data pipeline works correctly (spells with grimoire: true exist, the filter logic is correct, the useEffect populates grimoireSpells), but it's unreachable behind the dead guard.

Fix (One Line)

In src/app/components/GrimoireTab.tsx:

  • Option A: Remove the loaded state variable and the if (!loaded) guard entirely (cleanest — the existing grimoireSpells.length === 0 check already handles the empty state)
  • Option B: Call _setLoaded(true) at the end of the useEffect that populates grimoireSpells

File

  • src/app/components/GrimoireTab.tsx:12-24 (the bug)
## Bug The Grimoire tab doesn't load. It permanently shows "Loading grimoire..." and never displays the spell content. ## Root Cause In `src/app/components/GrimoireTab.tsx:12-13`: ```typescript const [grimoireSpells, setGrimoireSpells] = useState<[string, SpellDef][]>([]); const [loaded, _setLoaded] = useState(false); ``` The `loaded` state variable is initialized to `false`, and `_setLoaded` is **never called** (the underscore prefix signals "intentionally unused"). At line 22: ```typescript if (!loaded) { return <div className="p-4 text-center text-gray-400">Loading grimoire...</div>; } ``` Since `loaded` is always `false`, the component permanently renders the loading message. The spell data pipeline works correctly (spells with `grimoire: true` exist, the filter logic is correct, the `useEffect` populates `grimoireSpells`), but it's unreachable behind the dead guard. ## Fix (One Line) In `src/app/components/GrimoireTab.tsx`: - **Option A:** Remove the `loaded` state variable and the `if (!loaded)` guard entirely (cleanest — the existing `grimoireSpells.length === 0` check already handles the empty state) - **Option B:** Call `_setLoaded(true)` at the end of the `useEffect` that populates `grimoireSpells` ## File - `src/app/components/GrimoireTab.tsx:12-24` (the bug)
Anexim added the ai:todo label 2026-05-27 17:28:15 +02:00
n8n-gitea was assigned by Anexim 2026-05-27 17:28:15 +02:00
Author
Owner

Fixed in commit 8cebea9. Removed the dead loaded state guard in GrimoireTab.tsx that permanently showed "Loading grimoire...".

Fixed in commit 8cebea9. Removed the dead `loaded` state guard in GrimoireTab.tsx that permanently showed "Loading grimoire...".
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#172