Web: a task's progress no longer redraws its chat message; web-live green again #327

Merged
kompas-review merged 3 commits from khyretos/fix-weblive into main 2026-11-01 11:30:19 +01:00
Owner

Requested by Kees

web-live has been red on main since 31 Oct (run 9663). The cause is an app bug, not a flaky test.

Root cause. messageViews compared a message's tasks by object identity. Every progress tick of a running task (a new object, same id/state/title) rebuilt the whole message: the markdown was rendered again and all step cards were replaced. In the demo this happened every 1.2 s. Under CI load, step cards › the left icon… read a card in the middle of a rebuild. getComputedStyle on a detached node returns "", so it got "" instead of rgba(0, 0, 0, 0) and failed twice.

Fix. Tasks are now compared by what the message draws of them (id:state:title), the same way reactions already are. A new test checks that a step card keeps its DOM node across task ticks. It fails without the fix.

Effort picker test (flaky, passed on retry). It waited for document.getAnimations().length === 0. In the demo that means waiting for the running task to finish, because of an endless tov-pulse animation and progress-bar width transitions on every tick: about 15 of its 20 s. It now waits only for the side panel's transform slide, which is what its comment says it waits for.

Checked locally (CI's Playwright image v1.63.0, CI=1): typecheck and build OK; node tests 50/50; Playwright 454 passed, 0 failed. Two unrelated tests passed on retry: contextmeter:103 and providers:126.

Second commit (after CI run 27933 failed contextmeter:103). The chat header re-mounted on every tasks change, so on every task tick, even when its markup was identical. A test read the meter arc while it was being replaced (stroke ""; 10 of 36 local runs on 2 CPUs failed). The header now keeps its DOM when the markup is unchanged: 36 of 36 pass. Six tests waited for "no animations at all", or hand-filtered tov-pulse. They now share tests/settled.ts, which waits until only endless animations are left. Full suite after both commits: 455 passed. activity:69 was flaky once (a first-load race in the Activity tab) and is left as it is.

🤖 Generated with Claude Code

<!-- claude-projects-attribution: {"github_login":"Khyretos"} --> _Requested by **Kees**_ web-live has been red on main since 31 Oct (run 9663). The cause is an app bug, not a flaky test. **Root cause.** `messageViews` compared a message's tasks by object identity. Every progress tick of a running task (a new object, same id/state/title) rebuilt the whole message: the markdown was rendered again and all step cards were replaced. In the demo this happened every 1.2 s. Under CI load, `step cards › the left icon…` read a card in the middle of a rebuild. `getComputedStyle` on a detached node returns `""`, so it got `""` instead of `rgba(0, 0, 0, 0)` and failed twice. **Fix.** Tasks are now compared by what the message draws of them (`id:state:title`), the same way reactions already are. A new test checks that a step card keeps its DOM node across task ticks. It fails without the fix. **Effort picker test (flaky, passed on retry).** It waited for `document.getAnimations().length === 0`. In the demo that means waiting for the running task to finish, because of an endless `tov-pulse` animation and progress-bar `width` transitions on every tick: about 15 of its 20 s. It now waits only for the side panel's `transform` slide, which is what its comment says it waits for. **Checked locally** (CI's Playwright image v1.63.0, `CI=1`): typecheck and build OK; node tests 50/50; Playwright 454 passed, 0 failed. Two unrelated tests passed on retry: contextmeter:103 and providers:126. **Second commit (after CI run 27933 failed `contextmeter:103`).** The chat header re-mounted on every `tasks` change, so on every task tick, even when its markup was identical. A test read the meter arc while it was being replaced (stroke `""`; 10 of 36 local runs on 2 CPUs failed). The header now keeps its DOM when the markup is unchanged: 36 of 36 pass. Six tests waited for "no animations at all", or hand-filtered `tov-pulse`. They now share `tests/settled.ts`, which waits until only endless animations are left. Full suite after both commits: 455 passed. `activity:69` was flaky once (a first-load race in the Activity tab) and is left as it is. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Web: a task's progress no longer redraws its chat message; web-live green again
Some checks failed
review-gate / sweep (pull_request) Has been cancelled
build / skills (pull_request) Successful in 26s
build / web (pull_request) Successful in 23s
build / runner (pull_request) Successful in 3m37s
build / server (pull_request) Successful in 8m16s
build / runner-windows (pull_request) Successful in 1m54s
review-gate / gate PR-Agent is still reviewing the head
lint / megalinter (pull_request) Successful in 3m6s
build / web-live (pull_request) Failing after 6m16s
fresh-install / fresh-install (pull_request) Successful in 26m33s
kreative-pr/review review failed: Exception: Failed to generate prediction with any model of ['openai/Coder', 'openai/Coder']. Attempts: openai/Coder: Fallbac…
kk / all-checks Failed: build / web-live (pull_request), kreative-pr/review
a7cabd5e70
The message view cache compared a message's tasks by object identity, so every
progress tick of a running task (a new object, same id/title/state) rebuilt the
whole message: markdown again and all its step cards replaced. Under CI load the
step-card test read a card that was replaced mid-check (getComputedStyle of a
detached node is ""), so web-live failed on main. Tasks are now compared by what
the message draws of them (id, state, title), like reactions; a new test keeps
the step cards' nodes across ticks (it fails without the fix).

The effort picker test waited for "no animations at all", which in the demo means
waiting for a running task to finish (endless pulse, progress-bar easing): about
15 of its 20 s. It now waits for the side panel's slide only, as its comment says.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator

Title

Web: a task's progress no longer redraws its chat message; web-live green again


PR Type

Bug fix, Tests


Description

  • Fix message redraw bug by comparing tasks via content instead of object identity.

  • Update effort picker test to wait only for side panel slide, not all animations.

  • Add test verifying step cards persist DOM nodes during task progress ticks.


Diagram Walkthrough

flowchart LR
  A["Old logic: compare task objects"] -->|"causes rebuilds"| B["Message redraws on every tick"]
  B -->|"detaches nodes"| C["getComputedStyle returns empty"]
  D["New logic: compare id/state/title"] -->|"stable cache"| E["Step cards keep DOM node"]
  F["Effort test: wait for transform"] -.->|"replaces"| G["Wait for no animations"]

File Walkthrough

Relevant files
Bug fix
conversation.ts
Use content-based comparison for task caching in message views

web/src/views/conversation.ts

  • Added taskKey function to generate a stable string key from task id,
    state, and title.
  • Modified messageViews cache lookup to use taskKey instead of strict
    object equality for tasks.
  • This prevents the entire message view from being rebuilt when a
    running task updates its progress.
+3/-1     
Tests
effort.spec.ts
Wait only for side panel slide in effort picker test         

web/tests/effort.spec.ts

  • Updated the waiting condition for the effort picker to check only for
    side panel slide animations.
  • Removed requirement to wait for all CSS animations to finish, avoiding
    long waits due to endless task pulses.
  • Added comments explaining why the previous approach caused excessive
    delays.
+4/-1     
ux-round2.spec.ts
Add test ensuring step cards persist across task ticks     

web/tests/ux-round2.spec.ts

  • Added new test case verifying that step cards retain their DOM nodes
    during task progress ticks.
  • Test confirms that the first step card remains connected to the
    document after a 3-second delay.
  • Validates the fix for the issue where messages were redrawn on every
    task update.
+13/-0   

## Title <!-- pr-agent:describe:persistent --> Web: a task's progress no longer redraws its chat message; web-live green again ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Fix message redraw bug by comparing tasks via content instead of object identity. - Update effort picker test to wait only for side panel slide, not all animations. - Add test verifying step cards persist DOM nodes during task progress ticks. ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Old logic: compare task objects"] -->|"causes rebuilds"| B["Message redraws on every tick"] B -->|"detaches nodes"| C["getComputedStyle returns empty"] D["New logic: compare id/state/title"] -->|"stable cache"| E["Step cards keep DOM node"] F["Effort test: wait for transform"] -.->|"replaces"| G["Wait for no animations"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>conversation.ts</strong><dd><code>Use content-based comparison for task caching in message views</code></dd></summary> <hr> web/src/views/conversation.ts <ul><li>Added <code>taskKey</code> function to generate a stable string key from task id, <br>state, and title.<br> <li> Modified <code>messageViews</code> cache lookup to use <code>taskKey</code> instead of strict <br>object equality for tasks.<br> <li> This prevents the entire message view from being rebuilt when a <br>running task updates its progress.</ul> </details> </td> <td><a href="https://git.kreative-kompas.com/khyretos/kreative-kompanion/src/branch/khyretos/fix-weblive/web/src/views/conversation.ts">+3/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>effort.spec.ts</strong><dd><code>Wait only for side panel slide in effort picker test</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> web/tests/effort.spec.ts <ul><li>Updated the waiting condition for the effort picker to check only for <br>side panel slide animations.<br> <li> Removed requirement to wait for all CSS animations to finish, avoiding <br>long waits due to endless task pulses.<br> <li> Added comments explaining why the previous approach caused excessive <br>delays.</ul> </details> </td> <td><a href="https://git.kreative-kompas.com/khyretos/kreative-kompanion/src/branch/khyretos/fix-weblive/web/tests/effort.spec.ts">+4/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>ux-round2.spec.ts</strong><dd><code>Add test ensuring step cards persist across task ticks</code>&nbsp; &nbsp; &nbsp; </dd></summary> <hr> web/tests/ux-round2.spec.ts <ul><li>Added new test case verifying that step cards retain their DOM nodes <br>during task progress ticks.<br> <li> Test confirms that the first step card remains connected to the <br>document after a 3-second delay.<br> <li> Validates the fix for the issue where messages were redrawn on every <br>task update.</ul> </details> </td> <td><a href="https://git.kreative-kompas.com/khyretos/kreative-kompanion/src/branch/khyretos/fix-weblive/web/tests/ux-round2.spec.ts">+13/-0</a>&nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
Collaborator

/review

/review
Collaborator

Failed to review PR

Reason: Every configured model attempt failed. Check the PR-Agent service logs for the provider error, then retry.

Failed to review PR **Reason:** Every configured model attempt failed. Check the PR-Agent service logs for the provider error, then retry.

🧹 Lint report · ✅ all 25 checks clean

Errors below fail this check.

✅ Clean: black, checkstyle, djlint, editorconfig-checker, git_diff, gitleaks, grype, hadolint, htmlhint, isort, jsonlint, markdownlint, npm-groovy-lint, pmd, prettier, prettier, ruff, secretlint, shellcheck, shfmt, stylelint, trivy, trufflehog, xmllint, yamllint

MegaLinter on soucouyant · full logs in the Actions run · comment /improve for AI fix suggestions

<!-- kk-lint --> ## 🧹 Lint report · ✅ all 25 checks clean Errors below fail this check. ✅ Clean: black, checkstyle, djlint, editorconfig-checker, git_diff, gitleaks, grype, hadolint, htmlhint, isort, jsonlint, markdownlint, npm-groovy-lint, pmd, prettier, prettier, ruff, secretlint, shellcheck, shfmt, stylelint, trivy, trufflehog, xmllint, yamllint <sub>MegaLinter on soucouyant · full logs in the Actions run · comment <code>/improve</code> for AI fix suggestions</sub>
Author
Owner

/review

/review
Collaborator

Failed to review PR

Reason: Every configured model attempt failed. Check the PR-Agent service logs for the provider error, then retry.

Failed to review PR **Reason:** Every configured model attempt failed. Check the PR-Agent service logs for the provider error, then retry.
Web: the chat header is drawn again only when it changes; one settle helper for tests
Some checks failed
review-gate / sweep (pull_request) Has been cancelled
build / server (pull_request) Successful in 14m7s
build / skills (pull_request) Successful in 15s
build / web (pull_request) Successful in 20s
build / runner (pull_request) Successful in 3m40s
build / runner-windows (pull_request) Successful in 1m26s
build / web-live (pull_request) Failing after 5m58s
kk / all-checks Failed: build / web-live (pull_request)
lint / megalinter (pull_request) Successful in 3m36s
fresh-install / fresh-install (pull_request) Successful in 8m38s
kreative-pr/review reviewed: 0 finding(s)
review-gate / gate review findings are all handled
241ccbf0fd
web-live failed on #327 in contextmeter:103: the header re-mounted on every
"tasks" change, i.e. every progress tick of a running task, though it looked the
same, so the meter's arc was read while being replaced (stroke ""; 10 of 36 local
runs on 2 CPUs failed). The header now keeps its DOM when its markup is unchanged
(36 of 36 pass), and the test waits for the chat's usage before reading the arc.

Six tests waited for "no animations at all" (or hand-filtered tov-pulse): with a
demo task running that waited for it to finish. tests/settled.ts waits until
only endless animations are left; all of them use it now.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator

PR Reviewer Guide 🔍

(Review updated until commit 1639e2fdbf)

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected
## PR Reviewer Guide 🔍 <!-- pr-agent:review:full --> #### (Review updated until commit https://git.kreative-kompas.com/khyretos/kreative-kompanion/commit/1639e2fdbf05e8cfb44b13e489dd5bd1799259ae) Here are some key observations to aid the review process: <table> <tr><td>🧪&nbsp;<strong>No relevant tests</strong></td></tr> <tr><td>🔒&nbsp;<strong>No security concerns identified</strong></td></tr> <tr><td>⚡&nbsp;<strong>No major issues detected</strong></td></tr> </table>
Author
Owner

/review

/review
Web: step cards and Activity cards are drawn once; fonts/step-card tests settle on the real state
Some checks failed
build / skills (pull_request) Successful in 14s
build / web (pull_request) Successful in 12s
build / server (pull_request) Successful in 37s
fresh-install / fresh-install (pull_request) Successful in 11s
lint / megalinter (pull_request) Successful in 56s
review-gate / sweep (pull_request) Has been cancelled
build / runner-windows (pull_request) Successful in 1m41s
build / runner (pull_request) Successful in 3m11s
kreative-pr/review reviewed: 0 finding(s)
build / web-live (pull_request) Successful in 4m11s
review-gate / gate review findings are all handled
kk / all-checks All 10 checks passed
1639e2fdbf
web-live on #327 failed fonts.spec:20 (twice) and was flaky in ux-round2:336/367: all
three read a step card that was being replaced (computed font-family and colour "",
isConnected false). Fira Code itself loads fine (fonts:74 passes).

Cause: in demo mode the "command cards" steps were announced 100 ms after the question
but the reply only 500 ms later, so the four cards first sat under the question, with no
caret yet, and the tests' "4 cards, no caret" wait could pass there. When the reply came
the cards moved under it and every card was drawn again. The demo now announces those
steps once the reply is there, as a real answer's steps are.

activity.spec:69 was flaky the same way: opening the Activity tab drew it, then drew the
whole pane again for the list and again for the week's costs. Both now arrive in one
update, and a refetch with equal data no longer redraws it.

Locally (8 workers, 4 CPUs) the step-card, fonts and Activity tests pass 72 of 72.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
khyretos/kreative-kompanion!327
No description provided.