feat: add scroll speed to config (#1968)

This commit is contained in:
Aiden Cline
2025-08-15 13:21:02 -05:00
committed by GitHub
parent 57b04d9eb7
commit dc01071498
10 changed files with 116 additions and 62 deletions

View File

@@ -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
}

View File

@@ -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"`

View File

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