Commit Graph

92 Commits

Author SHA1 Message Date
76b68c0ea6 refactor(ws): unify WebSocket topic handling and add event subscription
- Refactor `WebSocketService` and `common.ts` to use a unified topic system instead of custom prefixes.
- Replace manual topic string concatenation with `getEventSubKey` and defined `WsServerSendTopics` types.
- Update client-side components (`EventCard`, `GroupingPrediction`) to support real-time event subscriptions and notifications.
- Move `useAuthSocket` and `WebScoketContext` initialization into `AppBarLayout` to ensure WebSocket state is available globally.
- Add error handling to WebSocket message processing in the Bun server.
- Implement a manual "Refresh Current Scores" button for `GroupingPrediction` to fetch fresh `nowScore` data.
- Update `HydrateFallback` UI to display a loading message instead of a refresh button during long load times.
- Add Service Worker (`sw.js`) build route to the Bun server configuration.
2026-03-22 13:00:50 +09:00
fd8257e194 feat(api): add user location management endpoints and database model
- Added `UserLocation` model to `prisma/schema.prisma` to store user location data including coordinates (point geometry), name, avatar, and bindings to Logto and Kaiqiu users.
- Created new API endpoints under `/api/account/location` to handle location operations:
  - `POST`: Create a new location record for a user.
  - `GET`: Retrieve nearby locations based on latitude and longitude.
  - `PUT`: Update an existing location record, including coordinate updates via spatial index.
  - `DELETE`: Remove a specific location record.
- Integrated the custom spatial operations from `xprisma` DAO to support geospatial queries and updates.
- Updated dependencies to include `@mui/icons-material` (and its peer dependencies like `prop-types` and `react-transition-group` which are implicitly required by the new icon components).
- Implemented `verifyLogtoToken` logic to secure the new endpoints and associate locations with authenticated users.

No breaking changes in API contracts; new endpoints are additive.
2026-03-19 00:29:02 +09:00
5168bdca29 feat(user-center): enhance loading fallback and avatar display
- Update HydrateFallback to show a refresh button after 10 seconds of loading
- Improve UserCenter avatar by using username/name as fallback when image is missing
- Add /dev route pointing to HydrateFallback component
2026-03-18 10:02:45 +09:00
3be476ad13 feat(UserCenter): add background change functionality
This commit introduces a new `ChangeBackground` component into the User Center page.
The component is now rendered before the main content to dynamically update the
background based on the user's picture URL.

- Added import for `ChangeBackground` component.
- Integrated `ChangeBackground` with the user's picture URL (falling back to empty string if unavailable).
- No breaking changes or migration required.
2026-03-18 01:59:21 +09:00
845a50253b chore: refactor dockerfile for prisma migration and build optimization
Refactor the Dockerfile to separate dependency installation and type
generation from the runtime environment.

Changes:
- Moved `bun prisma generate` to the build phase to ensure type definitions
  are created during image build rather than at runtime.
- Updated the ENTRYPOINT to run `bun prisma migrate deploy` before starting
  the application. This ensures database migrations are applied automatically
  upon container startup, supporting production deployments with incremental
  schema changes.
- Added missing newline at the end of the file for compliance.

This change ensures that the application handles schema updates safely in
production without requiring a separate migration step outside the container.
2026-03-18 01:39:54 +09:00
1793c10b45 feat(components): add navigation to profile on UID click
- Modified `BindKaiqiuAccount` to wrap the UID text in a clickable `Flex` component.
- Added an `ExportOutlined` icon to indicate the actionable link.
- Implemented navigation to `/profile/{uid}` when the UID section is clicked, utilizing the `useNavigate` hook.
- Imported the new icon and navigation hook to support this interaction.
2026-03-18 01:30:23 +09:00
c70aeda412 feat(auth): add Kaiqiu account binding and update WebSocket architecture
- Add `UserBind` model to Prisma schema for linking Logto and Kaiqiu user IDs.
- Implement `/api/account/bind` endpoint (GET/PUT) to handle Kaiqiu account binding and retrieval.
- Refactor `KaiqiuService` to include a `login` method that performs browser automation-like login on kaiqiuwang.cc using `cheerio` and `fetch`.
- Update `UserCenter` page to include a new `BindKaiqiuAccount` component.
- Restructure `WebSocketService`:
  - Change from a simple global connection map to a per-user client tracking system (`#userClients`).
  - Update topic naming conventions (e.g., `ONLINE_MEMBER_CHANGE` -> `MEMBER_CHANGE`).
  - Add client-side broadcast capabilities for user-specific events like `MY_CLIENT_ONLINE`.
  - Add support for dynamic subscription handling (SUB/UNSUB) via WebSocket messages.
- Update `verifyLogtoToken` to accept either `Headers` or a raw token string for flexibility in WebSocket auth.
- Minor fixes: typo corrections in `WSTopic` enum and commented out debug logs.

BREAKING CHANGE: WebSocket payload structure has changed.
The `ws.data` property now contains a `WsPaylaod` object with a `user` field (previously it was a JSON string of the JWT payload).
The `WSTopic` names have been updated (e.g., `ONLINE_MEMBER_CHANGE` is now `MEMBER_CHANGE`), requiring updates to any client code subscribing to these topics.
2026-03-18 01:18:34 +09:00
09f3ecaca6 feat(WebSocket & Event System): Add real-time updates and event subscription
Introduces WebSocket connectivity for live data updates and a new subscription model for events.

Key changes:
- Integrated WebSocketService to handle open, message, and close events via the /ws endpoint.
- Added EventSubscribeService APIs to manage user subscriptions to specific events (matchId) via REST endpoints (`/api/subscribe-event` and `/api/subscribe-event/:matchId`).
- Implemented custom message protocol (JSON format) for WebSocket communication with defined topics (ONLINE_MEMBER_CHANGE, etc.).
- Updated database schema to include the `EventSubs` model for storing subscriptions.
- Refactored Dockerfile to use `bun prisma db push` for database migrations on startup.
- UI Updates:
  - Replaced the Rate component in FavButton with Star icons for better UX.
  - Adjusted layout of FavButton to be absolute positioned.
  - Added debounce to ClubSummary data fetching.
  - Removed unused `isMobile` import from ClubSummary.
- Utilities: Added helper functions `toCustomMessage` and `fromCustomMessage` for parsing WebSocket messages.
2026-03-17 17:26:52 +09:00
c7faeb1b65 feat(api-versioning): remove git-based versioning and serve via HTML script tag
- Remove `getGitHash` function from `src/utils/server.ts` as it relied on `.git` directory presence which is not available in production builds.
- Remove the `/api/app-version` endpoint from `src/index.tsx` since fetching version via API is no longer needed.
- Update `src/hooks/useAppVersion.ts` to derive the version directly from the `src` attribute of a script tag in the HTML head.
- This change improves performance by avoiding an extra API request and ensures version accuracy across all deployment environments without requiring Git metadata.
2026-03-17 11:23:25 +09:00
eef4656f87 fix(page): remove unused Antd imports and protect "log in to view cloud collection" button
- Removed unused imports from Ant Design (`message as AntdMessage`, `StarFilled`, `ShopTwoTone`, `DeleteOutlined`, `UploadOutlined`) and `@ant-design/icons`.
- Removed unused `type IdTokenClaims` import from `@logto/react`.
- Updated the logic in the empty list state: the "Log in to view cloud collection" button now only displays when the user is NOT authenticated (`!isAuthenticated`). Previously, it showed even when logged in, which was misleading.

This cleans up the codebase and improves the user experience on the Favorite Players page.
2026-03-17 11:02:35 +09:00
f7cd596084 feat(ui): add app version display and API
- Add `getGitHash` utility to extract the git commit hash from the `.git/HEAD` file.
- Expose a new `/api/app-version` endpoint on the server to return the current version.
- Implement a `useAppVersion` hook to fetch the version asynchronously.
- Display the app version (e.g., `app version: a1b2c3d`) in the User Center UI for both authenticated and unauthenticated users.
- This helps in tracking which version of the application is currently running in production.
2026-03-17 10:57:10 +09:00
05200c8d48 style(AppBar): adjust container positioning and width
The AppBar container was previously positioned exactly at the bottom of the viewport, causing a potential 1px gap or overflow issue on certain screens.

- Changed `bottom` from `0` to `-1px` to pull the bar slightly up.
- Adjusted `left` to `-2px` and `width` to `calc(100vw + 4px)` to compensate for the negative left offset and ensure the bar spans the full visible area without horizontal scroll.

This ensures the fixed bar aligns perfectly with the viewport edges in all scenarios.
2026-03-16 23:57:34 +09:00
f29974c111 refactor(BattleTable): extract resultMap logic and simplify table building
- Move `initResultMap` and `buildMatchGroupTable` outside the component to reduce closure dependencies.
- Update `ClubEventList` to remove obsolete page key storage logic.
- Add `MATCH_RESULT_MAP_KEY` constant to `utils/constants.ts`.
- Refactor `useMemo` and `useCallback` hooks to rely on the extracted functions.
- Ensure consistent dependency arrays in callbacks for reliable re-renders.
2026-03-16 23:46:22 +09:00
ce5c523efb fix(index): update event URL format in server configuration
- Changed the `url` property in the serve configuration from a commented-out placeholder to an active template string.
- The new URL format `https://tt.ksr.la/event/${e.matchId}` replaces the previous implementation where the URL was disabled.
- This ensures that event links are correctly generated and clickable within the calendar view, improving user navigation to event details.
2026-03-16 22:45:42 +09:00
86c3b6651b feat(fav-players): optimize un-fav API response and refactor player list UI
- Modify the DELETE /api/fav endpoint to include the player uid in the response JSON.
- Refactor FavPlayersPage to remove explicit dependency on `aud` for API calls, relying solely on `useAuthHeaders`.
- Add a dedicated "un-fav" button to player cards to allow users to unfollow individual players.
- Implement logic to distinguish between local un-fav (for unauthenticated users) and server-side un-fav (for authenticated users).
- Improve UI layout using `styled-components` and updated Ant Design components (`Typography.Title`).
- Add a link to sign in and view cloud favorites when the local list is empty.
2026-03-16 19:33:44 +09:00
2d928ab1e3 feat: configure Logto scopes and externalize appId
- Add 'admin' scope to Logto configuration in frontend.tsx.
- Externalize Logto appId to common.ts utils for better configuration management.
- Remove `isAuthExpired` check in UserCenter.tsx and always show the "Re-login" button.
2026-03-16 14:30:23 +09:00
1b01cff7d7 refactor: extract club header logic into ClubSummary component and simplify ClubEventsPage
- Moved header logic (background, avatar, title, notice button) from ClubEventsPage into a new ClubSummary component.
- Updated ClubEventsPage to use ClubSummary instead of managing layout and state directly.
- Fixed `onClick` handler in ClubSummary to correctly spread the `info.geo` object when passing to `openWebMapRaw`.
- Removed unused imports and state from ClubEventsPage.
2026-03-16 13:46:49 +09:00
f188b4eac4 refactor: centralize Logto config and improve auth flow
- Centralized Logto domain and API base URLs in `common.ts` to avoid duplication.
- Replaced deprecated `Modal.useModal` with `App.useApp().modal` for consistent Ant Design usage.
- Refactored `useAutoLogin` hook to handle token expiration checks and trigger re-authentication.
- Updated `UserCenter` and `FavPlayersPage` to use the new `autoSignIn` flow.
- Removed the `useAuthHeaders` hook as logic was consolidated into `useAutoLogin`.
- Added `AUTH_CALLBACK_URL` and `USER_CENTER_URL` constants for cleaner routing.
2026-03-16 13:38:02 +09:00
de05ca2ecf feat: fallback to auto-login on token failure and improve redirect logic
- In `useAuthHeaders`, import `useAutoLogin` and trigger login if `getAccessToken` returns a falsy value. This handles edge cases where the token is expired or missing during an API call.
- In `useAutoLogin`, set the default redirect URL to `window.location.pathname` to ensure users return to the page they were on before logging in.
2026-03-16 12:51:39 +09:00
9c9b3735cb feat: migrate user fav system from session aud to Logto sub
- Update database schema to rename `UserFav` to `LogtoUserFav` with clearer field names (`logto_uid`, `kaiqiu_uid`).
- Bump `jose` dependency to v6.2.1 for improved JWT verification.
- Configure `@logto/react` to request the correct resource token for API access.
- Implement token verification on the server side using `jose` and `jwtVerify`.
- Update API routes (`/api/fav`) to extract the user ID from the verified JWT `sub` claim instead of the URL `aud` parameter.
- Refactor frontend components (`FavButton`, `FavePlayersPage`) to use `useAuthHeaders` for fetching auth headers instead of manual token claims extraction.
- Clean up unused migration and DAO functions related to the old `aud`-based logic.
2026-03-16 12:45:12 +09:00
ba8dfdf973 feat: add apple-touch-icon for iOS device support
Added link to ./logo.jpg as an apple-touch-icon in index.html to
ensure proper icon display when users add the site to their home
screen on iOS devices.
2026-03-16 10:02:45 +09:00
c4f28ae471 feat(app-bar): detect standalone mode and adjust padding
- Added `isRunningStandalone` utility in `src/utils/front.ts` to detect if the app is running as a standalone PWA or in a native container (iOS Safari, Android Chrome, etc.).
- Updated `AppBar.tsx` to conditionally apply bottom padding only when running in standalone mode, ensuring better layout alignment within custom containers.
2026-03-16 09:43:07 +09:00
93f2cd6525 fix(index): trim club name from event titles and simplify calendar name
- Modified `title` generation to remove the club name prefix if it exists.
- Updated `calName` to display only the club name instead of adding "的比赛" suffix.
- This prevents redundant information in the calendar event titles.
2026-03-16 02:10:56 +09:00
4b69ed3b84 refactor(front-end): switch to web-based map navigation and update layouts
- Update `openMapDirection` to `openWebMapRaw` in `utils/front.ts` to open
  maps in a new browser tab (`_blank`) using raw WGS-84 coordinates.
- Adjust URL schemes for Google, AMap, Baidu, Tencent, and Apple Maps to
  support direct web navigation with `coordinate` parameters.
- Update `ClubSummary.tsx` to use `openWebMapRaw` and change the map button
  label from "Navigation" to "View Location" with a new icon.
- Add `padding-bottom` to `AppBar.tsx` in `AppBarLayout.tsx` to accommodate
  the increased bottom padding required by the updated AppBar styling.
- Remove the "Home" FloatButton from `ProfilePage.tsx` and update `routes.tsx`
  to remove the unused `ActionButtonLayout` import.
- Update navigation handlers in `AppBar.tsx` to use `replace: true` for smoother
  state management without creating new browser history entries.
2026-03-16 02:04:06 +09:00
2f8ce1711f feat(club-summary): add map navigation and optimized article display
- Added a "Navigation" button in ClubSummary that opens a Dropdown menu.
- Supported multiple map types: Google, Apple, AMap, Tencent, and Baidu.
- Mobile-only features (AMap, Tencent, Baidu) are disabled on desktop devices.
- Added `geo` property to `ClubDetail` type to support location data.
- Implemented `openMapDirection` utility to launch specific map apps based on the selected type.
- Conditionally render the "View Announcement" button only if an article exists.
- Updated BaseLayout export name from `Layout` to `BaseLayout` for consistency.
2026-03-15 10:44:48 +09:00
6bcbff572e fix(i18n): normalize event date parsing for ICS export
- Update `src/index.tsx` to use a unified `ics.convertTimestampToArray` helper
  instead of manually parsing formatted strings. This ensures consistent timestamp
  handling across different environments.
- Remove the custom `HydrateFallback` and `Layout` components from `src/routes.tsx`.
- Import the existing `HydrateFallback` and `Layout` implementations from their
  respective component files (`./components/HydrateFallback` and `./components/Layout/BaseLayout`) to reduce code duplication and improve maintainability.
2026-03-15 09:13:57 +09:00
7103c5f7e3 refactor(components): migrate to Ant Design Statistic.Timer and remove useRunOnce
- Deleted the custom `useRunOnce` hook as its functionality is no longer needed.
- Refactored `EventCard` to determine `type` (countup/countdown) dynamically based on the event state and current time.
- Updated `EventCard` to pass `type` and `format` separately to the `Statistic.Timer` component, removing the need for string formatting logic inside the component.
- Modified `ClubEventList` to add a 300ms delay on page initialization, ensuring the component is fully mounted before triggering the initial fetch logic.
2026-03-15 08:42:53 +09:00
0f9e80856b refactor(components): optimize event list and search table with pagination persistence
- Refactor ClubEventList to support persistent page state in sessionStorage and dynamic toggle for finished events.
- Move pagination logic to useRunOnce hook for initialization, ensuring correct state restoration.
- Update ClubSearchTable to support "My Favorites" tab, using useRef to cache search results for different club types.
- Enhance EventCard with precise time formatting (HH:mm:ss) and dynamic countdown logic using dayjs timezone.
- Persist club selection in GameSelector using local storage and integrate ClubSummary component.
- Fix geo data handling in KaiqiuService, ensuring coordinates are correctly passed to iCalendar generator.
- Remove unused imports and simplify component structure across affected files.
2026-03-15 02:33:34 +09:00
4825f41337 fix: conditionally apply geo and location fields in calendar events
- Only include 'geo' object in the event attributes if valid latitude/longitude exists.
- Conditionally add 'location' field only when it is present on the event.
- Removed the 'noGeo' flag logic for conditional spreading, simplifying the map operation.
- Ensures clean event data without empty geo/location properties in the generated calendar file.
2026-03-14 20:10:47 +09:00
9657acea64 feat(club): upgrade event calendar subscription and add match status display
- Refactor ClubEventList to subscribe to all club events instead of just the current page, removing pagination from the ICS URL.
- Enhance ICS generation for club subscriptions:
  - Fetch all non-finished events across pages.
  - Include geographic location (lat/lon) in the event metadata.
  - Add 2-hour alarms (display and audio) to all subscribed events.
- Improve EventCard status display with logic for 'Finished', 'In Progress', and countdown formats.
- Update KaiqiuService to parse match status (isProcessing, isFinished) and location name accurately.
- Integrate dayjs timezone (Asia/Tokyo) and UTC plugins across index.tsx, services, and types.
- Update IEventInfo interface to include isProcessing and location fields.
2026-03-14 19:56:48 +09:00
aef89d2341 feat(club): add club type filtering and optimize event list display
- Add 'Club' vs 'Points Club' filter in `ClubSearchTable` using Radio buttons.
- Update `searchClub` request to accept and pass `clubType` parameter to the backend API.
- Refactor logic in `ClubEventList` to determine "Show All" button visibility based on whether all items are finished or not finished, rather than just a fixed count.
- Add custom CSS (styled-components) to limit the height of the game selector drawer for better UX.
- Update backend service `KaiqiuService` to handle the new query parameters for filtering clubs by type.
2026-03-14 00:11:42 +09:00
99fd5778df feat: search club 2026-03-13 20:15:57 +09:00
457fc8595d feat(components, page): club events list pagination in it's self 2026-03-13 12:10:04 +09:00
d323e1d925 feat(game-selector): implement pagination and caching for event list
- Add 'ics' dependency to package.json and update lockfile.
- Introduce pagination support in `ClubEventList` component (Ant Design Pagination + Spin loading state).
- Refactor `GameSelector` to fetch paginated data (`page` query parameter) and manage page state.
- Update `KaiqiuService` to:
  - Add Redis caching for event lists (1 hour TTL) and individual match details (10 hours TTL).
  - Implement `listClubEvents` method with pagination support (fetching HTML, parsing titles/urls/status, extracting total count).
  - Update `getEventInfo` to utilize cached data.
- Update server routes (`index.tsx`, `routes.tsx`) to handle query parameters and pass paginated responses to the frontend.
- Fix logic in `GroupingPrediction` to set group length when players <= 12.

This change improves performance by reducing initial load times through pagination and caching, preventing UI freezing with large event lists.
2026-03-13 11:34:23 +09:00
b560684dfb feat(app): split game selector and implement club detail page
- **Frontend Refactoring**: Extracted EventCard logic and finished game filtering from GameSelector into a new ClubEventsList component. Removed direct routing logic (handleGameClick, navigate) from App.tsx in favor of router loaders.

- **New Feature - Club Detail Page**: Implemented /club/:id route with ClubEventsPage. Added server-side loader to fetch club info and events in parallel via new API endpoints (/api/club/find, /api/club/:id). Created KaiqiuService for direct data fetching.

- **API & Types**: Extended IEventInfo with isFinished flag; updated server-side parsing in utils/server.ts. Added ClubInfo type definition. Migrated club search and filtering logic to the server side.

- **Dependencies**: Updated antd from 6.2.1 to 6.3.2.
2026-03-13 10:27:05 +09:00
c239b8bf40 feat(GameSelector): Add button to view game details and update parsing logic 2026-03-12 14:24:59 +09:00
6f1f8044dd feat(BattleTable): share code 2026-03-11 18:08:39 +09:00
9044073afd feat: sync favorite player state with server and improve clear confirmation
- Add `isFav` selector to `useFavPlayerStore` to determine initial button state immediately.
- Initialize `FavButton` value based on the store's `isFav` result instead of a stale local state.
- In `FavePlayersPage`, integrate Ant Design message hooks for user feedback during server sync.
  - Show "syncing" loading indicator when starting the sync process.
  - Show "synced" success notification upon completion.
- Enhance the "Clear Local Favorites" confirmation dialog:
  - Update warning text to indicate the action is irreversible.
  - Add custom button labels ("清空", "取消").
  - Make the confirm button dangerous and add a delete icon for better UX.
2026-03-11 11:51:30 +09:00
62e9053c79 Refactor BattleTable and GroupMember components
- Updated the styling and structure of the BattleTable component for better layout and readability.
- Added expandable functionality to the GroupMember component's drawer.
- Adjusted styles and content in BattleTable to improve the visual presentation and functionality.
2026-03-11 11:26:06 +09:00
56159de837 feat: add score prediction and clear actions to BattleTable
- Add "Clear Current Round" and "Clear All Groups" buttons to reset specific or entire match results.
- Implement a summary Table showing current scores, predicted scores after the latest round, and score differentials.
- Import necessary Ant Design components (Button, Table) and icons (ClearOutlined).
- Refactor `buildMatchGroupTable` to return full arrays instead of filtering out falsy values.
- Disable row hover effect in GroupMember table for cleaner appearance.
2026-03-11 00:48:44 +09:00
bb4ca8ae40 feat: add localStorage persistence for battle result map
- Initialize `resultMap` from `localStorage` on component mount if data exists.
- Save updated `resultMap` back to `localStorage` when the component unmounts.
- Removed debug console.log statement for cleaner logs.
2026-03-10 17:21:44 +09:00
65195289bd refactor: extract BattleTable to dedicated component and add score calculation utils
- Move `BattleTable` logic from `GroupMember` to its own `BattleTable.tsx` component.
- Clean up `GroupMember` by removing unused imports (`Divider`, `Flex`, `Space`, `Table`, `getRoundTable`).
- Add new utility functions in `src/utils/common.ts`:
  - `higherWin` and `lowerWin` to calculate scores based on point difference thresholds.
  - `calculate` to determine the final score return value based on win/loss status.
2026-03-10 17:11:49 +09:00
cc23ca5594 feat(logto): handle redirect navigation after successful login
- Refactor `useHandleSignInCallback` to return only hook data without an internal callback.
- Move redirect logic into a separate `useEffect` to decouple navigation from the callback lifecycle.
- Ensure the user is redirected to the saved path or `/user-center` immediately upon authentication.
2026-03-10 13:46:49 +09:00
2315503388 feat(UserCenter): remove icon from logout modal cancel button
Remove the HomeOutlined icon from the cancel button of the logout
confirmation modal. The button now only displays the text "保持登录".
2026-03-10 12:51:47 +09:00
73354d0394 refactor(auth): migrate user center logout and refactor callback logic
- Migrate from static `Modal.confirm` to `App.useModal` in UserCenter for better context support.
- Refactor Logto Callback page:
  - Remove unused `useEffect` dependency on `isAuthenticated`.
  - Inline redirect logic directly into the `onSuccess` callback of `useHandleSignInCallback`.
  - Preserve existing redirect flow logic while simplifying the component structure.
2026-03-10 12:50:00 +09:00
2032cec715 fix(xcxApi): change redis cache key 2026-03-10 11:23:58 +09:00
54d275796e feat: add player profile cache & manual sync button
- Cache user profile data in Redis with 10-minute expiration in XcxAPI service to reduce API overhead.
- Added a refresh/sync button on FavPlayersPage to manually trigger fetching players from the account.
- Refactored authentication logic to properly set and use ID token claims for syncing.
- Improved UX by removing automatic view switching logic that caused layout shifts, relying on state-driven rendering instead.
- Unified login redirect flow using the new `useAutoLogin` hook.
2026-03-10 11:19:30 +09:00
06665f3371 feat(FavPlayersPage): cache 2026-03-09 17:52:40 +09:00
d0aee38df8 fix: display correct local player count in FavPlayersPage dropdown
Update the label for the LOCAL filter option to reference `localList.length` instead of `list.length`, ensuring the item count displayed in the dropdown matches the actual filtered list size.

File: src/page/FavPlayersPage.tsx
- { label: `${ShowType.LOCAL}(${list.length})`, ... }
+ { label: `${ShowType.LOCAL}(${localList.length})`, ... }
2026-03-09 17:49:11 +09:00
d171e496ff refactor(page): 合并本地与远程球员收藏列表逻辑并简化组件
- 将本地列表 (localList) 和请求数据 (favListRequest.data) 的映射逻辑统一至主 list useMemo 中。
- 移除冗余的 showList useMemo,直接基于 showType 动态生成 list。
- 修正 sortType 默认分支显式返回 localList,确保排序逻辑一致性。
- 更新依赖数组并清理未使用的 isAuthenticated 相关逻辑。
- 调整空状态判断条件以匹配新的 list 结构。
2026-03-09 17:16:21 +09:00