Skip to content

fix(ui): make useAutoScroll smooth flag effective - #2019

Merged
openai0229 merged 2 commits into
OtterMind:mainfrom
Aias00:fix/2014-autoscroll-smooth
Jul 24, 2026
Merged

fix(ui): make useAutoScroll smooth flag effective#2019
openai0229 merged 2 commits into
OtterMind:mainfrom
Aias00:fix/2014-autoscroll-smooth

Conversation

@Aias00

@Aias00 Aias00 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #2014

Summary

useAutoScroll.scrollToBottom computed the scroll behavior as
smooth ? 'auto' : 'auto'. Both branches returned 'auto', so the
smooth flag had no effect and smooth scrolling was never applied.
Changed the truthy branch to 'smooth' so smooth ? 'smooth' : 'auto'
behaves as intended.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results: npx tsc --noEmit -p chat2db-community-client/tsconfig.json — no errors reported for hooks/useAutoScroll.ts.
  • Manual verification: A string literal swap; 'smooth' is a valid ScrollBehavior value per the DOM ScrollToOptions.behavior type.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: N/A.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: N/A.
  • Community / Local / Pro boundary: N/A.
  • Backward compatibility: Smooth scrolling is now actually used when requested; instant scroll still used otherwise.

Reviewer map

  • Start here: hooks/useAutoScroll.ts:24smooth ? 'auto' : 'auto' -> smooth ? 'smooth' : 'auto'.
  • Failure condition: Smooth scrolling still never applied when smooth=true.
  • Rollback or disable path: Revert this single commit.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: The fix, verification, and PR description were produced with Claude Code assistance.

scrollToBottom computed behavior as `smooth ? 'auto' : 'auto'`, so both
branches returned 'auto' and the smooth flag never produced smooth
scrolling. Use 'smooth' when requested.

Fixes OtterMind#2014

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 07:13
@Aias00
Aias00 requested a review from openai0229 as a code owner July 24, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@openai0229 openai0229 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.

Reviewed the hook call semantics and scrolling behavior. The change makes the existing smooth flag effective without altering the non-streaming path, and the updated Community frontend checks pass. No blocking issues found.

@openai0229
openai0229 merged commit ae0330b into OtterMind:main Jul 24, 2026
17 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

useAutoScroll ternary has identical branches, so smooth has no effect

3 participants