From 018304bd45cd9d71104586b4729b2455ea42b100 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 15 Aug 2026 18:19:15 +0200 Subject: [PATCH] Stop diving into a patch explorer when clicking the focused main view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clicking a line of the focused main view entered the staging or patch building panel at that line. The focused main view is about to gain a selection of its own, which is what a click there should set — and with the explorers on their way out, the dive has nowhere to go. Nothing replaces the gesture yet, so for the next couple of commits a click in the focused main view does nothing. Co-authored-by: Claude Opus 5 (1M context) --- pkg/gui/controllers/commits_files_controller.go | 10 ---------- pkg/gui/controllers/files_controller.go | 10 ---------- pkg/gui/controllers/main_view_controller.go | 14 -------------- 3 files changed, 34 deletions(-) diff --git a/pkg/gui/controllers/commits_files_controller.go b/pkg/gui/controllers/commits_files_controller.go index 0762d86e2..33cb7f045 100644 --- a/pkg/gui/controllers/commits_files_controller.go +++ b/pkg/gui/controllers/commits_files_controller.go @@ -606,16 +606,6 @@ func (self *CommitFilesController) expandAll() error { return nil } -func (self *CommitFilesController) GetOnClickFocusedMainView() func(mainViewName string, clickedLineIdx int) error { - return func(mainViewName string, clickedLineIdx int) error { - node := self.getSelectedItem() - if node != nil && node.File != nil { - return self.enterCommitFile(node, types.OnFocusOpts{ClickedWindowName: mainViewName, ClickedViewLineIdx: clickedLineIdx}) - } - return nil - } -} - func (self *CommitFilesController) pathsForDiff(node *filetree.CommitFileNode) []string { return diffPathsForNode( node.Raw(), self.context().GetRoot().Raw(), self.c.Model().CommitFiles, self.context().IsFiltering()) diff --git a/pkg/gui/controllers/files_controller.go b/pkg/gui/controllers/files_controller.go index b0997b08a..936b02fb3 100644 --- a/pkg/gui/controllers/files_controller.go +++ b/pkg/gui/controllers/files_controller.go @@ -408,16 +408,6 @@ func (self *FilesController) GetOnDoubleClick() func() error { }) } -func (self *FilesController) GetOnClickFocusedMainView() func(mainViewName string, clickedLineIdx int) error { - return func(mainViewName string, clickedLineIdx int) error { - node := self.getSelectedItem() - if node != nil && node.File != nil { - return self.EnterFile(types.OnFocusOpts{ClickedWindowName: mainViewName, ClickedViewLineIdx: clickedLineIdx}) - } - return nil - } -} - // if we are dealing with a status for which there is no key in this map, // then we won't optimistically render: we'll just let `git status` tell // us what the new status is. diff --git a/pkg/gui/controllers/main_view_controller.go b/pkg/gui/controllers/main_view_controller.go index 648a96b98..70e287f40 100644 --- a/pkg/gui/controllers/main_view_controller.go +++ b/pkg/gui/controllers/main_view_controller.go @@ -62,12 +62,6 @@ func (self *MainViewController) GetKeybindings(opts types.KeybindingsOpts) []*ty func (self *MainViewController) GetMouseKeybindings(opts types.KeybindingsOpts) []*gocui.ViewMouseBinding { return []*gocui.ViewMouseBinding{ - { - ViewName: self.context.GetViewName(), - Key: gocui.MouseLeft, - Handler: self.onClickInAlreadyFocusedView, - FocusedView: self.context.GetViewName(), - }, { ViewName: self.context.GetViewName(), Key: gocui.MouseLeft, @@ -94,14 +88,6 @@ func (self *MainViewController) escape() error { return nil } -func (self *MainViewController) onClickInAlreadyFocusedView(opts gocui.ViewMouseBindingOpts) error { - sidePanelContext := self.c.Context().NextInStack(self.context) - if sidePanelContext != nil && sidePanelContext.GetOnClickFocusedMainView() != nil { - return sidePanelContext.GetOnClickFocusedMainView()(self.context.GetViewName(), opts.Y) - } - return nil -} - func (self *MainViewController) onClickInOtherViewOfMainViewPair(opts gocui.ViewMouseBindingOpts) error { self.c.Context().Push(self.context, types.OnFocusOpts{ ClickedWindowName: self.context.GetWindowName(),