From dc01071498c4ca0bc9804e4d75ab5ac09d66df9e Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 15 Aug 2025 13:21:02 -0500 Subject: feat: add scroll speed to config (#1968) --- packages/tui/internal/app/app.go | 4 +++- packages/tui/internal/app/state.go | 1 - packages/tui/internal/components/chat/messages.go | 6 +----- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'packages/tui') diff --git a/packages/tui/internal/app/app.go b/packages/tui/internal/app/app.go index eff00f296..f046daaef 100644 --- a/packages/tui/internal/app/app.go +++ b/packages/tui/internal/app/app.go @@ -50,6 +50,7 @@ type App struct { compactCancel context.CancelFunc IsLeaderSequence bool IsBashMode bool + ScrollSpeed int } func (a *App) Agent() *opencode.Agent { @@ -198,6 +199,7 @@ func New( InitialPrompt: initialPrompt, InitialAgent: initialAgent, InitialSession: initialSession, + ScrollSpeed: int(configInfo.Tui.ScrollSpeed), } return app, nil @@ -725,7 +727,7 @@ func (a *App) MarkProjectInitialized(ctx context.Context) error { } func (a *App) CreateSession(ctx context.Context) (*opencode.Session, error) { - session, err := a.Client.Session.New(ctx) + session, err := a.Client.Session.New(ctx, opencode.SessionNewParams{}) if err != nil { return nil, err } diff --git a/packages/tui/internal/app/state.go b/packages/tui/internal/app/state.go index 2876eb3a9..cc65eea5e 100644 --- a/packages/tui/internal/app/state.go +++ b/packages/tui/internal/app/state.go @@ -28,7 +28,6 @@ type AgentModel struct { type State struct { Theme string `toml:"theme"` - ScrollSpeed *int `toml:"scroll_speed"` AgentModel map[string]AgentModel `toml:"agent_model"` Provider string `toml:"provider"` Model string `toml:"model"` diff --git a/packages/tui/internal/components/chat/messages.go b/packages/tui/internal/components/chat/messages.go index 109a734ad..0be2f462c 100644 --- a/packages/tui/internal/components/chat/messages.go +++ b/packages/tui/internal/components/chat/messages.go @@ -1194,11 +1194,7 @@ func NewMessagesComponent(app *app.App) MessagesComponent { vp := viewport.New() vp.KeyMap = viewport.KeyMap{} - if app.State.ScrollSpeed != nil && *app.State.ScrollSpeed > 0 { - vp.MouseWheelDelta = *app.State.ScrollSpeed - } else { - vp.MouseWheelDelta = 2 - } + vp.MouseWheelDelta = app.ScrollSpeed // Default to showing tool details, hidden thinking blocks showToolDetails := true -- cgit v1.2.3