[priority: high] Equipment names displayed twice in Equipment tab #197

Closed
opened 2026-05-29 13:05:07 +02:00 by Anexim · 2 comments
Owner

BUG: Equipment instance name renders redundantly next to type name

Bug Summary

In the Equipment tab, each equipped item shows its name twice because instance.name and type?.name resolve to the same string.

Root Cause

  • File: src/components/game/tabs/EquipmentTab/EquipmentSlotGrid.tsx
  • Line 39: Slot label (e.g., "Main Hand")
  • Line 42-44: Equipment instance name (e.g., "Basic Staff") rendered in font-semibold
  • Line 46-47: Equipment type name (e.g., "Basic Staff") rendered in smaller text
  • Since instances are initialized with the type's name, lines 43 and 47 display identical text

Current Display

Main Hand          ← slot label
Basic Staff        ← instance.name (bold)
Basic Staff        ← type?.name (smaller)
50/50 cap          ← capacity

Suggested Fix

Remove the redundant type name display (type?.name || instance.typeId on line 47) since instance.name already shows the same value. Or, if instances can be renamed in the future, keep the type name as a subtitle but differentiate the styling more clearly (e.g., show type name in italics or muted color below the custom name).

Priority

HIGH - Visual clutter in frequently-used equipment screen

**BUG: Equipment instance name renders redundantly next to type name** ### Bug Summary In the Equipment tab, each equipped item shows its name twice because `instance.name` and `type?.name` resolve to the same string. ### Root Cause - **File:** `src/components/game/tabs/EquipmentTab/EquipmentSlotGrid.tsx` - **Line 39:** Slot label (e.g., "Main Hand") - **Line 42-44:** Equipment instance name (e.g., "Basic Staff") rendered in `font-semibold` - **Line 46-47:** Equipment type name (e.g., "Basic Staff") rendered in smaller text - Since instances are initialized with the type's name, lines 43 and 47 display identical text ### Current Display ``` Main Hand ← slot label Basic Staff ← instance.name (bold) Basic Staff ← type?.name (smaller) 50/50 cap ← capacity ``` ### Suggested Fix Remove the redundant type name display (`type?.name || instance.typeId` on line 47) since `instance.name` already shows the same value. Or, if instances can be renamed in the future, keep the type name as a subtitle but differentiate the styling more clearly (e.g., show type name in italics or muted color below the custom name). ### Priority HIGH - Visual clutter in frequently-used equipment screen
Anexim added the ai:todo label 2026-05-29 13:05:07 +02:00
n8n-gitea was assigned by Anexim 2026-05-29 13:05:07 +02:00
Author
Owner

Starting work on the equipment name duplication bug. Examining EquipmentSlotGrid.tsx now.

Starting work on the equipment name duplication bug. Examining EquipmentSlotGrid.tsx now.
Author
Owner

Fixed the equipment name duplication bug in EquipmentSlotGrid.tsx. Removed the redundant type?.name line (line 46-47) since instance.name already displays the same value.

Changes:

  • Removed <div className="text-xs text-[var(--text-secondary)]">{type?.name || instance.typeId}</div> from EquipmentSlotGrid.tsx
  • All 896 tests pass, file size 80 lines (well under 400 limit)
  • Pre-commit hooks all pass (no circular deps, file size OK)

Commit: 7123572

Fixed the equipment name duplication bug in EquipmentSlotGrid.tsx. Removed the redundant `type?.name` line (line 46-47) since `instance.name` already displays the same value. Changes: - Removed `<div className="text-xs text-[var(--text-secondary)]">{type?.name || instance.typeId}</div>` from EquipmentSlotGrid.tsx - All 896 tests pass, file size 80 lines (well under 400 limit) - Pre-commit hooks all pass (no circular deps, file size OK) Commit: 7123572
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#197