Review and refactor codebase with documentation updates#20
Merged
at-ok merged 1 commit intoNov 20, 2025
Merged
Conversation
## 主な変更点 ### 1. コード重複の削減 - 距離計算関数を lib/geometry.ts に統一(5ファイルから約200行削減) - ユーザーマッピング関数を lib/user-mapper.ts に統一(3ファイルから約90行削減) ### 2. 型安全性の向上 - hooks/useAuth.tsx で as any を完全除去 - user-mapper を活用した型安全なデータ変換 ### 3. 定数の一元化 - constants/ui-labels.ts を新規作成(ゲーム状態、ミッション、ロールラベル) - constants/game-config.ts を新規作成(ゲーム設定定数) ### 4. パフォーマンス最適化 - Map コンポーネントで useCallback によるメモ化 - gamemaster ページで重複 find() 呼び出しを削減 ### 5. エラーハンドリング強化 - useLocation でエラー状態を適切に設定 - API ルートでエラーログを改善 ### 6. ドキュメント更新 - README.md のディレクトリ構成を更新 - docs/REFACTORING.md を新規作成(詳細な改善記録) ## 新規ファイル - lib/geometry.ts - lib/user-mapper.ts - constants/ui-labels.ts - constants/game-config.ts - docs/REFACTORING.md ## 効果 - コード重複: 約300行削減 - 型安全性: as any 使用箇所 2 → 0 - 保守性とコード品質の大幅な向上
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
主な変更点
1. コード重複の削減
2. 型安全性の向上
3. 定数の一元化
4. パフォーマンス最適化
5. エラーハンドリング強化
6. ドキュメント更新
新規ファイル
効果