Commit graph

56 commits

Author SHA1 Message Date
5d7e8334f9
orphaned item indicators (#447)
shows when collection items got nuked

- red badge + dimmed look on orphaned weapons/summons/characters
- amber banner at party level if anything's orphaned
- types updated for `orphaned` field
2025-12-23 22:42:20 -08:00
103d0c652d fix sass darken() deprecation 2025-12-21 23:49:55 -08:00
2c2580fba3 use job mutations and fix skill removal payload 2025-12-21 23:07:18 -08:00
f4dbf57765 fix unlimited raids to show 8 character slots 2025-12-21 23:05:37 -08:00
33b578ec21 tweak video embed border radius 2025-12-21 17:38:19 -08:00
5e01e56dec add video embed to description pane 2025-12-21 17:02:28 -08:00
c93f65153c show first two paragraphs in description tile with fade gradient 2025-12-21 17:02:18 -08:00
8329ec9de3 add rich text description editor
- use edra/tiptap for description editing in sidebar
- fix infinite loop by using onMount instead of $effect
2025-12-21 15:13:12 -08:00
e32ae12cb9 remove chevron from description area 2025-12-21 12:46:35 -08:00
23c4425a2a move title, user, and actions into description tile 2025-12-21 12:44:48 -08:00
9fea625e7c fix: drop shadows and clipping 2025-12-21 12:40:55 -08:00
b66405ca73 remove redundant edit description button and edit party modal 2025-12-21 12:37:54 -08:00
d8419aa8fd expose edit button next to menu 2025-12-21 12:29:58 -08:00
12074203f1 add raid parties pane
click raid tile to see other parties for same raid
filters for element and battle settings
2025-12-21 12:29:49 -08:00
b06c43385e update grid layout, hide video tile when empty 2025-12-21 11:35:34 -08:00
7cde30a427 add level and element to raid tile 2025-12-21 11:32:11 -08:00
5d00c1580d combine settings and performance into BattleTile 2025-12-21 11:31:59 -08:00
28b5f3de4f
party info grid + edit sidebar (#446)
adds a bunch of stuff for viewing and editing party metadata

## what's new

- **party info grid** - shows raid, settings, performance metrics, video
in a nice tile layout
- **party edit sidebar** - edit all the party metadata: battle settings,
clear time, button/chain/summon counts, video url, raid selection
- **raid selector** - browse raids by section (raids/events/solo),
search, sort by difficulty
- **input clearable prop** - inputs can now have a clear button

also some switch component cleanup and misc fixes
2025-12-21 03:01:28 -08:00
7793715a30 filter mainhand weapons by job proficiency 2025-12-20 02:13:56 -08:00
e1fe9810ce add unlimited raids with 7 character slots 2025-12-20 01:58:11 -08:00
9787af9c42 fix party avatar to use shared image utilities 2025-12-13 21:50:25 -08:00
7dae71965a extract DeleteTeamDialog component 2025-12-13 20:02:18 -08:00
789494e773 migrate dialog consumers to ModalHeader/Body/Footer pattern 2025-12-13 14:55:46 -08:00
0a2a3894bf Add sync from collection menu and highlight owned items in search
- Party.svelte: Add 'Sync from collection' to overflow menu for parties
  with linked collection items, with proper menu grouping
- SearchContent.svelte: Highlight items user owns in 'All Items' mode
  with subtle green background and checkmark indicator
2025-12-03 23:24:30 -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
83b18645c8 fix: guard pushState until router is initialized 2025-12-01 04:59:16 -08:00
4fda863339 fix: use pushState + popstate for instant tab switching 2025-12-01 04:57:22 -08:00
21bda28910 fix: always use explicit tab path in URL 2025-12-01 04:36:17 -08:00
5063e8e73c fix: use goto() instead of pushState for tab URL sync 2025-12-01 04:33:28 -08:00
af27f0fbbc add URL-based tab routing with pushState sync 2025-12-01 04:29:21 -08:00
af659b9760 components: update party and character components 2025-11-30 20:06:44 -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
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
149f30c538
Make parties more DRY (#444)
We extracted utility functions from the Party.svelte component in order
to make things more DRY.
2025-11-29 03:29:28 -08:00
Devin AI
67eb624bfc fix: type errors cleanup (161 -> 130 errors)
- Fix Party.svelte: add null checks for existingChar/existingWeapon/existingSummon
- Fix DropdownItem.svelte: replace asChild with child snippet pattern for bits-ui v2
- Fix UncapStar.svelte, TranscendenceStar.svelte: tabIndex -> tabindex
- Fix Party.svelte, Navigation.svelte: remove asChild prop usage
- Fix images.ts: add | undefined to pose/element params for exactOptionalPropertyTypes
- Fix ItemHeader.svelte, UncapIndicator.svelte: accept number | null | undefined
- Fix GridRepCollection.svelte, GuidebookUnit.svelte: PartyView -> Party type
- Fix search.adapter.ts: add optional type property to SearchResult
- Update various Props interfaces for exactOptionalPropertyTypes compliance

Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-28 21:58:11 +00:00
Devin AI
3b89628e7e fix: Party.svelte editKey type (string | null -> string | undefined)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-28 21:15:37 +00:00
Devin AI
606fa91b93 fix: Party.svelte mainWeapon derived state (181 -> 177 errors)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-28 21:10:03 +00:00
Devin AI
cf7a036575 fix: type errors in svelte-main branch (219 -> 191 errors)
- Fix paraglide aliases in svelte.config.js
- Fix Checkbox.svelte: use indeterminate prop, remove restProps spread
- Fix Switch.svelte: simplify Props interface, remove restProps spread
- Fix Button.svelte: add null checks for icon prop
- Fix sidebar.svelte.ts: use explicit undefined types for exactOptionalPropertyTypes
- Fix Party.svelte: fix import extension, remove ConflictService argument
- Fix job.resource.svelte.ts: add error property to success states, fix groupJobsByTier null checks

Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-28 21:06:05 +00:00
Devin AI
dfbb1e4e48 fix: type errors and cleanup for svelte-main branch
- Fix RequestOptions cache type incompatibility in adapters/types.ts
- Add missing properties to Character type in entity.adapter.ts and entities.ts
- Create adapters index.ts for module exports
- Update users.ts to use userAdapter instead of removed core module
- Fix UserSettingsModal.svelte switch import and type errors
- Add type shims for wx-svelte-grid and $env/static/public
- Accept upstream versions for SearchSidebar.svelte and teams/new/+page.svelte
- Add CLEANUP_PLAN.md documenting remaining work

Reduces type errors from ~412 to ~378. See CLEANUP_PLAN.md for remaining fixes.

Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-28 20:08:10 +00:00
b1bfe82507 fix party job/skill API calls
- use shortcode instead of id for job updates
- wrap job_id in party object for rails API
- only send editable skill slots (1-3), skip null values
- add updateAccessory method stub
2025-11-28 11:04:26 -08:00
d8e18c00e1 update ui components 2025-09-29 23:48:02 -07:00
4161a615ba add job system 2025-09-29 23:45:50 -07:00
bc2e7d6bdb fix dropdown double button issue 2025-09-24 02:52:24 -07:00
94ad52252e Update to use Button component
Also removes redundant styles
2025-09-24 01:53:59 -07:00
6ace86a00e Fix various spacing and sizing issues on party details 2025-09-24 01:24:57 -07:00
0c03332988 update ui components for better interaction 2025-09-23 22:09:39 -07:00
9ed6a00f5f feat: auto-close sidebar on navigation
- Added beforeNavigate hook to close sidebar when navigating between pages
- Prevents search sidebar from staying open when browsing different sections
- Ensures clean UI state transitions between pages
2025-09-20 21:36:49 -07:00
3e7ccf8fdb Refactored Button component 2025-09-17 22:06:45 -07:00
0bab6e0d7e refactor: restructure party component layout 2025-09-17 10:47:59 -07:00