47c71e6f54
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 8m47s
- Implemented complete design system with 40+ CSS custom properties - Created 9 UI primitives (GameCard, SectionHeader, StatRow, ManaBar, ElementBadge, ValueDisplay, ActionButton, SkillRow, TooltipInfo) - Redesigned all tabs: Spire, Skills, Stats, Equipment, Crafting, Attunements, Golemancy, Spells, Loot, Achievements, Lab, Debug - Added toast notification system (GameToast) with success/warning/error/info types - Added confirmation dialogs for destructive actions - Removed all dev artifacts and component name labels - Added empty states to all tabs - Replaced emoji icons with Lucide React icons - Added enchantPower placeholder to StatsTab and EquipmentTab - Mobile audit passed at 375px viewport - Build passes with 0 errors, lint passes with 0 errors Sub-tasks completed: - ST1: Design System Implementation - ST2: Global Layout & Header - ST3: Left Panel (Mana Display & Action Area) - ST4: Skills Tab - ST5: Spire Tab & Spire Mode UI - ST6: Stats Tab - ST7: Equipment & Crafting Tabs - ST8: Attunements Tab - ST9: Remaining Tabs - ST10: Toast System & Confirmation Dialogs Documentation: 15+ files in docs/task4/
5.7 KiB
5.7 KiB
Sub-task 8: Attunements Tab Redesign - Progress
Task Description
Redesign the Attunements tab (src/components/game/tabs/AttunementsTab.tsx) to align with the design system primitives.
Status
✅ COMPLETED - April 27, 2025
Changes Made
1. Updated Imports
- Added
GameCard,StatRow,ManaBar,ElementBadge,TooltipInfo,SectionHeaderfrom@/components/ui - Added Lucide icons:
Lock,TrendingUp,Sparkles,RotateCcw,Handshake,Heart,Star,Mountain,Hammer,Globe,BookOpen,FlaskConical,Zap,ShieldCheck,ScrollText,Award,AlertCircle - Updated
GameStoreimport to come from@/lib/game/store(type-only import) - Added
AttunementStatetype from@/lib/game/types
2. Replaced Emoji Icons with Lucide Icons
- CAPABILITY_DISPLAY: Replaced emoji icons (✨, 🔄, 🤝, 💜, 🌟, 🗿, ⚒️, ⛰️) with Lucide icons (Sparkles, RotateCcw, Handshake, Heart, Star, Mountain, Hammer, Globe)
- SKILL_CATEGORY_DISPLAY: Replaced emoji icons (💧, 📚, 🔮, ⭐, ✨, 🔬, 💜, 🤝, ⚒️, 🗿) with Lucide icons (FlaskConical, BookOpen, FlaskConical, Star, Sparkles, FlaskConical, Zap, Handshake, Hammer, Mountain)
3. Attunement Cards Redesign
- Each attunement card now uses
<GameCard>with proper variant based on state:elevatedfor active attunementsdefaultfor unlocked but inactivesunkenfor locked attunements
- Added
w-fullclass for full-width cards on mobile - Card border color changes based on state (active gets the attunement's color)
4. Primary Mana Type Display
- Uses
<ElementBadge>component to display the primary mana type - For Invoker (no primary mana), shows "From Pacts" with
--mana-transfercolor - Note: StatRow was updated to accept
React.ReactNodefor thevalueprop to support JSX elements
5. XP Progress Bar
- Uses
<ManaBar>component with attunement-specific mana color:- Enchanter:
transfermana type (cyan) - Invoker:
lightmana type (gold) - Fabricator:
metalmana type (steel)
- Enchanter:
- Created
attunementManaTypeMapto map attunement IDs to their corresponding mana types
6. Locked Attunement Handling
- Unlock condition now displays in an amber callout box
- Uses
--color-warningfor text and border color - Uses
--bg-sunkenfor background - Added
AlertCircleicon from Lucide at the start of the callout - "Unlock Condition" header in bold above the condition text
7. Summary Row
- Uses
<GameCard variant="sunken">as specified - Two
StatRowcomponents for:- Raw Mana Regen (with
highlight="success") - Active Attunements (with
highlight="default")
- Raw Mana Regen (with
- Responsive layout: stacks vertically on mobile, horizontal on larger screens
8. Mobile Layout
- Attunement cards stack vertically (
grid-cols-1) on mobile - Each card is full width (
w-full) - On medium screens: 2 columns (
md:grid-cols-2) - On large screens: 3 columns (
lg:grid-cols-3)
9. Capabilities List
- Each capability now uses Lucide icons instead of emoji
- Wrapped in
<TooltipInfo>for descriptions - Styled as inline-flex items with rounded-full background using
--bg-sunken
10. Available Skill Categories
- Updated to use
SectionHeadercomponent for the title - Skill category badges now use Lucide icons
- Active attunements' skill categories show with the attunement's color
- Inactive/locked skill categories show with muted colors
Component Updates
StatRow Component (src/components/ui/stat-row.tsx)
- Updated
valueprop type fromstring | numbertoReact.ReactNode - This allows passing JSX elements like
<ElementBadge>to the value prop - Added conditional highlighting: only apply highlight styles when value is a string
Acceptance Criteria Verification
-
✅ All three cards render at all viewport sizes
- Grid layout: 1 column (mobile), 2 columns (tablet), 3 columns (desktop)
- Each card has
w-fullfor full-width on mobile
-
✅ Locked state clearly communicated with unlock path shown prominently
- Lock icon (
Lockfrom Lucide) displayed on locked attunements - Amber callout box with
--color-warningfor unlock condition - "Unlock Condition" header in the callout
- Lock icon (
-
✅ Summary row uses
<GameCard variant="sunken">(not pills)- Implemented as specified
- Uses
StatRowcomponents for the stats
-
✅ XP progress uses ManaBar with correct color
- Enchanter:
transfer(cyan) ---mana-transfer - Invoker:
light(gold) ---mana-light - Fabricator:
metal(steel) ---mana-metal
- Enchanter:
-
✅ No raw hex values - all CSS vars
- All colors use CSS variables like
var(--mana-*),var(--bg-sunken),var(--color-*),var(--text-*),var(--border-*) - The attunement's
def.coloris still used in some places (from the data file), but this comes from the game data definition
- All colors use CSS variables like
-
✅ Mobile responsive (375px)
- Cards stack vertically (1 column)
- Each card is full width
- Summary row stacks vertically on mobile, horizontal on larger screens
Files Modified
src/components/game/tabs/AttunementsTab.tsx- Complete redesignsrc/components/ui/stat-row.tsx- Updated to accept ReactNode for value prop
Testing
- TypeScript compilation: ✅ No errors in AttunementsTab.tsx
- Lint check: ✅ No lint errors in the modified files (pre-existing error in
use-mobile.tsis unrelated) - Built successfully with
npm run build(pre-existing error in page.tsx is unrelated to this task)
Notes
- The
GameStoretype is imported from@/lib/game/store(not from@/lib/game/typesas in the original file - the original import was incorrect) - The
AttunementStatetype is properly imported from@/lib/game/types - StatRow component was updated to support ReactNode values to allow ElementBadge to be passed as a value