Skip to content

fix(web): respect manual scrolling in partner chat - #704

Merged
pancacake merged 1 commit into
HKUDS:devfrom
ZJPex:fix/partner-autoscroll-696-dev
Jul 26, 2026
Merged

pancacake merged 1 commit into
HKUDS:devfrom
ZJPex:fix/partner-autoscroll-696-dev

Conversation

@ZJPex

@ZJPex ZJPex commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes an issue where Partner chat forcibly scrolls to the bottom while a response is streaming, preventing users from reviewing earlier messages.

  • Reuse useChatAutoScroll in PartnerChat.
  • Stop forcing the viewport to the bottom for each stream event.
  • Re-enable live-follow when a user starts a new Partner turn.
  • Add regression coverage for Partner streaming scroll behavior.

Related Issues

Module(s) Affected

  • web (Frontend)
  • tests

Checklist

  • I have read and followed the contribution guidelines.
  • My code follows the project's coding standards.
  • I have run pre-commit run --all-files and fixed any issues.
  • I have added relevant tests for my changes.
  • I have updated the documentation (if necessary).
  • My changes do not introduce any new security vulnerabilities.

Additional Notes

  • Node tests and ESLint pass.
  • Manually verified with a streaming Partner response: scrolling upward is no longer overridden by incoming stream events.
  • Ran pre-commit run --all-files in Linux. All hooks passed except Prettier, which requests formatting changes to unrelated existing frontend files; those unrelated changes are not included in this PR.
  • Applied the Prettier formatting change required for the modified PartnerChat.tsx file.
  • No documentation changes are required for this internal frontend behavior fix.

Copilot AI review requested due to automatic review settings July 26, 2026 03:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Partner chat’s streaming autoscroll behavior so manual user scrolling is respected (matching the main chat surface), and adds a regression test to prevent reintroducing “force scroll to bottom on every stream event”.

Changes:

  • Replaces PartnerChat’s manual scroll management with the shared useChatAutoScroll hook and wires up scroll root attributes + handlers.
  • Removes imperative “scroll to bottom” calls from stream event handling and re-arms live-follow when a new user turn is sent.
  • Adds a Node-based regression test that asserts PartnerChat delegates scroll behavior to the shared hook and avoids fighting user scroll during streaming.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web/components/partners/PartnerChat.tsx Switches Partner chat to useChatAutoScroll, stops scroll forcing during streaming, and re-arms live-follow on new turns.
web/tests/partner-chat-autoscroll.test.ts Adds regression checks that PartnerChat uses the shared autoscroll hook and does not scroll-to-bottom on stream events.
Comments suppressed due to low confidence (2)

web/components/partners/PartnerChat.tsx:535

  • scrollToBottom's parameter is ScrollBehavior; "instant" is not a valid DOM scroll behavior and will not type-check. Use "auto" for an immediate jump.
            scrollToBottom("instant");

web/components/partners/PartnerChat.tsx:601

  • scrollToBottom is declared as (_behavior: ScrollBehavior) => void; passing "instant" is not a valid ScrollBehavior and will break type-checking.
      scrollToBottom("instant");

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cancelled = true;
};
}, [partnerId, sessionKey, scrollToBottom, tryAttach]);
}, [partnerId, sessionKey, scrollToBottom, shouldAutoScrollRef, tryAttach]);
@pancacake
pancacake merged commit 6f4ffa1 into HKUDS:dev Jul 26, 2026
11 checks passed
pancacake added a commit that referenced this pull request Jul 26, 2026
Maintenance release on top of v1.5.4, with two new ways to bring a model.

- OpenAI Codex is a first-party OAuth provider (#690): browser sign-in
  against your own ChatGPT plan replaces the API-key fields, credentials
  stay in <user-root>/private/openai-codex/ with owner-only permissions,
  and the managed profile is owner-bound so it is never handed out through
  grants or made active over an already-configured LLM.
- Eden AI joins as the 35th LLM binding (#671), an OpenAI-compatible
  gateway addressed as <provider>/<model>.
- Knowledge bases answer from a real document inventory instead of
  guessing from retrieval hits: a per-KB inventory rides the system prompt
  and a new kb_files tool enumerates on demand with glob/substring
  filters, mounted under rag's gate and deniable per partner.
- The rag tool cites the chunks, entities, and reports retrieval actually
  returned (#694) rather than an echo of its own query; the local LightRAG
  pipeline still surfaces nothing to cite.
- GraphRAG indexing runs on a worker thread with its own asyncio loop
  (#695), so UVICORN_LOOP=asyncio is no longer needed, and two config
  faults that broke the first run are fixed (#699).
- Assorted: unique optimistic message ids (#698, a v1.5.4 regression that
  dropped the assistant reply from the visible thread), partner-chat
  manual scrolling respected (#704), claude-opus-5 recognized as
  effort-based (#703), Kimi models omit temperature outright, and
  deeptutor start keeps relaying logs on legacy Windows code pages (#702).
- Typing: narrow the loopback callback server to asyncio.Server and gate
  the msvcrt lock path on sys.platform so it type-checks off Windows.

Release notes: assets/releases/ver1-5-5.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants