current_context - xopherdeep/do-it-for-the-xp GitHub Wiki
Current Context
Last Updated: 2025-12-31
Focus Area: Interface Polish & Code Quality
Project State Overview
Do It For The XP is a gamified chore management application built with Vue 3, Ionic 7, and Capacitor. The application transforms household tasks into RPG-style quests where children become "Bounty Hunters" and parents become "Game Masters."
Recent Development Focus
Interface Polish (In Progress)
Refining the core UI elements for a premium RPG feel.
- ✅ Main User HUD:
- Combined HP/MP bar and text labels for cleaner layout.
- Improved label visibility and alignment (text below bars).
- Grouped stat values for better readability.
- Added animated GP Bar stacked above XP Bar.
- Applied locale formatting to all HUD numbers (1,000 instead of 1000).
- Menu Toggle: Implemented
menuControllerlogic for the retro menu button to sync functionality with Quick Draw.
- ✅ Battle Task Menu Style: Adjusted "Attack" menu items and "Bash" costs to match the main RPG menu font (Apple Kid 1.5rem) and color (RPG yellow). Replaced the bolt icon with claw-marks and removed the redundant header for a cleaner, unified flow. removed background circles from icons.
- ✅ Area FAB / Page Menu:
- Centered menu on screen (matching User HUD aesthetic).
- Added backdrop blur overlay with click-to-close.
- Implemented "square-x" close button in top-right.
- Fixed Ionic FAB visibility issues by moving menu outside
ion-fab-list. - Synchronized Blur State: Fixed "phase-flipping" and "double-click" issues by letting Ionic handle natural toggles and forcing re-mounts on navigation via unique
:keybindings.
- ✅ User HUD Avatar:
- Optimized avatar image registration to perfectly cover the circular FAB button.
- Removed square green border artifacts and optimized hover scaling (1.12x).
- Improved AP badge display with "AP %" prefix.
- ✅ Navigation Highlighting:
- Implemented global styles to dim non-active tabs in
ion-tab-bar. - Non-selected tabs are grayscale (90%) and lower opacity (0.55).
- Active tabs feature saturation boost, brightness increase, and a subtle vertical lift (translateY).
- Added hover transitions for interactive feedback.
- Implemented global styles to dim non-active tabs in
- ✅ Equipment Modal:
- Converted into a full-page Ionic card modal with
presentation="card". - Integrated with the shared premium modal system (matching Profile Modal).
- Added user identity (name/level) to modal header for consistency.
- Simplified layout styles while maintaining the 7/5 grid split.
- Converted into a full-page Ionic card modal with
- ✅ Modal Dismissal System:
- Ref-Based Dismissal: Standardized all major modals (
UserProfileModal,XpEquipmentModal,ItemInfoModal,ATMModal,SaveAndQuitModal) to use a localdismiss()method via a componentref. - Sound Logic Refinement: Resolved the "double close sound" issue by using
@click.stopon close buttons to prevent event bubbling to global UI listeners. - Clean Event Flow: Decoupled the parent's
closestate from the button click, moving to the modal's nativedidDismisslifecycle event to ensure single-emission logic.
- Ref-Based Dismissal: Standardized all major modals (
- ✅ Temple Navigation: Implemented state-based smooth scrolling, formalized
/splashdefault routing, and tiered background strategy (parent-hosted vs child-transparent). - ✅ Quest Type Refactor: Replaced standard radio groups in
XpConfigAchievementwith iconic, dialpad-grid selection modals. Implemented genericXpTypeSelectorModalfor streamlined Quest and Party type definition. - ✅ Quest Navigation Optimization: Refactored
XpConfigAchievementto use nested routing andion-tabs, mirroring the Temple Settings architecture for consistent GM experience. Updated child tabs (Type, Heroes, Schedule, Rewards, Config) to individual components with shared state via Provide/Inject. - ✅ Temple Splash Page:
- Created a clean landing page for temple routes with a centered layout.
- Header: Icon, title, and description centered at top.
- Stats: 4-column responsive grid showing Rooms, Beasts, Floors, and World.
- WeatherFX: Integrated with correct world-to-weather mapping (matching
XpTemples.vue). - Navigation: Centered "Temple" tab in navigation bar using the temple's specific icon.
- ✅ Quest Type Selection:
- Replaced
ion-radio-groupwith two clean, iconic action boxes for Quest Type and Party Type. - Implemented
XpTypeSelectorModal: a generic, two-step selector (Grid -> Confirmation) matching the temple creator aesthetic. - Updated
useAchievementFormhook with reactive state for modal visibility and active party type details.
- Replaced
- ✅ Code Refactoring: Split
XpConfigAchievement.vueinto separate template (.vue), logic (.ts), and style (.scss) files for better maintainability. - ✅ Setup Slideshow & Dashboard Polish:
- Dynamic Themed Backgrounds: Integrated with the global
bg-slidesystem, applying color variations (.bg-slide-xp, .bg-slide-gp, etc.) to theion-pagefor stable, high-performance background transitions. - Premium Glassmorphism: Implemented a modern design language using
backdrop-filter: blur, subtle semi-transparent borders, and deep shadows for "floating" content cards. - Stat Counting Animations: Integrated
vue3-autocounterinto the sharedXpStatBox, providing a satisfying data revealed effect when dashboards load. - Dashboard Grid Refinement: Updated
XpDashboardGridto support a:colsprop for explicit column control. Configured theWelcomeDashboardto a 3-column layout (3x2 for the 6 boxes) as requested by the GM. - Entrance Animations: Added cubic-bezier staggered entrance animations for hero cards and dashboard components to enhance the "alive" feel of the onboarding flow.
- Custom Navigation: Replaced standard swiper arrows and bullets with themed, RPG-style indicators matching the Earthbound aesthetic.
- Dynamic Themed Backgrounds: Integrated with the global
- ✅ Code Quality & Linting: Performed a global cleanup of ESLint errors and warnings across the codebase, including removal of unused imports, console statements, and duplicated methods in major components like
BattleGround.ts,BattleState.ts, anduseAchievementForm.ts. - ✅ Bestiary Index Fix: Resolved critical syntax and structure errors in
XpBestiary.vuecaused by misplaced braces and broken method blocks. RefactoredclickAttachBeastto use clean async/await logic. Fixed spelling errors inDbStorageApitoast helpers. - ✅ Quest Index Icons:
- Implemented
LORE_COMBO_MATRIXshared constant for mapping Quest Type + Party Type to thematic icons/names. - Updated
XpAchievementItemto display dynamic "Combo Icons" or "Beast Previews" in the avatar slot. - Integrated beast loading into
XpAchievements.vueto ensure real-time beast avatars show in the quest index. - Enhanced Grid View in admin quest index to match the iconic combo logic.
- Updated
useAchievementFormsummary card to reflect the new lore-based naming and iconography.
- Implemented
- ✅ Beast Selection UI:
- Removed the heavy "TARGET ACQUIRED" overlay in
QuestTypeTab.vue. - Simplified the selection indicator by using
XpBeastSelectorItem's native checkmark and border logic.
- Removed the heavy "TARGET ACQUIRED" overlay in
- ✅ Beast Task List:
- Replaced the
alertController(which failed to render HTML) with a dedicatedBeastTaskListModal.vue. - Implemented a premium glassmorphic list with staggered entrance animations for beast tasks.
- Replaced the
- ✅ UI Polish: Synchronized Area FAB blur, optimized Avatar presentation, standardized Ref-based modal dismissal, implemented global tab-bar highlighting, added a premium splash page for temple discovery, fixed the retro User HUD menu toggle, and matched the "Attack" task menu styles to the main RPG dialog menu (removing headers and updating icons).
- ✅ Compendium Tab Root Navigation: Resolved a bug where clicking an active tab's subtree (e.g., editing a quest) wouldn't return to the tab's root index. Implemented
handleTabClickinXpCompendium.vueto intercept clicks and force-navigate to the base tab route when already within its subtree. - ✅ Room Editor Toggles Fix: Resolved double-triggering bug on "It's a Trap" and Mimic toggles where clicking the switch itself failed to toggle.
- ✅ AI Generate Card Alignment: Corrected the sizing of the AI Generate box in
QuestTypeTab.vueto match other beast cards. Implementedaspect-ratio: 1/1, increased dashed border thickness, and added structural alignment spacers to ensure a perfectly uniform grid layout.
Temple Creator (Refinement Complete)
The Temple Creator tool has been consolidated and polished for a more cohesive experience.
Location: src/app/Admin/XpCompendium/views/XpTemples/
Recent Accomplishments:
- ✅ Consolidated Editor: Removed redundant
TempleFloorEditor.vueand unified all editing logic into theLayouttab (XpTempleLayout.vue). - ✅ Centered Grid Layout: Optimized the grid editor to be centered with the page for better focus and premium aesthetic.
- ✅ Integrated Header: Re-enabled
XpTempleCreatorHeader.vuewithin the layout tab for seamless grid resizing. - ✅ Popover Sync: Updated the quick-edit popover with full feature parity, including item/loot selection.
Current State:
- ✅ Room type selection modal complete
- ✅ Cardinal door system (N/E/S/W) with locks
- ✅ Adjacent room detection for wall limiting
- ✅ Monster room beast selector integration
- ✅ Room navigation within editor
- ✅ Loot room configuration complete
- ✅ Shop room configuration complete
- ✅ Smooth navigation return paths with auto-scroll and highlight
- ✅ Dynamic accordion tier isolation for beast management
Key Components:
XpTempleLayout.vue- Unified editor and layout previewcomponents/RoomCardinalLayout.vue- Room direction/door UIcomponents/XpTempleCreatorHeader.vue- Floor controls
Battle System (Stable)
The battle system has been recently enhanced:
- ✅ Proper player stats HP/MP calculation (level + class based)
- ✅ Battle HUD with animated stats display
- ✅ Integrated action menu in dialog box
- ✅ Intro dialog messages before battle starts
- ✅ Pinia migration complete (Vuex fully removed)
Architecture Quick Reference
State Management
All stores are Pinia-based in src/lib/store/stores/:
user.ts- User profiles, authentication, GPgame.ts- Global game state, theme, entity cachingbattle.ts- Battle state managementaudio.ts- Sound controltemple-creator.ts- Temple builder state
Engine Structure
src/lib/engine/
├── battle/ # Combat logic
├── core/dungeons/ # Temple system
└── temples/ # Pre-built temples
Component Hierarchy
components/
├── atoms/ # Basic primitives
├── molecules/ # Composed units
└── organisms/ # Complex features
Immediate Next Steps
- Loot Room Configuration - Complete treasure chest reward selector
- Room Data Persistence - Ensure room edits save to temple
- Room Validation - Must have entrance, boss for temples
- Template Rooms - Pre-configured room types
Known Issues / Blockers
- Battle dialog may show duplicate intro messages (recently fixed)
- Wall icons occasionally show wrong icon type (recently fixed)
- Floor editor grid size needs custom dimensions (recently fixed)
- ✅ Navigation Crash: Fixed a
TypeError: Cannot read properties of undefined (reading 'preventDefault')inWorldPlains.tswhen navigating via FAB shortcuts. - Area FAB menu was invisible due to Ionic
ion-fab-listopacity transitions (recently fixed)
Key Documentation
| Doc | Purpose |
|---|---|
| Roadmap | Overall project direction |
| Architecture | Technical overview |
| Temple-System | Dungeon engine |
| Battle-System-Engine | Combat mechanics |
| Player-Stats-Leveling | HP/MP formulas |
Quick Start for New Context
- Read:
docs/Roadmap.md- Understand current phase - Read:
docs/current_context.md(this file) - Get oriented - Check: Active files in
XpTemples/- Temple Creator focus - Review:
lib/store/stores/- State architecture