[priority: 6] Consolidate all tab components into src/components/game/tabs/ #84

Closed
opened 2026-05-19 09:23:56 +02:00 by Anexim · 3 comments
Owner

Problem

Tab components are scattered across 3 different locations instead of living in the dedicated tabs/ subfolder:

Current Location Component
src/components/game/tabs/DisciplinesTab.tsx Already in tabs/
src/components/game/tabs/ActivityLog.tsx Already in tabs/
src/components/game/SpellsTab.tsx Loose in game/ root
src/components/game/StatsTab.tsx Loose in game/ root

The tabs/index.ts barrel file already re-exports SpellsTab and StatsTab from their loose paths (../SpellsTab, ../StatsTab), which means it knows they should be in tabs/ but they haven't been moved yet.

What needs to happen

  1. Move src/components/game/SpellsTab.tsxsrc/components/game/tabs/SpellsTab.tsx
  2. Move src/components/game/StatsTab.tsxsrc/components/game/tabs/StatsTab.tsx
  3. Move src/components/game/StatsTab/ (subfolder with section components) → src/components/game/tabs/StatsTab/
  4. Update tabs/index.ts barrel to use relative imports (./SpellsTab, ./StatsTab) instead of ../SpellsTab, ../StatsTab
  5. Update game/index.ts barrel — remove the direct SpellsTab/StatsTab re-exports since tabs/index.ts already covers them (or keep them but point to the new location)
  6. Update all direct imports across the codebase that reference the old paths (e.g. from '../SpellsTab' or from './SpellsTab')
  7. Verify the build still passes (bun run build or equivalent)

Notes

  • ActivityLog.tsx is already in tabs/ and is a shared component (used by both ActivityLogPanel and potentially as a tab), so it can stay.
  • The StatsTab/ subfolder contains: CombatStatsSection.tsx, ElementStatsSection.tsx, LoopStatsSection.tsx, ManaStatsSection.tsx, PactStatusSection.tsx, StudyStatsSection.tsx — these are internal to StatsTab and should move with it.
  • Check for any other files that import directly from SpellsTab.tsx or StatsTab.tsx outside of the barrel files.

Acceptance Criteria

  • All 4 tab files (SpellsTab, StatsTab, DisciplinesTab, ActivityLog) live under src/components/game/tabs/
  • StatsTab/ section subfolder lives under src/components/game/tabs/StatsTab/
  • tabs/index.ts uses relative imports (./SpellsTab, ./StatsTab)
  • All import paths across the codebase are updated
  • Build passes with no errors
  • No files exceed 400-line limit (pre-commit hook)
## Problem Tab components are scattered across 3 different locations instead of living in the dedicated `tabs/` subfolder: | Current Location | Component | |---|---| | `src/components/game/tabs/DisciplinesTab.tsx` | ✅ Already in `tabs/` | | `src/components/game/tabs/ActivityLog.tsx` | ✅ Already in `tabs/` | | `src/components/game/SpellsTab.tsx` | ❌ Loose in `game/` root | | `src/components/game/StatsTab.tsx` | ❌ Loose in `game/` root | The `tabs/index.ts` barrel file already re-exports `SpellsTab` and `StatsTab` from their loose paths (`../SpellsTab`, `../StatsTab`), which means it knows they should be in `tabs/` but they haven't been moved yet. ## What needs to happen 1. **Move** `src/components/game/SpellsTab.tsx` → `src/components/game/tabs/SpellsTab.tsx` 2. **Move** `src/components/game/StatsTab.tsx` → `src/components/game/tabs/StatsTab.tsx` 3. **Move** `src/components/game/StatsTab/` (subfolder with section components) → `src/components/game/tabs/StatsTab/` 4. **Update** `tabs/index.ts` barrel to use relative imports (`./SpellsTab`, `./StatsTab`) instead of `../SpellsTab`, `../StatsTab` 5. **Update** `game/index.ts` barrel — remove the direct `SpellsTab`/`StatsTab` re-exports since `tabs/index.ts` already covers them (or keep them but point to the new location) 6. **Update** all direct imports across the codebase that reference the old paths (e.g. `from '../SpellsTab'` or `from './SpellsTab'`) 7. **Verify** the build still passes (`bun run build` or equivalent) ## Notes - `ActivityLog.tsx` is already in `tabs/` and is a shared component (used by both `ActivityLogPanel` and potentially as a tab), so it can stay. - The `StatsTab/` subfolder contains: `CombatStatsSection.tsx`, `ElementStatsSection.tsx`, `LoopStatsSection.tsx`, `ManaStatsSection.tsx`, `PactStatusSection.tsx`, `StudyStatsSection.tsx` — these are internal to StatsTab and should move with it. - Check for any other files that import directly from `SpellsTab.tsx` or `StatsTab.tsx` outside of the barrel files. ## Acceptance Criteria - [ ] All 4 tab files (`SpellsTab`, `StatsTab`, `DisciplinesTab`, `ActivityLog`) live under `src/components/game/tabs/` - [ ] `StatsTab/` section subfolder lives under `src/components/game/tabs/StatsTab/` - [ ] `tabs/index.ts` uses relative imports (`./SpellsTab`, `./StatsTab`) - [ ] All import paths across the codebase are updated - [ ] Build passes with no errors - [ ] No files exceed 400-line limit (pre-commit hook)
Anexim added the ai:todo label 2026-05-19 09:23:56 +02:00
n8n-gitea was assigned by Anexim 2026-05-19 09:23:56 +02:00
Author
Owner

Starting work on consolidating tab components into src/components/game/tabs/. Will move SpellsTab.tsx, StatsTab.tsx, and StatsTab/ subfolder, then update all imports.

Starting work on consolidating tab components into src/components/game/tabs/. Will move SpellsTab.tsx, StatsTab.tsx, and StatsTab/ subfolder, then update all imports.
Author
Owner

Completed. All tab components consolidated into src/components/game/tabs/.

Changes made:

  • Moved SpellsTab.tsxtabs/SpellsTab.tsx
  • Moved StatsTab.tsxtabs/StatsTab.tsx
  • Moved StatsTab/ subfolder (6 section files) → tabs/StatsTab/
  • Updated tabs/index.ts barrel to use relative imports (./SpellsTab, ./StatsTab)
  • Updated game/index.ts barrel to point to new locations (./tabs/SpellsTab, ./tabs/StatsTab)
  • StatsTab.tsx internal imports (./StatsTab/...) remain correct since the file and subfolder are both under tabs/
  • Build passes ✓
  • Pre-commit checks pass ✓ (all files under 400 lines)
  • Committed and pushed: 3dcd967
✅ **Completed.** All tab components consolidated into `src/components/game/tabs/`. **Changes made:** - Moved `SpellsTab.tsx` → `tabs/SpellsTab.tsx` - Moved `StatsTab.tsx` → `tabs/StatsTab.tsx` - Moved `StatsTab/` subfolder (6 section files) → `tabs/StatsTab/` - Updated `tabs/index.ts` barrel to use relative imports (`./SpellsTab`, `./StatsTab`) - Updated `game/index.ts` barrel to point to new locations (`./tabs/SpellsTab`, `./tabs/StatsTab`) - StatsTab.tsx internal imports (`./StatsTab/...`) remain correct since the file and subfolder are both under `tabs/` - Build passes ✓ - Pre-commit checks pass ✓ (all files under 400 lines) - Committed and pushed: `3dcd967`
Author
Owner

Issue complete. All tab components now live under src/components/game/tabs/. Build passes, pre-commit checks pass.

Issue complete. All tab components now live under src/components/game/tabs/. Build passes, pre-commit checks pass.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#84