[PR #8896] [MERGED] fix(client): chat list scrolls to the open chat when its data arrives late; two test races #8870

Closed
opened 2026-11-07 17:40:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8896
Author: @SpicyMarinara
Created: 11/5/2026
Status: ✅ Merged
Merged: 11/5/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/v252-drag-dice-glb


📝 Commits (1)

  • 0f8e2c8 fix(client): the chat list scrolls to the open chat even when its data arrives late

📊 Changes

3 files changed (+26 additions, -9 deletions)

View changed files

📝 e2e/drag-list-scroll.e2e.ts (+11 -1)
📝 e2e/game-one-request-dice.e2e.ts (+4 -2)
📝 packages/client/src/components/layout/ChatSidebar.tsx (+11 -6)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Refs #8887 (the v2.5.2 promotion's browser-matrix failures).

Why this change

The full matrix on #8878 failed drag-list-scroll :25 on Chromium in both runs, once in the persona variant and once in the chat variant, and failed game-one-request-dice :48 on WebKit. The Playwright pin in #8894 doesn't cover either. Tracing the chat variant turned up a real bug in the chat list.

What changed

  • Chat list, app fix (ChatSidebar.tsx): the list scrolls the open chat's row into view 200 ms after its tab and folder settle. Two problems:
    • If chats or folders arrived within those 200 ms, the effect re-ran and cancelled the timer for good, so the row was never scrolled to. A pending flag now schedules the scroll again.
    • The lookup used document.querySelector, which could find the chat's composer first, because the composer carries the same data-chat-id. It now looks only inside the chat list.
  • drag-list-scroll, chat variant: that delayed scroll moved the list after the test had centred a row, so the swipe had no room. The test now waits for the active row to be in view and stop moving first.
  • drag-list-scroll, persona variant: hover() found the row still moving and retried. The retry scrolls the row to the list's bottom edge (in the CI trace, y 512 → 862), and the held drag then auto-scrolled against the wheel. The test now uses scrollIntoViewIfNeeded(), which waits without forcing a scroll.
  • game-one-request-dice :48: the Stealth check's own banner has a dice tray with the same dice-roll-card--game class (AnimatedSkillCheckResult). The CI snapshot shows "Stealth Check / DC 15" inside it. The "no stand-alone dice card for a placeholder roll" assertion only passed while it ran before the banner appeared. The count now leaves out the banner's tray, and the assertion's meaning is unchanged.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify that opening a chat far down the chat list (for example from a link or a reload) scrolls the list to it, including on a slow connection.

Agent-run checks:

  • Chat variant: with the active-chat scroll delayed 600 ms, the old test failed 1 of 2 runs on desktop-chromium and on mobile-chromium; the fixed test passed 2 of 2 on each.
  • App change reverted: the fixed test failed 2 of 2 runs with the folders response held 150 ms (the timer was cancelled) and 2 of 2 with the chats response held 2.5 s (the lookup hit the composer).
  • Persona variant: with the row still moving at the start of the step, the old test failed 2 of 6; the fix passed 6 of 6. Forcing the bottom-edge scroll failed the old test 3 of 3.
  • Dice: with the banner already up, the old assertion failed 2 of 2; the fix passed 2 of 2, then 3 of 3 on mobile-webkit and once each on mobile-chromium and desktop-chromium.
  • All projects: drag-list-scroll --repeat-each=3 passed 9/9 on desktop-chromium and 9/9 on mobile-chromium, and passed on mobile-webkit. Other specs that use the chat list (chat-open-bottom, panel-keyboard-import, five core-flows tests, marinara-host-namespace :335) passed on all three projects.
  • Client and server tsc --noEmit, check:e2e-types and Prettier on the three files: pass.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8896 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/5/2026 **Status:** ✅ Merged **Merged:** 11/5/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/v252-drag-dice-glb` --- ### 📝 Commits (1) - [`0f8e2c8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0f8e2c8073a58252a40628c2006395162a54f345) fix(client): the chat list scrolls to the open chat even when its data arrives late ### 📊 Changes **3 files changed** (+26 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `e2e/drag-list-scroll.e2e.ts` (+11 -1) 📝 `e2e/game-one-request-dice.e2e.ts` (+4 -2) 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+11 -6) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Refs #8887 (the v2.5.2 promotion's browser-matrix failures). ## Why this change The full matrix on #8878 failed `drag-list-scroll :25` on Chromium in both runs, once in the persona variant and once in the chat variant, and failed `game-one-request-dice :48` on WebKit. The Playwright pin in #8894 doesn't cover either. Tracing the chat variant turned up a real bug in the chat list. ## What changed - **Chat list, app fix (`ChatSidebar.tsx`):** the list scrolls the open chat's row into view 200 ms after its tab and folder settle. Two problems: - If chats or folders arrived within those 200 ms, the effect re-ran and cancelled the timer for good, so the row was never scrolled to. A pending flag now schedules the scroll again. - The lookup used `document.querySelector`, which could find the chat's composer first, because the composer carries the same `data-chat-id`. It now looks only inside the chat list. - **drag-list-scroll, chat variant:** that delayed scroll moved the list after the test had centred a row, so the swipe had no room. The test now waits for the active row to be in view and stop moving first. - **drag-list-scroll, persona variant:** `hover()` found the row still moving and retried. The retry scrolls the row to the list's bottom edge (in the CI trace, y 512 → 862), and the held drag then auto-scrolled against the wheel. The test now uses `scrollIntoViewIfNeeded()`, which waits without forcing a scroll. - **game-one-request-dice :48:** the Stealth check's own banner has a dice tray with the same `dice-roll-card--game` class (`AnimatedSkillCheckResult`). The CI snapshot shows "Stealth Check / DC 15" inside it. The "no stand-alone dice card for a placeholder roll" assertion only passed while it ran before the banner appeared. The count now leaves out the banner's tray, and the assertion's meaning is unchanged. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify that opening a chat far down the chat list (for example from a link or a reload) scrolls the list to it, including on a slow connection. Agent-run checks: - **Chat variant:** with the active-chat scroll delayed 600 ms, the old test failed 1 of 2 runs on desktop-chromium and on mobile-chromium; the fixed test passed 2 of 2 on each. - **App change reverted:** the fixed test failed 2 of 2 runs with the folders response held 150 ms (the timer was cancelled) and 2 of 2 with the chats response held 2.5 s (the lookup hit the composer). - **Persona variant:** with the row still moving at the start of the step, the old test failed 2 of 6; the fix passed 6 of 6. Forcing the bottom-edge scroll failed the old test 3 of 3. - **Dice:** with the banner already up, the old assertion failed 2 of 2; the fix passed 2 of 2, then 3 of 3 on mobile-webkit and once each on mobile-chromium and desktop-chromium. - **All projects:** drag-list-scroll `--repeat-each=3` passed 9/9 on desktop-chromium and 9/9 on mobile-chromium, and passed on mobile-webkit. Other specs that use the chat list (chat-open-bottom, panel-keyboard-import, five core-flows tests, marinara-host-namespace :335) passed on all three projects. - Client and server `tsc --noEmit`, `check:e2e-types` and Prettier on the three files: pass. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:40:21 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
Pasta-Devs/Marinara-Engine#8870
No description provided.