diff --git a/.github/instructions/DONE.md b/.github/instructions/DONE.md index 6aa7f44..f96f9e6 100644 --- a/.github/instructions/DONE.md +++ b/.github/instructions/DONE.md @@ -1155,3 +1155,9 @@ Completed the three Playout enhancement workstreams from `TODO.md`. Remaining po - Bumped `frontend/package.json` to `1.0.13` and README version badge to `1.0.13` - Committed remaining work + `chore: bump version to 1.0.13`, tagged `1.0.13` (annotated) - Pushed `main` + `1.0.13` to origin → CI/CD + `release.yml` builds semver images and creates the Gitea release + +## Session 2026-08-13 — Frontend Error Fix + +- Fixed `Uncaught TypeError: Cannot read properties of null (reading 'appendChild')` in the viewer bundle: `index.html` was missing the `#messages` chat container (and had a stray ``), so `addMessage` crashed on WebSocket open/message. +- Restored chat panel structure: added `
` and wrapped `#presence-list` in `
`. +- Made `addMessage` defensive (returns early when `#messages` is absent), matching the null-guards in `renderPresence`/`showTyping`/`hideTyping`. diff --git a/frontend/index.html b/frontend/index.html index 3b83ada..85bf5b2 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -41,7 +41,7 @@
- +
@@ -55,11 +55,14 @@

- +
+ + +
diff --git a/frontend/src/main.ts b/frontend/src/main.ts index c008d37..5b63cc4 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -119,7 +119,8 @@ function connectWebSocket(room: string) { } function addMessage(type: string, text: string, sender = "", timestamp = new Date()) { - const messages = document.getElementById("messages")!; + const messages = document.getElementById("messages"); + if (!messages) return; const div = document.createElement("div"); div.className = "message-row";