Bug: cancelDesign can't cancel slot 2 when slot 1 is filled #225

Closed
opened 2026-05-30 21:10:34 +02:00 by Anexim · 1 comment
Owner

Bug Description

The cancelDesign action in craftingStore.ts has inverted conditional logic. When both design slots are filled, only slot 1 is ever cancelled. Slot 2 can only be cancelled when slot 1 is empty. This creates a UX deadlock where a player with both slots filled can never cancel the second design without first completing or cancelling the first.

Code Location

src/lib/game/stores/craftingStore.ts lines 88-95:

cancelDesign: () => {
  const state = get();
  if (state.designProgress) {
    set({ designProgress: null });       // Always cancels slot 1 first
  } else if (state.designProgress2) {
    set({ designProgress2: null });      // Only reached when slot 1 is empty
  }
  // Deadlock: when both filled, slot 2 can NEVER be cancelled
},

Impact

Medium. UX deadlock in crafting UI. Players with both design slots filled have no way to cancel the second design. The workaround is to cancel slot 1 first (losing that design progress) then cancel slot 2.

Fix Required

Add a parameter to specify which slot to cancel, or always cancel slot 2 when both are filled, or provide separate cancel buttons per slot. The UI component already has two separate progress bars, so the cancel action should target the correct slot.

## Bug Description The `cancelDesign` action in `craftingStore.ts` has inverted conditional logic. When both design slots are filled, only slot 1 is ever cancelled. Slot 2 can only be cancelled when slot 1 is empty. This creates a UX deadlock where a player with both slots filled can never cancel the second design without first completing or cancelling the first. ## Code Location `src/lib/game/stores/craftingStore.ts` lines 88-95: ```typescript cancelDesign: () => { const state = get(); if (state.designProgress) { set({ designProgress: null }); // Always cancels slot 1 first } else if (state.designProgress2) { set({ designProgress2: null }); // Only reached when slot 1 is empty } // Deadlock: when both filled, slot 2 can NEVER be cancelled }, ``` ## Impact **Medium.** UX deadlock in crafting UI. Players with both design slots filled have no way to cancel the second design. The workaround is to cancel slot 1 first (losing that design progress) then cancel slot 2. ## Fix Required Add a parameter to specify which slot to cancel, or always cancel slot 2 when both are filled, or provide separate cancel buttons per slot. The UI component already has two separate progress bars, so the cancel action should target the correct slot.
Anexim added the ai:todo label 2026-05-30 21:10:34 +02:00
n8n-gitea was assigned by Anexim 2026-05-30 21:10:34 +02:00
Author
Owner

Fixed: cancelDesign now accepts optional slot parameter (1 | 2). UI updated with cancel button for slot 2 and slot parameter for slot 1.

Fixed: cancelDesign now accepts optional slot parameter (1 | 2). UI updated with cancel button for slot 2 and slot parameter for slot 1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#225