Skip to content

Add scroll acceleration support to TUI#4289

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

Add scroll acceleration support to TUI#4289
kommander merged 3 commits intoanomalyco:devfrom
remorses:scroll-acceleration

Conversation

@remorses
Copy link
Copy Markdown
Contributor

@remorses remorses commented Nov 13, 2025

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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/cli/cmd/tui/routes/session/index.tsx
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
Collaborator

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

Copy link
Copy Markdown
Collaborator

@kommander kommander left a comment

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
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 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