diff --git a/apps/web/docs/AUDIT_UI_SPOTIFY_DISCORD_20260210.md b/apps/web/docs/AUDIT_UI_SPOTIFY_DISCORD_20260210.md new file mode 100644 index 000000000..a6b0b379d --- /dev/null +++ b/apps/web/docs/AUDIT_UI_SPOTIFY_DISCORD_20260210.md @@ -0,0 +1,126 @@ +# Audit Frontend UI — Qualité Spotify/Discord (10 février 2026) + +Audit complet du frontend pour la phase d'amélioration UI autonome. Basé sur les documents existants et l'exécution des outils de vérification. + +--- + +## 1. Synthèse exécutive + +| Domaine | Score | Statut | +|---------|-------|--------| +| Design System & Tokens | 8.5/10 | 🟢 Mature | +| Valeurs arbitraires | 6.5/10 | 🟡 À migrer | +| Layout & Shell | 9/10 | 🟢 Excellent | +| Typographie | 8/10 | 🟢 Bon | +| Focus & Accessibilité | 8/10 | 🟢 Bon | +| États Loading/Error/Empty | 8/10 | 🟢 Bon | +| Cohérence visuelle | 8/10 | 🟢 Bon | + +--- + +## 2. Forces actuelles + +### 2.1 Design system +- **Tokens layout** : `index.css` définit sidebar, header, main, modales (`--layout-modal-max-height*`), lyrics, drawer, panel +- **Modales** : Les tokens `.max-h-layout-modal`, `.max-h-layout-modal-sm`, `.max-h-layout-modal-xs`, `.max-h-layout-modal-lg` existent et sont utilisés dans CreateAPIKeyModal, FlashSaleModal, LicenceDetailsModal, QuizModal, AddToPlaylistModal, NotificationBell, LyricsEditorModal +- **Ombres sémantiques** : `.shadow-card`, `.shadow-modal`, `.shadow-tooltip`, etc. +- **Transitions** : Durées tokenisées (`--duration-fast`, `--duration-normal`, etc.) + +### 2.2 Shell +- Sidebar, header, main alignés avec tokens +- Player positionné correctement +- Responsive documenté (lg breakpoint) + +### 2.3 Tests +- Playwright : smoke, auth, playlists, profile, upload, visual +- Config visuelle : `visual-complete.spec.ts`, `playwright.config.visual.ts` +- Storybook : stories full layout (Dashboard, Playlists, Library, Settings, Profile) + +--- + +## 3. Valeurs arbitraires à migrer (priorisées) + +### 3.1 Hauteurs critiques (composants visibles) + +| Fichier | Pattern | Recommandation | +|---------|---------|----------------| +| `ChatPage.tsx` | `h-[calc(100vh-6.25rem)]` | Token `--main-offset-top` ou nouvelle classe `h-layout-chat` | +| `LiveStreamDetailView.tsx` | `h-[calc(100vh-6rem)]` | `min-h-layout-main` ou token dédié | +| `ui/modal.tsx` | `h-[calc(100vh-2rem)]` | `max-h-layout-modal` | +| `ui/ImageCropper.tsx` | `h-[80vh]` | `max-h-layout-modal-sm` (80vh) | +| `ChatRoom.tsx` | `h-[50vh]` | `h-layout-lyrics-sm` (50vh) ou token | +| `ChatInput.tsx` | `h-[450px]`, `h-[400px]` | `max-h-layout-panel` ou `max-h-96` | +| `PlaybackSummary.tsx` | `h-[200px]` | `h-50` ou token chart | + +### 3.2 Largeurs arbitraires + +| Fichier | Pattern | Recommandation | +|---------|---------|----------------| +| `GlobalPlayer.tsx` | `max-w-[45%]` | `max-w-[min(45%,28rem)]` ou token | +| `ChatMessage.tsx` | `max-w-[80%]`, `max-w-[150px]` | `max-w-[80%]` acceptable (bubble) ; `min-w-36` ou `min-w-40` | +| `ChatInput.tsx` | `min-w-[150px]` | `min-w-36` (9rem) | +| `AstralBackground.tsx` | `w-[60%]`, `h-[60%]` | Documenter exception décorative | +| `data/Timeline.tsx` | `min-w-[200px]` | `min-w-50` (12.5rem) | + +### 3.3 Stories (priorité basse) +- `h-[400px]`, `h-[200px]`, `min-h-[400px]` → `min-h-layout-story` ou `min-h-layout-page-sm` avec commentaire +- `w-[300px]`, `w-[350px]`, `w-[500px]` → `w-80`, `w-96`, `max-w-xl` ou `min-h-layout-story` + +### 3.4 rounded-[var(--radius-xl)] → rounded-xl +- Le thème Tailwind expose `--radius-xl` ; la classe `rounded-xl` devrait exister +- Migrer `rounded-[var(--radius-xl)]` → `rounded-xl` et `rounded-[var(--radius)]` → `rounded-lg` (ou équivalent) + +### 3.5 NavigationProgress shadow +- `shadow-[0_0_10px_var(--primary)]` → token `--shadow-button-primary-glow` ou classe existante + +--- + +## 4. Composants à auditer (focus UI) + +1. **Player** : GlobalPlayer, PlayerExpanded, PlayerQueue — cohérence max-width, hauteurs +2. **Chat** : ChatPage, ChatInput, ChatMessage, ChatRoom — layout tokens +3. **Layout** : DashboardLayout, Sidebar, Header — vérifier pas de régression +4. **Modales** : ui/modal.tsx — aligner sur tokens + +--- + +## 5. Plan d'action (phases) + +### Phase 1 — Tokens layout (0 régression) +- Ajouter `h-layout-chat` (calc(100vh - 6.25rem)) et `min-h-layout-stream` si besoin +- Migrer ChatPage, LiveStreamDetailView, ui/modal vers tokens +- Migrer ChatRoom, ChatInput, ImageCropper vers tokens existants + +### Phase 2 — Largeurs et rounded +- GlobalPlayer : token ou max-w responsive +- ChatMessage : min-w scale Tailwind +- rounded-[var(...)] → rounded-xl / rounded-lg + +### Phase 3 — Stories et polish +- Stories : min-h-layout-story, min-h-layout-page-sm +- NavigationProgress : shadow token + +--- + +## 6. Commandes de vérification + +```bash +# Rapport arbitraire +npm run report:arbitrary + +# Tests +npm run test:e2e # Playwright (auth requise) +npm run test:visual # Capture visuelle +npm run test:storybook # Storybook audit +npm run lint +npm run typecheck +``` + +--- + +## 7. Fichiers de référence + +- `docs/DESIGN_TOKENS.md` +- `docs/APP_SHELL.md` +- `docs/UI_UX_AUDIT_DISCORD_SPOTIFY_QUALITY.md` +- `src/index.css` (lignes 95-135 : layout primitives) diff --git a/apps/web/docs/DESIGN_TOKENS.md b/apps/web/docs/DESIGN_TOKENS.md index 561ef88c7..af67f8389 100644 --- a/apps/web/docs/DESIGN_TOKENS.md +++ b/apps/web/docs/DESIGN_TOKENS.md @@ -99,6 +99,7 @@ Définis dans [index.css](../src/index.css). Référence complète : [APP_SHELL. - **Max heights (drawers, panels, lists)** : `--layout-drawer-max-height` (60vh), `--layout-panel-max-height` (70vh), `--layout-list-max-height` (25rem) — classes `.max-h-layout-drawer`, `.max-h-layout-panel`, `.max-h-layout-list`. - **Modales** : `--layout-modal-max-height` (85vh), `--layout-modal-max-height-sm` (80vh), `--layout-modal-max-height-xs` (70vh), `--layout-modal-max-height-lg` (90vh) — classes `.max-h-layout-modal`, `.max-h-layout-modal-sm`, `.max-h-layout-modal-xs`, `.max-h-layout-modal-lg`. - **Lyrics / hero** : `--layout-lyrics-height` (60vh), `--layout-lyrics-height-sm` (50vh) — classes `.h-layout-lyrics`, `.h-layout-lyrics-sm`. +- **Chat / full-page** : `--layout-chat-height` (calc(100vh - 6.25rem)), `--layout-chat-main-height` (calc(100vh - 6rem)), `--layout-stream-height` (calc(100vh - 6rem)), `--layout-modal-full-height` (calc(100vh - 2rem)) — classes `.h-layout-chat`, `.h-layout-chat-main`, `.h-layout-stream`, `.h-layout-modal-full`. Ne pas définir de variables concurrentes (ex. `--sidebar-width`, `--header-height`) ailleurs ; index.css est la source unique pour le shell. diff --git a/apps/web/src/components/live/LiveStreamDetailView.tsx b/apps/web/src/components/live/LiveStreamDetailView.tsx index 36fd12463..fa697aaea 100644 --- a/apps/web/src/components/live/LiveStreamDetailView.tsx +++ b/apps/web/src/components/live/LiveStreamDetailView.tsx @@ -82,7 +82,7 @@ export const LiveStreamDetailView: React.FC = ({ }; return ( -
+
{/* Header Overlay (Fade in/out logic usually here) */}