diff --git a/cmd/root/new.go b/cmd/root/new.go index 8dfcfa408..f1618331e 100644 --- a/cmd/root/new.go +++ b/cmd/root/new.go @@ -73,7 +73,6 @@ func (f *newFlags) runNewCommand(cmd *cobra.Command, args []string) error { progOpts := []tea.ProgramOption{ tea.WithContext(ctx), - tea.WithFilter(tui.MouseEventFilter), } p := tea.NewProgram(m, progOpts...) diff --git a/cmd/root/run.go b/cmd/root/run.go index a79fa719a..daaeb3b54 100644 --- a/cmd/root/run.go +++ b/cmd/root/run.go @@ -245,7 +245,6 @@ func handleRunMode(ctx context.Context, agentFilename string, rt runtime.Runtime progOpts := []tea.ProgramOption{ tea.WithContext(ctx), - tea.WithFilter(tui.MouseEventFilter), } p := tea.NewProgram(m, progOpts...) diff --git a/pkg/tui/components/messages/messages.go b/pkg/tui/components/messages/messages.go index fe60b7a08..3efba45b6 100644 --- a/pkg/tui/components/messages/messages.go +++ b/pkg/tui/components/messages/messages.go @@ -199,7 +199,7 @@ func (m *model) Update(msg tea.Msg) (layout.Model, tea.Cmd) { return m, nil case tea.MouseWheelMsg: - const mouseScrollAmount = 3 + const mouseScrollAmount = 2 buttonStr := msg.Button.String() switch buttonStr { diff --git a/pkg/tui/tui.go b/pkg/tui/tui.go index 025e1a96c..541b21974 100644 --- a/pkg/tui/tui.go +++ b/pkg/tui/tui.go @@ -3,7 +3,6 @@ package tui import ( "context" "fmt" - "time" "charm.land/bubbles/v2/help" "charm.land/bubbles/v2/key" @@ -27,21 +26,6 @@ import ( "github.com/docker/cagent/pkg/tui/styles" ) -var lastMouseEvent time.Time - -// MouseEventFilter filters mouse events to prevent spam -func MouseEventFilter(_ tea.Model, msg tea.Msg) tea.Msg { - switch msg.(type) { - case tea.MouseWheelMsg, tea.MouseMotionMsg, tea.MouseMsg: - now := time.Now() - if now.Sub(lastMouseEvent) < 20*time.Millisecond { - return nil - } - lastMouseEvent = now - } - return msg -} - // appModel represents the main application model type appModel struct { application *app.App