Commit graph

1280 commits

Author SHA1 Message Date
a414433f0d Remove PRD files and add prd/ to .gitignore 2025-09-03 16:18:40 -07:00
c6657694f7 Fix hydration mismatch causing avatar flash on page load
- Read auth cookies server-side in layout.tsx
- Pass initial auth data as props to AccountStateInitializer
- Initialize Valtio state synchronously before first render
- Fallback to client-side cookie reading only when no server data
- Eliminates anonymous avatar flash during hydration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 16:01:46 -07:00
9b60134933 Fix header not reflecting logged-in state after login
- Add useSnapshot from Valtio to make Header reactive to state changes
- Replace accountState references with accountSnap for reactive updates
- Add missing router import for navigation methods
- Fix router.reload() to router.refresh() for Next.js 13+
- Create AccountStateInitializer component to load auth from cookies
- Add initializer to root layout to ensure state is set on page load

The header now properly updates to show user avatar and authenticated menu when logging in.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 16:01:46 -07:00
f205e8fed0 Fix roadmap page useTranslation error
- Change useTranslation to useTranslations (correct next-intl hook)
- Add 'use client' directive to RoadmapPage component

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 16:00:17 -07:00
04b2c0a6b2 Fix updates page translation errors and data fetching
- Fix translation interpolation format from double to single curly braces for next-intl
- Create API route handlers for characters, weapons, summons, and raids
- Fix infinite recursion in ChangelogUnit by renaming fetch function to fetchItem
- Simplify fetch logic and add proper dependencies to useEffect
- Fix activeYear defaulting to 2024 instead of current year (2025)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 16:00:17 -07:00
c1cc810a39 Fix AboutPage translations to use next-intl format
- Update translation files to use named tags instead of numbered tags
  - Changed <2> tags to semantic names like <gameLink>, <link>, <link1>, <link2>
- Update AboutPage component to use matching tag names in t.rich() calls
- Fixes UNMATCHED_CLOSING_TAG errors from next-intl
- Both English and Japanese translations updated
2025-09-03 16:00:17 -07:00
eec47f69b6 Migrate about, updates, and roadmap pages to App Router
- Create separate pages for about, updates, and roadmap in App Router
- Use correct translation keys from common namespace (page.titles, page.descriptions)
- Remove unstable_setRequestLocale as it's not needed
- Each page has its own client component with segmented control navigation
- Fixes 404 errors for about-related pages
2025-09-03 16:00:17 -07:00
72c734153d Fix profile page to correctly load and display user teams
- Add getUserProfile function to fetch user data with teams from /users/{username} endpoint
- Update profile page to use the correct API response structure (profile.parties)
- Fix UserInfo component to receive user object instead of individual props
- Update ProfilePageClient to fetch additional pages from the correct endpoint
- Fix pagination metadata extraction from the API response

The profile page now correctly displays user teams with working infinite scroll pagination.
2025-09-03 16:00:17 -07:00
df7d81ee1d Fix broken locale assignment in JobSkillItem
- Remove broken ternary operator referencing undefined router.locale
- Fix syntax error from incomplete merge or migration
- Locale is correctly retrieved from NEXT_LOCALE cookie

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 15:58:12 -07:00
2d02f88622 Fix Link component legacy behavior and tab switching
- Remove legacyBehavior prop and nested <a> tags from Link components
- Modernize to Next.js 13+ Link API with className directly on Link
- Convert external links to plain <a> tags (LinkItem, Discord link)
- Remove unnecessary passHref props from Header components
- Fix tab switching by mapping string values to GridType enum

The tab switching issue was caused by trying to parse string values
("characters", "weapons", "summons") as integers when they needed to
be mapped to GridType enum values.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 15:58:12 -07:00
1d9bd18848 Fix PartyPageClient trying to set non-existent appState.parties
- Remove incorrect attempt to set appState.parties[0]
- Party component already handles storing party data via storeParty
- Keep only the raid groups initialization

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 21:16:51 -07:00
74cdbe5c70 Fix dynamic translation key error handling
- Add proper fallback for undefined statusText in error alerts
- Prevent accessing 'errors.undefined' translation key
- Handle cases where axiosError.statusText is undefined

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 21:15:55 -07:00
903ab8aeb1 Fix translation pluralization format for next-intl
- Convert i18next pluralization format to next-intl ICU format
- Change from with_count_one/with_count_other to ICU plural syntax
- Update footer.remixes.label to use # for count formatting
- Update party.details.turns to use proper plural format

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 21:15:35 -07:00
59bd37e806 fix: update server components to match API response structure
- Change teamsData.parties to teamsData.results (API returns "results" not "parties")
- Change teamsData.pagination to teamsData.meta (API returns "meta" not "pagination")
- Map meta.count to record_count for pagination
- Use page parameter for current_page instead of expecting it from API
- Fix raidGroups to use direct array instead of .raid_groups property

Aligns frontend expectations with actual backend API response format

🤖 Generated with Claude Code
https://claude.ai/code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 20:41:45 -07:00
8ea7c95446 fix: import useSearchParams from next/navigation instead of next-intl
- Remove useSearchParams from next-intl's createNavigation exports
- Import useSearchParams directly from next/navigation in client components
- Fixes "useSearchParams is not a function" error
- Affected components: TeamsPageClient, ProfilePageClient, SavedPageClient, PartyHeader

next-intl's createNavigation doesn't export useSearchParams, it must be
imported from Next.js directly

🤖 Generated with Claude Code
https://claude.ai/code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 20:41:21 -07:00
727549db6b refactor: migrate App Router pages to locale segments
- Move all App Router pages under [locale] dynamic segment
- Update layout to handle locale params and server-side version fetch
- Remove duplicate pages from root app directory
- Add generateStaticParams for static generation of locale routes
- Update Header component for locale-aware navigation
- Update about page to use next-intl hooks

🤖 Generated with Claude Code
https://claude.ai/code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 20:19:47 -07:00
b7bf44498b feat: implement server-side version fetching with hydration
- Add VersionHydrator component to sync server data to client state
- Update UpdateToastClient to use valtio reactivity with useSnapshot
- Ensure version data is fetched server-side and properly hydrated
- Fix issue where appState.version was never populated from backend

🤖 Generated with Claude Code
https://claude.ai/code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 19:59:08 -07:00
3b6fb6fe04 feat: add missing translation keys for modals
- Add summon modal messages for remove confirmation
- Add weapon modal messages for remove confirmation
- Update translation variable format from {{var}} to {var} for next-intl
- Add version formatting keys for updates

🤖 Generated with Claude Code
https://claude.ai/code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 19:53:56 -07:00
b34cc8a4eb refactor: migrate all components from next-i18next to next-intl
- Update all component imports from useTranslation to useTranslations
- Replace react-i18next and next-i18next imports with next-intl
- Convert Trans components to t.rich() for rich text formatting
- Update all translation hook usage to next-intl API

This affects 80+ component files across the codebase including:
- Character, weapon, summon components
- Auth modals (login, signup, account)
- Party management components
- Filter and search components
- Toast notifications
- About pages and content updates

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 19:48:04 -07:00
a9493402e2 fix: exclude API routes from i18n middleware processing
- Skip intl middleware for /api/* routes to prevent 404 errors
- Ensures API endpoints remain accessible without locale prefixes
- Fixes version endpoint that was returning 404

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 19:47:20 -07:00
95ce20bdab feat: setup next-intl for App Router i18n support
- Add next-intl package and remove next-i18next
- Configure next-intl plugin in next.config.js
- Create i18n configuration with locale settings
- Setup i18n request handler and navigation utilities
- Define supported locales (en, ja) with English as default

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 19:46:42 -07:00
c33de6f2a6 Fix Party component interface and remove incompatible head components
- Update NewPartyClient and PartyPageClient to pass correct props to Party component
- Remove SavedHead and ProfileHead usage from client components (incompatible with App Router)
- Create debugging wrapper for Party component
- Update webpack SVG configuration with safety checks
- Add TypeScript declarations for SVG imports
- Document all fixes in PRDs

These changes address the "Element type is invalid" error by fixing component interfaces
and removing Pages Router patterns incompatible with App Router.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 02:20:21 -07:00
218a524b55 Fix Party component interface and remove unstable_cache
- Update NewPartyClient and PartyPageClient to use correct Party props
- Remove unstable_cache from all data fetching functions
- Fix viewport metadata configuration in App Router
- Restore ToastViewport component in layout
- Fix import paths from 'types' to '~types' in Party components
- Add comprehensive PRD documenting the fixes

This addresses the interface mismatch between Party component and its
client wrappers that occurred during the App Router migration.
2025-09-01 19:06:22 -07:00
1775f3f5b6 Add PRD for fixing app router caching issues
- Document viewport metadata configuration issue
- Document dynamic data in cached functions issue
- Outline migration strategy for Next.js 15
- List all affected files and required changes
2025-09-01 16:44:36 -07:00
c6b53eb538 Migrate all remaining components to App Router navigation
- Add 'use client' directives to all remaining components
- Update imports from next/router to next/navigation
- Replace router.locale with getCookie('NEXT_LOCALE')
- Update LanguageSwitch to use router.refresh()
- Replace router.asPath with usePathname()

Components migrated:
- Common: SelectWithInput, Editor
- Layout: Header, Layout, MentionList, ElementToggle
- Misc: UpdateToast, SearchModal, RaidCombobox, FilterModal
- Misc: ChangelogUnit, HovercardHeader, LanguageSwitch
- Extra: GuidebookUnit, GuidebookResult
- Reps: GridRep, CharacterRep, WeaponRep, SummonRep

Added migration PRD documentation to track progress.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 16:31:18 -07:00
d48bdf25b6 Migrate job and mastery components to App Router navigation
- Add 'use client' directives to all job and mastery components
- Update imports from next/router to next/navigation
- Replace router.locale with getCookie('NEXT_LOCALE')

Job components migrated:
- JobSkillItem, JobSection, JobDropdown, JobAccessoryPopover
- JobAccessoryItem, JobSkillResult, JobImage

Mastery components migrated:
- ExtendedMasterySelect, AxSelect, AwakeningSelectWithInput

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 16:30:27 -07:00
36c101211f Migrate weapon and summon components to App Router navigation
- Add 'use client' directives to all weapon and summon components
- Update imports from next/router to next/navigation
- Replace router.locale with getCookie('NEXT_LOCALE')

Weapon components migrated:
- WeaponUnit, WeaponModal, WeaponKeySelect, WeaponHovercard
- WeaponConflictModal, WeaponResult, WeaponLabelIcon

Summon components migrated:
- SummonUnit, SummonHovercard, SummonResult

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 16:30:06 -07:00
c7410326ff Migrate character components to App Router navigation
- Add 'use client' directives to all character components
- Update imports from next/router to next/navigation
- Replace router.locale with getCookie('NEXT_LOCALE')
- Maintain type safety with proper type casting

Components migrated:
- CharacterUnit, CharacterModal, CharacterHovercard
- CharacterConflictModal, CharacterResult

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 16:28:53 -07:00
5cf9e9a40a Migrate party components to App Router navigation
- Add 'use client' directives to all party components
- Update imports from next/router to next/navigation
- Replace router.locale with getCookie('NEXT_LOCALE')
- Replace router.asPath with usePathname()
- Maintain all existing functionality

Components migrated:
- Party, PartyDropdown, PartyFooter, PartyHead, PartyHeader

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 16:26:49 -07:00
007def51a2 Migrate auth components to App Router navigation
- Update LoginModal, SignupModal, and AccountModal to use next/navigation
- Add 'use client' directives to auth components
- Replace router.locale with getCookie('NEXT_LOCALE')
- Update changeLanguage utility to work with App Router
- Replace router.reload() with router.refresh()

All auth flows now use App Router navigation patterns.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 16:24:49 -07:00
98604e698b Remove conflicting Pages Router files and fix App Router setup
- Remove duplicate route files that conflicted with App Router
- Create client-side Providers wrapper for React context providers
- Update app/layout.tsx to use client wrapper for providers
- Fix next/font import in pages/_app.tsx

This resolves the routing conflicts and React context errors when
running the app with both Pages and App routers.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 16:24:09 -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