Commit graph

13 commits

Author SHA1 Message Date
5c9b01d428 Merge main into fix-auth-hydration and resolve conflicts 2025-09-03 17:31:45 -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
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
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
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
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