detached e926382

fix(ui): prevent duplicate panes on split by properly handling widget reparenting

commit
e92638254b75cfbc8f7a3668f651519e01bb9c69
author
brice · · 2025-12-14 18:10 UTC
committer
brice · · 2025-12-14 18:51 UTC
parent
aa98e12
signature
unsigned
9 files · +293 -3
M internal/ui/component/pane_view.go +6 -1
@@ -112,7 +112,7 @@ func (pv *PaneView) SetWebViewWidget(widget layout.Widget) {
112112 pv.mu.Lock()
113113 defer pv.mu.Unlock()
114114
115- // Remove old widget
115+ // Remove old widget from this overlay
116116 if pv.webViewWidget != nil {
117117 pv.overlay.SetChild(nil)
118118 }
@@ -120,6 +120,11 @@ func (pv *PaneView) SetWebViewWidget(widget layout.Widget) {
120120 pv.webViewWidget = widget
121121
122122 if widget != nil {
123+ // Unparent widget from any previous parent (critical for rebuild scenarios)
124+ // In GTK4, a widget can only have one parent at a time
125+ if widget.GetParent() != nil {
126+ widget.Unparent()
127+ }
123128 widget.SetVisible(true)
124129 pv.overlay.SetChild(widget)
125130 }
@@ -112,7 +112,7 @@ func (pv *PaneView) SetWebViewWidget(widget layout.Widget) {
112 pv.mu.Lock()112 pv.mu.Lock()
113 defer pv.mu.Unlock()113 defer pv.mu.Unlock()
114 114
115- // Remove old widget115+ // Remove old widget from this overlay
116 if pv.webViewWidget != nil {116 if pv.webViewWidget != nil {
117 pv.overlay.SetChild(nil)117 pv.overlay.SetChild(nil)
118 }118 }
@@ -120,6 +120,11 @@ func (pv *PaneView) SetWebViewWidget(widget layout.Widget) {
120 pv.webViewWidget = widget120 pv.webViewWidget = widget
121 121
122 if widget != nil {122 if widget != nil {
123+ // Unparent widget from any previous parent (critical for rebuild scenarios)
124+ // In GTK4, a widget can only have one parent at a time
125+ if widget.GetParent() != nil {
126+ widget.Unparent()
127+ }
123 widget.SetVisible(true)128 widget.SetVisible(true)
124 pv.overlay.SetChild(widget)129 pv.overlay.SetChild(widget)
125 }130 }
M internal/ui/component/workspace_view.go +7 -2
@@ -24,6 +24,7 @@ type WorkspaceView struct {
2424 factory layout.WidgetFactory
2525 treeRenderer *layout.TreeRenderer
2626 container layout.BoxWidget
27+ rootWidget layout.Widget // Current root widget for removal on rebuild
2728 logger zerolog.Logger
2829
2930 workspace *entity.Workspace
@@ -103,8 +104,11 @@ func (wv *WorkspaceView) SetWorkspace(ws *entity.Workspace) error {
103104 wv.workspace = ws
104105 wv.paneViews = make(map[entity.PaneID]*PaneView)
105106
106- // Remove old content from container
107- // (In a real GTK app, we'd need to iterate and remove children)
107+ // Remove old root widget from container before building new tree
108+ if wv.rootWidget != nil {
109+ wv.container.Remove(wv.rootWidget)
110+ wv.rootWidget = nil
111+ }
108112
109113 // Build new tree
110114 if ws.Root != nil {
@@ -116,6 +120,7 @@ func (wv *WorkspaceView) SetWorkspace(ws *entity.Workspace) error {
116120 if widget != nil {
117121 widget.SetVisible(true)
118122 wv.container.Append(widget)
123+ wv.rootWidget = widget
119124 }
120125 }
121126
@@ -24,6 +24,7 @@ type WorkspaceView struct {
24 factory layout.WidgetFactory24 factory layout.WidgetFactory
25 treeRenderer *layout.TreeRenderer25 treeRenderer *layout.TreeRenderer
26 container layout.BoxWidget26 container layout.BoxWidget
27+ rootWidget layout.Widget // Current root widget for removal on rebuild
27 logger zerolog.Logger28 logger zerolog.Logger
28 29
29 workspace *entity.Workspace30 workspace *entity.Workspace
@@ -103,8 +104,11 @@ func (wv *WorkspaceView) SetWorkspace(ws *entity.Workspace) error {
103 wv.workspace = ws104 wv.workspace = ws
104 wv.paneViews = make(map[entity.PaneID]*PaneView)105 wv.paneViews = make(map[entity.PaneID]*PaneView)
105 106
106- // Remove old content from container107+ // Remove old root widget from container before building new tree
107- // (In a real GTK app, we'd need to iterate and remove children)108+ if wv.rootWidget != nil {
109+ wv.container.Remove(wv.rootWidget)
110+ wv.rootWidget = nil
111+ }
108 112
109 // Build new tree113 // Build new tree
110 if ws.Root != nil {114 if ws.Root != nil {
@@ -116,6 +120,7 @@ func (wv *WorkspaceView) SetWorkspace(ws *entity.Workspace) error {
116 if widget != nil {120 if widget != nil {
117 widget.SetVisible(true)121 widget.SetVisible(true)
118 wv.container.Append(widget)122 wv.container.Append(widget)
123+ wv.rootWidget = widget
119 }124 }
120 }125 }
121 126
M internal/ui/layout/mocks/mock_box_widget.go +40 -0
@@ -897,6 +897,46 @@ func (_c *MockBoxWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool))
897897 return _c
898898 }
899899
900+// SetCanTarget provides a mock function for the type MockBoxWidget
901+func (_mock *MockBoxWidget) SetCanTarget(canTarget bool) {
902+ _mock.Called(canTarget)
903+ return
904+}
905+
906+// MockBoxWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
907+type MockBoxWidget_SetCanTarget_Call struct {
908+ *mock.Call
909+}
910+
911+// SetCanTarget is a helper method to define mock.On call
912+// - canTarget bool
913+func (_e *MockBoxWidget_Expecter) SetCanTarget(canTarget interface{}) *MockBoxWidget_SetCanTarget_Call {
914+ return &MockBoxWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
915+}
916+
917+func (_c *MockBoxWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockBoxWidget_SetCanTarget_Call {
918+ _c.Call.Run(func(args mock.Arguments) {
919+ var arg0 bool
920+ if args[0] != nil {
921+ arg0 = args[0].(bool)
922+ }
923+ run(
924+ arg0,
925+ )
926+ })
927+ return _c
928+}
929+
930+func (_c *MockBoxWidget_SetCanTarget_Call) Return() *MockBoxWidget_SetCanTarget_Call {
931+ _c.Call.Return()
932+ return _c
933+}
934+
935+func (_c *MockBoxWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockBoxWidget_SetCanTarget_Call {
936+ _c.Run(run)
937+ return _c
938+}
939+
900940 // SetFocusOnClick provides a mock function for the type MockBoxWidget
901941 func (_mock *MockBoxWidget) SetFocusOnClick(focusOnClick bool) {
902942 _mock.Called(focusOnClick)
@@ -897,6 +897,46 @@ func (_c *MockBoxWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool))
897 return _c897 return _c
898 }898 }
899 899
900+// SetCanTarget provides a mock function for the type MockBoxWidget
901+func (_mock *MockBoxWidget) SetCanTarget(canTarget bool) {
902+ _mock.Called(canTarget)
903+ return
904+}
905+
906+// MockBoxWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
907+type MockBoxWidget_SetCanTarget_Call struct {
908+ *mock.Call
909+}
910+
911+// SetCanTarget is a helper method to define mock.On call
912+// - canTarget bool
913+func (_e *MockBoxWidget_Expecter) SetCanTarget(canTarget interface{}) *MockBoxWidget_SetCanTarget_Call {
914+ return &MockBoxWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
915+}
916+
917+func (_c *MockBoxWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockBoxWidget_SetCanTarget_Call {
918+ _c.Call.Run(func(args mock.Arguments) {
919+ var arg0 bool
920+ if args[0] != nil {
921+ arg0 = args[0].(bool)
922+ }
923+ run(
924+ arg0,
925+ )
926+ })
927+ return _c
928+}
929+
930+func (_c *MockBoxWidget_SetCanTarget_Call) Return() *MockBoxWidget_SetCanTarget_Call {
931+ _c.Call.Return()
932+ return _c
933+}
934+
935+func (_c *MockBoxWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockBoxWidget_SetCanTarget_Call {
936+ _c.Run(run)
937+ return _c
938+}
939+
900 // SetFocusOnClick provides a mock function for the type MockBoxWidget940 // SetFocusOnClick provides a mock function for the type MockBoxWidget
901 func (_mock *MockBoxWidget) SetFocusOnClick(focusOnClick bool) {941 func (_mock *MockBoxWidget) SetFocusOnClick(focusOnClick bool) {
902 _mock.Called(focusOnClick)942 _mock.Called(focusOnClick)
M internal/ui/layout/mocks/mock_button_widget.go +40 -0
@@ -694,6 +694,46 @@ func (_c *MockButtonWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool
694694 return _c
695695 }
696696
697+// SetCanTarget provides a mock function for the type MockButtonWidget
698+func (_mock *MockButtonWidget) SetCanTarget(canTarget bool) {
699+ _mock.Called(canTarget)
700+ return
701+}
702+
703+// MockButtonWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
704+type MockButtonWidget_SetCanTarget_Call struct {
705+ *mock.Call
706+}
707+
708+// SetCanTarget is a helper method to define mock.On call
709+// - canTarget bool
710+func (_e *MockButtonWidget_Expecter) SetCanTarget(canTarget interface{}) *MockButtonWidget_SetCanTarget_Call {
711+ return &MockButtonWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
712+}
713+
714+func (_c *MockButtonWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockButtonWidget_SetCanTarget_Call {
715+ _c.Call.Run(func(args mock.Arguments) {
716+ var arg0 bool
717+ if args[0] != nil {
718+ arg0 = args[0].(bool)
719+ }
720+ run(
721+ arg0,
722+ )
723+ })
724+ return _c
725+}
726+
727+func (_c *MockButtonWidget_SetCanTarget_Call) Return() *MockButtonWidget_SetCanTarget_Call {
728+ _c.Call.Return()
729+ return _c
730+}
731+
732+func (_c *MockButtonWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockButtonWidget_SetCanTarget_Call {
733+ _c.Run(run)
734+ return _c
735+}
736+
697737 // SetChild provides a mock function for the type MockButtonWidget
698738 func (_mock *MockButtonWidget) SetChild(child layout.Widget) {
699739 _mock.Called(child)
@@ -694,6 +694,46 @@ func (_c *MockButtonWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool
694 return _c694 return _c
695 }695 }
696 696
697+// SetCanTarget provides a mock function for the type MockButtonWidget
698+func (_mock *MockButtonWidget) SetCanTarget(canTarget bool) {
699+ _mock.Called(canTarget)
700+ return
701+}
702+
703+// MockButtonWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
704+type MockButtonWidget_SetCanTarget_Call struct {
705+ *mock.Call
706+}
707+
708+// SetCanTarget is a helper method to define mock.On call
709+// - canTarget bool
710+func (_e *MockButtonWidget_Expecter) SetCanTarget(canTarget interface{}) *MockButtonWidget_SetCanTarget_Call {
711+ return &MockButtonWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
712+}
713+
714+func (_c *MockButtonWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockButtonWidget_SetCanTarget_Call {
715+ _c.Call.Run(func(args mock.Arguments) {
716+ var arg0 bool
717+ if args[0] != nil {
718+ arg0 = args[0].(bool)
719+ }
720+ run(
721+ arg0,
722+ )
723+ })
724+ return _c
725+}
726+
727+func (_c *MockButtonWidget_SetCanTarget_Call) Return() *MockButtonWidget_SetCanTarget_Call {
728+ _c.Call.Return()
729+ return _c
730+}
731+
732+func (_c *MockButtonWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockButtonWidget_SetCanTarget_Call {
733+ _c.Run(run)
734+ return _c
735+}
736+
697 // SetChild provides a mock function for the type MockButtonWidget737 // SetChild provides a mock function for the type MockButtonWidget
698 func (_mock *MockButtonWidget) SetChild(child layout.Widget) {738 func (_mock *MockButtonWidget) SetChild(child layout.Widget) {
699 _mock.Called(child)739 _mock.Called(child)
M internal/ui/layout/mocks/mock_image_widget.go +40 -0
@@ -586,6 +586,46 @@ func (_c *MockImageWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool)
586586 return _c
587587 }
588588
589+// SetCanTarget provides a mock function for the type MockImageWidget
590+func (_mock *MockImageWidget) SetCanTarget(canTarget bool) {
591+ _mock.Called(canTarget)
592+ return
593+}
594+
595+// MockImageWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
596+type MockImageWidget_SetCanTarget_Call struct {
597+ *mock.Call
598+}
599+
600+// SetCanTarget is a helper method to define mock.On call
601+// - canTarget bool
602+func (_e *MockImageWidget_Expecter) SetCanTarget(canTarget interface{}) *MockImageWidget_SetCanTarget_Call {
603+ return &MockImageWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
604+}
605+
606+func (_c *MockImageWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockImageWidget_SetCanTarget_Call {
607+ _c.Call.Run(func(args mock.Arguments) {
608+ var arg0 bool
609+ if args[0] != nil {
610+ arg0 = args[0].(bool)
611+ }
612+ run(
613+ arg0,
614+ )
615+ })
616+ return _c
617+}
618+
619+func (_c *MockImageWidget_SetCanTarget_Call) Return() *MockImageWidget_SetCanTarget_Call {
620+ _c.Call.Return()
621+ return _c
622+}
623+
624+func (_c *MockImageWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockImageWidget_SetCanTarget_Call {
625+ _c.Run(run)
626+ return _c
627+}
628+
589629 // SetFocusOnClick provides a mock function for the type MockImageWidget
590630 func (_mock *MockImageWidget) SetFocusOnClick(focusOnClick bool) {
591631 _mock.Called(focusOnClick)
@@ -586,6 +586,46 @@ func (_c *MockImageWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool)
586 return _c586 return _c
587 }587 }
588 588
589+// SetCanTarget provides a mock function for the type MockImageWidget
590+func (_mock *MockImageWidget) SetCanTarget(canTarget bool) {
591+ _mock.Called(canTarget)
592+ return
593+}
594+
595+// MockImageWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
596+type MockImageWidget_SetCanTarget_Call struct {
597+ *mock.Call
598+}
599+
600+// SetCanTarget is a helper method to define mock.On call
601+// - canTarget bool
602+func (_e *MockImageWidget_Expecter) SetCanTarget(canTarget interface{}) *MockImageWidget_SetCanTarget_Call {
603+ return &MockImageWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
604+}
605+
606+func (_c *MockImageWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockImageWidget_SetCanTarget_Call {
607+ _c.Call.Run(func(args mock.Arguments) {
608+ var arg0 bool
609+ if args[0] != nil {
610+ arg0 = args[0].(bool)
611+ }
612+ run(
613+ arg0,
614+ )
615+ })
616+ return _c
617+}
618+
619+func (_c *MockImageWidget_SetCanTarget_Call) Return() *MockImageWidget_SetCanTarget_Call {
620+ _c.Call.Return()
621+ return _c
622+}
623+
624+func (_c *MockImageWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockImageWidget_SetCanTarget_Call {
625+ _c.Run(run)
626+ return _c
627+}
628+
589 // SetFocusOnClick provides a mock function for the type MockImageWidget629 // SetFocusOnClick provides a mock function for the type MockImageWidget
590 func (_mock *MockImageWidget) SetFocusOnClick(focusOnClick bool) {630 func (_mock *MockImageWidget) SetFocusOnClick(focusOnClick bool) {
591 _mock.Called(focusOnClick)631 _mock.Called(focusOnClick)
M internal/ui/layout/mocks/mock_label_widget.go +40 -0
@@ -597,6 +597,46 @@ func (_c *MockLabelWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool)
597597 return _c
598598 }
599599
600+// SetCanTarget provides a mock function for the type MockLabelWidget
601+func (_mock *MockLabelWidget) SetCanTarget(canTarget bool) {
602+ _mock.Called(canTarget)
603+ return
604+}
605+
606+// MockLabelWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
607+type MockLabelWidget_SetCanTarget_Call struct {
608+ *mock.Call
609+}
610+
611+// SetCanTarget is a helper method to define mock.On call
612+// - canTarget bool
613+func (_e *MockLabelWidget_Expecter) SetCanTarget(canTarget interface{}) *MockLabelWidget_SetCanTarget_Call {
614+ return &MockLabelWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
615+}
616+
617+func (_c *MockLabelWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockLabelWidget_SetCanTarget_Call {
618+ _c.Call.Run(func(args mock.Arguments) {
619+ var arg0 bool
620+ if args[0] != nil {
621+ arg0 = args[0].(bool)
622+ }
623+ run(
624+ arg0,
625+ )
626+ })
627+ return _c
628+}
629+
630+func (_c *MockLabelWidget_SetCanTarget_Call) Return() *MockLabelWidget_SetCanTarget_Call {
631+ _c.Call.Return()
632+ return _c
633+}
634+
635+func (_c *MockLabelWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockLabelWidget_SetCanTarget_Call {
636+ _c.Run(run)
637+ return _c
638+}
639+
600640 // SetEllipsize provides a mock function for the type MockLabelWidget
601641 func (_mock *MockLabelWidget) SetEllipsize(mode layout.EllipsizeMode) {
602642 _mock.Called(mode)
@@ -597,6 +597,46 @@ func (_c *MockLabelWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool)
597 return _c597 return _c
598 }598 }
599 599
600+// SetCanTarget provides a mock function for the type MockLabelWidget
601+func (_mock *MockLabelWidget) SetCanTarget(canTarget bool) {
602+ _mock.Called(canTarget)
603+ return
604+}
605+
606+// MockLabelWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
607+type MockLabelWidget_SetCanTarget_Call struct {
608+ *mock.Call
609+}
610+
611+// SetCanTarget is a helper method to define mock.On call
612+// - canTarget bool
613+func (_e *MockLabelWidget_Expecter) SetCanTarget(canTarget interface{}) *MockLabelWidget_SetCanTarget_Call {
614+ return &MockLabelWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
615+}
616+
617+func (_c *MockLabelWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockLabelWidget_SetCanTarget_Call {
618+ _c.Call.Run(func(args mock.Arguments) {
619+ var arg0 bool
620+ if args[0] != nil {
621+ arg0 = args[0].(bool)
622+ }
623+ run(
624+ arg0,
625+ )
626+ })
627+ return _c
628+}
629+
630+func (_c *MockLabelWidget_SetCanTarget_Call) Return() *MockLabelWidget_SetCanTarget_Call {
631+ _c.Call.Return()
632+ return _c
633+}
634+
635+func (_c *MockLabelWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockLabelWidget_SetCanTarget_Call {
636+ _c.Run(run)
637+ return _c
638+}
639+
600 // SetEllipsize provides a mock function for the type MockLabelWidget640 // SetEllipsize provides a mock function for the type MockLabelWidget
601 func (_mock *MockLabelWidget) SetEllipsize(mode layout.EllipsizeMode) {641 func (_mock *MockLabelWidget) SetEllipsize(mode layout.EllipsizeMode) {
602 _mock.Called(mode)642 _mock.Called(mode)
M internal/ui/layout/mocks/mock_overlay_widget.go +40 -0
@@ -781,6 +781,46 @@ func (_c *MockOverlayWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus boo
781781 return _c
782782 }
783783
784+// SetCanTarget provides a mock function for the type MockOverlayWidget
785+func (_mock *MockOverlayWidget) SetCanTarget(canTarget bool) {
786+ _mock.Called(canTarget)
787+ return
788+}
789+
790+// MockOverlayWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
791+type MockOverlayWidget_SetCanTarget_Call struct {
792+ *mock.Call
793+}
794+
795+// SetCanTarget is a helper method to define mock.On call
796+// - canTarget bool
797+func (_e *MockOverlayWidget_Expecter) SetCanTarget(canTarget interface{}) *MockOverlayWidget_SetCanTarget_Call {
798+ return &MockOverlayWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
799+}
800+
801+func (_c *MockOverlayWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockOverlayWidget_SetCanTarget_Call {
802+ _c.Call.Run(func(args mock.Arguments) {
803+ var arg0 bool
804+ if args[0] != nil {
805+ arg0 = args[0].(bool)
806+ }
807+ run(
808+ arg0,
809+ )
810+ })
811+ return _c
812+}
813+
814+func (_c *MockOverlayWidget_SetCanTarget_Call) Return() *MockOverlayWidget_SetCanTarget_Call {
815+ _c.Call.Return()
816+ return _c
817+}
818+
819+func (_c *MockOverlayWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockOverlayWidget_SetCanTarget_Call {
820+ _c.Run(run)
821+ return _c
822+}
823+
784824 // SetChild provides a mock function for the type MockOverlayWidget
785825 func (_mock *MockOverlayWidget) SetChild(child layout.Widget) {
786826 _mock.Called(child)
@@ -781,6 +781,46 @@ func (_c *MockOverlayWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus boo
781 return _c781 return _c
782 }782 }
783 783
784+// SetCanTarget provides a mock function for the type MockOverlayWidget
785+func (_mock *MockOverlayWidget) SetCanTarget(canTarget bool) {
786+ _mock.Called(canTarget)
787+ return
788+}
789+
790+// MockOverlayWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
791+type MockOverlayWidget_SetCanTarget_Call struct {
792+ *mock.Call
793+}
794+
795+// SetCanTarget is a helper method to define mock.On call
796+// - canTarget bool
797+func (_e *MockOverlayWidget_Expecter) SetCanTarget(canTarget interface{}) *MockOverlayWidget_SetCanTarget_Call {
798+ return &MockOverlayWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
799+}
800+
801+func (_c *MockOverlayWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockOverlayWidget_SetCanTarget_Call {
802+ _c.Call.Run(func(args mock.Arguments) {
803+ var arg0 bool
804+ if args[0] != nil {
805+ arg0 = args[0].(bool)
806+ }
807+ run(
808+ arg0,
809+ )
810+ })
811+ return _c
812+}
813+
814+func (_c *MockOverlayWidget_SetCanTarget_Call) Return() *MockOverlayWidget_SetCanTarget_Call {
815+ _c.Call.Return()
816+ return _c
817+}
818+
819+func (_c *MockOverlayWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockOverlayWidget_SetCanTarget_Call {
820+ _c.Run(run)
821+ return _c
822+}
823+
784 // SetChild provides a mock function for the type MockOverlayWidget824 // SetChild provides a mock function for the type MockOverlayWidget
785 func (_mock *MockOverlayWidget) SetChild(child layout.Widget) {825 func (_mock *MockOverlayWidget) SetChild(child layout.Widget) {
786 _mock.Called(child)826 _mock.Called(child)
M internal/ui/layout/mocks/mock_paned_widget.go +40 -0
@@ -1099,6 +1099,46 @@ func (_c *MockPanedWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool)
10991099 return _c
11001100 }
11011101
1102+// SetCanTarget provides a mock function for the type MockPanedWidget
1103+func (_mock *MockPanedWidget) SetCanTarget(canTarget bool) {
1104+ _mock.Called(canTarget)
1105+ return
1106+}
1107+
1108+// MockPanedWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
1109+type MockPanedWidget_SetCanTarget_Call struct {
1110+ *mock.Call
1111+}
1112+
1113+// SetCanTarget is a helper method to define mock.On call
1114+// - canTarget bool
1115+func (_e *MockPanedWidget_Expecter) SetCanTarget(canTarget interface{}) *MockPanedWidget_SetCanTarget_Call {
1116+ return &MockPanedWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
1117+}
1118+
1119+func (_c *MockPanedWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockPanedWidget_SetCanTarget_Call {
1120+ _c.Call.Run(func(args mock.Arguments) {
1121+ var arg0 bool
1122+ if args[0] != nil {
1123+ arg0 = args[0].(bool)
1124+ }
1125+ run(
1126+ arg0,
1127+ )
1128+ })
1129+ return _c
1130+}
1131+
1132+func (_c *MockPanedWidget_SetCanTarget_Call) Return() *MockPanedWidget_SetCanTarget_Call {
1133+ _c.Call.Return()
1134+ return _c
1135+}
1136+
1137+func (_c *MockPanedWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockPanedWidget_SetCanTarget_Call {
1138+ _c.Run(run)
1139+ return _c
1140+}
1141+
11021142 // SetEndChild provides a mock function for the type MockPanedWidget
11031143 func (_mock *MockPanedWidget) SetEndChild(child layout.Widget) {
11041144 _mock.Called(child)
@@ -1099,6 +1099,46 @@ func (_c *MockPanedWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool)
1099 return _c1099 return _c
1100 }1100 }
1101 1101
1102+// SetCanTarget provides a mock function for the type MockPanedWidget
1103+func (_mock *MockPanedWidget) SetCanTarget(canTarget bool) {
1104+ _mock.Called(canTarget)
1105+ return
1106+}
1107+
1108+// MockPanedWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
1109+type MockPanedWidget_SetCanTarget_Call struct {
1110+ *mock.Call
1111+}
1112+
1113+// SetCanTarget is a helper method to define mock.On call
1114+// - canTarget bool
1115+func (_e *MockPanedWidget_Expecter) SetCanTarget(canTarget interface{}) *MockPanedWidget_SetCanTarget_Call {
1116+ return &MockPanedWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
1117+}
1118+
1119+func (_c *MockPanedWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockPanedWidget_SetCanTarget_Call {
1120+ _c.Call.Run(func(args mock.Arguments) {
1121+ var arg0 bool
1122+ if args[0] != nil {
1123+ arg0 = args[0].(bool)
1124+ }
1125+ run(
1126+ arg0,
1127+ )
1128+ })
1129+ return _c
1130+}
1131+
1132+func (_c *MockPanedWidget_SetCanTarget_Call) Return() *MockPanedWidget_SetCanTarget_Call {
1133+ _c.Call.Return()
1134+ return _c
1135+}
1136+
1137+func (_c *MockPanedWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockPanedWidget_SetCanTarget_Call {
1138+ _c.Run(run)
1139+ return _c
1140+}
1141+
1102 // SetEndChild provides a mock function for the type MockPanedWidget1142 // SetEndChild provides a mock function for the type MockPanedWidget
1103 func (_mock *MockPanedWidget) SetEndChild(child layout.Widget) {1143 func (_mock *MockPanedWidget) SetEndChild(child layout.Widget) {
1104 _mock.Called(child)1144 _mock.Called(child)
M internal/ui/layout/mocks/mock_widget.go +40 -0
@@ -553,6 +553,46 @@ func (_c *MockWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool)) *Mo
553553 return _c
554554 }
555555
556+// SetCanTarget provides a mock function for the type MockWidget
557+func (_mock *MockWidget) SetCanTarget(canTarget bool) {
558+ _mock.Called(canTarget)
559+ return
560+}
561+
562+// MockWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
563+type MockWidget_SetCanTarget_Call struct {
564+ *mock.Call
565+}
566+
567+// SetCanTarget is a helper method to define mock.On call
568+// - canTarget bool
569+func (_e *MockWidget_Expecter) SetCanTarget(canTarget interface{}) *MockWidget_SetCanTarget_Call {
570+ return &MockWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
571+}
572+
573+func (_c *MockWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockWidget_SetCanTarget_Call {
574+ _c.Call.Run(func(args mock.Arguments) {
575+ var arg0 bool
576+ if args[0] != nil {
577+ arg0 = args[0].(bool)
578+ }
579+ run(
580+ arg0,
581+ )
582+ })
583+ return _c
584+}
585+
586+func (_c *MockWidget_SetCanTarget_Call) Return() *MockWidget_SetCanTarget_Call {
587+ _c.Call.Return()
588+ return _c
589+}
590+
591+func (_c *MockWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockWidget_SetCanTarget_Call {
592+ _c.Run(run)
593+ return _c
594+}
595+
556596 // SetFocusOnClick provides a mock function for the type MockWidget
557597 func (_mock *MockWidget) SetFocusOnClick(focusOnClick bool) {
558598 _mock.Called(focusOnClick)
@@ -553,6 +553,46 @@ func (_c *MockWidget_SetCanFocus_Call) RunAndReturn(run func(canFocus bool)) *Mo
553 return _c553 return _c
554 }554 }
555 555
556+// SetCanTarget provides a mock function for the type MockWidget
557+func (_mock *MockWidget) SetCanTarget(canTarget bool) {
558+ _mock.Called(canTarget)
559+ return
560+}
561+
562+// MockWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget'
563+type MockWidget_SetCanTarget_Call struct {
564+ *mock.Call
565+}
566+
567+// SetCanTarget is a helper method to define mock.On call
568+// - canTarget bool
569+func (_e *MockWidget_Expecter) SetCanTarget(canTarget interface{}) *MockWidget_SetCanTarget_Call {
570+ return &MockWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)}
571+}
572+
573+func (_c *MockWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockWidget_SetCanTarget_Call {
574+ _c.Call.Run(func(args mock.Arguments) {
575+ var arg0 bool
576+ if args[0] != nil {
577+ arg0 = args[0].(bool)
578+ }
579+ run(
580+ arg0,
581+ )
582+ })
583+ return _c
584+}
585+
586+func (_c *MockWidget_SetCanTarget_Call) Return() *MockWidget_SetCanTarget_Call {
587+ _c.Call.Return()
588+ return _c
589+}
590+
591+func (_c *MockWidget_SetCanTarget_Call) RunAndReturn(run func(canTarget bool)) *MockWidget_SetCanTarget_Call {
592+ _c.Run(run)
593+ return _c
594+}
595+
556 // SetFocusOnClick provides a mock function for the type MockWidget596 // SetFocusOnClick provides a mock function for the type MockWidget
557 func (_mock *MockWidget) SetFocusOnClick(focusOnClick bool) {597 func (_mock *MockWidget) SetFocusOnClick(focusOnClick bool) {
558 _mock.Called(focusOnClick)598 _mock.Called(focusOnClick)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close