Commit graph

5 commits

Author SHA1 Message Date
3795ee06cb 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>
2026-12-01 21:05:59 +01:00
8cf0a8eb5b Stop listening when an events client disconnects; warn on partial OAuth setup
All checks were successful
Deploy Palico Bot / check (push) Successful in 10s
Deploy Palico Bot / deploy (push) Successful in 7s
- Detach the events stream from the queue on the response's close event,
  which fires when the client goes away whatever the Node version.
- Log a warning when only some of the Discord login variables are set,
  instead of silently leaving the login disabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 12:23:28 +01:00
9fb54798dd Keep the queue across restarts; add shuffle, loop, renaming and live events
- Save the queue to storage/runtime/queue.json and restore it at startup,
  the interrupted track first; playback resumes once someone is in the
  voice channel. Shutdown keeps the queued files instead of deleting them.
- Shuffle the upcoming tracks; loop mode sends finished tracks back to the
  end of the queue, except removed or failed ones.
- Rename library tracks (queued copies follow), enqueue the whole library,
  optionally shuffled.
- Stream queue and library changes to the web page with Server-Sent Events
  (GET /api/events).
- Sanitise the requester name sent when queueing a library track.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 12:15:25 +01:00
362c7772ba Make Discord commands and the deploy pipeline sturdier
- Defer the voice commands' reply: updating every member can take longer
  than the 3 seconds Discord allows; one member leaving no longer fails the
  whole operation.
- Replace the deprecated ephemeral option with MessageFlags, answer command
  errors in French and log when that answer itself fails; route
  autocomplete interactions to the command.
- Add /readyz, which answers 503 while the bot is not connected to Discord.
- Run npm ci and npm run check on every push; deploy main only when they
  pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 12:04:43 +01:00
6895d20459 Fix deploy and lock down the DM route; add /invitation
All checks were successful
Deploy Palico Bot / deploy (push) Successful in 32s
- Deploy workflow: pin node:24-bookworm; install openssh-client only if missing
- Auth failure limiter counts only 401s (422/404 no longer lock out clients)
- trust proxy configurable (WEB_TRUSTED_PROXIES), never "true"
- DM route: loopback connections only, dedicated NOTIFICATIONS_API_KEY, 503 when unset
- Jukebox: no polling without a key, stop on 401
- /invitation: posts the temporary invite message after checking the link
- Stop tracking storage/library.json; README describes the real deployment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 10:57:22 +01:00