Resolved PUBLIC_SIERO_OAUTH_URL import issue by removing the intermediate
config.ts file and importing environment variables directly where needed.
Changes:
- Removed src/lib/config.ts (unnecessary abstraction layer)
- Updated src/lib/auth/oauth.ts to import PUBLIC_SIERO_API_URL directly
- Updated src/routes/auth/refresh/+server.ts to import directly
- Construct OAUTH_BASE locally as `${PUBLIC_SIERO_API_URL}/oauth`
This fixes the TypeScript error where svelte-check couldn't resolve
PUBLIC_SIERO_OAUTH_URL from the config file, even though the variable
was properly defined in .env and .svelte-kit/ambient.d.ts.
Result: 38 → 37 errors (-1)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed all test fixture mock data to match actual type definitions across
4 test files. Resolved 9 distinct type errors by correcting mock object
structures.
Files modified:
- entity.adapter.test.ts: Fixed Character mock to use nested hp/atk objects
- grid.adapter.test.ts: Fixed GridWeapon/GridCharacter/GridSummon mocks
- Added proper entity objects (mockWeapon, mockCharacter, mockSummon)
- Fixed transcendenceStage -> transcendenceStep
- Removed invalid partyId/weaponId/characterId/summonId properties
- party.adapter.test.ts: Fixed Party mock
- Changed visibility from 'public' string to 0 number
- Removed invalid skills array from Job object
- Added complete RaidGroup with all required properties
- user.adapter.test.ts: Fixed User/Party mocks
- Created separate mockUser (User type) vs mockUserInfo (UserInfo type)
- Fixed role type mismatch (number vs string)
- Added required arrays (weapons, characters, summons) to Party objects
Result: 42 → 38 errors (-4)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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>
Removed inappropriate use of optionalProps() type shim from our own
codebase where we control the types. Type shims should only be used
for third-party library incompatibilities.
Files modified:
- base.adapter.ts: Removed shim from RequestOptions spreading
- grid.service.ts: Removed 3 usages from update methods
- party.service.ts: Removed import
- users.ts: Removed import and usage
- UserSettingsModal.svelte: Direct object construction
- drag-drop.svelte.ts: Direct object for DragOperation.target
Result: 45 → 43 errors (-2)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Build avatar object separately with proper types before assignment
- Apply optionalProps before passing to updateProfile
This maintains 53 errors (65% reduction from original 151).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add | undefined to all optional properties in Button Props interface
- This fixes 4 type errors related to Button component usage with exactOptionalPropertyTypes
Reduces errors from 57 to 53 (65% reduction from original 151).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update UserUpdateParams to include | undefined for all optional fields
- Add | undefined to CreatePartyParams and UpdatePartyParams interfaces
- Add | undefined to CreateGrid*Params interfaces (Weapon, Character, Summon)
- Transform UserUpdateParams to nested avatar structure in users.ts
- Remove unnecessary optionalProps wrappers (now handled by interface definitions)
- Fix TeamView awakening prop with conditional spreading
Reduces errors from 63 to 60.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix jobUtils proficiency type narrowing by storing intermediate values
- Add default empty string for openDescriptionSidebar title parameter
- Remove explicit undefined assignments in search resource tests
Reduces errors from 68 to 63.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add optionalProps shim to base.adapter.ts for RequestInit compatibility
- Apply optionalProps to UserSettingsModal updateData
- Use conditional spreading for Navigation Button element prop
- Apply optionalProps to drag-drop target object creation
- Apply optionalProps to party.service create/update methods
- Apply optionalProps to grid.service CRUD operations
- Fix transcendenceStage -> transcendenceStep typo in grid.service
- Update UserUpdateParams interface to include | undefined
- Update DragOperation interface properties to include | undefined
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- DatabaseProvider.ts: Remove redundant normalizer check
- Normalizer is applied by parent class, no need to apply twice
- Fixes "Property 'normalizer' does not exist" error
- image.ts: Separate type and value exports for proper type resolution
- CharacterImageCell.svelte: Fix getCharacterImage parameter order
- Changed (id, pose, variant) to (id, variant, pose)
- SearchContent.svelte: Fix getCharacterImage parameter order
Fixes ImageVariant type errors and property access errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- jobUtils.ts: Remove string comparison for job.row (row is typed as number)
- job.row === '1' comparison is always false, removed
- grid.service.ts: Fix swap operation to compare position with position
- Changed i.id === operation.targetPosition to i.position === operation.targetPosition
- targetPosition is a number (position), not a string (id)
Fixes "This comparison appears to be unintentional because the types have no overlap" errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- errors.ts: Only assign retryAfter when defined, not undefined
- user.adapter.ts: Build UserProfileResponse conditionally
- Only include optional properties (total, totalPages, perPage) when defined
- Use intermediate variables to ensure type safety
Fixes exactOptionalPropertyTypes violations where `T | undefined` cannot be
assigned to optional property `prop?: T`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update entities.ts WeaponKey to include all required fields (granblue_id, series, group, order)
- Use snake_case naming (granblue_id) to match API/database conventions
- Update modifiers.ts to import from entities.ts and use snake_case property
- Removes duplicate WeaponKey type and eliminates type conflicts
Fixes "Property 'granblueId' does not exist on type 'WeaponKey'" and type assignment errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- UncapIndicator.svelte: Use nullish coalescing for uncapLevel comparison
- UncapStatusDisplay.svelte: Guard uncapLevel in badge active checks
Fixes "'uncapLevel' is possibly 'null'" errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove duplicate generic SearchResult<T> from types.ts
- Export SearchResult from search.adapter.ts via index.ts
- Eliminates type conflict between two incompatible SearchResult definitions
This fixes "Type 'SearchResult' is not assignable to type 'SearchResult<any>'" errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Select.svelte: Use conditional spreading for optional `disabled` prop and `value` prop
- Switch.svelte: Conditionally spread `name` and `value` props
- Segment/RepSegment: Remove HTMLButtonAttributes extension and handle disabled prop properly
- Replace inline `import('svelte').Snippet` with proper import statements
Fixes type errors where bits-ui prop types don't include explicit `undefined` for optional properties, which conflicts with `exactOptionalPropertyTypes: true`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix DetailItem.svelte to accept boolean and null values
- Fix proficiency access in database/characters/[id]/+page.svelte
Co-Authored-By: Justin Edmund <justin@jedmund.com>
- 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>
## Summary
This PR fixes several pre-existing type errors identified by
`svelte-check`:
1. **PartyService constructor** - Removed unused `fetch` argument from
constructor call in `teams/[id]/+page.server.ts`. The `PartyService`
class has an empty constructor that doesn't accept any parameters.
2. **PaginatedResponse property** - Changed `response.per` to
`response.perPage` in `teams/explore/+page.server.ts` to match the
`PaginatedResponse<T>` type definition.
3. **Broken test files** - Removed 3 test files that were importing
non-existent `actions` exports:
- `database/characters/[id]/page.server.test.ts`
- `database/summons/[id]/page.server.test.ts`
- `database/weapons/[id]/page.server.test.ts`
These tests were testing SvelteKit form actions that don't exist in the
corresponding `+page.server.ts` files.
Reduces `svelte-check` errors from 419 to 366 (-53 errors).
## Review & Testing Checklist for Human
- [ ] **Verify party loading works** - Navigate to `/teams/[shortcode]`
and confirm party data loads correctly. The `PartyService` now uses
`partyAdapter` directly without a custom fetch function - verify this
works on both client and server.
- [ ] **Verify explore pagination** - Navigate to `/teams/explore` and
confirm pagination displays correctly (page count, items per page).
- [ ] **Confirm deleted tests were not needed** - The removed tests were
for form actions (`actions.save`) that don't exist. Verify there's no
plan to implement these actions soon, or if there is, the tests should
be re-added when the actions are implemented.
### Notes
The deleted test files were testing functionality that doesn't exist -
they imported `actions` from page.server.ts files that only export
`load` functions, not form actions. If database entity editing via form
actions is planned, new tests should be written when that functionality
is implemented.
Link to Devin run:
https://app.devin.ai/sessions/611580bc2db94e20a48c3692d3cbd432
Requested by: Justin Edmund (justin@jedmund.com) / @jedmund
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Justin Edmund <justin@jedmund.com>
## Summary
This PR performs low-risk cleanup tasks on the svelte-main branch:
1. **Remove unused imports** from `base.adapter.ts` - `snakeToCamel` and
`camelToSnake` were imported but never used
2. **Add `/.next` to `.gitignore`** - This is a SvelteKit project but
had a stale Next.js build artifact showing in git status
3. **Fix broken auth import** - `map.ts` was importing
`UserInfoResponse` from `$lib/api/resources/users` which never existed.
Created the type in `oauth.ts` based on actual usage in `buildCookies()`
4. **Remove test/example routes** - Deleted development scaffolding that
had no references elsewhere:
- `src/lib/components/examples/SearchExample.svelte`
- `src/routes/test-sidebar/+page.svelte`
- `src/routes/test/drag-drop/+page.svelte`
## Review & Testing Checklist for Human
- [ ] **Verify `UserInfoResponse` type matches actual API response** - I
inferred the type from usage in `map.ts`, but haven't verified against
the actual `/users/info` endpoint response from hensei-api. Fields:
`id`, `username`, `role`, `avatar.picture`, `avatar.element`,
`language`, `gender`, `theme`
- [ ] **Confirm test routes are not needed** - These appeared to be dev
scaffolding with no code references, but verify they're not used in any
manual QA workflows
- [ ] **Test auth flow** - Login/signup should still work correctly with
the new type location
**Recommended test plan:** Log in to the app and verify user info
(avatar, language, theme preferences) loads correctly after
authentication.
### Notes
- The broken `$lib/api/resources/users` import was pre-existing (the
file never existed), not caused by the previous API layer cleanup PR
- Running `pnpm check` confirms the auth/map error is resolved;
remaining type errors are unrelated pre-existing issues
Link to Devin run:
https://app.devin.ai/sessions/611580bc2db94e20a48c3692d3cbd432
Requested by: Justin Edmund (justin@jedmund.com) / @jedmund
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Justin Edmund <justin@jedmund.com>
# Remove legacy API layer (APIClient, core.ts, resources/)
## Summary
This PR consolidates the API layer by removing unused legacy code. The
codebase had two API patterns:
1. **Adapters layer** (`src/lib/api/adapters/`) - The newer, canonical
HTTP layer with retry logic, caching, and proper error handling
2. **Legacy layer** (`src/lib/api/client.ts`, `core.ts`, `resources/`) -
An older pattern using SvelteKit proxy endpoints that was no longer
imported anywhere
The legacy layer was confirmed unused via grep analysis. The only
exception was `transformResponse` and `transformRequest` functions in
`client.ts` which were still used by `BaseAdapter` and
`schemas/party.ts` - these have been moved to `schemas/transforms.ts`.
**Files deleted:**
- `src/lib/api/client.ts` (732 lines - APIClient class was dead code)
- `src/lib/api/core.ts` (helper functions, unused)
- `src/lib/api/index.ts` (empty file)
- `src/lib/api/resources/` directory (search.ts, weapons.ts,
characters.ts, summons.ts - all unused)
**Files modified:**
- `src/lib/api/schemas/transforms.ts` - Added `transformResponse`,
`transformRequest`, and their helper functions
- `src/lib/api/adapters/base.adapter.ts` - Updated import path
- `src/lib/api/schemas/party.ts` - Updated import path
## Review & Testing Checklist for Human
- [ ] **Verify transform functions work correctly** - The
`transformResponse` and `transformRequest` functions handle critical
data transformation (snake_case ↔ camelCase, object ↔ entity field
renaming). Test that party data loads correctly with proper field names.
- [ ] **Test party CRUD operations** - Create, update, and delete a
party to verify the adapters layer still works end-to-end
- [ ] **Test grid operations** - Add/remove weapons, characters, and
summons to verify the entity field renaming still works correctly
- [ ] **Check for any runtime errors** - The local type checking
couldn't run due to missing dev dependencies, so CI is the first line of
defense
**Recommended test plan:**
1. Load an existing party page and verify all data displays correctly
2. Create a new party and add weapons/characters/summons
3. Edit an existing party (update name, add/remove items)
4. Verify search functionality works for weapons/characters/summons
### Notes
- Local lint/typecheck commands failed due to missing dependencies
(prettier-plugin-svelte, eslint-config-prettier) - relying on CI for
type verification
- The services layer (`src/lib/services/`) was intentionally kept as
it's a business logic layer that wraps the adapters
Link to Devin run:
https://app.devin.ai/sessions/611580bc2db94e20a48c3692d3cbd432
Requested by: Justin Edmund (justin@jedmund.com) / @jedmund
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Justin Edmund <justin@jedmund.com>
- let backend compute default uncap levels
- fix InfiniteScroll resource lifecycle (don't destroy on unmount)
- improve party resource error handling with type narrowing
- use SvelteMap/SvelteDate for reactivity
- 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
- update JobSkill type with emp/base boolean flags
- use new skill fields in jobUtils and components
- update job adapter with locale and filter params
- restyle empty skill slots with cleaner placeholder
- simplify ML badge to not show level number
- track active item in sidebar store
- add element accent colors and focus ring mixins
- units show pulsing focus ring when selected in sidebar
- refactor units to use shared menu components
- update context menu test page
- UnitMenuContainer for context/dropdown menu wrapper
- MenuItems for reusable action items
- GearMenuButton for hover-triggered dropdown
- shared scss styles for both menu variants
- replace manual fetch with createInfiniteQuery
- debounced search input with reactive filters
- pagination handled automatically via infinite scroll
- cleaner state management via query result
- integrate @tanstack/svelte-query into layout
- add query client factory and query keys
- new InfiniteScrollQuery component for paginated data
- search query options for weapons/characters/summons
- update dev port to 5174