BUG: EnchantmentDesigner EffectSelector does not render after selecting equipment #239

Closed
opened 2026-06-01 09:22:37 +02:00 by Anexim · 1 comment
Owner

Bug Description

After selecting an equipment type (e.g., Basic Staff) in the Enchantment Designer's Design phase, the EffectSelector component does not appear in the accessibility tree. Only the DesignForm (name input, capacity, time, start button) renders. Without the EffectSelector, the player cannot add effects to a design, blocking the entire enchanting workflow.

Steps to Reproduce

  1. Open Crafting tab → Enchanter sub-tab → Design phase
  2. Click "Select Basic Staff" (or any equipment type)
  3. Observe: DesignForm appears but no effect list is shown
  4. The "Start Design" button remains disabled because selectedEffects.length === 0 and there's no way to add effects

Expected Behavior

After selecting an equipment type, the EffectSelector should render showing available enchantment effects that can be added to the design.

Likely Root Cause

The EffectSelector may not render when availableEffects is empty (because unlockedEffects is empty at game start) and the component's ScrollArea with zero items may collapse to zero height. Alternatively, a conditional rendering gate is preventing display.

## Bug Description After selecting an equipment type (e.g., Basic Staff) in the Enchantment Designer's Design phase, the EffectSelector component does not appear in the accessibility tree. Only the DesignForm (name input, capacity, time, start button) renders. Without the EffectSelector, the player cannot add effects to a design, blocking the entire enchanting workflow. ## Steps to Reproduce 1. Open Crafting tab → Enchanter sub-tab → Design phase 2. Click "Select Basic Staff" (or any equipment type) 3. Observe: DesignForm appears but no effect list is shown 4. The "Start Design" button remains disabled because `selectedEffects.length === 0` and there's no way to add effects ## Expected Behavior After selecting an equipment type, the EffectSelector should render showing available enchantment effects that can be added to the design. ## Likely Root Cause The EffectSelector may not render when `availableEffects` is empty (because `unlockedEffects` is empty at game start) and the component's ScrollArea with zero items may collapse to zero height. Alternatively, a conditional rendering gate is preventing display.
Anexim added the ai:todo label 2026-06-01 09:22:37 +02:00
n8n-gitea was assigned by Anexim 2026-06-01 09:22:37 +02:00
Anexim added this to the (deleted) project 2026-06-01 11:45:48 +02:00
Author
Owner

Fixed. Changed getAvailableEffects() in EnchantmentDesigner/utils.ts to show all effects when unlockedEffects array is empty (fresh game). Previously the filter required unlockedEffects.includes(effect.id) which was always false for an empty array, making EffectSelector render nothing. The fix adds unlockedEffects.length === 0 || bypass.

Fixed. Changed `getAvailableEffects()` in `EnchantmentDesigner/utils.ts` to show all effects when `unlockedEffects` array is empty (fresh game). Previously the filter required `unlockedEffects.includes(effect.id)` which was always false for an empty array, making EffectSelector render nothing. The fix adds `unlockedEffects.length === 0 ||` bypass.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#239