Commit graph

64 commits

Author SHA1 Message Date
abed7fee22 use small contained uncap indicator in crew roster 2025-12-20 19:48:30 -08:00
0bc00e090c add roster types and getRoster to crew adapter 2025-12-20 04:15:15 -08:00
e1fe9810ce add unlimited raids with 7 character slots 2025-12-20 01:58:11 -08:00
fd0044211b add raids/groups database pages with view toggle 2025-12-20 01:08:36 -08:00
916a6f52cd add collection counts query for nav tab totals 2025-12-19 15:42:46 -08:00
1e1f4f9478 add artifact skill api methods and types
- gameName field on ArtifactSkill type
- getSkill and updateSkill adapter methods
- skillById query and skillDetail key
2025-12-18 23:14:47 -08:00
e83650cb97 support aux_weapon in job database 2025-12-18 21:34:32 -08:00
c100d6c311 add types and utils for membership gaps 2025-12-18 19:36:36 -08:00
807cb8fb96 add member/phantom gw scores history pages 2025-12-18 11:04:07 -08:00
cefcdfef07 add retired date field to edit player dialog 2025-12-18 00:36:04 -08:00
eaf5094bd7 add score column to gw events table 2025-12-17 23:00:34 -08:00
2800bf0554 add crew scores tab to gw events page 2025-12-17 22:40:15 -08:00
ef95a294b3 add api layer for phantom claim accept/decline
- declinePhantomClaim and getPendingPhantomClaims adapter methods
- useDeclinePhantomClaim mutation
- pendingPhantomClaims query
- crew field on PhantomPlayer type
2025-12-17 18:29:33 -08:00
828c70a07e add server-side sorting support for database grid 2025-12-17 10:17:10 -08:00
0d22746154 add series to collection filters type 2025-12-16 21:18:25 -08:00
c875f3cefb refactor members page, add pending filter tab 2025-12-16 14:45:49 -08:00
cfcda8f01e remove Standard from series enum, shift IDs 2025-12-15 17:48:56 -08:00
57b90ac724 add imageId/actionId to JobSkill type 2025-12-15 16:09:07 -08:00
34c3dd6aa6 update entity types for new api format
- remove links property, use wiki/gamewith/kamigame at top level
- add seriesNames to Character
2025-12-15 12:48:16 -08:00
dd16718c03 add Holiday to CHARACTER_SERIES, remove Standard season 2025-12-15 09:51:54 -08:00
d921d37362 add character and summon series types 2025-12-14 11:59:26 -08:00
7f9398efbd add retired toggle to member/phantom edit dialog 2025-12-14 01:52:19 -08:00
9ee90fc6fc add /users/me endpoint to user adapter 2025-12-14 01:23:55 -08:00
da7299625c misc type and style fixes 2025-12-13 21:25:02 -08:00
aee62522e9 redesign profile header with gamertag + gbf profile link 2025-12-13 21:24:09 -08:00
a3c5676c4c add missing type props: dates, wiki links, editKey, gw stats 2025-12-13 14:55:40 -08:00
32af6a7788 crew members page improvements
- edit join date dialog
- add phantom with join date
- dropdown menus for member actions
- disable scout when roster full (30)
- invalidate gw queries on join date change
2025-12-04 03:03:04 -08:00
f4d04a7073 gw event page improvements
- total honors instead of total score
- muted style for players with existing scores
- by-event score endpoints
2025-12-04 03:02:58 -08:00
f5d0bbe7da Add sync UI to Party and edit sidebars
- Party.svelte: Pass authUserId to openSearchSidebar, link collection
  items when adding to party via collectionId
- DetailsSidebar: Show sync banner for out-of-sync items, add sync
  functionality for characters, weapons, and summons
- EditCharacterSidebar/EditWeaponSidebar: Add sync banner and button
  for items linked to collection
- party.ts types: Add collectionId and outOfSync fields to grid types
2025-12-03 23:13:59 -08:00
bf2bf8663f add search mode toggle for collection items 2025-12-03 22:58:46 -08:00
48121612fc add collection refs and sync methods to frontend types and adapters 2025-12-03 22:51:23 -08:00
4b2d1b7dc0 add calculateSkillDisplayValue helper for artifact skills 2025-12-03 20:50:42 -08:00
096214bc52 add artifact types and add artifact field to GridCharacter 2025-12-03 15:49:16 -08:00
108b662e33 make weapon series flags non-optional in type 2025-12-03 12:33:46 -08:00
a8d97479ff update Weapon.series to use WeaponSeriesRef, remove unused type files 2025-12-03 11:58:58 -08:00
58d8899075 add WeaponSeriesRef type definitions 2025-12-03 11:58:54 -08:00
cc2b2c1f95 convert collection filters from buttons to dropdowns 2025-12-02 17:19:31 -08:00
d053a9377e add race/proficiency/gender to CollectionFilters type 2025-12-02 15:32:11 -08:00
60ac5d4ab2 add collection API layer
Types, adapter, queries, and mutations for managing user collections
(characters, weapons, summons, job accessories). Supports both private
collection management and public collection viewing with privacy.
2025-12-02 09:28:22 -08:00
67b87c7d1b add season, series, promotions to entity types 2025-12-02 05:25:23 -08:00
b6db09bcc4 add formal promotion to enums 2025-12-02 05:25:10 -08:00
1cbcd91f94 entity adapter: add raw data fetch methods 2025-12-01 09:54:39 -08:00
8bfa31d925 types: add NO_AWAKENING sentinel and update entity types 2025-11-30 20:05:50 -08:00
8b078cdfd8 feat: add conflict dialog for duplicate characters/weapons 2025-11-30 02:32:03 -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
3b2782ec89 refactor: consolidate Awakening type definition
Phase 3.1: Remove duplicate Awakening interface
- Removed unused src/lib/types/Awakening.d.ts
- Using entities.ts as single source of truth for Awakening type
- Awakening now properly uses LocalizedName interface
- No breaking changes (unused file had zero imports)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:48:21 -08:00
271dcb3c81 refactor: add wx-svelte-grid Cell type for database cells
Phase 2.2: Add proper type definitions for wx-svelte-grid
- Created Cell interface export in wx-svelte-grid declarations
- Updated all 9 database cell components to use Cell type
- Removed custom Props interfaces with loose IRow typing
- Improved IntelliSense support for grid component props

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:46:48 -08:00
c074ea8bda refactor: unify visibility types to string literals
Changed from numeric (0/1/2) to string literals ('public'/'private'/'unlisted')
- Created PartyVisibility type with const assertion
- Updated Party and PartyPreview interfaces
- Updated PartyUpdatePayload interface
- Updated Zod schemas for validation
- Updated test mocks to use string literals
- Added deprecated conversion helpers for backward compat

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:43:55 -08:00
c821873ac6 fix: test fixtures and awakening type issues
- remove recruits property from Character test mock (doesn't exist in type)
- add missing subaura property to Summon test mocks
- consolidate Awakening imports to use entities source
- make awakening type/level optional in GridWeapon/GridSummon
- fix null handling in AwakeningDisplay (null -> undefined)
2025-11-28 21:04:26 -08:00
45b51d8880 fix: Phase 3 - fix adapter type issues (43 -> 42 errors)
Fixed three key type definition issues in the adapter layer:

1. Added missing element property to Party interface
   - Added `element?: number` to Party type
   - Used throughout codebase but was missing from interface

2. Aligned onError callback types for consistency
   - Changed ResourceOptions.onError from Error to AdapterError
   - Now matches AdapterOptions.onError type signature

3. Exported Grid types from grid.adapter.ts
   - Re-exported GridWeapon, GridCharacter, GridSummon
   - Makes types available for test files

Files modified:
- src/lib/types/api/party.ts: Added element property
- src/lib/api/adapters/types.ts: Fixed onError callback type
- src/lib/api/adapters/grid.adapter.ts: Added type re-exports

Result: 43 → 42 errors (-1)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 19:25:23 -08:00