diff --git a/AGENTS.md b/AGENTS.md index 2b0bac4..95c1a20 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1802,6 +1802,6 @@ For questions, issues, or contributions: --- -**Last Updated**: November 24, 2025 -**Version**: 2.3.2 - Username Validation & Lobby Refactor +**Last Updated**: November 26, 2025 +**Version**: 2.3.3 - Components Architecture Refactor **Status**: ✅ Production Ready (API + Web + Docker + Timer Sync + Calibration) diff --git a/README.md b/README.md index 8f5311a..624275a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **League of Legends Website Tool: Easily Time and Communicate Summoner Spells - THE FLASH! 🌟** -[![Version](https://img.shields.io/badge/version-2.3.2-brightgreen?style=flat)](https://github.com/yourusername/LolTimeFlash/releases) +[![Version](https://img.shields.io/badge/version-2.3.3-brightgreen?style=flat)](https://github.com/yourusername/LolTimeFlash/releases) [![Next.js](https://img.shields.io/badge/Next.js-16.0.1-black?style=flat&logo=next.js)](https://nextjs.org/) [![TypeScript](https://img.shields.io/badge/TypeScript-5.7.2-blue?style=flat&logo=typescript)](https://www.typescriptlang.org/) [![Socket.IO](https://img.shields.io/badge/Socket.IO-4.8.1-010101?style=flat&logo=socket.io)](https://socket.io/) diff --git a/VERSIONS.md b/VERSIONS.md index 124f60d..7f123cf 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -7,6 +7,46 @@ ## 📚 Version History +### Version 2.3.3 - November 2025 (Components Architecture Refactor) + +**Refactoring** : + +- ♻️ **Components Organization** : Réorganisation des composants en dossiers logiques (`game/`, `room/`, `status/`, `controls/`) +- 🔄 **Path Aliases Migration** : Migration de tous les imports relatifs vers des alias TypeScript (`@/features/game/...`) +- 📁 **Simplified Structure** : Suppression des dossiers `ui/` et `input/` inutiles + +**Technical Changes** : + +**Frontend** : +- Nouvelle structure : `components/game/`, `components/room/`, `components/status/`, `components/controls/` +- Migration complète des imports relatifs vers `@/features/game/...` +- Création de barrel exports (`index.ts`) pour chaque dossier +- Amélioration du support IDE (autocomplete, refactoring) + +**Fichiers Modifiés** : + +| Fichier | Changements | +| ------------------------------------------------------------ | ---------------------------------------------- | +| `apps/web/features/game/components/game/*` | Déplacés depuis root, imports mis à jour | +| `apps/web/features/game/components/room/*` | Déplacés depuis root, imports mis à jour | +| `apps/web/features/game/components/status/*` | Déplacés depuis root, imports mis à jour | +| `apps/web/features/game/components/controls/*` | Déplacés depuis root, imports mis à jour | +| `apps/web/features/game/components/*.tsx` | Imports mis à jour vers alias | +| `apps/web/features/game/screens/*.tsx` | Imports mis à jour vers alias | +| `apps/web/features/game/contexts/*.tsx` | Imports mis à jour vers alias | +| `apps/web/features/game/hooks/*.ts` | Imports mis à jour vers alias | +| `apps/web/features/game/constants/*.ts` | Imports mis à jour vers alias | + +**Impact** : + +- ✅ Organisation améliorée (composants groupés par fonctionnalité) +- ✅ Imports cohérents (tous utilisent des alias) +- ✅ Support IDE amélioré (autocomplete, refactoring) +- ✅ Maintenabilité accrue (navigation facilitée) +- ✅ Scalabilité améliorée (ajout de composants simplifié) + +--- + ### Version 2.3.2 - November 2025 (Username Validation & Lobby Refactor) **New Features** : diff --git a/apps/web/components/ui/drawer.tsx b/apps/web/components/ui/drawer.tsx new file mode 100644 index 0000000..6a0ef53 --- /dev/null +++ b/apps/web/components/ui/drawer.tsx @@ -0,0 +1,118 @@ +"use client" + +import * as React from "react" +import { Drawer as DrawerPrimitive } from "vaul" + +import { cn } from "@/lib/utils" + +const Drawer = ({ + shouldScaleBackground = true, + ...props +}: React.ComponentProps) => ( + +) +Drawer.displayName = "Drawer" + +const DrawerTrigger = DrawerPrimitive.Trigger + +const DrawerPortal = DrawerPrimitive.Portal + +const DrawerClose = DrawerPrimitive.Close + +const DrawerOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName + +const DrawerContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + +
+ {children} + + +)) +DrawerContent.displayName = "DrawerContent" + +const DrawerHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DrawerHeader.displayName = "DrawerHeader" + +const DrawerFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DrawerFooter.displayName = "DrawerFooter" + +const DrawerTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DrawerTitle.displayName = DrawerPrimitive.Title.displayName + +const DrawerDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DrawerDescription.displayName = DrawerPrimitive.Description.displayName + +export { + Drawer, + DrawerPortal, + DrawerOverlay, + DrawerTrigger, + DrawerClose, + DrawerContent, + DrawerHeader, + DrawerFooter, + DrawerTitle, + DrawerDescription, +} diff --git a/apps/web/components/ui/select.tsx b/apps/web/components/ui/select.tsx new file mode 100644 index 0000000..6014d78 --- /dev/null +++ b/apps/web/components/ui/select.tsx @@ -0,0 +1,161 @@ +"use client" + +import * as React from "react" +import * as SelectPrimitive from "@radix-ui/react-select" +import { FaCheck } from "react-icons/fa" +import { HiChevronDown, HiChevronUp } from "react-icons/hi" + +import { cn } from "@/lib/utils" + +const Select = SelectPrimitive.Root + +const SelectGroup = SelectPrimitive.Group + +const SelectValue = SelectPrimitive.Value + +const SelectTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + span]:line-clamp-1", + className + )} + {...props} + > + {children} + + + + +)) +SelectTrigger.displayName = SelectPrimitive.Trigger.displayName + +const SelectScrollUpButton = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)) +SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName + +const SelectScrollDownButton = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)) +SelectScrollDownButton.displayName = + SelectPrimitive.ScrollDownButton.displayName + +const SelectContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, position = "popper", ...props }, ref) => ( + + + + + {children} + + + + +)) +SelectContent.displayName = SelectPrimitive.Content.displayName + +const SelectLabel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +SelectLabel.displayName = SelectPrimitive.Label.displayName + +const SelectItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + + + + {children} + +)) +SelectItem.displayName = SelectPrimitive.Item.displayName + +const SelectSeparator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +SelectSeparator.displayName = SelectPrimitive.Separator.displayName + +export { + Select, + SelectGroup, + SelectValue, + SelectTrigger, + SelectContent, + SelectLabel, + SelectItem, + SelectSeparator, + SelectScrollUpButton, + SelectScrollDownButton, +} + diff --git a/apps/web/features/game/components/game-controls.component.tsx b/apps/web/features/game/components/controls/game-controls.component.tsx similarity index 90% rename from apps/web/features/game/components/game-controls.component.tsx rename to apps/web/features/game/components/controls/game-controls.component.tsx index 6506ded..4e295c4 100644 --- a/apps/web/features/game/components/game-controls.component.tsx +++ b/apps/web/features/game/components/controls/game-controls.component.tsx @@ -23,7 +23,7 @@ const GameControlsComponent = (props: IGameControlsProps) => { <> {/* Back Button */} + + + + + + + + + + + + ) +} + +export const MobileUserListDrawer = memo( + MobileUserListDrawerComponent, + (prev, next) => { + if (prev.users.length !== next.users.length) return false + return prev.users.every((user, index) => user === next.users[index]) + } +) diff --git a/apps/web/features/game/components/room/mobile-user-list.component.tsx b/apps/web/features/game/components/room/mobile-user-list.component.tsx new file mode 100644 index 0000000..6aa4411 --- /dev/null +++ b/apps/web/features/game/components/room/mobile-user-list.component.tsx @@ -0,0 +1,34 @@ +'use client' + +import { memo } from 'react' + +interface IMobileUserListProps { + users: string[] +} + +const MobileUserListComponent = (props: IMobileUserListProps) => { + const { users } = props + + if (users.length === 0) return null + + return ( +
    + {users.map((user, index) => ( +
  • + +

    + {user} +

    +
  • + ))} +
+ ) +} + +export const MobileUserList = memo(MobileUserListComponent, (prev, next) => { + if (prev.users.length !== next.users.length) return false + return prev.users.every((user, index) => user === next.users[index]) +}) diff --git a/apps/web/features/game/components/room-info.component.tsx b/apps/web/features/game/components/room/room-info.component.tsx similarity index 100% rename from apps/web/features/game/components/room-info.component.tsx rename to apps/web/features/game/components/room/room-info.component.tsx diff --git a/apps/web/features/game/components/user-list.component.tsx b/apps/web/features/game/components/room/user-list.component.tsx similarity index 83% rename from apps/web/features/game/components/user-list.component.tsx rename to apps/web/features/game/components/room/user-list.component.tsx index 10414c9..937fdc9 100644 --- a/apps/web/features/game/components/user-list.component.tsx +++ b/apps/web/features/game/components/room/user-list.component.tsx @@ -10,7 +10,7 @@ const UserListComponent = (props: IUserListProps) => { if (users.length === 0) return null return ( -
    +
      {users.map((user, index) => (
    • { if (isConnected) { return ( -
      +
      Connected
      @@ -24,9 +24,9 @@ const ConnectionStatusComponent = (props: IConnectionStatusProps) => { return (