Commit graph

315 commits

Author SHA1 Message Date
f79e3f2a10 update auth store redirect to /auth/login 2025-11-30 22:29:08 -08:00
a1bcb0e523 update Navigation login link to /auth/login 2025-11-30 22:29:08 -08:00
0f50d9fd73 remove old login route (moved to /auth/login) 2025-11-30 22:28:59 -08:00
9ace6f0862 remove old routes (moved to app group) 2025-11-30 22:28:59 -08:00
b78ee7ca20 move routes to (app) route group 2025-11-30 22:28:17 -08:00
3498b7d966 add signup redirect to register 2025-11-30 22:28:13 -08:00
765a9b358a add auth page translations 2025-11-30 22:28:13 -08:00
93efc9946a add registration page with validation 2025-11-30 22:26:32 -08:00
fd10dcfb15 add login page with contained inputs 2025-11-30 22:26:32 -08:00
762d5c0fc0 add auth layout with centered container 2025-11-30 22:26:32 -08:00
06dd832ada add AuthCard component for auth pages 2025-11-30 22:26:25 -08:00
33fa9f9c9c reset fieldset border/padding/margin in Input component 2025-11-30 22:26:25 -08:00
d2cb4c5052 routes: update layout and teams page 2025-11-30 20:06:49 -08:00
af659b9760 components: update party and character components 2025-11-30 20:06:44 -08:00
c3ed9b2885 api: update entity adapter and queries 2025-11-30 20:06:40 -08:00
db5bfe9f7f sidebar: remove unused modification components 2025-11-30 20:06:36 -08:00
a858877545 sidebar: refactor details components 2025-11-30 20:06:31 -08:00
47885b1429 sidebar: wire up edit sidebars in openDetailsSidebar feature 2025-11-30 20:06:26 -08:00
8ac9dea2d3 sidebar: add EditCharacterSidebar and EditWeaponSidebar 2025-11-30 20:06:21 -08:00
4f132f9947 sidebar: add edit form components for character/weapon modifications 2025-11-30 20:06:15 -08:00
ad10d3fe73 stores: add partyStore for character/weapon updates 2025-11-30 20:06:09 -08:00
393bbdbcb0 sidebar: add MasteryRow component for rings/earring selects 2025-11-30 20:06:04 -08:00
5784b9638d sidebar: add DetailRow and DetailsSection components 2025-11-30 20:05:59 -08:00
c0dc3d0bc1 utils: update grid helpers and modification utilities 2025-11-30 20:05:54 -08:00
8bfa31d925 types: add NO_AWAKENING sentinel and update entity types 2025-11-30 20:05:50 -08:00
c1974c1d40 data: add ax skill definitions 2025-11-30 20:05:46 -08:00
f815ca4f30 ui: update Input, Select, Button, Sidebar components 2025-11-30 20:05:42 -08:00
5df563198b fix: render related characters 2025-11-30 14:57:43 -08:00
d5a22baa0a use Checkbox component in database edit pages with element theming 2025-11-30 13:59:45 -08:00
b8ad70229d fix database dropdown item rendering 2025-11-30 13:59:40 -08:00
3007aadbb0 sync pictureData with available profile images 2025-11-30 06:02:56 -08:00
7406f80edd use contained selects in settings modal 2025-11-30 06:02:56 -08:00
92e93309bf add typeahead component 2025-11-30 06:02:56 -08:00
66b03c9108 fix dropdown trigger props, add onClose alias to sidebar 2025-11-30 06:02:50 -08:00
fcc0a884f5 fix icon color inheritance, tweak select chevron 2025-11-30 06:02:50 -08:00
bc67d22c4b checkbox and switch theming with hover states 2025-11-30 06:02:50 -08:00
8a4bac542b update deps 2025-11-30 06:02:41 -08:00
bbec620d00 add storybook setup and initial stories 2025-11-30 06:02:41 -08:00
94fdcf1c6b docs: update CLAUDE.md 2025-11-30 02:32:15 -08:00
ef980b9084 chore: theme colors and svelte config tweaks 2025-11-30 02:32:11 -08:00
5e77bb3093 feat: add weapon series utility and i18n messages 2025-11-30 02:32:07 -08:00
8b078cdfd8 feat: add conflict dialog for duplicate characters/weapons 2025-11-30 02:32:03 -08:00
ff7199fbbb fix: add is-active state to weapon and summon units 2025-11-30 02:31:58 -08:00
2f0b67cb44 feat: add JobSection to /teams/new
- import JobSection and job selection handlers
- add context methods for slot selection glow
- render JobSection in character tab
2025-11-30 02:31:54 -08:00
d51fe03905 fix: character slot selection glow and empty protagonist
- character grid starts at position 1 (skip protagonist)
- add isEmptySelected state for glow on empty slots
- empty protagonist shows relief.png background only
2025-11-30 02:31:48 -08:00
18328e2d38 fix: party mutation parameter types
- favorite/unfavorite take shortcode string directly
- delete takes {id, shortcode} since API expects UUID
- remix takes shortcode string directly
- update spreads updates at top level
2025-11-30 02:31:42 -08:00
f346a73b61 fix: handle 204 No Content responses in base adapter 2025-11-30 02:31:37 -08:00
2275daec61 fix: PartySegmentedControl rep components now update reactively
The WeaponRep (and other rep components) weren't visually updating when
new items were added to the party. The issue was that Svelte's reactivity
wasn't properly propagating through the {#each} blocks.

Changes:
- PartySegmentedControl: Add derived values for party sub-properties to
  ensure reactivity propagates through snippet boundaries
- WeaponRep: Pre-compute rows as explicit $derived value and use keyed
  {#each} blocks for proper change detection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:23:44 -08:00
f457343e26
Complete TanStack Query v6 migration (#445)
## Overview

Complete migration from service layer to TanStack Query v6 with
mutations, queries, and automatic cache management.

## What Was Completed

### Phase 1: Entity Queries & Database Pages 
- Created `entity.queries.ts` with query options for weapons,
characters, and summons
- Migrated all database detail pages to use TanStack Query with
`withInitialData()` pattern
- SSR with client-side hydration working correctly

### Phase 2: Server Load Cleanup 
- Removed PartyService dependency from teams detail server load
- Server loads now use adapters directly instead of service layer
- Cleaner separation of concerns

### Phase 3: Party.svelte Refactoring 
- Removed all PartyService, GridService, and ConflictService
dependencies
- Migrated to TanStack Query mutations for all operations:
  - Grid operations: create, update, delete, swap, move
  - Party operations: update, delete, remix, favorite, unfavorite
- Added swap/move mutations for drag-and-drop operations
- Automatic cache invalidation and query refetching

### Phase 4: Service Layer Removal 
- Deleted all service layer files (~1,345 lines removed):
  - `party.service.ts` (620 lines)
  - `grid.service.ts` (450 lines)
  - `conflict.service.ts` (120 lines)
  - `gridOperations.ts` (unused utility)
- Deleted empty `services/` directory
- Created utility functions for cross-cutting concerns:
  - `localId.ts`: Anonymous user local ID management
  - `editKeys.ts`: Edit key management for anonymous editing
  - `party-context.ts`: Extracted PartyContext type

### Phase 5: /teams/new Migration 
- Migrated party creation wizard to use TanStack Query mutations
- Replaced all direct adapter calls with mutations (7 locations)
- Maintains existing behavior and flow
- Automatic cache invalidation for newly created parties

## Benefits

### Performance
- Automatic request deduplication
- Better cache utilization across pages
- Background refetching for fresh data
- Optimistic updates for instant UI feedback

### Developer Experience
- Single source of truth for data fetching
- Consistent patterns across entire app
- Query devtools for debugging
- Less boilerplate code

### Code Quality
- ~1,088 net lines removed
- Simpler mental model (no service layer)
- Better TypeScript inference
- Easier to test

### Architecture
- **100% TanStack Query coverage** - no service layer, no direct adapter
calls
- Clear separation: UI ← Queries/Mutations ← Adapters ← API
- Automatic cache management
- Consistent mutation patterns everywhere

## Testing

All features verified:
- Party creation (anonymous & authenticated)
- Grid operations (add, remove, update, swap, move)
- Party operations (update, delete, remix, favorite)
- Cache invalidation across tabs
- Error handling and rollback
- SSR with hydration

## Files Modified

### Created (3)
- `src/lib/types/party-context.ts`
- `src/lib/utils/editKeys.ts`
- `src/lib/utils/localId.ts`

### Deleted (4)
- `src/lib/services/party.service.ts`
- `src/lib/services/grid.service.ts`
- `src/lib/services/conflict.service.ts`
- `src/lib/utils/gridOperations.ts`

### Modified (13)
- `src/lib/api/mutations/grid.mutations.ts`
- `src/lib/components/grids/CharacterGrid.svelte`
- `src/lib/components/grids/SummonGrid.svelte`
- `src/lib/components/grids/WeaponGrid.svelte`
- `src/lib/components/party/Party.svelte`
- `src/routes/teams/new/+page.svelte`
- Database entity pages (characters, weapons, summons)
- Other supporting files

## Migration Complete

This PR completes the TanStack Query migration. The entire application
now uses TanStack Query v6 for all data fetching and mutations, with
zero remaining service layer code.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-29 22:32:15 -08:00
c06c8135ed feat: add TanStack Query devtools for development
added @tanstack/svelte-query-devtools (dev only)
- shows in dev mode only, tree-shaken from production
- provides visual debugging of queries, cache, and mutations
- accessible via floating icon in bottom-right corner
2025-11-29 03:44:59 -08:00