Add file headers, tidy the stylesheet and document the conventions
Headers: - Every JavaScript file (sources, front, scripts, tests) starts with a /** @file … */ header, in the three levels used by sokko-g: a short description for simple files; Utilisé par / Attention / @see for shared modules; a full header (context, entry points, callers, dependencies, pitfalls) for index.js, the music queue, the web server, the storage manager and the jukebox page script. - No @author, @version or @since: git already knows. - test/fileHeaders.test.js fails `npm run check` when a header is missing or a central file's header is incomplete. Stylesheet (no visual change, checked by comparing every element's computed styles in Chromium at 1280, 800 and 400 px, hover included): - Role header and section comments. - Transparent shades derive from the colour variables with color-mix() instead of copied rgba() values; new tokens for repeated values (text, text on accent, accent gradient, white veils, shadow). - Native nesting for buttons, the live indicator, upload rows and home cards; drop the unused .hero__visual--large and redundant rules. - Utility classes move to the end so they win over components. The library list's u-mt-1, which never applied (.list reset it), is removed to keep the layout as it was. Docs: CONTRIBUTING.md describes the language, header and stylesheet conventions; CLAUDE.md points to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e08dba41a3
commit
3795ee06cb
65 changed files with 843 additions and 163 deletions
|
|
@ -1,3 +1,12 @@
|
|||
/**
|
||||
* @file Outils de la page du jukebox indépendants de son affichage : mémoire du mot de passe et du nom,
|
||||
* messages d'état, échappement HTML, formats de taille, durée et date, client de l'API.
|
||||
*
|
||||
* Utilisé par : public/scripts/jukebox.js.
|
||||
* Attention : chargé tel quel par le navigateur (module ES, sans compilation). Le texte venu de l'API
|
||||
* passe par escapeHtml avant d'être inséré en HTML.
|
||||
*/
|
||||
|
||||
const API_KEY_STORAGE_KEY = "palico-api-key";
|
||||
const DISPLAY_NAME_STORAGE_KEY = "palico-display-name";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
/**
|
||||
* @file Page du jukebox : connexion (Discord ou mot de passe), lecteur, file d'attente, bibliothèque
|
||||
* et ajout de morceaux.
|
||||
*
|
||||
* Contexte : servi tel quel au navigateur (module ES, sans compilation) ; ne parle qu'à l'API de
|
||||
* src/web/.
|
||||
* Points d'entrée : initialize (au chargement), connectEvents (flux en direct), refreshAll.
|
||||
* Utilisé par : public/jukebox.html.
|
||||
* Dépend de : common.js, et des identifiants des éléments de jukebox.html (objet `elements`).
|
||||
* Attention :
|
||||
* - L'état arrive par le flux /api/events ; tant qu'il est coupé, chaque action recharge tout.
|
||||
* - Le flux est lu avec fetch, et non EventSource, qui ne permet pas d'envoyer la clé.
|
||||
* - Connecté avec Discord, la session (cookie) remplace la clé : pas d'en-tête Authorization.
|
||||
* - Tout texte venu de l'API passe par escapeHtml avant d'aller dans innerHTML.
|
||||
* @see README.md#jukebox
|
||||
*/
|
||||
|
||||
import {
|
||||
createApiClient,
|
||||
createStatusManager,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue