Skip to content

Add scroll acceleration support to TUI - #4289

Merged
kommander merged 3 commits into
anomalyco:devfrom
remorses:scroll-acceleration
Nov 13, 2025
Merged

kommander merged 3 commits into
anomalyco:devfrom
remorses:scroll-acceleration

Conversation

@remorses

@remorses remorses commented Nov 13, 2025 •

Copy link
Copy Markdown
Contributor

Adds configurable scroll acceleration to the TUI with macOS-style smooth scrolling via scroll_acceleration.enabled config option. Falls back to existing scroll_speed for custom linear speed. Acceleration takes precedence when both are set.

Now opencode will scroll faster than before because scroll speed is 2 by deafult. Should I change the default to 1?

Fix #3907

Copilot AI review requested due to automatic review settings November 13, 2025 14:54

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 adds configurable scroll acceleration to the TUI with macOS-style smooth scrolling. The implementation allows users to enable smooth scrolling via scroll_acceleration.enabled or continue using custom linear speed with scroll_speed, with acceleration taking precedence when both are configured.

  • Adds new configuration schema for scroll acceleration with an enabled boolean flag
  • Implements CustomSpeedScroll class for linear scrolling and integrates MacOSScrollAccel for smooth acceleration
  • Updates the session scrollbox component to use the configured scroll behavior

Reviewed Changes

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

File Description
packages/sdk/js/src/gen/types.gen.ts Adds TypeScript type definition for scroll_acceleration configuration option with enabled boolean field
packages/opencode/src/config/config.ts Adds Zod schema validation for the new scroll_acceleration configuration option
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx Implements scroll acceleration logic with CustomSpeedScroll class and integrates both acceleration modes into the session's scrollbox

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

Comment thread packages/opencode/src/config/config.ts Outdated
@@ -438,6 +438,12 @@ export namespace Config {

export const TUI = z.object({
scroll_speed: z.number().min(1).optional().default(2).describe("TUI scroll speed"),

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.

Now that this is considered, I would default it to 1, because the default linear scroll speed in opentui is what some users expect now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

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

If the MacOSScrollAccelaration had a multiplier option as well it could be configured for terminals where it is too fast. But that can be added with this setup.

@kommander
kommander merged commit 609ab06 into anomalyco:dev Nov 13, 2025
3 checks passed
github-actions Bot pushed a commit to yuguorui/opencode that referenced this pull request Jan 18, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
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.

Bug: scroll_speed doing nothing

3 participants