Commit graph

1257 commits

Author SHA1 Message Date
1f8de7ee30
Fix Railway build errors by marking dynamic routes (#437)
## Summary
- Fixes Railway deployment build failures caused by dynamic server usage
errors
- Marks routes that use runtime features as `force-dynamic` to prevent
static generation attempts
- Creates proper error pages to handle 404/500 scenarios

## Problem
The build was failing with "Dynamic server usage" errors because Next.js
was trying to statically generate pages that use runtime features like:
- `cookies()` for authentication
- `searchParams` for filtering
- Dynamic data fetching that requires request-time context

## Solution
Added `export const dynamic = 'force-dynamic'` to:

### API Routes
- `/api/jobs/route.ts` - uses searchParams
- `/api/jobs/skills/route.ts` - uses cookies via fetchFromApi
- `/api/version/route.ts` - uses cookies via fetchFromApi
- `/api/raids/groups/route.ts` - uses cookies via fetchFromApi
- `/api/parties/route.ts` - uses searchParams and cookies
- `/api/parties/[shortcode]/route.ts` - uses cookies
- `/api/parties/[shortcode]/remix/route.ts` - uses cookies

### Page Components
- `/app/[locale]/teams/page.tsx` - uses searchParams
- `/app/[locale]/new/page.tsx` - fetches dynamic data
- `/app/[locale]/saved/page.tsx` - uses cookies and searchParams
- Additional pages to avoid useContext errors during static generation

### Error Handling
- Created `/pages/_error.tsx` - Simple error page without i18n
complexity
- Created `/app/not-found.tsx` - App Router 404 page

## Test plan
- [x] Build completes successfully locally with `npm run build`
- [ ] Deploy to Railway staging environment
- [ ] Verify all dynamic routes work correctly
- [ ] Check error pages display properly

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-04 02:41:03 -07:00
e4b7f0c356
Fix TypeScript errors for production build (#436)
## Summary
Fixed multiple TypeScript errors that were preventing the production
build from completing on Railway.

## Changes Made

### Nullable Type Fixes
- Fixed `searchParams.toString()` calls with optional chaining (`?.`)
and fallback values
- Fixed `pathname` nullable access in UpdateToastClient
- Added fallbacks for undefined values in translation interpolations

### Type Consistency Fixes
- Fixed recency parameter handling (string from URL, converted to number
internally)
- Removed duplicate local interface definitions for Party and User types
- Fixed Party type mismatches by using global type definitions

### API Route Error Handling
- Fixed error type checking in catch blocks for login/signup routes
- Added proper type guards for axios error objects

### Component Props Fixes
- Fixed RadixSelect.Trigger by removing invalid placeholder prop
- Fixed Toast and Tooltip components by using Omit to exclude
conflicting content type
- Added missing onAdvancedFilter prop to FilterBar components
- Fixed PartyFooter props with required parameters

## Test Plan
- [x] Fixed all TypeScript compilation errors locally
- [ ] Production build should complete successfully on Railway
- [ ] All affected components should function correctly

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-04 01:47:10 -07:00
02676fd7d4
Fix ESLint errors causing Railway deployment failure (#435)
## Summary
- Fixed unescaped apostrophes in JSX text that were causing ESLint
errors
- These errors were preventing the production build from completing on
Railway

## Changes
- `app/[locale]/error.tsx`: Escaped apostrophe in "couldn't"
- `app/[locale]/not-found.tsx`: Escaped apostrophes in "you're" and
"couldn't"
- `app/[locale]/unauthorized/page.tsx`: Escaped apostrophe in "don't"

## Test plan
- [x] ESLint errors resolved locally
- [ ] Railway deployment succeeds after merge

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-09-03 23:23:27 -07:00
d2bf37a40e
Remove images that were accidentally committed (#434) 2025-09-03 23:16:30 -07:00
778a1c70bd
Fix authentication state hydration mismatch (#433)
## Summary
- Fixed avatar showing anonymous for several seconds on page load
- Eliminated hydration mismatch for authentication state
- Header now shows correct user state immediately

## Root Cause
AccountStateInitializer was running client-side in useEffect AFTER
hydration, causing:
1. Server renders anonymous state
2. Client hydrates with anonymous state
3. useEffect runs and updates state (causing the flash)

## Solution
- Read auth cookies server-side in layout.tsx
- Pass initial auth data as props to AccountStateInitializer
- Initialize Valtio state synchronously before first render
- Client-side cookie reading only as fallback

## Changes
- Added server-side cookie parsing in layout.tsx
- Modified AccountStateInitializer to accept initial auth data props
- Made Header component reactive with useSnapshot from Valtio
- State initialization happens synchronously, preventing the flash

## Test plan
- [x] Avatar renders correctly on first load
- [x] No anonymous avatar flash when logged in
- [x] Login/logout still works properly
- [x] State updates are reactive in the header

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-03 17:34:34 -07:00
73395efee8
Migrate about pages to App Router (#432)
## Summary
- Migrated about, updates, and roadmap pages from Pages Router to App
Router
- Fixed profile page data loading and display
- Created API route handlers for proxying backend calls
- Fixed translation format issues with next-intl

## Changes
- Created new App Router pages under `/app/[locale]/`
- Fixed translation interpolation from `{{variable}}` to `{variable}`
format
- Added API routes for characters, raids, summons, and weapons
- Fixed infinite recursion in ChangelogUnit by renaming fetch function
- Converted from useTranslation to useTranslations hook

## Test plan
- [x] About page loads and displays correctly
- [x] Updates page fetches and displays changelog data
- [x] Roadmap page renders without errors
- [x] Profile page shows user teams correctly
- [x] All translations render properly

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-03 17:20:16 -07:00
fa23c13db1
Modernize Link components to Next.js 13+ patterns (#431)
## Summary
- Removed legacy behavior from Link components
- Fixed onClick warnings with next-intl Link wrapper
- Fixed tab switching on party page
- Fixed JobSkillItem router undefined error

## Changes
- Removed `legacyBehavior` prop and nested `<a>` tags from all Link
components
- Updated GridTabsCompact to use next-intl's Link wrapper correctly
- Fixed PartyPageClient tab switching by mapping string values to
GridType enum
- Removed broken locale assignment code in JobSkillItem

## Test plan
- [x] No more console warnings about onClick and legacyBehavior
- [x] Tab switching works correctly on party page
- [x] No router undefined errors in JobSkillItem
- [x] All navigation links work as expected

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-03 17:07:09 -07:00
3d67622353
Fix i18n migration to next-intl (#430)
## Summary
- Fixed translation key format compatibility with next-intl
- Fixed pluralization format from i18next to next-intl format
- Fixed dynamic translation key error handling
- Updated server components to match API response structure
- Fixed useSearchParams import location

## Changes
- Changed pluralization from `{{count}} items` to `{count} items` format
- Added proper error handling for missing translation keys
- Fixed import paths for next-intl hooks
- Fixed PartyPageClient trying to set non-existent appState.parties

## Test plan
- [x] Verified translations render correctly
- [x] Tested pluralization works with different counts
- [x] Confirmed no console errors about missing translations
- [x] Tested party page functionality

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-03 16:25:59 -07:00
b1472fd35d
Fix package manager errors (#429)
- **Use bounded caching via unstable_cache, add Axios client with
timeout/keepAlive for server-side requests, and dedupe preview API route
by removing duplicate handler**
- **Remove Dockerfile and .dockerignore; keep PR focused on caching and
HTTP client fixes using npm (no Docker)**
2025-08-31 12:30:52 -07:00
426645813e
Fix intermittent crash: bounded caching + HTTP timeouts/keepAlive + preview route dedupe (#428)
## Summary
- Fixes periodic production crashes (undici ECONNREFUSED ::1) by
bounding server cache size/lifetime and hardening server HTTP client.

### Root cause
- React server cache (cache(...)) held axios responses indefinitely
across many parameter combinations, causing slow memory growth until the
Next.js app router worker was OOM-killed. The main server then failed
IPC to the worker (ECONNREFUSED ::1:<port>).

### Changes
- `app/lib/data.ts`: Replace unbounded cache(...) with unstable_cache
and explicit keys; TTLs: 60s for teams/detail/favorites/user, 300s for
meta (jobs/skills/accessories/raids/version).
- `app/lib/api-utils.ts`: Add shared Axios instance with 15s timeout and
keepAlive http/https agents; apply to GET/POST/PUT/DELETE helpers.
- `pages/api/preview/[shortcode].ts`: Remove duplicate handler to dedupe
route; retain the .tsx variant using `NEXT_PUBLIC_SIERO_API_URL`.

### Notes
- Build currently has pre-existing app/pages route duplication errors;
out of scope here but unrelated to this fix.
- Ensure `NEXT_PUBLIC_SIERO_API_URL` and `NEXT_PUBLIC_SIERO_OAUTH_URL`
are set on Railway.

### Risk/impact
- Low risk; behavior is unchanged aside from bounded caching and
resilient HTTP.
- Cache TTLs can be tuned later if needed.

### Test plan
- Verify saved/teams/user pages load and revalidate after TTL.
- Validate API routes still proxy correctly; timeouts occur after ~15s
for hung upstreams.
- Monitor memory over several days; expect stable usage without steady
growth.
2025-08-31 12:16:42 -07:00
0be7be8612
Fix saving characters (#427)
Saving characters was buggy because we added a key to the
`GridCharacter` response. They added to the backend but didn't show up
on the frontend without a refresh. Now we properly unwrap things and
newly added characters display instantly again.
2025-02-25 10:53:45 -05:00
156f4222d7
Modify users#info endpoint to send username (#426) 2025-02-13 05:42:00 -08:00
0e7aeed5d6
CSS fixes for summon grid and optional fix for character hovercard (#425) 2025-02-13 01:12:06 -08:00
a02a6c70aa
Jedmund/image embeds 2 (#424)
## Component Refactors:
- Updated `CharacterHovercard` to improve over mastery and awakening
section logic.
- Refactored `CharacterModal` to streamline state management (rings,
awakening, perpetuity) and object preparation.
- Adjusted `CharacterUnit` for consistent over mastery handling.
- Simplified `AwakeningSelectWithInput` to use awakening slug values and
improve error handling.
- Updated `RingSelect` to refine ring value syncing and index logic.
- Modified `Party` and `PartyHead` to ensure consistent over mastery
processing and proper preview URL construction.
- Updated `WeaponModal` to align awakening value handling with the new
slug-based approach.

## Styling and Configuration:
- Improved grid layout and styling in the `WeaponRep` SCSS module.
- Updated `next.config.js` rewrite rules to support new preview and
character routes.
- Added a new API endpoint (`pages/api/preview/[shortcode].tsx`) for
fetching party preview images.

## Type Definitions:
- Refined types in `types/GridCharacter.d.ts` and `types/index.d.ts` to
reflect updated structures for rings, over mastery, and awakening.
2025-02-09 22:54:15 -08:00
eff96e5a37
More work on image embeds (#423)
* Writes redirect for preview images so we're not embedding the API URL
in user-facing pages
* Adds the NextJs API page that actually serves the image
* Use a more straightforward URL construction method
* Add the og:image:width and og:image:height
2025-01-20 03:51:21 -08:00
2628d1745b
Use party.id to query embed image instead of shortcode (#422)
The API doesn't understand shortcodes as indexes
2025-01-18 09:30:59 -08:00
0dc03d44f3
Adds og:image for showing the page preview (#421) 2025-01-18 09:08:11 -08:00
4a30dbbf9f
Add weapons and items from April and early May (#420)
* Chloe and Kolulu
* Fire and Dark Omega Rebirth weapons
* LuciZero pendulums

---------

Co-authored-by: Justin Edmund <383021+jedmund@users.noreply.github.com>
2024-05-06 16:49:57 -07:00
4bc211c240
Fix renamed variables (#419)
Silly bug!

Co-authored-by: Justin Edmund <383021+jedmund@users.noreply.github.com>
2024-05-06 14:51:49 -07:00
2160a57a20
Further GridRep and Collection fixes (#417)
* z-index issues
* Some issues with GridRep (but there are still issues)
* Added a message when no teams are found for the current set of filters

---------

Co-authored-by: Justin Edmund <383021+jedmund@users.noreply.github.com>
2024-04-23 05:11:23 -07:00
4a38168593
Collection fixes (#416)
This fixes some issues that cropped up in the last PR

---------

Co-authored-by: Justin Edmund <383021+jedmund@users.noreply.github.com>
2024-04-22 23:57:49 -07:00
2eaaf1baae
Added updates from the past 2 weeks (#415)
* March 2024 Legfest
* April 2024  Flash Gala
* Celestial Weapons
* April Fools character
* Cardinal Saints character and uncap

Co-authored-by: Justin Edmund <383021+jedmund@users.noreply.github.com>
2024-04-21 03:59:10 -07:00
fc616aab01
Break collection pages into hooks (#414)
This refactors the collection pages (teams, saved and profiles) into a
bunch of hooks that handle various chunks of functionality. This way,
the actual "pages" have significantly less logic and significantly less
repeated code.

* **useFavorites** handles favoriting teams
* **useFilterState** handles the URL query filters
* **usePaginationState** simply holds data pertaining to pagination
* **useFetchTeams** handles fetching and parsing team data from the
server
* **useTeamFilter** pulls all other states together and handles some
logic that is closest to the page

Co-authored-by: Justin Edmund <383021+jedmund@users.noreply.github.com>
2024-04-21 00:46:04 -07:00
4dc2279d68
Used the wrong key (#413)
character.uncap.transcendence doesn't exist!

Co-authored-by: Justin Edmund <383021+jedmund@users.noreply.github.com>
2024-03-25 06:01:51 -04:00
ecbfd3ae7f
Game updates: 2024-03-25 (#412)
* Adds new raids and drop items
* Adds support for showing transcendence and subauras in search results

---------

Co-authored-by: Justin Edmund <383021+jedmund@users.noreply.github.com>
2024-03-25 05:55:19 -04:00
Justin Edmund
de8e3b322c Remove unused dependency 2024-03-13 19:46:37 -07:00
Justin Edmund
3cac1d03cc Fix display of telumas in WeaponUnit 2024-03-13 19:46:30 -07:00
Justin Edmund
c43e36e525 Fix search modal filtering
Why were we scoping this to only job_skills?
2024-03-13 19:46:13 -07:00
cfa78dccc3
Add year selector to updates page (#410)
The Updates page was getting really long which meant a humongous
request. This splits it up by year.
2024-03-11 07:21:39 -07:00
5824b3ccea
Added new items from anniversary update (#409)
* Transcended Primals
* Awakened Grands
* Uncapped weapons
2024-03-11 06:38:17 -07:00
eaef607dc3 2024-02 Legfest
* Sandalphon (Grand)
* Sabrina
* Richard
2024-02-29 00:58:33 -05:00
a3815d2866
Hotfix SCSS nesting bug (#408) 2024-02-21 23:29:08 -05:00
31745b17de
February 2024 updates and bug fixes (#407)
### New content
* Adds Onmyoji
* Adds Dark Rapture Zero
* Adds Exo Aristarchus

### Bug fixes
* Fixed a bug that prevented filtering job skills by category
* Fixed a bug that prevented infinite scroll in search modals
2024-02-21 23:18:53 -05:00
0f03ca5e27
Added items from 2024/02 Flash Gala and the February uncap (#406)
- Cidala (Valentine)
- Nehan (Valentine)
- Europa uncap
2024-02-18 17:00:15 -05:00
3ee2a1ac47
2024/01 Legend Festival (#405)
Adds items from 2024/01 Legend Festival and final set of Ultimate
Mastery skills
2024-01-30 22:40:48 -08:00
5a5457f10d
Add support for weapon transcendence images (#404)
Also adds new content from 2024/01 Flash Gala and My Hero Academia
collab.
2024-01-25 02:51:04 -08:00
74077a0501
Hotfix code replace error (#403) 2024-01-15 14:22:13 -08:00
3b6cc5ba65
Add support for weapon transcendence (#402) 2024-01-15 14:16:49 -08:00
acf9773f38
Add Lucilius profile picture for salem (#401) 2024-01-08 04:47:13 -08:00
cac2613e9e
Add note to latest update (#400) 2024-01-08 04:32:30 -08:00
bc3f716f8c
Updates next-usequerystate to nuqs (#399) 2024-01-08 04:20:45 -08:00
9ad2b64e2d
2024/01 Update (#398)
* Adds Celestial Weapons and final Evoker uncaps
* Fixes a bug that prevented logged out users from creating new parties
from the Character or Summon tabs
2024-01-08 04:07:19 -08:00
06c7192f25
2023/12 Legfest (#396)
* Dracosius (Payila)
* Pillardriver (Uriel)
* Buddysaurus Rex (Tyra)
* Triple Zero
* Tuna and Salmun
* Mother's Mad Spine
* T. Axe
2023-12-30 20:29:02 -08:00
e93343018f
Fix text colors for tags (#395)
We need to use -element-text-contrast
2023-12-30 16:04:21 -08:00
b665d005d5
Hotfix issues regarding Draconic Weapons (#394)
* Properly send draconic key 3 to API
* Show key images over Draconic Weapons Providence
* Show key images in hovercards
2023-12-30 07:28:33 -08:00
02fe61df88
Add Zeta (Grand) and Lowain (#393) 2023-12-28 03:06:40 -08:00
c58957f98e
Hotfix: Providence key not in appState (#392) 2023-12-26 04:43:49 -08:00
8f9f7d7a07
Add notes to latest update (#391) 2023-12-26 04:28:53 -08:00
cb2efb07a5
Adding content from late-November to mid-December (#390)
## Characters
* Illnott (Holiday)
* Yuni (Holiday)
* Noa (Holiday)
* Shalem (Holiday)

## New Weapons
* Blockbuster
* Nox Meteorum
* Grim Evidence
* Trap Knight's Helm
* Ornamental Paddle
* Bab-Bell Rendezvous
* Exo Maitrah Karuna

## Weapon unaps
* The World weapons
* Daggerpeak
* Dawn Rising
2023-12-26 04:19:57 -08:00
3347d47eeb
Logic updates for Draconic Weapons Providence (#389) 2023-12-26 03:21:39 -08:00