Files
linearvoid/.github/instructions/TODO.md
T
zwitschi 474da7418e
CI / test (push) Successful in 1m55s
CI / docker (push) Successful in 28s
fix(frontend): consolidate chat sidebar and modal auth flow
2026-08-16 13:40:16 +02:00

3.1 KiB

TODO

Completed tasks moved to DONE. Remaining tasks in BACKLOG.

Chat sidebar

  • remove search bar from chat sidebar (not needed for single-room)
  • remove "user" toggle button from chat sidebar (hide for now, add back when user interface is stable)
  • make login/registration form a modal and only toggle it when user is not logged in and clicks "Login" or "Register"
  • when user is logged in, do not show login/registration form
  • make sure each message is only rendered once in the chat log (no duplicates on reconnect or initial load)

Plan

Files: frontend/index.html, frontend/src/main.ts, frontend/src/style.css.

  1. Remove search bar (single-room)

    • index.html: delete the <div id="dm-search-row"> block.
    • main.ts: remove searchDM() and the dm-search-btn listener; drop the #dm-search-row show/hide logic in switchRoom() (the searchRow.hidden = !isDM lines). Keep currentDMTarget only if the "New DM" flow stays.
  2. Remove "Users" toggle button

    • index.html: delete the <button id="users-toggle-btn"> button.
    • main.ts: remove toggleUserList() and the users-toggle-btn listener; drop the now-unused usersVisible variable.
  3. Login/registration form as a modal

    • index.html: wrap the #auth-panel form in a modal structure (.auth-modal + backdrop) with a close button.
    • style.css: add .auth-modal / .auth-modal-backdrop styles.
    • main.ts: add openAuthModal() / closeAuthModal(); change the auth-toggle-btn handler to open the modal (only when not authenticated) instead of toggling #auth-panel inline; wire a close/backdrop-click to closeAuthModal().
  4. Hide form when logged in

    • main.ts updateAuthUI(): when authenticated → hide the "Sign in" button and call closeAuthModal(); show the user label + "Sign out" button. When not authenticated → show "Sign in" and hide "Sign out".
  5. No duplicate messages

    • main.ts: add clearMessages() (empties #messages) and call it at the top of connectWebSocket() so each (re)connect renders history fresh instead of appending.
    • Fix the initial double-connect: make the initial connectWebSocket("main") wait for refreshUserSession() (or connect once with the resolved username) so history isn't pushed twice on load.

Frontend Tests

User Frontend

  • Test coverage for all critical frontend components and interactions
  • Add code coverage reporting and enforce minimum coverage threshold in CI/CD pipeline
  • Document test cases and expected outcomes

Admin Frontend

  • Test coverage for all critical admin UI components and interactions
  • Add code coverage reporting and enforce minimum coverage threshold in CI/CD pipeline
  • Document test cases and expected outcomes

Backend Integration Tests

Cloudflare R2

  • Test retrieval of segments and manifests from R2 via Cloudflare edge
  • Validate cache hit/miss behavior and performance metrics
  • Validate edge cache hit/miss behavior with repeat requests — script scripts/validate-edge-cache.sh created