detached 79f8362

refactor(tests): update test cases and regenerate mocks for context parameter changes

Update test files to call refactored methods with context parameter:
- internal/ui/layout/tree_test.go
- internal/ui/layout/split_test.go
- internal/ui/layout/stacked_test.go

Regenerate mock files to reflect interface changes in refactored components:
- internal/ui/layout/mocks/mock_box_widget.go
- internal/ui/layout/mocks/mock_button_widget.go
- internal/ui/layout/mocks/mock_image_widget.go
- internal/ui/layout/mocks/mock_label_widget.go
- internal/ui/layout/mocks/mock_overlay_widget.go
- internal/ui/layout/mocks/mock_paned_widget.go
- internal/ui/layout/mocks/mock_widget.go
commit
79f836210d498a54fc65861132cbd489ad69e8dc
author
brice · · 2025-12-17 06:45 UTC
parent
5a4101a
signature
unsigned
10 files · +1156 -78
M internal/ui/layout/mocks/mock_box_widget.go +154 -0
@@ -117,6 +117,160 @@ func (_c *MockBoxWidget_Append_Call) RunAndReturn(run func(child layout.Widget))
117117 return _c
118118 }
119119
120+// ComputePoint provides a mock function for the type MockBoxWidget
121+func (_mock *MockBoxWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
122+ ret := _mock.Called(target)
123+
124+ if len(ret) == 0 {
125+ panic("no return value specified for ComputePoint")
126+ }
127+
128+ var r0 float64
129+ var r1 float64
130+ var r2 bool
131+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
132+ return returnFunc(target)
133+ }
134+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
135+ r0 = returnFunc(target)
136+ } else {
137+ r0 = ret.Get(0).(float64)
138+ }
139+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
140+ r1 = returnFunc(target)
141+ } else {
142+ r1 = ret.Get(1).(float64)
143+ }
144+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
145+ r2 = returnFunc(target)
146+ } else {
147+ r2 = ret.Get(2).(bool)
148+ }
149+ return r0, r1, r2
150+}
151+
152+// MockBoxWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
153+type MockBoxWidget_ComputePoint_Call struct {
154+ *mock.Call
155+}
156+
157+// ComputePoint is a helper method to define mock.On call
158+// - target layout.Widget
159+func (_e *MockBoxWidget_Expecter) ComputePoint(target interface{}) *MockBoxWidget_ComputePoint_Call {
160+ return &MockBoxWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
161+}
162+
163+func (_c *MockBoxWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockBoxWidget_ComputePoint_Call {
164+ _c.Call.Run(func(args mock.Arguments) {
165+ var arg0 layout.Widget
166+ if args[0] != nil {
167+ arg0 = args[0].(layout.Widget)
168+ }
169+ run(
170+ arg0,
171+ )
172+ })
173+ return _c
174+}
175+
176+func (_c *MockBoxWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockBoxWidget_ComputePoint_Call {
177+ _c.Call.Return(x, y, ok)
178+ return _c
179+}
180+
181+func (_c *MockBoxWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockBoxWidget_ComputePoint_Call {
182+ _c.Call.Return(run)
183+ return _c
184+}
185+
186+// GetAllocatedHeight provides a mock function for the type MockBoxWidget
187+func (_mock *MockBoxWidget) GetAllocatedHeight() int {
188+ ret := _mock.Called()
189+
190+ if len(ret) == 0 {
191+ panic("no return value specified for GetAllocatedHeight")
192+ }
193+
194+ var r0 int
195+ if returnFunc, ok := ret.Get(0).(func() int); ok {
196+ r0 = returnFunc()
197+ } else {
198+ r0 = ret.Get(0).(int)
199+ }
200+ return r0
201+}
202+
203+// MockBoxWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
204+type MockBoxWidget_GetAllocatedHeight_Call struct {
205+ *mock.Call
206+}
207+
208+// GetAllocatedHeight is a helper method to define mock.On call
209+func (_e *MockBoxWidget_Expecter) GetAllocatedHeight() *MockBoxWidget_GetAllocatedHeight_Call {
210+ return &MockBoxWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
211+}
212+
213+func (_c *MockBoxWidget_GetAllocatedHeight_Call) Run(run func()) *MockBoxWidget_GetAllocatedHeight_Call {
214+ _c.Call.Run(func(args mock.Arguments) {
215+ run()
216+ })
217+ return _c
218+}
219+
220+func (_c *MockBoxWidget_GetAllocatedHeight_Call) Return(n int) *MockBoxWidget_GetAllocatedHeight_Call {
221+ _c.Call.Return(n)
222+ return _c
223+}
224+
225+func (_c *MockBoxWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockBoxWidget_GetAllocatedHeight_Call {
226+ _c.Call.Return(run)
227+ return _c
228+}
229+
230+// GetAllocatedWidth provides a mock function for the type MockBoxWidget
231+func (_mock *MockBoxWidget) GetAllocatedWidth() int {
232+ ret := _mock.Called()
233+
234+ if len(ret) == 0 {
235+ panic("no return value specified for GetAllocatedWidth")
236+ }
237+
238+ var r0 int
239+ if returnFunc, ok := ret.Get(0).(func() int); ok {
240+ r0 = returnFunc()
241+ } else {
242+ r0 = ret.Get(0).(int)
243+ }
244+ return r0
245+}
246+
247+// MockBoxWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
248+type MockBoxWidget_GetAllocatedWidth_Call struct {
249+ *mock.Call
250+}
251+
252+// GetAllocatedWidth is a helper method to define mock.On call
253+func (_e *MockBoxWidget_Expecter) GetAllocatedWidth() *MockBoxWidget_GetAllocatedWidth_Call {
254+ return &MockBoxWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
255+}
256+
257+func (_c *MockBoxWidget_GetAllocatedWidth_Call) Run(run func()) *MockBoxWidget_GetAllocatedWidth_Call {
258+ _c.Call.Run(func(args mock.Arguments) {
259+ run()
260+ })
261+ return _c
262+}
263+
264+func (_c *MockBoxWidget_GetAllocatedWidth_Call) Return(n int) *MockBoxWidget_GetAllocatedWidth_Call {
265+ _c.Call.Return(n)
266+ return _c
267+}
268+
269+func (_c *MockBoxWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockBoxWidget_GetAllocatedWidth_Call {
270+ _c.Call.Return(run)
271+ return _c
272+}
273+
120274 // GetHexpand provides a mock function for the type MockBoxWidget
121275 func (_mock *MockBoxWidget) GetHexpand() bool {
122276 ret := _mock.Called()
@@ -117,6 +117,160 @@ func (_c *MockBoxWidget_Append_Call) RunAndReturn(run func(child layout.Widget))
117 return _c117 return _c
118 }118 }
119 119
120+// ComputePoint provides a mock function for the type MockBoxWidget
121+func (_mock *MockBoxWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
122+ ret := _mock.Called(target)
123+
124+ if len(ret) == 0 {
125+ panic("no return value specified for ComputePoint")
126+ }
127+
128+ var r0 float64
129+ var r1 float64
130+ var r2 bool
131+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
132+ return returnFunc(target)
133+ }
134+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
135+ r0 = returnFunc(target)
136+ } else {
137+ r0 = ret.Get(0).(float64)
138+ }
139+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
140+ r1 = returnFunc(target)
141+ } else {
142+ r1 = ret.Get(1).(float64)
143+ }
144+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
145+ r2 = returnFunc(target)
146+ } else {
147+ r2 = ret.Get(2).(bool)
148+ }
149+ return r0, r1, r2
150+}
151+
152+// MockBoxWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
153+type MockBoxWidget_ComputePoint_Call struct {
154+ *mock.Call
155+}
156+
157+// ComputePoint is a helper method to define mock.On call
158+// - target layout.Widget
159+func (_e *MockBoxWidget_Expecter) ComputePoint(target interface{}) *MockBoxWidget_ComputePoint_Call {
160+ return &MockBoxWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
161+}
162+
163+func (_c *MockBoxWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockBoxWidget_ComputePoint_Call {
164+ _c.Call.Run(func(args mock.Arguments) {
165+ var arg0 layout.Widget
166+ if args[0] != nil {
167+ arg0 = args[0].(layout.Widget)
168+ }
169+ run(
170+ arg0,
171+ )
172+ })
173+ return _c
174+}
175+
176+func (_c *MockBoxWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockBoxWidget_ComputePoint_Call {
177+ _c.Call.Return(x, y, ok)
178+ return _c
179+}
180+
181+func (_c *MockBoxWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockBoxWidget_ComputePoint_Call {
182+ _c.Call.Return(run)
183+ return _c
184+}
185+
186+// GetAllocatedHeight provides a mock function for the type MockBoxWidget
187+func (_mock *MockBoxWidget) GetAllocatedHeight() int {
188+ ret := _mock.Called()
189+
190+ if len(ret) == 0 {
191+ panic("no return value specified for GetAllocatedHeight")
192+ }
193+
194+ var r0 int
195+ if returnFunc, ok := ret.Get(0).(func() int); ok {
196+ r0 = returnFunc()
197+ } else {
198+ r0 = ret.Get(0).(int)
199+ }
200+ return r0
201+}
202+
203+// MockBoxWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
204+type MockBoxWidget_GetAllocatedHeight_Call struct {
205+ *mock.Call
206+}
207+
208+// GetAllocatedHeight is a helper method to define mock.On call
209+func (_e *MockBoxWidget_Expecter) GetAllocatedHeight() *MockBoxWidget_GetAllocatedHeight_Call {
210+ return &MockBoxWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
211+}
212+
213+func (_c *MockBoxWidget_GetAllocatedHeight_Call) Run(run func()) *MockBoxWidget_GetAllocatedHeight_Call {
214+ _c.Call.Run(func(args mock.Arguments) {
215+ run()
216+ })
217+ return _c
218+}
219+
220+func (_c *MockBoxWidget_GetAllocatedHeight_Call) Return(n int) *MockBoxWidget_GetAllocatedHeight_Call {
221+ _c.Call.Return(n)
222+ return _c
223+}
224+
225+func (_c *MockBoxWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockBoxWidget_GetAllocatedHeight_Call {
226+ _c.Call.Return(run)
227+ return _c
228+}
229+
230+// GetAllocatedWidth provides a mock function for the type MockBoxWidget
231+func (_mock *MockBoxWidget) GetAllocatedWidth() int {
232+ ret := _mock.Called()
233+
234+ if len(ret) == 0 {
235+ panic("no return value specified for GetAllocatedWidth")
236+ }
237+
238+ var r0 int
239+ if returnFunc, ok := ret.Get(0).(func() int); ok {
240+ r0 = returnFunc()
241+ } else {
242+ r0 = ret.Get(0).(int)
243+ }
244+ return r0
245+}
246+
247+// MockBoxWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
248+type MockBoxWidget_GetAllocatedWidth_Call struct {
249+ *mock.Call
250+}
251+
252+// GetAllocatedWidth is a helper method to define mock.On call
253+func (_e *MockBoxWidget_Expecter) GetAllocatedWidth() *MockBoxWidget_GetAllocatedWidth_Call {
254+ return &MockBoxWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
255+}
256+
257+func (_c *MockBoxWidget_GetAllocatedWidth_Call) Run(run func()) *MockBoxWidget_GetAllocatedWidth_Call {
258+ _c.Call.Run(func(args mock.Arguments) {
259+ run()
260+ })
261+ return _c
262+}
263+
264+func (_c *MockBoxWidget_GetAllocatedWidth_Call) Return(n int) *MockBoxWidget_GetAllocatedWidth_Call {
265+ _c.Call.Return(n)
266+ return _c
267+}
268+
269+func (_c *MockBoxWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockBoxWidget_GetAllocatedWidth_Call {
270+ _c.Call.Return(run)
271+ return _c
272+}
273+
120 // GetHexpand provides a mock function for the type MockBoxWidget274 // GetHexpand provides a mock function for the type MockBoxWidget
121 func (_mock *MockBoxWidget) GetHexpand() bool {275 func (_mock *MockBoxWidget) GetHexpand() bool {
122 ret := _mock.Called()276 ret := _mock.Called()
M internal/ui/layout/mocks/mock_button_widget.go +154 -0
@@ -77,6 +77,72 @@ func (_c *MockButtonWidget_AddCssClass_Call) RunAndReturn(run func(cssClass stri
7777 return _c
7878 }
7979
80+// ComputePoint provides a mock function for the type MockButtonWidget
81+func (_mock *MockButtonWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
82+ ret := _mock.Called(target)
83+
84+ if len(ret) == 0 {
85+ panic("no return value specified for ComputePoint")
86+ }
87+
88+ var r0 float64
89+ var r1 float64
90+ var r2 bool
91+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
92+ return returnFunc(target)
93+ }
94+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
95+ r0 = returnFunc(target)
96+ } else {
97+ r0 = ret.Get(0).(float64)
98+ }
99+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
100+ r1 = returnFunc(target)
101+ } else {
102+ r1 = ret.Get(1).(float64)
103+ }
104+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
105+ r2 = returnFunc(target)
106+ } else {
107+ r2 = ret.Get(2).(bool)
108+ }
109+ return r0, r1, r2
110+}
111+
112+// MockButtonWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
113+type MockButtonWidget_ComputePoint_Call struct {
114+ *mock.Call
115+}
116+
117+// ComputePoint is a helper method to define mock.On call
118+// - target layout.Widget
119+func (_e *MockButtonWidget_Expecter) ComputePoint(target interface{}) *MockButtonWidget_ComputePoint_Call {
120+ return &MockButtonWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
121+}
122+
123+func (_c *MockButtonWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockButtonWidget_ComputePoint_Call {
124+ _c.Call.Run(func(args mock.Arguments) {
125+ var arg0 layout.Widget
126+ if args[0] != nil {
127+ arg0 = args[0].(layout.Widget)
128+ }
129+ run(
130+ arg0,
131+ )
132+ })
133+ return _c
134+}
135+
136+func (_c *MockButtonWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockButtonWidget_ComputePoint_Call {
137+ _c.Call.Return(x, y, ok)
138+ return _c
139+}
140+
141+func (_c *MockButtonWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockButtonWidget_ComputePoint_Call {
142+ _c.Call.Return(run)
143+ return _c
144+}
145+
80146 // ConnectClicked provides a mock function for the type MockButtonWidget
81147 func (_mock *MockButtonWidget) ConnectClicked(callback func()) uint32 {
82148 ret := _mock.Called(callback)
@@ -128,6 +194,94 @@ func (_c *MockButtonWidget_ConnectClicked_Call) RunAndReturn(run func(callback f
128194 return _c
129195 }
130196
197+// GetAllocatedHeight provides a mock function for the type MockButtonWidget
198+func (_mock *MockButtonWidget) GetAllocatedHeight() int {
199+ ret := _mock.Called()
200+
201+ if len(ret) == 0 {
202+ panic("no return value specified for GetAllocatedHeight")
203+ }
204+
205+ var r0 int
206+ if returnFunc, ok := ret.Get(0).(func() int); ok {
207+ r0 = returnFunc()
208+ } else {
209+ r0 = ret.Get(0).(int)
210+ }
211+ return r0
212+}
213+
214+// MockButtonWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
215+type MockButtonWidget_GetAllocatedHeight_Call struct {
216+ *mock.Call
217+}
218+
219+// GetAllocatedHeight is a helper method to define mock.On call
220+func (_e *MockButtonWidget_Expecter) GetAllocatedHeight() *MockButtonWidget_GetAllocatedHeight_Call {
221+ return &MockButtonWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
222+}
223+
224+func (_c *MockButtonWidget_GetAllocatedHeight_Call) Run(run func()) *MockButtonWidget_GetAllocatedHeight_Call {
225+ _c.Call.Run(func(args mock.Arguments) {
226+ run()
227+ })
228+ return _c
229+}
230+
231+func (_c *MockButtonWidget_GetAllocatedHeight_Call) Return(n int) *MockButtonWidget_GetAllocatedHeight_Call {
232+ _c.Call.Return(n)
233+ return _c
234+}
235+
236+func (_c *MockButtonWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockButtonWidget_GetAllocatedHeight_Call {
237+ _c.Call.Return(run)
238+ return _c
239+}
240+
241+// GetAllocatedWidth provides a mock function for the type MockButtonWidget
242+func (_mock *MockButtonWidget) GetAllocatedWidth() int {
243+ ret := _mock.Called()
244+
245+ if len(ret) == 0 {
246+ panic("no return value specified for GetAllocatedWidth")
247+ }
248+
249+ var r0 int
250+ if returnFunc, ok := ret.Get(0).(func() int); ok {
251+ r0 = returnFunc()
252+ } else {
253+ r0 = ret.Get(0).(int)
254+ }
255+ return r0
256+}
257+
258+// MockButtonWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
259+type MockButtonWidget_GetAllocatedWidth_Call struct {
260+ *mock.Call
261+}
262+
263+// GetAllocatedWidth is a helper method to define mock.On call
264+func (_e *MockButtonWidget_Expecter) GetAllocatedWidth() *MockButtonWidget_GetAllocatedWidth_Call {
265+ return &MockButtonWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
266+}
267+
268+func (_c *MockButtonWidget_GetAllocatedWidth_Call) Run(run func()) *MockButtonWidget_GetAllocatedWidth_Call {
269+ _c.Call.Run(func(args mock.Arguments) {
270+ run()
271+ })
272+ return _c
273+}
274+
275+func (_c *MockButtonWidget_GetAllocatedWidth_Call) Return(n int) *MockButtonWidget_GetAllocatedWidth_Call {
276+ _c.Call.Return(n)
277+ return _c
278+}
279+
280+func (_c *MockButtonWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockButtonWidget_GetAllocatedWidth_Call {
281+ _c.Call.Return(run)
282+ return _c
283+}
284+
131285 // GetChild provides a mock function for the type MockButtonWidget
132286 func (_mock *MockButtonWidget) GetChild() layout.Widget {
133287 ret := _mock.Called()
@@ -77,6 +77,72 @@ func (_c *MockButtonWidget_AddCssClass_Call) RunAndReturn(run func(cssClass stri
77 return _c77 return _c
78 }78 }
79 79
80+// ComputePoint provides a mock function for the type MockButtonWidget
81+func (_mock *MockButtonWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
82+ ret := _mock.Called(target)
83+
84+ if len(ret) == 0 {
85+ panic("no return value specified for ComputePoint")
86+ }
87+
88+ var r0 float64
89+ var r1 float64
90+ var r2 bool
91+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
92+ return returnFunc(target)
93+ }
94+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
95+ r0 = returnFunc(target)
96+ } else {
97+ r0 = ret.Get(0).(float64)
98+ }
99+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
100+ r1 = returnFunc(target)
101+ } else {
102+ r1 = ret.Get(1).(float64)
103+ }
104+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
105+ r2 = returnFunc(target)
106+ } else {
107+ r2 = ret.Get(2).(bool)
108+ }
109+ return r0, r1, r2
110+}
111+
112+// MockButtonWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
113+type MockButtonWidget_ComputePoint_Call struct {
114+ *mock.Call
115+}
116+
117+// ComputePoint is a helper method to define mock.On call
118+// - target layout.Widget
119+func (_e *MockButtonWidget_Expecter) ComputePoint(target interface{}) *MockButtonWidget_ComputePoint_Call {
120+ return &MockButtonWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
121+}
122+
123+func (_c *MockButtonWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockButtonWidget_ComputePoint_Call {
124+ _c.Call.Run(func(args mock.Arguments) {
125+ var arg0 layout.Widget
126+ if args[0] != nil {
127+ arg0 = args[0].(layout.Widget)
128+ }
129+ run(
130+ arg0,
131+ )
132+ })
133+ return _c
134+}
135+
136+func (_c *MockButtonWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockButtonWidget_ComputePoint_Call {
137+ _c.Call.Return(x, y, ok)
138+ return _c
139+}
140+
141+func (_c *MockButtonWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockButtonWidget_ComputePoint_Call {
142+ _c.Call.Return(run)
143+ return _c
144+}
145+
80 // ConnectClicked provides a mock function for the type MockButtonWidget146 // ConnectClicked provides a mock function for the type MockButtonWidget
81 func (_mock *MockButtonWidget) ConnectClicked(callback func()) uint32 {147 func (_mock *MockButtonWidget) ConnectClicked(callback func()) uint32 {
82 ret := _mock.Called(callback)148 ret := _mock.Called(callback)
@@ -128,6 +194,94 @@ func (_c *MockButtonWidget_ConnectClicked_Call) RunAndReturn(run func(callback f
128 return _c194 return _c
129 }195 }
130 196
197+// GetAllocatedHeight provides a mock function for the type MockButtonWidget
198+func (_mock *MockButtonWidget) GetAllocatedHeight() int {
199+ ret := _mock.Called()
200+
201+ if len(ret) == 0 {
202+ panic("no return value specified for GetAllocatedHeight")
203+ }
204+
205+ var r0 int
206+ if returnFunc, ok := ret.Get(0).(func() int); ok {
207+ r0 = returnFunc()
208+ } else {
209+ r0 = ret.Get(0).(int)
210+ }
211+ return r0
212+}
213+
214+// MockButtonWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
215+type MockButtonWidget_GetAllocatedHeight_Call struct {
216+ *mock.Call
217+}
218+
219+// GetAllocatedHeight is a helper method to define mock.On call
220+func (_e *MockButtonWidget_Expecter) GetAllocatedHeight() *MockButtonWidget_GetAllocatedHeight_Call {
221+ return &MockButtonWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
222+}
223+
224+func (_c *MockButtonWidget_GetAllocatedHeight_Call) Run(run func()) *MockButtonWidget_GetAllocatedHeight_Call {
225+ _c.Call.Run(func(args mock.Arguments) {
226+ run()
227+ })
228+ return _c
229+}
230+
231+func (_c *MockButtonWidget_GetAllocatedHeight_Call) Return(n int) *MockButtonWidget_GetAllocatedHeight_Call {
232+ _c.Call.Return(n)
233+ return _c
234+}
235+
236+func (_c *MockButtonWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockButtonWidget_GetAllocatedHeight_Call {
237+ _c.Call.Return(run)
238+ return _c
239+}
240+
241+// GetAllocatedWidth provides a mock function for the type MockButtonWidget
242+func (_mock *MockButtonWidget) GetAllocatedWidth() int {
243+ ret := _mock.Called()
244+
245+ if len(ret) == 0 {
246+ panic("no return value specified for GetAllocatedWidth")
247+ }
248+
249+ var r0 int
250+ if returnFunc, ok := ret.Get(0).(func() int); ok {
251+ r0 = returnFunc()
252+ } else {
253+ r0 = ret.Get(0).(int)
254+ }
255+ return r0
256+}
257+
258+// MockButtonWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
259+type MockButtonWidget_GetAllocatedWidth_Call struct {
260+ *mock.Call
261+}
262+
263+// GetAllocatedWidth is a helper method to define mock.On call
264+func (_e *MockButtonWidget_Expecter) GetAllocatedWidth() *MockButtonWidget_GetAllocatedWidth_Call {
265+ return &MockButtonWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
266+}
267+
268+func (_c *MockButtonWidget_GetAllocatedWidth_Call) Run(run func()) *MockButtonWidget_GetAllocatedWidth_Call {
269+ _c.Call.Run(func(args mock.Arguments) {
270+ run()
271+ })
272+ return _c
273+}
274+
275+func (_c *MockButtonWidget_GetAllocatedWidth_Call) Return(n int) *MockButtonWidget_GetAllocatedWidth_Call {
276+ _c.Call.Return(n)
277+ return _c
278+}
279+
280+func (_c *MockButtonWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockButtonWidget_GetAllocatedWidth_Call {
281+ _c.Call.Return(run)
282+ return _c
283+}
284+
131 // GetChild provides a mock function for the type MockButtonWidget285 // GetChild provides a mock function for the type MockButtonWidget
132 func (_mock *MockButtonWidget) GetChild() layout.Widget {286 func (_mock *MockButtonWidget) GetChild() layout.Widget {
133 ret := _mock.Called()287 ret := _mock.Called()
M internal/ui/layout/mocks/mock_image_widget.go +194 -0
@@ -110,6 +110,160 @@ func (_c *MockImageWidget_Clear_Call) RunAndReturn(run func()) *MockImageWidget_
110110 return _c
111111 }
112112
113+// ComputePoint provides a mock function for the type MockImageWidget
114+func (_mock *MockImageWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
115+ ret := _mock.Called(target)
116+
117+ if len(ret) == 0 {
118+ panic("no return value specified for ComputePoint")
119+ }
120+
121+ var r0 float64
122+ var r1 float64
123+ var r2 bool
124+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
125+ return returnFunc(target)
126+ }
127+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
128+ r0 = returnFunc(target)
129+ } else {
130+ r0 = ret.Get(0).(float64)
131+ }
132+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
133+ r1 = returnFunc(target)
134+ } else {
135+ r1 = ret.Get(1).(float64)
136+ }
137+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
138+ r2 = returnFunc(target)
139+ } else {
140+ r2 = ret.Get(2).(bool)
141+ }
142+ return r0, r1, r2
143+}
144+
145+// MockImageWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
146+type MockImageWidget_ComputePoint_Call struct {
147+ *mock.Call
148+}
149+
150+// ComputePoint is a helper method to define mock.On call
151+// - target layout.Widget
152+func (_e *MockImageWidget_Expecter) ComputePoint(target interface{}) *MockImageWidget_ComputePoint_Call {
153+ return &MockImageWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
154+}
155+
156+func (_c *MockImageWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockImageWidget_ComputePoint_Call {
157+ _c.Call.Run(func(args mock.Arguments) {
158+ var arg0 layout.Widget
159+ if args[0] != nil {
160+ arg0 = args[0].(layout.Widget)
161+ }
162+ run(
163+ arg0,
164+ )
165+ })
166+ return _c
167+}
168+
169+func (_c *MockImageWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockImageWidget_ComputePoint_Call {
170+ _c.Call.Return(x, y, ok)
171+ return _c
172+}
173+
174+func (_c *MockImageWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockImageWidget_ComputePoint_Call {
175+ _c.Call.Return(run)
176+ return _c
177+}
178+
179+// GetAllocatedHeight provides a mock function for the type MockImageWidget
180+func (_mock *MockImageWidget) GetAllocatedHeight() int {
181+ ret := _mock.Called()
182+
183+ if len(ret) == 0 {
184+ panic("no return value specified for GetAllocatedHeight")
185+ }
186+
187+ var r0 int
188+ if returnFunc, ok := ret.Get(0).(func() int); ok {
189+ r0 = returnFunc()
190+ } else {
191+ r0 = ret.Get(0).(int)
192+ }
193+ return r0
194+}
195+
196+// MockImageWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
197+type MockImageWidget_GetAllocatedHeight_Call struct {
198+ *mock.Call
199+}
200+
201+// GetAllocatedHeight is a helper method to define mock.On call
202+func (_e *MockImageWidget_Expecter) GetAllocatedHeight() *MockImageWidget_GetAllocatedHeight_Call {
203+ return &MockImageWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
204+}
205+
206+func (_c *MockImageWidget_GetAllocatedHeight_Call) Run(run func()) *MockImageWidget_GetAllocatedHeight_Call {
207+ _c.Call.Run(func(args mock.Arguments) {
208+ run()
209+ })
210+ return _c
211+}
212+
213+func (_c *MockImageWidget_GetAllocatedHeight_Call) Return(n int) *MockImageWidget_GetAllocatedHeight_Call {
214+ _c.Call.Return(n)
215+ return _c
216+}
217+
218+func (_c *MockImageWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockImageWidget_GetAllocatedHeight_Call {
219+ _c.Call.Return(run)
220+ return _c
221+}
222+
223+// GetAllocatedWidth provides a mock function for the type MockImageWidget
224+func (_mock *MockImageWidget) GetAllocatedWidth() int {
225+ ret := _mock.Called()
226+
227+ if len(ret) == 0 {
228+ panic("no return value specified for GetAllocatedWidth")
229+ }
230+
231+ var r0 int
232+ if returnFunc, ok := ret.Get(0).(func() int); ok {
233+ r0 = returnFunc()
234+ } else {
235+ r0 = ret.Get(0).(int)
236+ }
237+ return r0
238+}
239+
240+// MockImageWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
241+type MockImageWidget_GetAllocatedWidth_Call struct {
242+ *mock.Call
243+}
244+
245+// GetAllocatedWidth is a helper method to define mock.On call
246+func (_e *MockImageWidget_Expecter) GetAllocatedWidth() *MockImageWidget_GetAllocatedWidth_Call {
247+ return &MockImageWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
248+}
249+
250+func (_c *MockImageWidget_GetAllocatedWidth_Call) Run(run func()) *MockImageWidget_GetAllocatedWidth_Call {
251+ _c.Call.Run(func(args mock.Arguments) {
252+ run()
253+ })
254+ return _c
255+}
256+
257+func (_c *MockImageWidget_GetAllocatedWidth_Call) Return(n int) *MockImageWidget_GetAllocatedWidth_Call {
258+ _c.Call.Return(n)
259+ return _c
260+}
261+
262+func (_c *MockImageWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockImageWidget_GetAllocatedWidth_Call {
263+ _c.Call.Return(run)
264+ return _c
265+}
266+
113267 // GetHexpand provides a mock function for the type MockImageWidget
114268 func (_mock *MockImageWidget) GetHexpand() bool {
115269 ret := _mock.Called()
@@ -746,6 +900,46 @@ func (_c *MockImageWidget_SetFromIconName_Call) RunAndReturn(run func(iconName s
746900 return _c
747901 }
748902
903+// SetFromPaintable provides a mock function for the type MockImageWidget
904+func (_mock *MockImageWidget) SetFromPaintable(paintable layout.Paintable) {
905+ _mock.Called(paintable)
906+ return
907+}
908+
909+// MockImageWidget_SetFromPaintable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFromPaintable'
910+type MockImageWidget_SetFromPaintable_Call struct {
911+ *mock.Call
912+}
913+
914+// SetFromPaintable is a helper method to define mock.On call
915+// - paintable layout.Paintable
916+func (_e *MockImageWidget_Expecter) SetFromPaintable(paintable interface{}) *MockImageWidget_SetFromPaintable_Call {
917+ return &MockImageWidget_SetFromPaintable_Call{Call: _e.mock.On("SetFromPaintable", paintable)}
918+}
919+
920+func (_c *MockImageWidget_SetFromPaintable_Call) Run(run func(paintable layout.Paintable)) *MockImageWidget_SetFromPaintable_Call {
921+ _c.Call.Run(func(args mock.Arguments) {
922+ var arg0 layout.Paintable
923+ if args[0] != nil {
924+ arg0 = args[0].(layout.Paintable)
925+ }
926+ run(
927+ arg0,
928+ )
929+ })
930+ return _c
931+}
932+
933+func (_c *MockImageWidget_SetFromPaintable_Call) Return() *MockImageWidget_SetFromPaintable_Call {
934+ _c.Call.Return()
935+ return _c
936+}
937+
938+func (_c *MockImageWidget_SetFromPaintable_Call) RunAndReturn(run func(paintable layout.Paintable)) *MockImageWidget_SetFromPaintable_Call {
939+ _c.Run(run)
940+ return _c
941+}
942+
749943 // SetHalign provides a mock function for the type MockImageWidget
750944 func (_mock *MockImageWidget) SetHalign(align gtk.Align) {
751945 _mock.Called(align)
@@ -110,6 +110,160 @@ func (_c *MockImageWidget_Clear_Call) RunAndReturn(run func()) *MockImageWidget_
110 return _c110 return _c
111 }111 }
112 112
113+// ComputePoint provides a mock function for the type MockImageWidget
114+func (_mock *MockImageWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
115+ ret := _mock.Called(target)
116+
117+ if len(ret) == 0 {
118+ panic("no return value specified for ComputePoint")
119+ }
120+
121+ var r0 float64
122+ var r1 float64
123+ var r2 bool
124+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
125+ return returnFunc(target)
126+ }
127+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
128+ r0 = returnFunc(target)
129+ } else {
130+ r0 = ret.Get(0).(float64)
131+ }
132+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
133+ r1 = returnFunc(target)
134+ } else {
135+ r1 = ret.Get(1).(float64)
136+ }
137+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
138+ r2 = returnFunc(target)
139+ } else {
140+ r2 = ret.Get(2).(bool)
141+ }
142+ return r0, r1, r2
143+}
144+
145+// MockImageWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
146+type MockImageWidget_ComputePoint_Call struct {
147+ *mock.Call
148+}
149+
150+// ComputePoint is a helper method to define mock.On call
151+// - target layout.Widget
152+func (_e *MockImageWidget_Expecter) ComputePoint(target interface{}) *MockImageWidget_ComputePoint_Call {
153+ return &MockImageWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
154+}
155+
156+func (_c *MockImageWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockImageWidget_ComputePoint_Call {
157+ _c.Call.Run(func(args mock.Arguments) {
158+ var arg0 layout.Widget
159+ if args[0] != nil {
160+ arg0 = args[0].(layout.Widget)
161+ }
162+ run(
163+ arg0,
164+ )
165+ })
166+ return _c
167+}
168+
169+func (_c *MockImageWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockImageWidget_ComputePoint_Call {
170+ _c.Call.Return(x, y, ok)
171+ return _c
172+}
173+
174+func (_c *MockImageWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockImageWidget_ComputePoint_Call {
175+ _c.Call.Return(run)
176+ return _c
177+}
178+
179+// GetAllocatedHeight provides a mock function for the type MockImageWidget
180+func (_mock *MockImageWidget) GetAllocatedHeight() int {
181+ ret := _mock.Called()
182+
183+ if len(ret) == 0 {
184+ panic("no return value specified for GetAllocatedHeight")
185+ }
186+
187+ var r0 int
188+ if returnFunc, ok := ret.Get(0).(func() int); ok {
189+ r0 = returnFunc()
190+ } else {
191+ r0 = ret.Get(0).(int)
192+ }
193+ return r0
194+}
195+
196+// MockImageWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
197+type MockImageWidget_GetAllocatedHeight_Call struct {
198+ *mock.Call
199+}
200+
201+// GetAllocatedHeight is a helper method to define mock.On call
202+func (_e *MockImageWidget_Expecter) GetAllocatedHeight() *MockImageWidget_GetAllocatedHeight_Call {
203+ return &MockImageWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
204+}
205+
206+func (_c *MockImageWidget_GetAllocatedHeight_Call) Run(run func()) *MockImageWidget_GetAllocatedHeight_Call {
207+ _c.Call.Run(func(args mock.Arguments) {
208+ run()
209+ })
210+ return _c
211+}
212+
213+func (_c *MockImageWidget_GetAllocatedHeight_Call) Return(n int) *MockImageWidget_GetAllocatedHeight_Call {
214+ _c.Call.Return(n)
215+ return _c
216+}
217+
218+func (_c *MockImageWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockImageWidget_GetAllocatedHeight_Call {
219+ _c.Call.Return(run)
220+ return _c
221+}
222+
223+// GetAllocatedWidth provides a mock function for the type MockImageWidget
224+func (_mock *MockImageWidget) GetAllocatedWidth() int {
225+ ret := _mock.Called()
226+
227+ if len(ret) == 0 {
228+ panic("no return value specified for GetAllocatedWidth")
229+ }
230+
231+ var r0 int
232+ if returnFunc, ok := ret.Get(0).(func() int); ok {
233+ r0 = returnFunc()
234+ } else {
235+ r0 = ret.Get(0).(int)
236+ }
237+ return r0
238+}
239+
240+// MockImageWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
241+type MockImageWidget_GetAllocatedWidth_Call struct {
242+ *mock.Call
243+}
244+
245+// GetAllocatedWidth is a helper method to define mock.On call
246+func (_e *MockImageWidget_Expecter) GetAllocatedWidth() *MockImageWidget_GetAllocatedWidth_Call {
247+ return &MockImageWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
248+}
249+
250+func (_c *MockImageWidget_GetAllocatedWidth_Call) Run(run func()) *MockImageWidget_GetAllocatedWidth_Call {
251+ _c.Call.Run(func(args mock.Arguments) {
252+ run()
253+ })
254+ return _c
255+}
256+
257+func (_c *MockImageWidget_GetAllocatedWidth_Call) Return(n int) *MockImageWidget_GetAllocatedWidth_Call {
258+ _c.Call.Return(n)
259+ return _c
260+}
261+
262+func (_c *MockImageWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockImageWidget_GetAllocatedWidth_Call {
263+ _c.Call.Return(run)
264+ return _c
265+}
266+
113 // GetHexpand provides a mock function for the type MockImageWidget267 // GetHexpand provides a mock function for the type MockImageWidget
114 func (_mock *MockImageWidget) GetHexpand() bool {268 func (_mock *MockImageWidget) GetHexpand() bool {
115 ret := _mock.Called()269 ret := _mock.Called()
@@ -746,6 +900,46 @@ func (_c *MockImageWidget_SetFromIconName_Call) RunAndReturn(run func(iconName s
746 return _c900 return _c
747 }901 }
748 902
903+// SetFromPaintable provides a mock function for the type MockImageWidget
904+func (_mock *MockImageWidget) SetFromPaintable(paintable layout.Paintable) {
905+ _mock.Called(paintable)
906+ return
907+}
908+
909+// MockImageWidget_SetFromPaintable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFromPaintable'
910+type MockImageWidget_SetFromPaintable_Call struct {
911+ *mock.Call
912+}
913+
914+// SetFromPaintable is a helper method to define mock.On call
915+// - paintable layout.Paintable
916+func (_e *MockImageWidget_Expecter) SetFromPaintable(paintable interface{}) *MockImageWidget_SetFromPaintable_Call {
917+ return &MockImageWidget_SetFromPaintable_Call{Call: _e.mock.On("SetFromPaintable", paintable)}
918+}
919+
920+func (_c *MockImageWidget_SetFromPaintable_Call) Run(run func(paintable layout.Paintable)) *MockImageWidget_SetFromPaintable_Call {
921+ _c.Call.Run(func(args mock.Arguments) {
922+ var arg0 layout.Paintable
923+ if args[0] != nil {
924+ arg0 = args[0].(layout.Paintable)
925+ }
926+ run(
927+ arg0,
928+ )
929+ })
930+ return _c
931+}
932+
933+func (_c *MockImageWidget_SetFromPaintable_Call) Return() *MockImageWidget_SetFromPaintable_Call {
934+ _c.Call.Return()
935+ return _c
936+}
937+
938+func (_c *MockImageWidget_SetFromPaintable_Call) RunAndReturn(run func(paintable layout.Paintable)) *MockImageWidget_SetFromPaintable_Call {
939+ _c.Run(run)
940+ return _c
941+}
942+
749 // SetHalign provides a mock function for the type MockImageWidget943 // SetHalign provides a mock function for the type MockImageWidget
750 func (_mock *MockImageWidget) SetHalign(align gtk.Align) {944 func (_mock *MockImageWidget) SetHalign(align gtk.Align) {
751 _mock.Called(align)945 _mock.Called(align)
M internal/ui/layout/mocks/mock_label_widget.go +154 -0
@@ -77,6 +77,160 @@ func (_c *MockLabelWidget_AddCssClass_Call) RunAndReturn(run func(cssClass strin
7777 return _c
7878 }
7979
80+// ComputePoint provides a mock function for the type MockLabelWidget
81+func (_mock *MockLabelWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
82+ ret := _mock.Called(target)
83+
84+ if len(ret) == 0 {
85+ panic("no return value specified for ComputePoint")
86+ }
87+
88+ var r0 float64
89+ var r1 float64
90+ var r2 bool
91+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
92+ return returnFunc(target)
93+ }
94+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
95+ r0 = returnFunc(target)
96+ } else {
97+ r0 = ret.Get(0).(float64)
98+ }
99+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
100+ r1 = returnFunc(target)
101+ } else {
102+ r1 = ret.Get(1).(float64)
103+ }
104+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
105+ r2 = returnFunc(target)
106+ } else {
107+ r2 = ret.Get(2).(bool)
108+ }
109+ return r0, r1, r2
110+}
111+
112+// MockLabelWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
113+type MockLabelWidget_ComputePoint_Call struct {
114+ *mock.Call
115+}
116+
117+// ComputePoint is a helper method to define mock.On call
118+// - target layout.Widget
119+func (_e *MockLabelWidget_Expecter) ComputePoint(target interface{}) *MockLabelWidget_ComputePoint_Call {
120+ return &MockLabelWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
121+}
122+
123+func (_c *MockLabelWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockLabelWidget_ComputePoint_Call {
124+ _c.Call.Run(func(args mock.Arguments) {
125+ var arg0 layout.Widget
126+ if args[0] != nil {
127+ arg0 = args[0].(layout.Widget)
128+ }
129+ run(
130+ arg0,
131+ )
132+ })
133+ return _c
134+}
135+
136+func (_c *MockLabelWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockLabelWidget_ComputePoint_Call {
137+ _c.Call.Return(x, y, ok)
138+ return _c
139+}
140+
141+func (_c *MockLabelWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockLabelWidget_ComputePoint_Call {
142+ _c.Call.Return(run)
143+ return _c
144+}
145+
146+// GetAllocatedHeight provides a mock function for the type MockLabelWidget
147+func (_mock *MockLabelWidget) GetAllocatedHeight() int {
148+ ret := _mock.Called()
149+
150+ if len(ret) == 0 {
151+ panic("no return value specified for GetAllocatedHeight")
152+ }
153+
154+ var r0 int
155+ if returnFunc, ok := ret.Get(0).(func() int); ok {
156+ r0 = returnFunc()
157+ } else {
158+ r0 = ret.Get(0).(int)
159+ }
160+ return r0
161+}
162+
163+// MockLabelWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
164+type MockLabelWidget_GetAllocatedHeight_Call struct {
165+ *mock.Call
166+}
167+
168+// GetAllocatedHeight is a helper method to define mock.On call
169+func (_e *MockLabelWidget_Expecter) GetAllocatedHeight() *MockLabelWidget_GetAllocatedHeight_Call {
170+ return &MockLabelWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
171+}
172+
173+func (_c *MockLabelWidget_GetAllocatedHeight_Call) Run(run func()) *MockLabelWidget_GetAllocatedHeight_Call {
174+ _c.Call.Run(func(args mock.Arguments) {
175+ run()
176+ })
177+ return _c
178+}
179+
180+func (_c *MockLabelWidget_GetAllocatedHeight_Call) Return(n int) *MockLabelWidget_GetAllocatedHeight_Call {
181+ _c.Call.Return(n)
182+ return _c
183+}
184+
185+func (_c *MockLabelWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockLabelWidget_GetAllocatedHeight_Call {
186+ _c.Call.Return(run)
187+ return _c
188+}
189+
190+// GetAllocatedWidth provides a mock function for the type MockLabelWidget
191+func (_mock *MockLabelWidget) GetAllocatedWidth() int {
192+ ret := _mock.Called()
193+
194+ if len(ret) == 0 {
195+ panic("no return value specified for GetAllocatedWidth")
196+ }
197+
198+ var r0 int
199+ if returnFunc, ok := ret.Get(0).(func() int); ok {
200+ r0 = returnFunc()
201+ } else {
202+ r0 = ret.Get(0).(int)
203+ }
204+ return r0
205+}
206+
207+// MockLabelWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
208+type MockLabelWidget_GetAllocatedWidth_Call struct {
209+ *mock.Call
210+}
211+
212+// GetAllocatedWidth is a helper method to define mock.On call
213+func (_e *MockLabelWidget_Expecter) GetAllocatedWidth() *MockLabelWidget_GetAllocatedWidth_Call {
214+ return &MockLabelWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
215+}
216+
217+func (_c *MockLabelWidget_GetAllocatedWidth_Call) Run(run func()) *MockLabelWidget_GetAllocatedWidth_Call {
218+ _c.Call.Run(func(args mock.Arguments) {
219+ run()
220+ })
221+ return _c
222+}
223+
224+func (_c *MockLabelWidget_GetAllocatedWidth_Call) Return(n int) *MockLabelWidget_GetAllocatedWidth_Call {
225+ _c.Call.Return(n)
226+ return _c
227+}
228+
229+func (_c *MockLabelWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockLabelWidget_GetAllocatedWidth_Call {
230+ _c.Call.Return(run)
231+ return _c
232+}
233+
80234 // GetHexpand provides a mock function for the type MockLabelWidget
81235 func (_mock *MockLabelWidget) GetHexpand() bool {
82236 ret := _mock.Called()
@@ -77,6 +77,160 @@ func (_c *MockLabelWidget_AddCssClass_Call) RunAndReturn(run func(cssClass strin
77 return _c77 return _c
78 }78 }
79 79
80+// ComputePoint provides a mock function for the type MockLabelWidget
81+func (_mock *MockLabelWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
82+ ret := _mock.Called(target)
83+
84+ if len(ret) == 0 {
85+ panic("no return value specified for ComputePoint")
86+ }
87+
88+ var r0 float64
89+ var r1 float64
90+ var r2 bool
91+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
92+ return returnFunc(target)
93+ }
94+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
95+ r0 = returnFunc(target)
96+ } else {
97+ r0 = ret.Get(0).(float64)
98+ }
99+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
100+ r1 = returnFunc(target)
101+ } else {
102+ r1 = ret.Get(1).(float64)
103+ }
104+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
105+ r2 = returnFunc(target)
106+ } else {
107+ r2 = ret.Get(2).(bool)
108+ }
109+ return r0, r1, r2
110+}
111+
112+// MockLabelWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
113+type MockLabelWidget_ComputePoint_Call struct {
114+ *mock.Call
115+}
116+
117+// ComputePoint is a helper method to define mock.On call
118+// - target layout.Widget
119+func (_e *MockLabelWidget_Expecter) ComputePoint(target interface{}) *MockLabelWidget_ComputePoint_Call {
120+ return &MockLabelWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
121+}
122+
123+func (_c *MockLabelWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockLabelWidget_ComputePoint_Call {
124+ _c.Call.Run(func(args mock.Arguments) {
125+ var arg0 layout.Widget
126+ if args[0] != nil {
127+ arg0 = args[0].(layout.Widget)
128+ }
129+ run(
130+ arg0,
131+ )
132+ })
133+ return _c
134+}
135+
136+func (_c *MockLabelWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockLabelWidget_ComputePoint_Call {
137+ _c.Call.Return(x, y, ok)
138+ return _c
139+}
140+
141+func (_c *MockLabelWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockLabelWidget_ComputePoint_Call {
142+ _c.Call.Return(run)
143+ return _c
144+}
145+
146+// GetAllocatedHeight provides a mock function for the type MockLabelWidget
147+func (_mock *MockLabelWidget) GetAllocatedHeight() int {
148+ ret := _mock.Called()
149+
150+ if len(ret) == 0 {
151+ panic("no return value specified for GetAllocatedHeight")
152+ }
153+
154+ var r0 int
155+ if returnFunc, ok := ret.Get(0).(func() int); ok {
156+ r0 = returnFunc()
157+ } else {
158+ r0 = ret.Get(0).(int)
159+ }
160+ return r0
161+}
162+
163+// MockLabelWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
164+type MockLabelWidget_GetAllocatedHeight_Call struct {
165+ *mock.Call
166+}
167+
168+// GetAllocatedHeight is a helper method to define mock.On call
169+func (_e *MockLabelWidget_Expecter) GetAllocatedHeight() *MockLabelWidget_GetAllocatedHeight_Call {
170+ return &MockLabelWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
171+}
172+
173+func (_c *MockLabelWidget_GetAllocatedHeight_Call) Run(run func()) *MockLabelWidget_GetAllocatedHeight_Call {
174+ _c.Call.Run(func(args mock.Arguments) {
175+ run()
176+ })
177+ return _c
178+}
179+
180+func (_c *MockLabelWidget_GetAllocatedHeight_Call) Return(n int) *MockLabelWidget_GetAllocatedHeight_Call {
181+ _c.Call.Return(n)
182+ return _c
183+}
184+
185+func (_c *MockLabelWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockLabelWidget_GetAllocatedHeight_Call {
186+ _c.Call.Return(run)
187+ return _c
188+}
189+
190+// GetAllocatedWidth provides a mock function for the type MockLabelWidget
191+func (_mock *MockLabelWidget) GetAllocatedWidth() int {
192+ ret := _mock.Called()
193+
194+ if len(ret) == 0 {
195+ panic("no return value specified for GetAllocatedWidth")
196+ }
197+
198+ var r0 int
199+ if returnFunc, ok := ret.Get(0).(func() int); ok {
200+ r0 = returnFunc()
201+ } else {
202+ r0 = ret.Get(0).(int)
203+ }
204+ return r0
205+}
206+
207+// MockLabelWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
208+type MockLabelWidget_GetAllocatedWidth_Call struct {
209+ *mock.Call
210+}
211+
212+// GetAllocatedWidth is a helper method to define mock.On call
213+func (_e *MockLabelWidget_Expecter) GetAllocatedWidth() *MockLabelWidget_GetAllocatedWidth_Call {
214+ return &MockLabelWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
215+}
216+
217+func (_c *MockLabelWidget_GetAllocatedWidth_Call) Run(run func()) *MockLabelWidget_GetAllocatedWidth_Call {
218+ _c.Call.Run(func(args mock.Arguments) {
219+ run()
220+ })
221+ return _c
222+}
223+
224+func (_c *MockLabelWidget_GetAllocatedWidth_Call) Return(n int) *MockLabelWidget_GetAllocatedWidth_Call {
225+ _c.Call.Return(n)
226+ return _c
227+}
228+
229+func (_c *MockLabelWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockLabelWidget_GetAllocatedWidth_Call {
230+ _c.Call.Return(run)
231+ return _c
232+}
233+
80 // GetHexpand provides a mock function for the type MockLabelWidget234 // GetHexpand provides a mock function for the type MockLabelWidget
81 func (_mock *MockLabelWidget) GetHexpand() bool {235 func (_mock *MockLabelWidget) GetHexpand() bool {
82 ret := _mock.Called()236 ret := _mock.Called()
M internal/ui/layout/mocks/mock_overlay_widget.go +154 -0
@@ -117,6 +117,160 @@ func (_c *MockOverlayWidget_AddOverlay_Call) RunAndReturn(run func(overlay layou
117117 return _c
118118 }
119119
120+// ComputePoint provides a mock function for the type MockOverlayWidget
121+func (_mock *MockOverlayWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
122+ ret := _mock.Called(target)
123+
124+ if len(ret) == 0 {
125+ panic("no return value specified for ComputePoint")
126+ }
127+
128+ var r0 float64
129+ var r1 float64
130+ var r2 bool
131+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
132+ return returnFunc(target)
133+ }
134+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
135+ r0 = returnFunc(target)
136+ } else {
137+ r0 = ret.Get(0).(float64)
138+ }
139+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
140+ r1 = returnFunc(target)
141+ } else {
142+ r1 = ret.Get(1).(float64)
143+ }
144+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
145+ r2 = returnFunc(target)
146+ } else {
147+ r2 = ret.Get(2).(bool)
148+ }
149+ return r0, r1, r2
150+}
151+
152+// MockOverlayWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
153+type MockOverlayWidget_ComputePoint_Call struct {
154+ *mock.Call
155+}
156+
157+// ComputePoint is a helper method to define mock.On call
158+// - target layout.Widget
159+func (_e *MockOverlayWidget_Expecter) ComputePoint(target interface{}) *MockOverlayWidget_ComputePoint_Call {
160+ return &MockOverlayWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
161+}
162+
163+func (_c *MockOverlayWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockOverlayWidget_ComputePoint_Call {
164+ _c.Call.Run(func(args mock.Arguments) {
165+ var arg0 layout.Widget
166+ if args[0] != nil {
167+ arg0 = args[0].(layout.Widget)
168+ }
169+ run(
170+ arg0,
171+ )
172+ })
173+ return _c
174+}
175+
176+func (_c *MockOverlayWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockOverlayWidget_ComputePoint_Call {
177+ _c.Call.Return(x, y, ok)
178+ return _c
179+}
180+
181+func (_c *MockOverlayWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockOverlayWidget_ComputePoint_Call {
182+ _c.Call.Return(run)
183+ return _c
184+}
185+
186+// GetAllocatedHeight provides a mock function for the type MockOverlayWidget
187+func (_mock *MockOverlayWidget) GetAllocatedHeight() int {
188+ ret := _mock.Called()
189+
190+ if len(ret) == 0 {
191+ panic("no return value specified for GetAllocatedHeight")
192+ }
193+
194+ var r0 int
195+ if returnFunc, ok := ret.Get(0).(func() int); ok {
196+ r0 = returnFunc()
197+ } else {
198+ r0 = ret.Get(0).(int)
199+ }
200+ return r0
201+}
202+
203+// MockOverlayWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
204+type MockOverlayWidget_GetAllocatedHeight_Call struct {
205+ *mock.Call
206+}
207+
208+// GetAllocatedHeight is a helper method to define mock.On call
209+func (_e *MockOverlayWidget_Expecter) GetAllocatedHeight() *MockOverlayWidget_GetAllocatedHeight_Call {
210+ return &MockOverlayWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
211+}
212+
213+func (_c *MockOverlayWidget_GetAllocatedHeight_Call) Run(run func()) *MockOverlayWidget_GetAllocatedHeight_Call {
214+ _c.Call.Run(func(args mock.Arguments) {
215+ run()
216+ })
217+ return _c
218+}
219+
220+func (_c *MockOverlayWidget_GetAllocatedHeight_Call) Return(n int) *MockOverlayWidget_GetAllocatedHeight_Call {
221+ _c.Call.Return(n)
222+ return _c
223+}
224+
225+func (_c *MockOverlayWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockOverlayWidget_GetAllocatedHeight_Call {
226+ _c.Call.Return(run)
227+ return _c
228+}
229+
230+// GetAllocatedWidth provides a mock function for the type MockOverlayWidget
231+func (_mock *MockOverlayWidget) GetAllocatedWidth() int {
232+ ret := _mock.Called()
233+
234+ if len(ret) == 0 {
235+ panic("no return value specified for GetAllocatedWidth")
236+ }
237+
238+ var r0 int
239+ if returnFunc, ok := ret.Get(0).(func() int); ok {
240+ r0 = returnFunc()
241+ } else {
242+ r0 = ret.Get(0).(int)
243+ }
244+ return r0
245+}
246+
247+// MockOverlayWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
248+type MockOverlayWidget_GetAllocatedWidth_Call struct {
249+ *mock.Call
250+}
251+
252+// GetAllocatedWidth is a helper method to define mock.On call
253+func (_e *MockOverlayWidget_Expecter) GetAllocatedWidth() *MockOverlayWidget_GetAllocatedWidth_Call {
254+ return &MockOverlayWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
255+}
256+
257+func (_c *MockOverlayWidget_GetAllocatedWidth_Call) Run(run func()) *MockOverlayWidget_GetAllocatedWidth_Call {
258+ _c.Call.Run(func(args mock.Arguments) {
259+ run()
260+ })
261+ return _c
262+}
263+
264+func (_c *MockOverlayWidget_GetAllocatedWidth_Call) Return(n int) *MockOverlayWidget_GetAllocatedWidth_Call {
265+ _c.Call.Return(n)
266+ return _c
267+}
268+
269+func (_c *MockOverlayWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockOverlayWidget_GetAllocatedWidth_Call {
270+ _c.Call.Return(run)
271+ return _c
272+}
273+
120274 // GetChild provides a mock function for the type MockOverlayWidget
121275 func (_mock *MockOverlayWidget) GetChild() layout.Widget {
122276 ret := _mock.Called()
@@ -117,6 +117,160 @@ func (_c *MockOverlayWidget_AddOverlay_Call) RunAndReturn(run func(overlay layou
117 return _c117 return _c
118 }118 }
119 119
120+// ComputePoint provides a mock function for the type MockOverlayWidget
121+func (_mock *MockOverlayWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
122+ ret := _mock.Called(target)
123+
124+ if len(ret) == 0 {
125+ panic("no return value specified for ComputePoint")
126+ }
127+
128+ var r0 float64
129+ var r1 float64
130+ var r2 bool
131+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
132+ return returnFunc(target)
133+ }
134+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
135+ r0 = returnFunc(target)
136+ } else {
137+ r0 = ret.Get(0).(float64)
138+ }
139+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
140+ r1 = returnFunc(target)
141+ } else {
142+ r1 = ret.Get(1).(float64)
143+ }
144+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
145+ r2 = returnFunc(target)
146+ } else {
147+ r2 = ret.Get(2).(bool)
148+ }
149+ return r0, r1, r2
150+}
151+
152+// MockOverlayWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
153+type MockOverlayWidget_ComputePoint_Call struct {
154+ *mock.Call
155+}
156+
157+// ComputePoint is a helper method to define mock.On call
158+// - target layout.Widget
159+func (_e *MockOverlayWidget_Expecter) ComputePoint(target interface{}) *MockOverlayWidget_ComputePoint_Call {
160+ return &MockOverlayWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
161+}
162+
163+func (_c *MockOverlayWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockOverlayWidget_ComputePoint_Call {
164+ _c.Call.Run(func(args mock.Arguments) {
165+ var arg0 layout.Widget
166+ if args[0] != nil {
167+ arg0 = args[0].(layout.Widget)
168+ }
169+ run(
170+ arg0,
171+ )
172+ })
173+ return _c
174+}
175+
176+func (_c *MockOverlayWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockOverlayWidget_ComputePoint_Call {
177+ _c.Call.Return(x, y, ok)
178+ return _c
179+}
180+
181+func (_c *MockOverlayWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockOverlayWidget_ComputePoint_Call {
182+ _c.Call.Return(run)
183+ return _c
184+}
185+
186+// GetAllocatedHeight provides a mock function for the type MockOverlayWidget
187+func (_mock *MockOverlayWidget) GetAllocatedHeight() int {
188+ ret := _mock.Called()
189+
190+ if len(ret) == 0 {
191+ panic("no return value specified for GetAllocatedHeight")
192+ }
193+
194+ var r0 int
195+ if returnFunc, ok := ret.Get(0).(func() int); ok {
196+ r0 = returnFunc()
197+ } else {
198+ r0 = ret.Get(0).(int)
199+ }
200+ return r0
201+}
202+
203+// MockOverlayWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
204+type MockOverlayWidget_GetAllocatedHeight_Call struct {
205+ *mock.Call
206+}
207+
208+// GetAllocatedHeight is a helper method to define mock.On call
209+func (_e *MockOverlayWidget_Expecter) GetAllocatedHeight() *MockOverlayWidget_GetAllocatedHeight_Call {
210+ return &MockOverlayWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
211+}
212+
213+func (_c *MockOverlayWidget_GetAllocatedHeight_Call) Run(run func()) *MockOverlayWidget_GetAllocatedHeight_Call {
214+ _c.Call.Run(func(args mock.Arguments) {
215+ run()
216+ })
217+ return _c
218+}
219+
220+func (_c *MockOverlayWidget_GetAllocatedHeight_Call) Return(n int) *MockOverlayWidget_GetAllocatedHeight_Call {
221+ _c.Call.Return(n)
222+ return _c
223+}
224+
225+func (_c *MockOverlayWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockOverlayWidget_GetAllocatedHeight_Call {
226+ _c.Call.Return(run)
227+ return _c
228+}
229+
230+// GetAllocatedWidth provides a mock function for the type MockOverlayWidget
231+func (_mock *MockOverlayWidget) GetAllocatedWidth() int {
232+ ret := _mock.Called()
233+
234+ if len(ret) == 0 {
235+ panic("no return value specified for GetAllocatedWidth")
236+ }
237+
238+ var r0 int
239+ if returnFunc, ok := ret.Get(0).(func() int); ok {
240+ r0 = returnFunc()
241+ } else {
242+ r0 = ret.Get(0).(int)
243+ }
244+ return r0
245+}
246+
247+// MockOverlayWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
248+type MockOverlayWidget_GetAllocatedWidth_Call struct {
249+ *mock.Call
250+}
251+
252+// GetAllocatedWidth is a helper method to define mock.On call
253+func (_e *MockOverlayWidget_Expecter) GetAllocatedWidth() *MockOverlayWidget_GetAllocatedWidth_Call {
254+ return &MockOverlayWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
255+}
256+
257+func (_c *MockOverlayWidget_GetAllocatedWidth_Call) Run(run func()) *MockOverlayWidget_GetAllocatedWidth_Call {
258+ _c.Call.Run(func(args mock.Arguments) {
259+ run()
260+ })
261+ return _c
262+}
263+
264+func (_c *MockOverlayWidget_GetAllocatedWidth_Call) Return(n int) *MockOverlayWidget_GetAllocatedWidth_Call {
265+ _c.Call.Return(n)
266+ return _c
267+}
268+
269+func (_c *MockOverlayWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockOverlayWidget_GetAllocatedWidth_Call {
270+ _c.Call.Return(run)
271+ return _c
272+}
273+
120 // GetChild provides a mock function for the type MockOverlayWidget274 // GetChild provides a mock function for the type MockOverlayWidget
121 func (_mock *MockOverlayWidget) GetChild() layout.Widget {275 func (_mock *MockOverlayWidget) GetChild() layout.Widget {
122 ret := _mock.Called()276 ret := _mock.Called()
M internal/ui/layout/mocks/mock_paned_widget.go +66 -0
@@ -128,6 +128,72 @@ func (_c *MockPanedWidget_AddTickCallback_Call) RunAndReturn(run func(callback f
128128 return _c
129129 }
130130
131+// ComputePoint provides a mock function for the type MockPanedWidget
132+func (_mock *MockPanedWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
133+ ret := _mock.Called(target)
134+
135+ if len(ret) == 0 {
136+ panic("no return value specified for ComputePoint")
137+ }
138+
139+ var r0 float64
140+ var r1 float64
141+ var r2 bool
142+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
143+ return returnFunc(target)
144+ }
145+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
146+ r0 = returnFunc(target)
147+ } else {
148+ r0 = ret.Get(0).(float64)
149+ }
150+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
151+ r1 = returnFunc(target)
152+ } else {
153+ r1 = ret.Get(1).(float64)
154+ }
155+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
156+ r2 = returnFunc(target)
157+ } else {
158+ r2 = ret.Get(2).(bool)
159+ }
160+ return r0, r1, r2
161+}
162+
163+// MockPanedWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
164+type MockPanedWidget_ComputePoint_Call struct {
165+ *mock.Call
166+}
167+
168+// ComputePoint is a helper method to define mock.On call
169+// - target layout.Widget
170+func (_e *MockPanedWidget_Expecter) ComputePoint(target interface{}) *MockPanedWidget_ComputePoint_Call {
171+ return &MockPanedWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
172+}
173+
174+func (_c *MockPanedWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockPanedWidget_ComputePoint_Call {
175+ _c.Call.Run(func(args mock.Arguments) {
176+ var arg0 layout.Widget
177+ if args[0] != nil {
178+ arg0 = args[0].(layout.Widget)
179+ }
180+ run(
181+ arg0,
182+ )
183+ })
184+ return _c
185+}
186+
187+func (_c *MockPanedWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockPanedWidget_ComputePoint_Call {
188+ _c.Call.Return(x, y, ok)
189+ return _c
190+}
191+
192+func (_c *MockPanedWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockPanedWidget_ComputePoint_Call {
193+ _c.Call.Return(run)
194+ return _c
195+}
196+
131197 // ConnectMap provides a mock function for the type MockPanedWidget
132198 func (_mock *MockPanedWidget) ConnectMap(callback func()) uint32 {
133199 ret := _mock.Called(callback)
@@ -128,6 +128,72 @@ func (_c *MockPanedWidget_AddTickCallback_Call) RunAndReturn(run func(callback f
128 return _c128 return _c
129 }129 }
130 130
131+// ComputePoint provides a mock function for the type MockPanedWidget
132+func (_mock *MockPanedWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
133+ ret := _mock.Called(target)
134+
135+ if len(ret) == 0 {
136+ panic("no return value specified for ComputePoint")
137+ }
138+
139+ var r0 float64
140+ var r1 float64
141+ var r2 bool
142+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
143+ return returnFunc(target)
144+ }
145+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
146+ r0 = returnFunc(target)
147+ } else {
148+ r0 = ret.Get(0).(float64)
149+ }
150+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
151+ r1 = returnFunc(target)
152+ } else {
153+ r1 = ret.Get(1).(float64)
154+ }
155+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
156+ r2 = returnFunc(target)
157+ } else {
158+ r2 = ret.Get(2).(bool)
159+ }
160+ return r0, r1, r2
161+}
162+
163+// MockPanedWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
164+type MockPanedWidget_ComputePoint_Call struct {
165+ *mock.Call
166+}
167+
168+// ComputePoint is a helper method to define mock.On call
169+// - target layout.Widget
170+func (_e *MockPanedWidget_Expecter) ComputePoint(target interface{}) *MockPanedWidget_ComputePoint_Call {
171+ return &MockPanedWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
172+}
173+
174+func (_c *MockPanedWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockPanedWidget_ComputePoint_Call {
175+ _c.Call.Run(func(args mock.Arguments) {
176+ var arg0 layout.Widget
177+ if args[0] != nil {
178+ arg0 = args[0].(layout.Widget)
179+ }
180+ run(
181+ arg0,
182+ )
183+ })
184+ return _c
185+}
186+
187+func (_c *MockPanedWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockPanedWidget_ComputePoint_Call {
188+ _c.Call.Return(x, y, ok)
189+ return _c
190+}
191+
192+func (_c *MockPanedWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockPanedWidget_ComputePoint_Call {
193+ _c.Call.Return(run)
194+ return _c
195+}
196+
131 // ConnectMap provides a mock function for the type MockPanedWidget197 // ConnectMap provides a mock function for the type MockPanedWidget
132 func (_mock *MockPanedWidget) ConnectMap(callback func()) uint32 {198 func (_mock *MockPanedWidget) ConnectMap(callback func()) uint32 {
133 ret := _mock.Called(callback)199 ret := _mock.Called(callback)
M internal/ui/layout/mocks/mock_widget.go +154 -0
@@ -77,6 +77,160 @@ func (_c *MockWidget_AddCssClass_Call) RunAndReturn(run func(cssClass string)) *
7777 return _c
7878 }
7979
80+// ComputePoint provides a mock function for the type MockWidget
81+func (_mock *MockWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
82+ ret := _mock.Called(target)
83+
84+ if len(ret) == 0 {
85+ panic("no return value specified for ComputePoint")
86+ }
87+
88+ var r0 float64
89+ var r1 float64
90+ var r2 bool
91+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
92+ return returnFunc(target)
93+ }
94+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
95+ r0 = returnFunc(target)
96+ } else {
97+ r0 = ret.Get(0).(float64)
98+ }
99+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
100+ r1 = returnFunc(target)
101+ } else {
102+ r1 = ret.Get(1).(float64)
103+ }
104+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
105+ r2 = returnFunc(target)
106+ } else {
107+ r2 = ret.Get(2).(bool)
108+ }
109+ return r0, r1, r2
110+}
111+
112+// MockWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
113+type MockWidget_ComputePoint_Call struct {
114+ *mock.Call
115+}
116+
117+// ComputePoint is a helper method to define mock.On call
118+// - target layout.Widget
119+func (_e *MockWidget_Expecter) ComputePoint(target interface{}) *MockWidget_ComputePoint_Call {
120+ return &MockWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
121+}
122+
123+func (_c *MockWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockWidget_ComputePoint_Call {
124+ _c.Call.Run(func(args mock.Arguments) {
125+ var arg0 layout.Widget
126+ if args[0] != nil {
127+ arg0 = args[0].(layout.Widget)
128+ }
129+ run(
130+ arg0,
131+ )
132+ })
133+ return _c
134+}
135+
136+func (_c *MockWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockWidget_ComputePoint_Call {
137+ _c.Call.Return(x, y, ok)
138+ return _c
139+}
140+
141+func (_c *MockWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockWidget_ComputePoint_Call {
142+ _c.Call.Return(run)
143+ return _c
144+}
145+
146+// GetAllocatedHeight provides a mock function for the type MockWidget
147+func (_mock *MockWidget) GetAllocatedHeight() int {
148+ ret := _mock.Called()
149+
150+ if len(ret) == 0 {
151+ panic("no return value specified for GetAllocatedHeight")
152+ }
153+
154+ var r0 int
155+ if returnFunc, ok := ret.Get(0).(func() int); ok {
156+ r0 = returnFunc()
157+ } else {
158+ r0 = ret.Get(0).(int)
159+ }
160+ return r0
161+}
162+
163+// MockWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
164+type MockWidget_GetAllocatedHeight_Call struct {
165+ *mock.Call
166+}
167+
168+// GetAllocatedHeight is a helper method to define mock.On call
169+func (_e *MockWidget_Expecter) GetAllocatedHeight() *MockWidget_GetAllocatedHeight_Call {
170+ return &MockWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
171+}
172+
173+func (_c *MockWidget_GetAllocatedHeight_Call) Run(run func()) *MockWidget_GetAllocatedHeight_Call {
174+ _c.Call.Run(func(args mock.Arguments) {
175+ run()
176+ })
177+ return _c
178+}
179+
180+func (_c *MockWidget_GetAllocatedHeight_Call) Return(n int) *MockWidget_GetAllocatedHeight_Call {
181+ _c.Call.Return(n)
182+ return _c
183+}
184+
185+func (_c *MockWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockWidget_GetAllocatedHeight_Call {
186+ _c.Call.Return(run)
187+ return _c
188+}
189+
190+// GetAllocatedWidth provides a mock function for the type MockWidget
191+func (_mock *MockWidget) GetAllocatedWidth() int {
192+ ret := _mock.Called()
193+
194+ if len(ret) == 0 {
195+ panic("no return value specified for GetAllocatedWidth")
196+ }
197+
198+ var r0 int
199+ if returnFunc, ok := ret.Get(0).(func() int); ok {
200+ r0 = returnFunc()
201+ } else {
202+ r0 = ret.Get(0).(int)
203+ }
204+ return r0
205+}
206+
207+// MockWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
208+type MockWidget_GetAllocatedWidth_Call struct {
209+ *mock.Call
210+}
211+
212+// GetAllocatedWidth is a helper method to define mock.On call
213+func (_e *MockWidget_Expecter) GetAllocatedWidth() *MockWidget_GetAllocatedWidth_Call {
214+ return &MockWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
215+}
216+
217+func (_c *MockWidget_GetAllocatedWidth_Call) Run(run func()) *MockWidget_GetAllocatedWidth_Call {
218+ _c.Call.Run(func(args mock.Arguments) {
219+ run()
220+ })
221+ return _c
222+}
223+
224+func (_c *MockWidget_GetAllocatedWidth_Call) Return(n int) *MockWidget_GetAllocatedWidth_Call {
225+ _c.Call.Return(n)
226+ return _c
227+}
228+
229+func (_c *MockWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockWidget_GetAllocatedWidth_Call {
230+ _c.Call.Return(run)
231+ return _c
232+}
233+
80234 // GetHexpand provides a mock function for the type MockWidget
81235 func (_mock *MockWidget) GetHexpand() bool {
82236 ret := _mock.Called()
@@ -77,6 +77,160 @@ func (_c *MockWidget_AddCssClass_Call) RunAndReturn(run func(cssClass string)) *
77 return _c77 return _c
78 }78 }
79 79
80+// ComputePoint provides a mock function for the type MockWidget
81+func (_mock *MockWidget) ComputePoint(target layout.Widget) (float64, float64, bool) {
82+ ret := _mock.Called(target)
83+
84+ if len(ret) == 0 {
85+ panic("no return value specified for ComputePoint")
86+ }
87+
88+ var r0 float64
89+ var r1 float64
90+ var r2 bool
91+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok {
92+ return returnFunc(target)
93+ }
94+ if returnFunc, ok := ret.Get(0).(func(layout.Widget) float64); ok {
95+ r0 = returnFunc(target)
96+ } else {
97+ r0 = ret.Get(0).(float64)
98+ }
99+ if returnFunc, ok := ret.Get(1).(func(layout.Widget) float64); ok {
100+ r1 = returnFunc(target)
101+ } else {
102+ r1 = ret.Get(1).(float64)
103+ }
104+ if returnFunc, ok := ret.Get(2).(func(layout.Widget) bool); ok {
105+ r2 = returnFunc(target)
106+ } else {
107+ r2 = ret.Get(2).(bool)
108+ }
109+ return r0, r1, r2
110+}
111+
112+// MockWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint'
113+type MockWidget_ComputePoint_Call struct {
114+ *mock.Call
115+}
116+
117+// ComputePoint is a helper method to define mock.On call
118+// - target layout.Widget
119+func (_e *MockWidget_Expecter) ComputePoint(target interface{}) *MockWidget_ComputePoint_Call {
120+ return &MockWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)}
121+}
122+
123+func (_c *MockWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockWidget_ComputePoint_Call {
124+ _c.Call.Run(func(args mock.Arguments) {
125+ var arg0 layout.Widget
126+ if args[0] != nil {
127+ arg0 = args[0].(layout.Widget)
128+ }
129+ run(
130+ arg0,
131+ )
132+ })
133+ return _c
134+}
135+
136+func (_c *MockWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockWidget_ComputePoint_Call {
137+ _c.Call.Return(x, y, ok)
138+ return _c
139+}
140+
141+func (_c *MockWidget_ComputePoint_Call) RunAndReturn(run func(target layout.Widget) (float64, float64, bool)) *MockWidget_ComputePoint_Call {
142+ _c.Call.Return(run)
143+ return _c
144+}
145+
146+// GetAllocatedHeight provides a mock function for the type MockWidget
147+func (_mock *MockWidget) GetAllocatedHeight() int {
148+ ret := _mock.Called()
149+
150+ if len(ret) == 0 {
151+ panic("no return value specified for GetAllocatedHeight")
152+ }
153+
154+ var r0 int
155+ if returnFunc, ok := ret.Get(0).(func() int); ok {
156+ r0 = returnFunc()
157+ } else {
158+ r0 = ret.Get(0).(int)
159+ }
160+ return r0
161+}
162+
163+// MockWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight'
164+type MockWidget_GetAllocatedHeight_Call struct {
165+ *mock.Call
166+}
167+
168+// GetAllocatedHeight is a helper method to define mock.On call
169+func (_e *MockWidget_Expecter) GetAllocatedHeight() *MockWidget_GetAllocatedHeight_Call {
170+ return &MockWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")}
171+}
172+
173+func (_c *MockWidget_GetAllocatedHeight_Call) Run(run func()) *MockWidget_GetAllocatedHeight_Call {
174+ _c.Call.Run(func(args mock.Arguments) {
175+ run()
176+ })
177+ return _c
178+}
179+
180+func (_c *MockWidget_GetAllocatedHeight_Call) Return(n int) *MockWidget_GetAllocatedHeight_Call {
181+ _c.Call.Return(n)
182+ return _c
183+}
184+
185+func (_c *MockWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockWidget_GetAllocatedHeight_Call {
186+ _c.Call.Return(run)
187+ return _c
188+}
189+
190+// GetAllocatedWidth provides a mock function for the type MockWidget
191+func (_mock *MockWidget) GetAllocatedWidth() int {
192+ ret := _mock.Called()
193+
194+ if len(ret) == 0 {
195+ panic("no return value specified for GetAllocatedWidth")
196+ }
197+
198+ var r0 int
199+ if returnFunc, ok := ret.Get(0).(func() int); ok {
200+ r0 = returnFunc()
201+ } else {
202+ r0 = ret.Get(0).(int)
203+ }
204+ return r0
205+}
206+
207+// MockWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth'
208+type MockWidget_GetAllocatedWidth_Call struct {
209+ *mock.Call
210+}
211+
212+// GetAllocatedWidth is a helper method to define mock.On call
213+func (_e *MockWidget_Expecter) GetAllocatedWidth() *MockWidget_GetAllocatedWidth_Call {
214+ return &MockWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")}
215+}
216+
217+func (_c *MockWidget_GetAllocatedWidth_Call) Run(run func()) *MockWidget_GetAllocatedWidth_Call {
218+ _c.Call.Run(func(args mock.Arguments) {
219+ run()
220+ })
221+ return _c
222+}
223+
224+func (_c *MockWidget_GetAllocatedWidth_Call) Return(n int) *MockWidget_GetAllocatedWidth_Call {
225+ _c.Call.Return(n)
226+ return _c
227+}
228+
229+func (_c *MockWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockWidget_GetAllocatedWidth_Call {
230+ _c.Call.Return(run)
231+ return _c
232+}
233+
80 // GetHexpand provides a mock function for the type MockWidget234 // GetHexpand provides a mock function for the type MockWidget
81 func (_mock *MockWidget) GetHexpand() bool {235 func (_mock *MockWidget) GetHexpand() bool {
82 ret := _mock.Called()236 ret := _mock.Called()
M internal/ui/layout/split_test.go +29 -15
@@ -1,9 +1,9 @@
11 package layout_test
22
33 import (
4+ "context"
45 "testing"
56
6- "github.com/rs/zerolog"
77 "github.com/stretchr/testify/assert"
88 "github.com/stretchr/testify/mock"
99 "github.com/stretchr/testify/require"
@@ -35,6 +35,7 @@ func setupSplitViewMocks(mockPaned *mocks.MockPanedWidget, orientation layout.Or
3535
3636 func TestNewSplitView_Horizontal(t *testing.T) {
3737 // Arrange
38+ ctx := context.Background()
3839 mockFactory := mocks.NewMockWidgetFactory(t)
3940 mockPaned := mocks.NewMockPanedWidget(t)
4041 mockStartChild := mocks.NewMockWidget(t)
@@ -46,7 +47,7 @@ func TestNewSplitView_Horizontal(t *testing.T) {
4647 mockPaned.EXPECT().SetEndChild(mockEndChild).Once()
4748
4849 // Act
49- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, mockStartChild, mockEndChild, 0.5)
50+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, mockStartChild, mockEndChild, 0.5)
5051
5152 // Assert
5253 require.NotNil(t, sv)
@@ -58,6 +59,7 @@ func TestNewSplitView_Horizontal(t *testing.T) {
5859
5960 func TestNewSplitView_Vertical(t *testing.T) {
6061 // Arrange
62+ ctx := context.Background()
6163 mockFactory := mocks.NewMockWidgetFactory(t)
6264 mockPaned := mocks.NewMockPanedWidget(t)
6365 mockStartChild := mocks.NewMockWidget(t)
@@ -69,7 +71,7 @@ func TestNewSplitView_Vertical(t *testing.T) {
6971 mockPaned.EXPECT().SetEndChild(mockEndChild).Once()
7072
7173 // Act
72- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationVertical, mockStartChild, mockEndChild, 0.5)
74+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationVertical, mockStartChild, mockEndChild, 0.5)
7375
7476 // Assert
7577 require.NotNil(t, sv)
@@ -78,6 +80,7 @@ func TestNewSplitView_Vertical(t *testing.T) {
7880
7981 func TestNewSplitView_NilChildren(t *testing.T) {
8082 // Arrange
83+ ctx := context.Background()
8184 mockFactory := mocks.NewMockWidgetFactory(t)
8285 mockPaned := mocks.NewMockPanedWidget(t)
8386
@@ -86,7 +89,7 @@ func TestNewSplitView_NilChildren(t *testing.T) {
8689 // SetStartChild and SetEndChild should NOT be called when children are nil
8790
8891 // Act
89- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)
92+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
9093
9194 // Assert
9295 require.NotNil(t, sv)
@@ -109,6 +112,7 @@ func TestSetRatio_ValidRange(t *testing.T) {
109112
110113 for _, tt := range tests {
111114 t.Run(tt.name, func(t *testing.T) {
115+ ctx := context.Background()
112116 // Arrange
113117 mockFactory := mocks.NewMockWidgetFactory(t)
114118 mockPaned := mocks.NewMockPanedWidget(t)
@@ -116,7 +120,7 @@ func TestSetRatio_ValidRange(t *testing.T) {
116120 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
117121 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
118122
119- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)
123+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
120124
121125 // Act
122126 sv.SetRatio(tt.input)
@@ -141,6 +145,7 @@ func TestSetRatio_OutOfRange_Clamped(t *testing.T) {
141145
142146 for _, tt := range tests {
143147 t.Run(tt.name, func(t *testing.T) {
148+ ctx := context.Background()
144149 // Arrange
145150 mockFactory := mocks.NewMockWidgetFactory(t)
146151 mockPaned := mocks.NewMockPanedWidget(t)
@@ -148,7 +153,7 @@ func TestSetRatio_OutOfRange_Clamped(t *testing.T) {
148153 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
149154 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
150155
151- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)
156+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
152157
153158 // Act
154159 sv.SetRatio(tt.input)
@@ -161,6 +166,7 @@ func TestSetRatio_OutOfRange_Clamped(t *testing.T) {
161166
162167 func TestSwapStart_ReplacesChild(t *testing.T) {
163168 // Arrange
169+ ctx := context.Background()
164170 mockFactory := mocks.NewMockWidgetFactory(t)
165171 mockPaned := mocks.NewMockPanedWidget(t)
166172 mockOldChild := mocks.NewMockWidget(t)
@@ -170,7 +176,7 @@ func TestSwapStart_ReplacesChild(t *testing.T) {
170176 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
171177 mockPaned.EXPECT().SetStartChild(mockOldChild).Once()
172178
173- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, mockOldChild, nil, 0.5)
179+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, mockOldChild, nil, 0.5)
174180
175181 // Expect swap operations
176182 mockPaned.EXPECT().SetStartChild(nil).Once() // Remove old
@@ -185,6 +191,7 @@ func TestSwapStart_ReplacesChild(t *testing.T) {
185191
186192 func TestSwapEnd_ReplacesChild(t *testing.T) {
187193 // Arrange
194+ ctx := context.Background()
188195 mockFactory := mocks.NewMockWidgetFactory(t)
189196 mockPaned := mocks.NewMockPanedWidget(t)
190197 mockOldChild := mocks.NewMockWidget(t)
@@ -194,7 +201,7 @@ func TestSwapEnd_ReplacesChild(t *testing.T) {
194201 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
195202 mockPaned.EXPECT().SetEndChild(mockOldChild).Once()
196203
197- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, mockOldChild, 0.5)
204+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, mockOldChild, 0.5)
198205
199206 // Expect swap operations
200207 mockPaned.EXPECT().SetEndChild(nil).Once() // Remove old
@@ -209,6 +216,7 @@ func TestSwapEnd_ReplacesChild(t *testing.T) {
209216
210217 func TestSwapStart_FromNil(t *testing.T) {
211218 // Arrange
219+ ctx := context.Background()
212220 mockFactory := mocks.NewMockWidgetFactory(t)
213221 mockPaned := mocks.NewMockPanedWidget(t)
214222 mockNewChild := mocks.NewMockWidget(t)
@@ -216,7 +224,7 @@ func TestSwapStart_FromNil(t *testing.T) {
216224 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
217225 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
218226
219- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)
227+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
220228
221229 // Expect only adding new child (no removal since old was nil)
222230 mockPaned.EXPECT().SetStartChild(mockNewChild).Once()
@@ -230,6 +238,7 @@ func TestSwapStart_FromNil(t *testing.T) {
230238
231239 func TestSwapEnd_ToNil(t *testing.T) {
232240 // Arrange
241+ ctx := context.Background()
233242 mockFactory := mocks.NewMockWidgetFactory(t)
234243 mockPaned := mocks.NewMockPanedWidget(t)
235244 mockOldChild := mocks.NewMockWidget(t)
@@ -238,7 +247,7 @@ func TestSwapEnd_ToNil(t *testing.T) {
238247 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
239248 mockPaned.EXPECT().SetEndChild(mockOldChild).Once()
240249
241- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, mockOldChild, 0.5)
250+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, mockOldChild, 0.5)
242251
243252 // Expect removal (SetEndChild(nil) called for clearing old)
244253 mockPaned.EXPECT().SetEndChild(nil).Once()
@@ -252,13 +261,14 @@ func TestSwapEnd_ToNil(t *testing.T) {
252261
253262 func TestWidget_ReturnsPanedWidget(t *testing.T) {
254263 // Arrange
264+ ctx := context.Background()
255265 mockFactory := mocks.NewMockWidgetFactory(t)
256266 mockPaned := mocks.NewMockPanedWidget(t)
257267
258268 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
259269 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
260270
261- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)
271+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
262272
263273 // Act
264274 widget := sv.Widget()
@@ -269,13 +279,14 @@ func TestWidget_ReturnsPanedWidget(t *testing.T) {
269279
270280 func TestSetPosition_DelegatesToPaned(t *testing.T) {
271281 // Arrange
282+ ctx := context.Background()
272283 mockFactory := mocks.NewMockWidgetFactory(t)
273284 mockPaned := mocks.NewMockPanedWidget(t)
274285
275286 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
276287 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
277288
278- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)
289+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
279290
280291 mockPaned.EXPECT().SetPosition(400).Once()
281292
@@ -287,13 +298,14 @@ func TestSetPosition_DelegatesToPaned(t *testing.T) {
287298
288299 func TestGetPosition_DelegatesToPaned(t *testing.T) {
289300 // Arrange
301+ ctx := context.Background()
290302 mockFactory := mocks.NewMockWidgetFactory(t)
291303 mockPaned := mocks.NewMockPanedWidget(t)
292304
293305 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
294306 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
295307
296- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)
308+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
297309
298310 mockPaned.EXPECT().GetPosition().Return(400).Once()
299311
@@ -306,13 +318,14 @@ func TestGetPosition_DelegatesToPaned(t *testing.T) {
306318
307319 func TestSetWideHandle_DelegatesToPaned(t *testing.T) {
308320 // Arrange
321+ ctx := context.Background()
309322 mockFactory := mocks.NewMockWidgetFactory(t)
310323 mockPaned := mocks.NewMockPanedWidget(t)
311324
312325 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
313326 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
314327
315- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)
328+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
316329
317330 mockPaned.EXPECT().SetWideHandle(true).Once()
318331
@@ -335,6 +348,7 @@ func TestNewSplitView_InitialRatio_Clamped(t *testing.T) {
335348
336349 for _, tt := range tests {
337350 t.Run(tt.name, func(t *testing.T) {
351+ ctx := context.Background()
338352 // Arrange
339353 mockFactory := mocks.NewMockWidgetFactory(t)
340354 mockPaned := mocks.NewMockPanedWidget(t)
@@ -343,7 +357,7 @@ func TestNewSplitView_InitialRatio_Clamped(t *testing.T) {
343357 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
344358
345359 // Act
346- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, tt.input)
360+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, tt.input)
347361
348362 // Assert
349363 assert.Equal(t, tt.expected, sv.GetRatio())
@@ -1,9 +1,9 @@
1 package layout_test1 package layout_test
2 2
3 import (3 import (
4+ "context"
4 "testing"5 "testing"
5 6
6- "github.com/rs/zerolog"
7 "github.com/stretchr/testify/assert"7 "github.com/stretchr/testify/assert"
8 "github.com/stretchr/testify/mock"8 "github.com/stretchr/testify/mock"
9 "github.com/stretchr/testify/require"9 "github.com/stretchr/testify/require"
@@ -35,6 +35,7 @@ func setupSplitViewMocks(mockPaned *mocks.MockPanedWidget, orientation layout.Or
35 35
36 func TestNewSplitView_Horizontal(t *testing.T) {36 func TestNewSplitView_Horizontal(t *testing.T) {
37 // Arrange37 // Arrange
38+ ctx := context.Background()
38 mockFactory := mocks.NewMockWidgetFactory(t)39 mockFactory := mocks.NewMockWidgetFactory(t)
39 mockPaned := mocks.NewMockPanedWidget(t)40 mockPaned := mocks.NewMockPanedWidget(t)
40 mockStartChild := mocks.NewMockWidget(t)41 mockStartChild := mocks.NewMockWidget(t)
@@ -46,7 +47,7 @@ func TestNewSplitView_Horizontal(t *testing.T) {
46 mockPaned.EXPECT().SetEndChild(mockEndChild).Once()47 mockPaned.EXPECT().SetEndChild(mockEndChild).Once()
47 48
48 // Act49 // Act
49- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, mockStartChild, mockEndChild, 0.5)50+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, mockStartChild, mockEndChild, 0.5)
50 51
51 // Assert52 // Assert
52 require.NotNil(t, sv)53 require.NotNil(t, sv)
@@ -58,6 +59,7 @@ func TestNewSplitView_Horizontal(t *testing.T) {
58 59
59 func TestNewSplitView_Vertical(t *testing.T) {60 func TestNewSplitView_Vertical(t *testing.T) {
60 // Arrange61 // Arrange
62+ ctx := context.Background()
61 mockFactory := mocks.NewMockWidgetFactory(t)63 mockFactory := mocks.NewMockWidgetFactory(t)
62 mockPaned := mocks.NewMockPanedWidget(t)64 mockPaned := mocks.NewMockPanedWidget(t)
63 mockStartChild := mocks.NewMockWidget(t)65 mockStartChild := mocks.NewMockWidget(t)
@@ -69,7 +71,7 @@ func TestNewSplitView_Vertical(t *testing.T) {
69 mockPaned.EXPECT().SetEndChild(mockEndChild).Once()71 mockPaned.EXPECT().SetEndChild(mockEndChild).Once()
70 72
71 // Act73 // Act
72- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationVertical, mockStartChild, mockEndChild, 0.5)74+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationVertical, mockStartChild, mockEndChild, 0.5)
73 75
74 // Assert76 // Assert
75 require.NotNil(t, sv)77 require.NotNil(t, sv)
@@ -78,6 +80,7 @@ func TestNewSplitView_Vertical(t *testing.T) {
78 80
79 func TestNewSplitView_NilChildren(t *testing.T) {81 func TestNewSplitView_NilChildren(t *testing.T) {
80 // Arrange82 // Arrange
83+ ctx := context.Background()
81 mockFactory := mocks.NewMockWidgetFactory(t)84 mockFactory := mocks.NewMockWidgetFactory(t)
82 mockPaned := mocks.NewMockPanedWidget(t)85 mockPaned := mocks.NewMockPanedWidget(t)
83 86
@@ -86,7 +89,7 @@ func TestNewSplitView_NilChildren(t *testing.T) {
86 // SetStartChild and SetEndChild should NOT be called when children are nil89 // SetStartChild and SetEndChild should NOT be called when children are nil
87 90
88 // Act91 // Act
89- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)92+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
90 93
91 // Assert94 // Assert
92 require.NotNil(t, sv)95 require.NotNil(t, sv)
@@ -109,6 +112,7 @@ func TestSetRatio_ValidRange(t *testing.T) {
109 112
110 for _, tt := range tests {113 for _, tt := range tests {
111 t.Run(tt.name, func(t *testing.T) {114 t.Run(tt.name, func(t *testing.T) {
115+ ctx := context.Background()
112 // Arrange116 // Arrange
113 mockFactory := mocks.NewMockWidgetFactory(t)117 mockFactory := mocks.NewMockWidgetFactory(t)
114 mockPaned := mocks.NewMockPanedWidget(t)118 mockPaned := mocks.NewMockPanedWidget(t)
@@ -116,7 +120,7 @@ func TestSetRatio_ValidRange(t *testing.T) {
116 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()120 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
117 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)121 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
118 122
119- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)123+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
120 124
121 // Act125 // Act
122 sv.SetRatio(tt.input)126 sv.SetRatio(tt.input)
@@ -141,6 +145,7 @@ func TestSetRatio_OutOfRange_Clamped(t *testing.T) {
141 145
142 for _, tt := range tests {146 for _, tt := range tests {
143 t.Run(tt.name, func(t *testing.T) {147 t.Run(tt.name, func(t *testing.T) {
148+ ctx := context.Background()
144 // Arrange149 // Arrange
145 mockFactory := mocks.NewMockWidgetFactory(t)150 mockFactory := mocks.NewMockWidgetFactory(t)
146 mockPaned := mocks.NewMockPanedWidget(t)151 mockPaned := mocks.NewMockPanedWidget(t)
@@ -148,7 +153,7 @@ func TestSetRatio_OutOfRange_Clamped(t *testing.T) {
148 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()153 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
149 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)154 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
150 155
151- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)156+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
152 157
153 // Act158 // Act
154 sv.SetRatio(tt.input)159 sv.SetRatio(tt.input)
@@ -161,6 +166,7 @@ func TestSetRatio_OutOfRange_Clamped(t *testing.T) {
161 166
162 func TestSwapStart_ReplacesChild(t *testing.T) {167 func TestSwapStart_ReplacesChild(t *testing.T) {
163 // Arrange168 // Arrange
169+ ctx := context.Background()
164 mockFactory := mocks.NewMockWidgetFactory(t)170 mockFactory := mocks.NewMockWidgetFactory(t)
165 mockPaned := mocks.NewMockPanedWidget(t)171 mockPaned := mocks.NewMockPanedWidget(t)
166 mockOldChild := mocks.NewMockWidget(t)172 mockOldChild := mocks.NewMockWidget(t)
@@ -170,7 +176,7 @@ func TestSwapStart_ReplacesChild(t *testing.T) {
170 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)176 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
171 mockPaned.EXPECT().SetStartChild(mockOldChild).Once()177 mockPaned.EXPECT().SetStartChild(mockOldChild).Once()
172 178
173- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, mockOldChild, nil, 0.5)179+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, mockOldChild, nil, 0.5)
174 180
175 // Expect swap operations181 // Expect swap operations
176 mockPaned.EXPECT().SetStartChild(nil).Once() // Remove old182 mockPaned.EXPECT().SetStartChild(nil).Once() // Remove old
@@ -185,6 +191,7 @@ func TestSwapStart_ReplacesChild(t *testing.T) {
185 191
186 func TestSwapEnd_ReplacesChild(t *testing.T) {192 func TestSwapEnd_ReplacesChild(t *testing.T) {
187 // Arrange193 // Arrange
194+ ctx := context.Background()
188 mockFactory := mocks.NewMockWidgetFactory(t)195 mockFactory := mocks.NewMockWidgetFactory(t)
189 mockPaned := mocks.NewMockPanedWidget(t)196 mockPaned := mocks.NewMockPanedWidget(t)
190 mockOldChild := mocks.NewMockWidget(t)197 mockOldChild := mocks.NewMockWidget(t)
@@ -194,7 +201,7 @@ func TestSwapEnd_ReplacesChild(t *testing.T) {
194 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)201 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
195 mockPaned.EXPECT().SetEndChild(mockOldChild).Once()202 mockPaned.EXPECT().SetEndChild(mockOldChild).Once()
196 203
197- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, mockOldChild, 0.5)204+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, mockOldChild, 0.5)
198 205
199 // Expect swap operations206 // Expect swap operations
200 mockPaned.EXPECT().SetEndChild(nil).Once() // Remove old207 mockPaned.EXPECT().SetEndChild(nil).Once() // Remove old
@@ -209,6 +216,7 @@ func TestSwapEnd_ReplacesChild(t *testing.T) {
209 216
210 func TestSwapStart_FromNil(t *testing.T) {217 func TestSwapStart_FromNil(t *testing.T) {
211 // Arrange218 // Arrange
219+ ctx := context.Background()
212 mockFactory := mocks.NewMockWidgetFactory(t)220 mockFactory := mocks.NewMockWidgetFactory(t)
213 mockPaned := mocks.NewMockPanedWidget(t)221 mockPaned := mocks.NewMockPanedWidget(t)
214 mockNewChild := mocks.NewMockWidget(t)222 mockNewChild := mocks.NewMockWidget(t)
@@ -216,7 +224,7 @@ func TestSwapStart_FromNil(t *testing.T) {
216 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()224 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
217 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)225 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
218 226
219- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)227+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
220 228
221 // Expect only adding new child (no removal since old was nil)229 // Expect only adding new child (no removal since old was nil)
222 mockPaned.EXPECT().SetStartChild(mockNewChild).Once()230 mockPaned.EXPECT().SetStartChild(mockNewChild).Once()
@@ -230,6 +238,7 @@ func TestSwapStart_FromNil(t *testing.T) {
230 238
231 func TestSwapEnd_ToNil(t *testing.T) {239 func TestSwapEnd_ToNil(t *testing.T) {
232 // Arrange240 // Arrange
241+ ctx := context.Background()
233 mockFactory := mocks.NewMockWidgetFactory(t)242 mockFactory := mocks.NewMockWidgetFactory(t)
234 mockPaned := mocks.NewMockPanedWidget(t)243 mockPaned := mocks.NewMockPanedWidget(t)
235 mockOldChild := mocks.NewMockWidget(t)244 mockOldChild := mocks.NewMockWidget(t)
@@ -238,7 +247,7 @@ func TestSwapEnd_ToNil(t *testing.T) {
238 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)247 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
239 mockPaned.EXPECT().SetEndChild(mockOldChild).Once()248 mockPaned.EXPECT().SetEndChild(mockOldChild).Once()
240 249
241- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, mockOldChild, 0.5)250+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, mockOldChild, 0.5)
242 251
243 // Expect removal (SetEndChild(nil) called for clearing old)252 // Expect removal (SetEndChild(nil) called for clearing old)
244 mockPaned.EXPECT().SetEndChild(nil).Once()253 mockPaned.EXPECT().SetEndChild(nil).Once()
@@ -252,13 +261,14 @@ func TestSwapEnd_ToNil(t *testing.T) {
252 261
253 func TestWidget_ReturnsPanedWidget(t *testing.T) {262 func TestWidget_ReturnsPanedWidget(t *testing.T) {
254 // Arrange263 // Arrange
264+ ctx := context.Background()
255 mockFactory := mocks.NewMockWidgetFactory(t)265 mockFactory := mocks.NewMockWidgetFactory(t)
256 mockPaned := mocks.NewMockPanedWidget(t)266 mockPaned := mocks.NewMockPanedWidget(t)
257 267
258 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()268 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
259 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)269 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
260 270
261- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)271+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
262 272
263 // Act273 // Act
264 widget := sv.Widget()274 widget := sv.Widget()
@@ -269,13 +279,14 @@ func TestWidget_ReturnsPanedWidget(t *testing.T) {
269 279
270 func TestSetPosition_DelegatesToPaned(t *testing.T) {280 func TestSetPosition_DelegatesToPaned(t *testing.T) {
271 // Arrange281 // Arrange
282+ ctx := context.Background()
272 mockFactory := mocks.NewMockWidgetFactory(t)283 mockFactory := mocks.NewMockWidgetFactory(t)
273 mockPaned := mocks.NewMockPanedWidget(t)284 mockPaned := mocks.NewMockPanedWidget(t)
274 285
275 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()286 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
276 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)287 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
277 288
278- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)289+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
279 290
280 mockPaned.EXPECT().SetPosition(400).Once()291 mockPaned.EXPECT().SetPosition(400).Once()
281 292
@@ -287,13 +298,14 @@ func TestSetPosition_DelegatesToPaned(t *testing.T) {
287 298
288 func TestGetPosition_DelegatesToPaned(t *testing.T) {299 func TestGetPosition_DelegatesToPaned(t *testing.T) {
289 // Arrange300 // Arrange
301+ ctx := context.Background()
290 mockFactory := mocks.NewMockWidgetFactory(t)302 mockFactory := mocks.NewMockWidgetFactory(t)
291 mockPaned := mocks.NewMockPanedWidget(t)303 mockPaned := mocks.NewMockPanedWidget(t)
292 304
293 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()305 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
294 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)306 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
295 307
296- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)308+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
297 309
298 mockPaned.EXPECT().GetPosition().Return(400).Once()310 mockPaned.EXPECT().GetPosition().Return(400).Once()
299 311
@@ -306,13 +318,14 @@ func TestGetPosition_DelegatesToPaned(t *testing.T) {
306 318
307 func TestSetWideHandle_DelegatesToPaned(t *testing.T) {319 func TestSetWideHandle_DelegatesToPaned(t *testing.T) {
308 // Arrange320 // Arrange
321+ ctx := context.Background()
309 mockFactory := mocks.NewMockWidgetFactory(t)322 mockFactory := mocks.NewMockWidgetFactory(t)
310 mockPaned := mocks.NewMockPanedWidget(t)323 mockPaned := mocks.NewMockPanedWidget(t)
311 324
312 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()325 mockFactory.EXPECT().NewPaned(mock.Anything).Return(mockPaned).Once()
313 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)326 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
314 327
315- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, 0.5)328+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, 0.5)
316 329
317 mockPaned.EXPECT().SetWideHandle(true).Once()330 mockPaned.EXPECT().SetWideHandle(true).Once()
318 331
@@ -335,6 +348,7 @@ func TestNewSplitView_InitialRatio_Clamped(t *testing.T) {
335 348
336 for _, tt := range tests {349 for _, tt := range tests {
337 t.Run(tt.name, func(t *testing.T) {350 t.Run(tt.name, func(t *testing.T) {
351+ ctx := context.Background()
338 // Arrange352 // Arrange
339 mockFactory := mocks.NewMockWidgetFactory(t)353 mockFactory := mocks.NewMockWidgetFactory(t)
340 mockPaned := mocks.NewMockPanedWidget(t)354 mockPaned := mocks.NewMockPanedWidget(t)
@@ -343,7 +357,7 @@ func TestNewSplitView_InitialRatio_Clamped(t *testing.T) {
343 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)357 setupSplitViewMocks(mockPaned, layout.OrientationHorizontal)
344 358
345 // Act359 // Act
346- sv := layout.NewSplitView(mockFactory, zerolog.Nop(), layout.OrientationHorizontal, nil, nil, tt.input)360+ sv := layout.NewSplitView(ctx, mockFactory, layout.OrientationHorizontal, nil, nil, tt.input)
347 361
348 // Assert362 // Assert
349 assert.Equal(t, tt.expected, sv.GetRatio())363 assert.Equal(t, tt.expected, sv.GetRatio())
M internal/ui/layout/stacked_test.go +47 -30
@@ -1,6 +1,7 @@
11 package layout_test
22
33 import (
4+ "context"
45 "testing"
56
67 "github.com/stretchr/testify/assert"
@@ -80,6 +81,7 @@ func TestNewStackedView_EmptyStack(t *testing.T) {
8081
8182 func TestAddPane_SinglePane_BecomesActive(t *testing.T) {
8283 // Arrange
84+ ctx := context.Background()
8385 mockFactory, mockBox := setupMockFactory(t)
8486 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
8587
@@ -91,7 +93,7 @@ func TestAddPane_SinglePane_BecomesActive(t *testing.T) {
9193 sv := layout.NewStackedView(mockFactory)
9294
9395 // Act
94- index := sv.AddPane("Test Page", "web-browser-symbolic", mockContainer)
96+ index := sv.AddPane(ctx, "Test Page", "web-browser-symbolic", mockContainer)
9597
9698 // Assert
9799 assert.Equal(t, 0, index)
@@ -101,6 +103,7 @@ func TestAddPane_SinglePane_BecomesActive(t *testing.T) {
101103
102104 func TestAddPane_MultiplePanes_LastBecomesActive(t *testing.T) {
103105 // Arrange
106+ ctx := context.Background()
104107 mockFactory, mockBox := setupMockFactory(t)
105108
106109 // First pane
@@ -124,8 +127,8 @@ func TestAddPane_MultiplePanes_LastBecomesActive(t *testing.T) {
124127 sv := layout.NewStackedView(mockFactory)
125128
126129 // Act
127- sv.AddPane("Page 1", "", mockContainer1)
128- index := sv.AddPane("Page 2", "", mockContainer2)
130+ sv.AddPane(ctx, "Page 1", "", mockContainer1)
131+ index := sv.AddPane(ctx, "Page 2", "", mockContainer2)
129132
130133 // Assert
131134 assert.Equal(t, 1, index)
@@ -135,6 +138,7 @@ func TestAddPane_MultiplePanes_LastBecomesActive(t *testing.T) {
135138
136139 func TestRemovePane_MiddlePane(t *testing.T) {
137140 // Arrange
141+ ctx := context.Background()
138142 mockFactory, mockBox := setupMockFactory(t)
139143
140144 // Setup 3 panes (simplified - just track the key behaviors)
@@ -159,9 +163,9 @@ func TestRemovePane_MiddlePane(t *testing.T) {
159163 }
160164
161165 sv := layout.NewStackedView(mockFactory)
162- sv.AddPane("Page 1", "", containers[0])
163- sv.AddPane("Page 2", "", containers[1])
164- sv.AddPane("Page 3", "", containers[2])
166+ sv.AddPane(ctx, "Page 1", "", containers[0])
167+ sv.AddPane(ctx, "Page 2", "", containers[1])
168+ sv.AddPane(ctx, "Page 3", "", containers[2])
165169
166170 // Remove middle pane (index 1)
167171 // The parent of titleBar is the button widget
@@ -169,7 +173,7 @@ func TestRemovePane_MiddlePane(t *testing.T) {
169173 mockBox.EXPECT().Remove(containers[1]).Once()
170174
171175 // Act
172- err := sv.RemovePane(1)
176+ err := sv.RemovePane(ctx, 1)
173177
174178 // Assert
175179 require.NoError(t, err)
@@ -178,6 +182,7 @@ func TestRemovePane_MiddlePane(t *testing.T) {
178182
179183 func TestRemovePane_LastPane_ReturnsError(t *testing.T) {
180184 // Arrange
185+ ctx := context.Background()
181186 mockFactory, mockBox := setupMockFactory(t)
182187 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
183188
@@ -186,10 +191,10 @@ func TestRemovePane_LastPane_ReturnsError(t *testing.T) {
186191 mockTitleBar.EXPECT().AddCssClass("active").Once()
187192
188193 sv := layout.NewStackedView(mockFactory)
189- sv.AddPane("Only Page", "", mockContainer)
194+ sv.AddPane(ctx, "Only Page", "", mockContainer)
190195
191196 // Act
192- err := sv.RemovePane(0)
197+ err := sv.RemovePane(ctx, 0)
193198
194199 // Assert
195200 assert.ErrorIs(t, err, layout.ErrCannotRemoveLastPane)
@@ -198,11 +203,12 @@ func TestRemovePane_LastPane_ReturnsError(t *testing.T) {
198203
199204 func TestRemovePane_EmptyStack_ReturnsError(t *testing.T) {
200205 // Arrange
206+ ctx := context.Background()
201207 mockFactory, _ := setupMockFactory(t)
202208 sv := layout.NewStackedView(mockFactory)
203209
204210 // Act
205- err := sv.RemovePane(0)
211+ err := sv.RemovePane(ctx, 0)
206212
207213 // Assert
208214 assert.ErrorIs(t, err, layout.ErrStackEmpty)
@@ -210,6 +216,7 @@ func TestRemovePane_EmptyStack_ReturnsError(t *testing.T) {
210216
211217 func TestRemovePane_IndexOutOfBounds(t *testing.T) {
212218 // Arrange
219+ ctx := context.Background()
213220 mockFactory, mockBox := setupMockFactory(t)
214221 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
215222
@@ -218,10 +225,10 @@ func TestRemovePane_IndexOutOfBounds(t *testing.T) {
218225 mockTitleBar.EXPECT().AddCssClass("active").Once()
219226
220227 sv := layout.NewStackedView(mockFactory)
221- sv.AddPane("Page", "", mockContainer)
228+ sv.AddPane(ctx, "Page", "", mockContainer)
222229
223230 // Act
224- err := sv.RemovePane(5)
231+ err := sv.RemovePane(ctx, 5)
225232
226233 // Assert
227234 assert.ErrorIs(t, err, layout.ErrIndexOutOfBounds)
@@ -229,6 +236,7 @@ func TestRemovePane_IndexOutOfBounds(t *testing.T) {
229236
230237 func TestSetActive_ValidIndex(t *testing.T) {
231238 // Arrange
239+ ctx := context.Background()
232240 mockFactory, mockBox := setupMockFactory(t)
233241
234242 containers := make([]*mocks.MockWidget, 2)
@@ -243,11 +251,11 @@ func TestSetActive_ValidIndex(t *testing.T) {
243251 }
244252
245253 sv := layout.NewStackedView(mockFactory)
246- sv.AddPane("Page 1", "", containers[0])
247- sv.AddPane("Page 2", "", containers[1])
254+ sv.AddPane(ctx, "Page 1", "", containers[0])
255+ sv.AddPane(ctx, "Page 2", "", containers[1])
248256
249257 // Act - switch back to first pane
250- err := sv.SetActive(0)
258+ err := sv.SetActive(ctx, 0)
251259
252260 // Assert
253261 require.NoError(t, err)
@@ -256,6 +264,7 @@ func TestSetActive_ValidIndex(t *testing.T) {
256264
257265 func TestSetActive_OutOfBounds(t *testing.T) {
258266 // Arrange
267+ ctx := context.Background()
259268 mockFactory, mockBox := setupMockFactory(t)
260269 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
261270
@@ -264,10 +273,10 @@ func TestSetActive_OutOfBounds(t *testing.T) {
264273 mockTitleBar.EXPECT().AddCssClass("active").Once()
265274
266275 sv := layout.NewStackedView(mockFactory)
267- sv.AddPane("Page", "", mockContainer)
276+ sv.AddPane(ctx, "Page", "", mockContainer)
268277
269278 // Act
270- err := sv.SetActive(5)
279+ err := sv.SetActive(ctx, 5)
271280
272281 // Assert
273282 assert.ErrorIs(t, err, layout.ErrIndexOutOfBounds)
@@ -275,11 +284,12 @@ func TestSetActive_OutOfBounds(t *testing.T) {
275284
276285 func TestSetActive_EmptyStack(t *testing.T) {
277286 // Arrange
287+ ctx := context.Background()
278288 mockFactory, _ := setupMockFactory(t)
279289 sv := layout.NewStackedView(mockFactory)
280290
281291 // Act
282- err := sv.SetActive(0)
292+ err := sv.SetActive(ctx, 0)
283293
284294 // Assert
285295 assert.ErrorIs(t, err, layout.ErrStackEmpty)
@@ -287,6 +297,7 @@ func TestSetActive_EmptyStack(t *testing.T) {
287297
288298 func TestUpdateTitle(t *testing.T) {
289299 // Arrange
300+ ctx := context.Background()
290301 mockFactory, mockBox := setupMockFactory(t)
291302 mockTitleBar, _, mockLabel, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
292303
@@ -295,7 +306,7 @@ func TestUpdateTitle(t *testing.T) {
295306 mockTitleBar.EXPECT().AddCssClass("active").Once()
296307
297308 sv := layout.NewStackedView(mockFactory)
298- sv.AddPane("Old Title", "", mockContainer)
309+ sv.AddPane(ctx, "Old Title", "", mockContainer)
299310
300311 mockLabel.EXPECT().SetText("New Title").Once()
301312
@@ -320,6 +331,7 @@ func TestUpdateTitle_InvalidIndex(t *testing.T) {
320331
321332 func TestUpdateFavicon(t *testing.T) {
322333 // Arrange
334+ ctx := context.Background()
323335 mockFactory, mockBox := setupMockFactory(t)
324336 mockTitleBar, mockFavicon, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
325337
@@ -328,7 +340,7 @@ func TestUpdateFavicon(t *testing.T) {
328340 mockTitleBar.EXPECT().AddCssClass("active").Once()
329341
330342 sv := layout.NewStackedView(mockFactory)
331- sv.AddPane("Page", "", mockContainer)
343+ sv.AddPane(ctx, "Page", "", mockContainer)
332344
333345 mockFavicon.EXPECT().SetFromIconName("new-icon").Once()
334346
@@ -341,6 +353,7 @@ func TestUpdateFavicon(t *testing.T) {
341353
342354 func TestGetContainer(t *testing.T) {
343355 // Arrange
356+ ctx := context.Background()
344357 mockFactory, mockBox := setupMockFactory(t)
345358 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
346359
@@ -349,7 +362,7 @@ func TestGetContainer(t *testing.T) {
349362 mockTitleBar.EXPECT().AddCssClass("active").Once()
350363
351364 sv := layout.NewStackedView(mockFactory)
352- sv.AddPane("Page", "", mockContainer)
365+ sv.AddPane(ctx, "Page", "", mockContainer)
353366
354367 // Act
355368 container, err := sv.GetContainer(0)
@@ -386,6 +399,7 @@ func TestWidget_ReturnsBoxWidget(t *testing.T) {
386399
387400 func TestNavigateNext_WrapsAround(t *testing.T) {
388401 // Arrange
402+ ctx := context.Background()
389403 mockFactory, mockBox := setupMockFactory(t)
390404
391405 containers := make([]*mocks.MockWidget, 2)
@@ -400,14 +414,14 @@ func TestNavigateNext_WrapsAround(t *testing.T) {
400414 }
401415
402416 sv := layout.NewStackedView(mockFactory)
403- sv.AddPane("Page 1", "", containers[0])
404- sv.AddPane("Page 2", "", containers[1])
417+ sv.AddPane(ctx, "Page 1", "", containers[0])
418+ sv.AddPane(ctx, "Page 2", "", containers[1])
405419
406420 // Currently at index 1 (last added)
407421 assert.Equal(t, 1, sv.ActiveIndex())
408422
409423 // Act - navigate next should wrap to 0
410- err := sv.NavigateNext()
424+ err := sv.NavigateNext(ctx)
411425
412426 // Assert
413427 require.NoError(t, err)
@@ -416,6 +430,7 @@ func TestNavigateNext_WrapsAround(t *testing.T) {
416430
417431 func TestNavigatePrevious_WrapsAround(t *testing.T) {
418432 // Arrange
433+ ctx := context.Background()
419434 mockFactory, mockBox := setupMockFactory(t)
420435
421436 containers := make([]*mocks.MockWidget, 2)
@@ -430,14 +445,14 @@ func TestNavigatePrevious_WrapsAround(t *testing.T) {
430445 }
431446
432447 sv := layout.NewStackedView(mockFactory)
433- sv.AddPane("Page 1", "", containers[0])
434- sv.AddPane("Page 2", "", containers[1])
448+ sv.AddPane(ctx, "Page 1", "", containers[0])
449+ sv.AddPane(ctx, "Page 2", "", containers[1])
435450
436451 // Set to first pane
437- sv.SetActive(0)
452+ sv.SetActive(ctx, 0)
438453
439454 // Act - navigate previous should wrap to 1
440- err := sv.NavigatePrevious()
455+ err := sv.NavigatePrevious(ctx)
441456
442457 // Assert
443458 require.NoError(t, err)
@@ -446,11 +461,12 @@ func TestNavigatePrevious_WrapsAround(t *testing.T) {
446461
447462 func TestNavigateNext_EmptyStack(t *testing.T) {
448463 // Arrange
464+ ctx := context.Background()
449465 mockFactory, _ := setupMockFactory(t)
450466 sv := layout.NewStackedView(mockFactory)
451467
452468 // Act
453- err := sv.NavigateNext()
469+ err := sv.NavigateNext(ctx)
454470
455471 // Assert
456472 assert.ErrorIs(t, err, layout.ErrStackEmpty)
@@ -458,11 +474,12 @@ func TestNavigateNext_EmptyStack(t *testing.T) {
458474
459475 func TestNavigatePrevious_EmptyStack(t *testing.T) {
460476 // Arrange
477+ ctx := context.Background()
461478 mockFactory, _ := setupMockFactory(t)
462479 sv := layout.NewStackedView(mockFactory)
463480
464481 // Act
465- err := sv.NavigatePrevious()
482+ err := sv.NavigatePrevious(ctx)
466483
467484 // Assert
468485 assert.ErrorIs(t, err, layout.ErrStackEmpty)
@@ -1,6 +1,7 @@
1 package layout_test1 package layout_test
2 2
3 import (3 import (
4+ "context"
4 "testing"5 "testing"
5 6
6 "github.com/stretchr/testify/assert"7 "github.com/stretchr/testify/assert"
@@ -80,6 +81,7 @@ func TestNewStackedView_EmptyStack(t *testing.T) {
80 81
81 func TestAddPane_SinglePane_BecomesActive(t *testing.T) {82 func TestAddPane_SinglePane_BecomesActive(t *testing.T) {
82 // Arrange83 // Arrange
84+ ctx := context.Background()
83 mockFactory, mockBox := setupMockFactory(t)85 mockFactory, mockBox := setupMockFactory(t)
84 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)86 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
85 87
@@ -91,7 +93,7 @@ func TestAddPane_SinglePane_BecomesActive(t *testing.T) {
91 sv := layout.NewStackedView(mockFactory)93 sv := layout.NewStackedView(mockFactory)
92 94
93 // Act95 // Act
94- index := sv.AddPane("Test Page", "web-browser-symbolic", mockContainer)96+ index := sv.AddPane(ctx, "Test Page", "web-browser-symbolic", mockContainer)
95 97
96 // Assert98 // Assert
97 assert.Equal(t, 0, index)99 assert.Equal(t, 0, index)
@@ -101,6 +103,7 @@ func TestAddPane_SinglePane_BecomesActive(t *testing.T) {
101 103
102 func TestAddPane_MultiplePanes_LastBecomesActive(t *testing.T) {104 func TestAddPane_MultiplePanes_LastBecomesActive(t *testing.T) {
103 // Arrange105 // Arrange
106+ ctx := context.Background()
104 mockFactory, mockBox := setupMockFactory(t)107 mockFactory, mockBox := setupMockFactory(t)
105 108
106 // First pane109 // First pane
@@ -124,8 +127,8 @@ func TestAddPane_MultiplePanes_LastBecomesActive(t *testing.T) {
124 sv := layout.NewStackedView(mockFactory)127 sv := layout.NewStackedView(mockFactory)
125 128
126 // Act129 // Act
127- sv.AddPane("Page 1", "", mockContainer1)130+ sv.AddPane(ctx, "Page 1", "", mockContainer1)
128- index := sv.AddPane("Page 2", "", mockContainer2)131+ index := sv.AddPane(ctx, "Page 2", "", mockContainer2)
129 132
130 // Assert133 // Assert
131 assert.Equal(t, 1, index)134 assert.Equal(t, 1, index)
@@ -135,6 +138,7 @@ func TestAddPane_MultiplePanes_LastBecomesActive(t *testing.T) {
135 138
136 func TestRemovePane_MiddlePane(t *testing.T) {139 func TestRemovePane_MiddlePane(t *testing.T) {
137 // Arrange140 // Arrange
141+ ctx := context.Background()
138 mockFactory, mockBox := setupMockFactory(t)142 mockFactory, mockBox := setupMockFactory(t)
139 143
140 // Setup 3 panes (simplified - just track the key behaviors)144 // Setup 3 panes (simplified - just track the key behaviors)
@@ -159,9 +163,9 @@ func TestRemovePane_MiddlePane(t *testing.T) {
159 }163 }
160 164
161 sv := layout.NewStackedView(mockFactory)165 sv := layout.NewStackedView(mockFactory)
162- sv.AddPane("Page 1", "", containers[0])166+ sv.AddPane(ctx, "Page 1", "", containers[0])
163- sv.AddPane("Page 2", "", containers[1])167+ sv.AddPane(ctx, "Page 2", "", containers[1])
164- sv.AddPane("Page 3", "", containers[2])168+ sv.AddPane(ctx, "Page 3", "", containers[2])
165 169
166 // Remove middle pane (index 1)170 // Remove middle pane (index 1)
167 // The parent of titleBar is the button widget171 // The parent of titleBar is the button widget
@@ -169,7 +173,7 @@ func TestRemovePane_MiddlePane(t *testing.T) {
169 mockBox.EXPECT().Remove(containers[1]).Once()173 mockBox.EXPECT().Remove(containers[1]).Once()
170 174
171 // Act175 // Act
172- err := sv.RemovePane(1)176+ err := sv.RemovePane(ctx, 1)
173 177
174 // Assert178 // Assert
175 require.NoError(t, err)179 require.NoError(t, err)
@@ -178,6 +182,7 @@ func TestRemovePane_MiddlePane(t *testing.T) {
178 182
179 func TestRemovePane_LastPane_ReturnsError(t *testing.T) {183 func TestRemovePane_LastPane_ReturnsError(t *testing.T) {
180 // Arrange184 // Arrange
185+ ctx := context.Background()
181 mockFactory, mockBox := setupMockFactory(t)186 mockFactory, mockBox := setupMockFactory(t)
182 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)187 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
183 188
@@ -186,10 +191,10 @@ func TestRemovePane_LastPane_ReturnsError(t *testing.T) {
186 mockTitleBar.EXPECT().AddCssClass("active").Once()191 mockTitleBar.EXPECT().AddCssClass("active").Once()
187 192
188 sv := layout.NewStackedView(mockFactory)193 sv := layout.NewStackedView(mockFactory)
189- sv.AddPane("Only Page", "", mockContainer)194+ sv.AddPane(ctx, "Only Page", "", mockContainer)
190 195
191 // Act196 // Act
192- err := sv.RemovePane(0)197+ err := sv.RemovePane(ctx, 0)
193 198
194 // Assert199 // Assert
195 assert.ErrorIs(t, err, layout.ErrCannotRemoveLastPane)200 assert.ErrorIs(t, err, layout.ErrCannotRemoveLastPane)
@@ -198,11 +203,12 @@ func TestRemovePane_LastPane_ReturnsError(t *testing.T) {
198 203
199 func TestRemovePane_EmptyStack_ReturnsError(t *testing.T) {204 func TestRemovePane_EmptyStack_ReturnsError(t *testing.T) {
200 // Arrange205 // Arrange
206+ ctx := context.Background()
201 mockFactory, _ := setupMockFactory(t)207 mockFactory, _ := setupMockFactory(t)
202 sv := layout.NewStackedView(mockFactory)208 sv := layout.NewStackedView(mockFactory)
203 209
204 // Act210 // Act
205- err := sv.RemovePane(0)211+ err := sv.RemovePane(ctx, 0)
206 212
207 // Assert213 // Assert
208 assert.ErrorIs(t, err, layout.ErrStackEmpty)214 assert.ErrorIs(t, err, layout.ErrStackEmpty)
@@ -210,6 +216,7 @@ func TestRemovePane_EmptyStack_ReturnsError(t *testing.T) {
210 216
211 func TestRemovePane_IndexOutOfBounds(t *testing.T) {217 func TestRemovePane_IndexOutOfBounds(t *testing.T) {
212 // Arrange218 // Arrange
219+ ctx := context.Background()
213 mockFactory, mockBox := setupMockFactory(t)220 mockFactory, mockBox := setupMockFactory(t)
214 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)221 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
215 222
@@ -218,10 +225,10 @@ func TestRemovePane_IndexOutOfBounds(t *testing.T) {
218 mockTitleBar.EXPECT().AddCssClass("active").Once()225 mockTitleBar.EXPECT().AddCssClass("active").Once()
219 226
220 sv := layout.NewStackedView(mockFactory)227 sv := layout.NewStackedView(mockFactory)
221- sv.AddPane("Page", "", mockContainer)228+ sv.AddPane(ctx, "Page", "", mockContainer)
222 229
223 // Act230 // Act
224- err := sv.RemovePane(5)231+ err := sv.RemovePane(ctx, 5)
225 232
226 // Assert233 // Assert
227 assert.ErrorIs(t, err, layout.ErrIndexOutOfBounds)234 assert.ErrorIs(t, err, layout.ErrIndexOutOfBounds)
@@ -229,6 +236,7 @@ func TestRemovePane_IndexOutOfBounds(t *testing.T) {
229 236
230 func TestSetActive_ValidIndex(t *testing.T) {237 func TestSetActive_ValidIndex(t *testing.T) {
231 // Arrange238 // Arrange
239+ ctx := context.Background()
232 mockFactory, mockBox := setupMockFactory(t)240 mockFactory, mockBox := setupMockFactory(t)
233 241
234 containers := make([]*mocks.MockWidget, 2)242 containers := make([]*mocks.MockWidget, 2)
@@ -243,11 +251,11 @@ func TestSetActive_ValidIndex(t *testing.T) {
243 }251 }
244 252
245 sv := layout.NewStackedView(mockFactory)253 sv := layout.NewStackedView(mockFactory)
246- sv.AddPane("Page 1", "", containers[0])254+ sv.AddPane(ctx, "Page 1", "", containers[0])
247- sv.AddPane("Page 2", "", containers[1])255+ sv.AddPane(ctx, "Page 2", "", containers[1])
248 256
249 // Act - switch back to first pane257 // Act - switch back to first pane
250- err := sv.SetActive(0)258+ err := sv.SetActive(ctx, 0)
251 259
252 // Assert260 // Assert
253 require.NoError(t, err)261 require.NoError(t, err)
@@ -256,6 +264,7 @@ func TestSetActive_ValidIndex(t *testing.T) {
256 264
257 func TestSetActive_OutOfBounds(t *testing.T) {265 func TestSetActive_OutOfBounds(t *testing.T) {
258 // Arrange266 // Arrange
267+ ctx := context.Background()
259 mockFactory, mockBox := setupMockFactory(t)268 mockFactory, mockBox := setupMockFactory(t)
260 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)269 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
261 270
@@ -264,10 +273,10 @@ func TestSetActive_OutOfBounds(t *testing.T) {
264 mockTitleBar.EXPECT().AddCssClass("active").Once()273 mockTitleBar.EXPECT().AddCssClass("active").Once()
265 274
266 sv := layout.NewStackedView(mockFactory)275 sv := layout.NewStackedView(mockFactory)
267- sv.AddPane("Page", "", mockContainer)276+ sv.AddPane(ctx, "Page", "", mockContainer)
268 277
269 // Act278 // Act
270- err := sv.SetActive(5)279+ err := sv.SetActive(ctx, 5)
271 280
272 // Assert281 // Assert
273 assert.ErrorIs(t, err, layout.ErrIndexOutOfBounds)282 assert.ErrorIs(t, err, layout.ErrIndexOutOfBounds)
@@ -275,11 +284,12 @@ func TestSetActive_OutOfBounds(t *testing.T) {
275 284
276 func TestSetActive_EmptyStack(t *testing.T) {285 func TestSetActive_EmptyStack(t *testing.T) {
277 // Arrange286 // Arrange
287+ ctx := context.Background()
278 mockFactory, _ := setupMockFactory(t)288 mockFactory, _ := setupMockFactory(t)
279 sv := layout.NewStackedView(mockFactory)289 sv := layout.NewStackedView(mockFactory)
280 290
281 // Act291 // Act
282- err := sv.SetActive(0)292+ err := sv.SetActive(ctx, 0)
283 293
284 // Assert294 // Assert
285 assert.ErrorIs(t, err, layout.ErrStackEmpty)295 assert.ErrorIs(t, err, layout.ErrStackEmpty)
@@ -287,6 +297,7 @@ func TestSetActive_EmptyStack(t *testing.T) {
287 297
288 func TestUpdateTitle(t *testing.T) {298 func TestUpdateTitle(t *testing.T) {
289 // Arrange299 // Arrange
300+ ctx := context.Background()
290 mockFactory, mockBox := setupMockFactory(t)301 mockFactory, mockBox := setupMockFactory(t)
291 mockTitleBar, _, mockLabel, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)302 mockTitleBar, _, mockLabel, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
292 303
@@ -295,7 +306,7 @@ func TestUpdateTitle(t *testing.T) {
295 mockTitleBar.EXPECT().AddCssClass("active").Once()306 mockTitleBar.EXPECT().AddCssClass("active").Once()
296 307
297 sv := layout.NewStackedView(mockFactory)308 sv := layout.NewStackedView(mockFactory)
298- sv.AddPane("Old Title", "", mockContainer)309+ sv.AddPane(ctx, "Old Title", "", mockContainer)
299 310
300 mockLabel.EXPECT().SetText("New Title").Once()311 mockLabel.EXPECT().SetText("New Title").Once()
301 312
@@ -320,6 +331,7 @@ func TestUpdateTitle_InvalidIndex(t *testing.T) {
320 331
321 func TestUpdateFavicon(t *testing.T) {332 func TestUpdateFavicon(t *testing.T) {
322 // Arrange333 // Arrange
334+ ctx := context.Background()
323 mockFactory, mockBox := setupMockFactory(t)335 mockFactory, mockBox := setupMockFactory(t)
324 mockTitleBar, mockFavicon, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)336 mockTitleBar, mockFavicon, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
325 337
@@ -328,7 +340,7 @@ func TestUpdateFavicon(t *testing.T) {
328 mockTitleBar.EXPECT().AddCssClass("active").Once()340 mockTitleBar.EXPECT().AddCssClass("active").Once()
329 341
330 sv := layout.NewStackedView(mockFactory)342 sv := layout.NewStackedView(mockFactory)
331- sv.AddPane("Page", "", mockContainer)343+ sv.AddPane(ctx, "Page", "", mockContainer)
332 344
333 mockFavicon.EXPECT().SetFromIconName("new-icon").Once()345 mockFavicon.EXPECT().SetFromIconName("new-icon").Once()
334 346
@@ -341,6 +353,7 @@ func TestUpdateFavicon(t *testing.T) {
341 353
342 func TestGetContainer(t *testing.T) {354 func TestGetContainer(t *testing.T) {
343 // Arrange355 // Arrange
356+ ctx := context.Background()
344 mockFactory, mockBox := setupMockFactory(t)357 mockFactory, mockBox := setupMockFactory(t)
345 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)358 mockTitleBar, _, _, _, mockContainer := setupPaneMocks(t, mockFactory, mockBox)
346 359
@@ -349,7 +362,7 @@ func TestGetContainer(t *testing.T) {
349 mockTitleBar.EXPECT().AddCssClass("active").Once()362 mockTitleBar.EXPECT().AddCssClass("active").Once()
350 363
351 sv := layout.NewStackedView(mockFactory)364 sv := layout.NewStackedView(mockFactory)
352- sv.AddPane("Page", "", mockContainer)365+ sv.AddPane(ctx, "Page", "", mockContainer)
353 366
354 // Act367 // Act
355 container, err := sv.GetContainer(0)368 container, err := sv.GetContainer(0)
@@ -386,6 +399,7 @@ func TestWidget_ReturnsBoxWidget(t *testing.T) {
386 399
387 func TestNavigateNext_WrapsAround(t *testing.T) {400 func TestNavigateNext_WrapsAround(t *testing.T) {
388 // Arrange401 // Arrange
402+ ctx := context.Background()
389 mockFactory, mockBox := setupMockFactory(t)403 mockFactory, mockBox := setupMockFactory(t)
390 404
391 containers := make([]*mocks.MockWidget, 2)405 containers := make([]*mocks.MockWidget, 2)
@@ -400,14 +414,14 @@ func TestNavigateNext_WrapsAround(t *testing.T) {
400 }414 }
401 415
402 sv := layout.NewStackedView(mockFactory)416 sv := layout.NewStackedView(mockFactory)
403- sv.AddPane("Page 1", "", containers[0])417+ sv.AddPane(ctx, "Page 1", "", containers[0])
404- sv.AddPane("Page 2", "", containers[1])418+ sv.AddPane(ctx, "Page 2", "", containers[1])
405 419
406 // Currently at index 1 (last added)420 // Currently at index 1 (last added)
407 assert.Equal(t, 1, sv.ActiveIndex())421 assert.Equal(t, 1, sv.ActiveIndex())
408 422
409 // Act - navigate next should wrap to 0423 // Act - navigate next should wrap to 0
410- err := sv.NavigateNext()424+ err := sv.NavigateNext(ctx)
411 425
412 // Assert426 // Assert
413 require.NoError(t, err)427 require.NoError(t, err)
@@ -416,6 +430,7 @@ func TestNavigateNext_WrapsAround(t *testing.T) {
416 430
417 func TestNavigatePrevious_WrapsAround(t *testing.T) {431 func TestNavigatePrevious_WrapsAround(t *testing.T) {
418 // Arrange432 // Arrange
433+ ctx := context.Background()
419 mockFactory, mockBox := setupMockFactory(t)434 mockFactory, mockBox := setupMockFactory(t)
420 435
421 containers := make([]*mocks.MockWidget, 2)436 containers := make([]*mocks.MockWidget, 2)
@@ -430,14 +445,14 @@ func TestNavigatePrevious_WrapsAround(t *testing.T) {
430 }445 }
431 446
432 sv := layout.NewStackedView(mockFactory)447 sv := layout.NewStackedView(mockFactory)
433- sv.AddPane("Page 1", "", containers[0])448+ sv.AddPane(ctx, "Page 1", "", containers[0])
434- sv.AddPane("Page 2", "", containers[1])449+ sv.AddPane(ctx, "Page 2", "", containers[1])
435 450
436 // Set to first pane451 // Set to first pane
437- sv.SetActive(0)452+ sv.SetActive(ctx, 0)
438 453
439 // Act - navigate previous should wrap to 1454 // Act - navigate previous should wrap to 1
440- err := sv.NavigatePrevious()455+ err := sv.NavigatePrevious(ctx)
441 456
442 // Assert457 // Assert
443 require.NoError(t, err)458 require.NoError(t, err)
@@ -446,11 +461,12 @@ func TestNavigatePrevious_WrapsAround(t *testing.T) {
446 461
447 func TestNavigateNext_EmptyStack(t *testing.T) {462 func TestNavigateNext_EmptyStack(t *testing.T) {
448 // Arrange463 // Arrange
464+ ctx := context.Background()
449 mockFactory, _ := setupMockFactory(t)465 mockFactory, _ := setupMockFactory(t)
450 sv := layout.NewStackedView(mockFactory)466 sv := layout.NewStackedView(mockFactory)
451 467
452 // Act468 // Act
453- err := sv.NavigateNext()469+ err := sv.NavigateNext(ctx)
454 470
455 // Assert471 // Assert
456 assert.ErrorIs(t, err, layout.ErrStackEmpty)472 assert.ErrorIs(t, err, layout.ErrStackEmpty)
@@ -458,11 +474,12 @@ func TestNavigateNext_EmptyStack(t *testing.T) {
458 474
459 func TestNavigatePrevious_EmptyStack(t *testing.T) {475 func TestNavigatePrevious_EmptyStack(t *testing.T) {
460 // Arrange476 // Arrange
477+ ctx := context.Background()
461 mockFactory, _ := setupMockFactory(t)478 mockFactory, _ := setupMockFactory(t)
462 sv := layout.NewStackedView(mockFactory)479 sv := layout.NewStackedView(mockFactory)
463 480
464 // Act481 // Act
465- err := sv.NavigatePrevious()482+ err := sv.NavigatePrevious(ctx)
466 483
467 // Assert484 // Assert
468 assert.ErrorIs(t, err, layout.ErrStackEmpty)485 assert.ErrorIs(t, err, layout.ErrStackEmpty)
M internal/ui/layout/tree_test.go +50 -33
@@ -1,9 +1,9 @@
11 package layout_test
22
33 import (
4+ "context"
45 "testing"
56
6- "github.com/rs/zerolog"
77 "github.com/stretchr/testify/assert"
88 "github.com/stretchr/testify/mock"
99 "github.com/stretchr/testify/require"
@@ -15,11 +15,12 @@ import (
1515
1616 func TestNewTreeRenderer_CreatesRenderer(t *testing.T) {
1717 // Arrange
18+ ctx := context.Background()
1819 mockFactory := mocks.NewMockWidgetFactory(t)
1920 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
2021
2122 // Act
22- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
23+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
2324
2425 // Assert
2526 require.NotNil(t, renderer)
@@ -28,13 +29,14 @@ func TestNewTreeRenderer_CreatesRenderer(t *testing.T) {
2829
2930 func TestBuild_NilRoot_ReturnsError(t *testing.T) {
3031 // Arrange
32+ ctx := context.Background()
3133 mockFactory := mocks.NewMockWidgetFactory(t)
3234 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
3335
34- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
36+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
3537
3638 // Act
37- widget, err := renderer.Build(nil)
39+ widget, err := renderer.Build(ctx, nil)
3840
3941 // Assert
4042 assert.Nil(t, widget)
@@ -43,6 +45,7 @@ func TestBuild_NilRoot_ReturnsError(t *testing.T) {
4345
4446 func TestBuild_SingleLeafPane(t *testing.T) {
4547 // Arrange
48+ ctx := context.Background()
4649 mockFactory := mocks.NewMockWidgetFactory(t)
4750 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
4851 mockWidget := mocks.NewMockWidget(t)
@@ -55,10 +58,10 @@ func TestBuild_SingleLeafPane(t *testing.T) {
5558
5659 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
5760
58- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
61+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
5962
6063 // Act
61- widget, err := renderer.Build(node)
64+ widget, err := renderer.Build(ctx, node)
6265
6366 // Assert
6467 require.NoError(t, err)
@@ -71,6 +74,7 @@ func TestBuild_SingleLeafPane(t *testing.T) {
7174
7275 func TestBuild_HorizontalSplit(t *testing.T) {
7376 // Arrange
77+ ctx := context.Background()
7478 mockFactory := mocks.NewMockWidgetFactory(t)
7579 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
7680 mockPaned := mocks.NewMockPanedWidget(t)
@@ -105,10 +109,10 @@ func TestBuild_HorizontalSplit(t *testing.T) {
105109 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
106110 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
107111
108- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
112+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
109113
110114 // Act
111- widget, err := renderer.Build(splitNode)
115+ widget, err := renderer.Build(ctx, splitNode)
112116
113117 // Assert
114118 require.NoError(t, err)
@@ -118,6 +122,7 @@ func TestBuild_HorizontalSplit(t *testing.T) {
118122
119123 func TestBuild_VerticalSplit(t *testing.T) {
120124 // Arrange
125+ ctx := context.Background()
121126 mockFactory := mocks.NewMockWidgetFactory(t)
122127 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
123128 mockPaned := mocks.NewMockPanedWidget(t)
@@ -152,10 +157,10 @@ func TestBuild_VerticalSplit(t *testing.T) {
152157 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
153158 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
154159
155- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
160+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
156161
157162 // Act
158- widget, err := renderer.Build(splitNode)
163+ widget, err := renderer.Build(ctx, splitNode)
159164
160165 // Assert
161166 require.NoError(t, err)
@@ -164,6 +169,7 @@ func TestBuild_VerticalSplit(t *testing.T) {
164169
165170 func TestBuild_NestedSplits(t *testing.T) {
166171 // Arrange
172+ ctx := context.Background()
167173 mockFactory := mocks.NewMockWidgetFactory(t)
168174 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
169175 mockOuterPaned := mocks.NewMockPanedWidget(t)
@@ -230,10 +236,10 @@ func TestBuild_NestedSplits(t *testing.T) {
230236 mockOuterPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
231237 mockOuterPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
232238
233- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
239+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
234240
235241 // Act
236- widget, err := renderer.Build(outerSplit)
242+ widget, err := renderer.Build(ctx, outerSplit)
237243
238244 // Assert
239245 require.NoError(t, err)
@@ -248,6 +254,7 @@ func TestBuild_NestedSplits(t *testing.T) {
248254
249255 func TestLookup_ExistingNode(t *testing.T) {
250256 // Arrange
257+ ctx := context.Background()
251258 mockFactory := mocks.NewMockWidgetFactory(t)
252259 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
253260 mockWidget := mocks.NewMockWidget(t)
@@ -257,8 +264,8 @@ func TestLookup_ExistingNode(t *testing.T) {
257264
258265 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
259266
260- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
261- _, _ = renderer.Build(node)
267+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
268+ _, _ = renderer.Build(ctx, node)
262269
263270 // Act
264271 result := renderer.Lookup("test-node-id")
@@ -269,6 +276,7 @@ func TestLookup_ExistingNode(t *testing.T) {
269276
270277 func TestLookup_NonExistentNode(t *testing.T) {
271278 // Arrange
279+ ctx := context.Background()
272280 mockFactory := mocks.NewMockWidgetFactory(t)
273281 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
274282 mockWidget := mocks.NewMockWidget(t)
@@ -278,8 +286,8 @@ func TestLookup_NonExistentNode(t *testing.T) {
278286
279287 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
280288
281- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
282- _, _ = renderer.Build(node)
289+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
290+ _, _ = renderer.Build(ctx, node)
283291
284292 // Act
285293 result := renderer.Lookup("non-existent-id")
@@ -290,6 +298,7 @@ func TestLookup_NonExistentNode(t *testing.T) {
290298
291299 func TestLookupNode_Existing(t *testing.T) {
292300 // Arrange
301+ ctx := context.Background()
293302 mockFactory := mocks.NewMockWidgetFactory(t)
294303 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
295304 mockWidget := mocks.NewMockWidget(t)
@@ -299,8 +308,8 @@ func TestLookupNode_Existing(t *testing.T) {
299308
300309 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
301310
302- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
303- _, _ = renderer.Build(node)
311+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
312+ _, _ = renderer.Build(ctx, node)
304313
305314 // Act
306315 widget, found := renderer.LookupNode("node-1")
@@ -312,10 +321,11 @@ func TestLookupNode_Existing(t *testing.T) {
312321
313322 func TestLookupNode_NonExistent(t *testing.T) {
314323 // Arrange
324+ ctx := context.Background()
315325 mockFactory := mocks.NewMockWidgetFactory(t)
316326 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
317327
318- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
328+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
319329
320330 // Act
321331 widget, found := renderer.LookupNode("non-existent")
@@ -327,6 +337,7 @@ func TestLookupNode_NonExistent(t *testing.T) {
327337
328338 func TestClear_RemovesAllMappings(t *testing.T) {
329339 // Arrange
340+ ctx := context.Background()
330341 mockFactory := mocks.NewMockWidgetFactory(t)
331342 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
332343 mockWidget := mocks.NewMockWidget(t)
@@ -336,8 +347,8 @@ func TestClear_RemovesAllMappings(t *testing.T) {
336347
337348 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
338349
339- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
340- _, _ = renderer.Build(node)
350+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
351+ _, _ = renderer.Build(ctx, node)
341352
342353 require.Equal(t, 1, renderer.NodeCount())
343354
@@ -352,6 +363,7 @@ func TestClear_RemovesAllMappings(t *testing.T) {
352363 func TestGetNodeIDs_ReturnsAllIDs(t *testing.T) {
353364 // Arrange
354365 mockFactory := mocks.NewMockWidgetFactory(t)
366+ ctx := context.Background()
355367 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
356368 mockPaned := mocks.NewMockPanedWidget(t)
357369 mockWidget1 := mocks.NewMockWidget(t)
@@ -384,8 +396,8 @@ func TestGetNodeIDs_ReturnsAllIDs(t *testing.T) {
384396 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
385397 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
386398
387- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
388- _, _ = renderer.Build(splitNode)
399+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
400+ _, _ = renderer.Build(ctx, splitNode)
389401
390402 // Act
391403 ids := renderer.GetNodeIDs()
@@ -399,6 +411,7 @@ func TestGetNodeIDs_ReturnsAllIDs(t *testing.T) {
399411
400412 func TestBuild_ClearsPreviousMappings(t *testing.T) {
401413 // Arrange
414+ ctx := context.Background()
402415 mockFactory := mocks.NewMockWidgetFactory(t)
403416 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
404417 mockWidget1 := mocks.NewMockWidget(t)
@@ -413,15 +426,15 @@ func TestBuild_ClearsPreviousMappings(t *testing.T) {
413426 mockPaneViewFactory.EXPECT().CreatePaneView(node1).Return(mockWidget1).Once()
414427 mockPaneViewFactory.EXPECT().CreatePaneView(node2).Return(mockWidget2).Once()
415428
416- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
429+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
417430
418431 // First build
419- _, _ = renderer.Build(node1)
432+ _, _ = renderer.Build(ctx, node1)
420433 require.Equal(t, 1, renderer.NodeCount())
421434 require.NotNil(t, renderer.Lookup("old-node"))
422435
423436 // Act - second build should clear old mappings
424- _, _ = renderer.Build(node2)
437+ _, _ = renderer.Build(ctx, node2)
425438
426439 // Assert
427440 assert.Equal(t, 1, renderer.NodeCount())
@@ -431,15 +444,16 @@ func TestBuild_ClearsPreviousMappings(t *testing.T) {
431444
432445 func TestBuild_NilPaneViewFactory_ReturnsNilForLeaves(t *testing.T) {
433446 // Arrange
447+ ctx := context.Background()
434448 mockFactory := mocks.NewMockWidgetFactory(t)
435449
436450 pane := entity.NewPane(entity.PaneID("pane-1"))
437451 node := &entity.PaneNode{ID: "node-1", Pane: pane}
438452
439- renderer := layout.NewTreeRenderer(mockFactory, nil, zerolog.Nop())
453+ renderer := layout.NewTreeRenderer(ctx, mockFactory, nil)
440454
441455 // Act
442- widget, err := renderer.Build(node)
456+ widget, err := renderer.Build(ctx, node)
443457
444458 // Assert
445459 require.NoError(t, err)
@@ -448,6 +462,7 @@ func TestBuild_NilPaneViewFactory_ReturnsNilForLeaves(t *testing.T) {
448462
449463 func TestBuild_EmptyNodeID_NotStored(t *testing.T) {
450464 // Arrange
465+ ctx := context.Background()
451466 mockFactory := mocks.NewMockWidgetFactory(t)
452467 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
453468 mockWidget := mocks.NewMockWidget(t)
@@ -457,10 +472,10 @@ func TestBuild_EmptyNodeID_NotStored(t *testing.T) {
457472
458473 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
459474
460- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
475+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
461476
462477 // Act
463- widget, err := renderer.Build(node)
478+ widget, err := renderer.Build(ctx, node)
464479
465480 // Assert
466481 require.NoError(t, err)
@@ -471,6 +486,7 @@ func TestBuild_EmptyNodeID_NotStored(t *testing.T) {
471486 func TestUpdateSplitRatio_ExistingNode(t *testing.T) {
472487 // Arrange
473488 mockFactory := mocks.NewMockWidgetFactory(t)
489+ ctx := context.Background()
474490 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
475491 mockPaned := mocks.NewMockPanedWidget(t)
476492 mockWidget1 := mocks.NewMockWidget(t)
@@ -503,8 +519,8 @@ func TestUpdateSplitRatio_ExistingNode(t *testing.T) {
503519 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
504520 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
505521
506- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
507- _, _ = renderer.Build(splitNode)
522+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
523+ _, _ = renderer.Build(ctx, splitNode)
508524
509525 // Act
510526 err := renderer.UpdateSplitRatio("split-node", 0.7)
@@ -516,9 +532,10 @@ func TestUpdateSplitRatio_ExistingNode(t *testing.T) {
516532 func TestUpdateSplitRatio_NonExistentNode(t *testing.T) {
517533 // Arrange
518534 mockFactory := mocks.NewMockWidgetFactory(t)
535+ ctx := context.Background()
519536 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
520537
521- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())
538+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
522539
523540 // Act
524541 err := renderer.UpdateSplitRatio("non-existent", 0.7)
@@ -1,9 +1,9 @@
1 package layout_test1 package layout_test
2 2
3 import (3 import (
4+ "context"
4 "testing"5 "testing"
5 6
6- "github.com/rs/zerolog"
7 "github.com/stretchr/testify/assert"7 "github.com/stretchr/testify/assert"
8 "github.com/stretchr/testify/mock"8 "github.com/stretchr/testify/mock"
9 "github.com/stretchr/testify/require"9 "github.com/stretchr/testify/require"
@@ -15,11 +15,12 @@ import (
15 15
16 func TestNewTreeRenderer_CreatesRenderer(t *testing.T) {16 func TestNewTreeRenderer_CreatesRenderer(t *testing.T) {
17 // Arrange17 // Arrange
18+ ctx := context.Background()
18 mockFactory := mocks.NewMockWidgetFactory(t)19 mockFactory := mocks.NewMockWidgetFactory(t)
19 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)20 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
20 21
21 // Act22 // Act
22- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())23+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
23 24
24 // Assert25 // Assert
25 require.NotNil(t, renderer)26 require.NotNil(t, renderer)
@@ -28,13 +29,14 @@ func TestNewTreeRenderer_CreatesRenderer(t *testing.T) {
28 29
29 func TestBuild_NilRoot_ReturnsError(t *testing.T) {30 func TestBuild_NilRoot_ReturnsError(t *testing.T) {
30 // Arrange31 // Arrange
32+ ctx := context.Background()
31 mockFactory := mocks.NewMockWidgetFactory(t)33 mockFactory := mocks.NewMockWidgetFactory(t)
32 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)34 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
33 35
34- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())36+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
35 37
36 // Act38 // Act
37- widget, err := renderer.Build(nil)39+ widget, err := renderer.Build(ctx, nil)
38 40
39 // Assert41 // Assert
40 assert.Nil(t, widget)42 assert.Nil(t, widget)
@@ -43,6 +45,7 @@ func TestBuild_NilRoot_ReturnsError(t *testing.T) {
43 45
44 func TestBuild_SingleLeafPane(t *testing.T) {46 func TestBuild_SingleLeafPane(t *testing.T) {
45 // Arrange47 // Arrange
48+ ctx := context.Background()
46 mockFactory := mocks.NewMockWidgetFactory(t)49 mockFactory := mocks.NewMockWidgetFactory(t)
47 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)50 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
48 mockWidget := mocks.NewMockWidget(t)51 mockWidget := mocks.NewMockWidget(t)
@@ -55,10 +58,10 @@ func TestBuild_SingleLeafPane(t *testing.T) {
55 58
56 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()59 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
57 60
58- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())61+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
59 62
60 // Act63 // Act
61- widget, err := renderer.Build(node)64+ widget, err := renderer.Build(ctx, node)
62 65
63 // Assert66 // Assert
64 require.NoError(t, err)67 require.NoError(t, err)
@@ -71,6 +74,7 @@ func TestBuild_SingleLeafPane(t *testing.T) {
71 74
72 func TestBuild_HorizontalSplit(t *testing.T) {75 func TestBuild_HorizontalSplit(t *testing.T) {
73 // Arrange76 // Arrange
77+ ctx := context.Background()
74 mockFactory := mocks.NewMockWidgetFactory(t)78 mockFactory := mocks.NewMockWidgetFactory(t)
75 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)79 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
76 mockPaned := mocks.NewMockPanedWidget(t)80 mockPaned := mocks.NewMockPanedWidget(t)
@@ -105,10 +109,10 @@ func TestBuild_HorizontalSplit(t *testing.T) {
105 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()109 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
106 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()110 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
107 111
108- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())112+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
109 113
110 // Act114 // Act
111- widget, err := renderer.Build(splitNode)115+ widget, err := renderer.Build(ctx, splitNode)
112 116
113 // Assert117 // Assert
114 require.NoError(t, err)118 require.NoError(t, err)
@@ -118,6 +122,7 @@ func TestBuild_HorizontalSplit(t *testing.T) {
118 122
119 func TestBuild_VerticalSplit(t *testing.T) {123 func TestBuild_VerticalSplit(t *testing.T) {
120 // Arrange124 // Arrange
125+ ctx := context.Background()
121 mockFactory := mocks.NewMockWidgetFactory(t)126 mockFactory := mocks.NewMockWidgetFactory(t)
122 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)127 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
123 mockPaned := mocks.NewMockPanedWidget(t)128 mockPaned := mocks.NewMockPanedWidget(t)
@@ -152,10 +157,10 @@ func TestBuild_VerticalSplit(t *testing.T) {
152 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()157 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
153 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()158 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
154 159
155- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())160+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
156 161
157 // Act162 // Act
158- widget, err := renderer.Build(splitNode)163+ widget, err := renderer.Build(ctx, splitNode)
159 164
160 // Assert165 // Assert
161 require.NoError(t, err)166 require.NoError(t, err)
@@ -164,6 +169,7 @@ func TestBuild_VerticalSplit(t *testing.T) {
164 169
165 func TestBuild_NestedSplits(t *testing.T) {170 func TestBuild_NestedSplits(t *testing.T) {
166 // Arrange171 // Arrange
172+ ctx := context.Background()
167 mockFactory := mocks.NewMockWidgetFactory(t)173 mockFactory := mocks.NewMockWidgetFactory(t)
168 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)174 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
169 mockOuterPaned := mocks.NewMockPanedWidget(t)175 mockOuterPaned := mocks.NewMockPanedWidget(t)
@@ -230,10 +236,10 @@ func TestBuild_NestedSplits(t *testing.T) {
230 mockOuterPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()236 mockOuterPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
231 mockOuterPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()237 mockOuterPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
232 238
233- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())239+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
234 240
235 // Act241 // Act
236- widget, err := renderer.Build(outerSplit)242+ widget, err := renderer.Build(ctx, outerSplit)
237 243
238 // Assert244 // Assert
239 require.NoError(t, err)245 require.NoError(t, err)
@@ -248,6 +254,7 @@ func TestBuild_NestedSplits(t *testing.T) {
248 254
249 func TestLookup_ExistingNode(t *testing.T) {255 func TestLookup_ExistingNode(t *testing.T) {
250 // Arrange256 // Arrange
257+ ctx := context.Background()
251 mockFactory := mocks.NewMockWidgetFactory(t)258 mockFactory := mocks.NewMockWidgetFactory(t)
252 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)259 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
253 mockWidget := mocks.NewMockWidget(t)260 mockWidget := mocks.NewMockWidget(t)
@@ -257,8 +264,8 @@ func TestLookup_ExistingNode(t *testing.T) {
257 264
258 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()265 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
259 266
260- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())267+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
261- _, _ = renderer.Build(node)268+ _, _ = renderer.Build(ctx, node)
262 269
263 // Act270 // Act
264 result := renderer.Lookup("test-node-id")271 result := renderer.Lookup("test-node-id")
@@ -269,6 +276,7 @@ func TestLookup_ExistingNode(t *testing.T) {
269 276
270 func TestLookup_NonExistentNode(t *testing.T) {277 func TestLookup_NonExistentNode(t *testing.T) {
271 // Arrange278 // Arrange
279+ ctx := context.Background()
272 mockFactory := mocks.NewMockWidgetFactory(t)280 mockFactory := mocks.NewMockWidgetFactory(t)
273 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)281 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
274 mockWidget := mocks.NewMockWidget(t)282 mockWidget := mocks.NewMockWidget(t)
@@ -278,8 +286,8 @@ func TestLookup_NonExistentNode(t *testing.T) {
278 286
279 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()287 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
280 288
281- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())289+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
282- _, _ = renderer.Build(node)290+ _, _ = renderer.Build(ctx, node)
283 291
284 // Act292 // Act
285 result := renderer.Lookup("non-existent-id")293 result := renderer.Lookup("non-existent-id")
@@ -290,6 +298,7 @@ func TestLookup_NonExistentNode(t *testing.T) {
290 298
291 func TestLookupNode_Existing(t *testing.T) {299 func TestLookupNode_Existing(t *testing.T) {
292 // Arrange300 // Arrange
301+ ctx := context.Background()
293 mockFactory := mocks.NewMockWidgetFactory(t)302 mockFactory := mocks.NewMockWidgetFactory(t)
294 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)303 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
295 mockWidget := mocks.NewMockWidget(t)304 mockWidget := mocks.NewMockWidget(t)
@@ -299,8 +308,8 @@ func TestLookupNode_Existing(t *testing.T) {
299 308
300 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()309 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
301 310
302- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())311+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
303- _, _ = renderer.Build(node)312+ _, _ = renderer.Build(ctx, node)
304 313
305 // Act314 // Act
306 widget, found := renderer.LookupNode("node-1")315 widget, found := renderer.LookupNode("node-1")
@@ -312,10 +321,11 @@ func TestLookupNode_Existing(t *testing.T) {
312 321
313 func TestLookupNode_NonExistent(t *testing.T) {322 func TestLookupNode_NonExistent(t *testing.T) {
314 // Arrange323 // Arrange
324+ ctx := context.Background()
315 mockFactory := mocks.NewMockWidgetFactory(t)325 mockFactory := mocks.NewMockWidgetFactory(t)
316 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)326 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
317 327
318- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())328+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
319 329
320 // Act330 // Act
321 widget, found := renderer.LookupNode("non-existent")331 widget, found := renderer.LookupNode("non-existent")
@@ -327,6 +337,7 @@ func TestLookupNode_NonExistent(t *testing.T) {
327 337
328 func TestClear_RemovesAllMappings(t *testing.T) {338 func TestClear_RemovesAllMappings(t *testing.T) {
329 // Arrange339 // Arrange
340+ ctx := context.Background()
330 mockFactory := mocks.NewMockWidgetFactory(t)341 mockFactory := mocks.NewMockWidgetFactory(t)
331 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)342 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
332 mockWidget := mocks.NewMockWidget(t)343 mockWidget := mocks.NewMockWidget(t)
@@ -336,8 +347,8 @@ func TestClear_RemovesAllMappings(t *testing.T) {
336 347
337 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()348 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
338 349
339- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())350+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
340- _, _ = renderer.Build(node)351+ _, _ = renderer.Build(ctx, node)
341 352
342 require.Equal(t, 1, renderer.NodeCount())353 require.Equal(t, 1, renderer.NodeCount())
343 354
@@ -352,6 +363,7 @@ func TestClear_RemovesAllMappings(t *testing.T) {
352 func TestGetNodeIDs_ReturnsAllIDs(t *testing.T) {363 func TestGetNodeIDs_ReturnsAllIDs(t *testing.T) {
353 // Arrange364 // Arrange
354 mockFactory := mocks.NewMockWidgetFactory(t)365 mockFactory := mocks.NewMockWidgetFactory(t)
366+ ctx := context.Background()
355 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)367 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
356 mockPaned := mocks.NewMockPanedWidget(t)368 mockPaned := mocks.NewMockPanedWidget(t)
357 mockWidget1 := mocks.NewMockWidget(t)369 mockWidget1 := mocks.NewMockWidget(t)
@@ -384,8 +396,8 @@ func TestGetNodeIDs_ReturnsAllIDs(t *testing.T) {
384 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()396 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
385 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()397 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
386 398
387- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())399+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
388- _, _ = renderer.Build(splitNode)400+ _, _ = renderer.Build(ctx, splitNode)
389 401
390 // Act402 // Act
391 ids := renderer.GetNodeIDs()403 ids := renderer.GetNodeIDs()
@@ -399,6 +411,7 @@ func TestGetNodeIDs_ReturnsAllIDs(t *testing.T) {
399 411
400 func TestBuild_ClearsPreviousMappings(t *testing.T) {412 func TestBuild_ClearsPreviousMappings(t *testing.T) {
401 // Arrange413 // Arrange
414+ ctx := context.Background()
402 mockFactory := mocks.NewMockWidgetFactory(t)415 mockFactory := mocks.NewMockWidgetFactory(t)
403 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)416 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
404 mockWidget1 := mocks.NewMockWidget(t)417 mockWidget1 := mocks.NewMockWidget(t)
@@ -413,15 +426,15 @@ func TestBuild_ClearsPreviousMappings(t *testing.T) {
413 mockPaneViewFactory.EXPECT().CreatePaneView(node1).Return(mockWidget1).Once()426 mockPaneViewFactory.EXPECT().CreatePaneView(node1).Return(mockWidget1).Once()
414 mockPaneViewFactory.EXPECT().CreatePaneView(node2).Return(mockWidget2).Once()427 mockPaneViewFactory.EXPECT().CreatePaneView(node2).Return(mockWidget2).Once()
415 428
416- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())429+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
417 430
418 // First build431 // First build
419- _, _ = renderer.Build(node1)432+ _, _ = renderer.Build(ctx, node1)
420 require.Equal(t, 1, renderer.NodeCount())433 require.Equal(t, 1, renderer.NodeCount())
421 require.NotNil(t, renderer.Lookup("old-node"))434 require.NotNil(t, renderer.Lookup("old-node"))
422 435
423 // Act - second build should clear old mappings436 // Act - second build should clear old mappings
424- _, _ = renderer.Build(node2)437+ _, _ = renderer.Build(ctx, node2)
425 438
426 // Assert439 // Assert
427 assert.Equal(t, 1, renderer.NodeCount())440 assert.Equal(t, 1, renderer.NodeCount())
@@ -431,15 +444,16 @@ func TestBuild_ClearsPreviousMappings(t *testing.T) {
431 444
432 func TestBuild_NilPaneViewFactory_ReturnsNilForLeaves(t *testing.T) {445 func TestBuild_NilPaneViewFactory_ReturnsNilForLeaves(t *testing.T) {
433 // Arrange446 // Arrange
447+ ctx := context.Background()
434 mockFactory := mocks.NewMockWidgetFactory(t)448 mockFactory := mocks.NewMockWidgetFactory(t)
435 449
436 pane := entity.NewPane(entity.PaneID("pane-1"))450 pane := entity.NewPane(entity.PaneID("pane-1"))
437 node := &entity.PaneNode{ID: "node-1", Pane: pane}451 node := &entity.PaneNode{ID: "node-1", Pane: pane}
438 452
439- renderer := layout.NewTreeRenderer(mockFactory, nil, zerolog.Nop())453+ renderer := layout.NewTreeRenderer(ctx, mockFactory, nil)
440 454
441 // Act455 // Act
442- widget, err := renderer.Build(node)456+ widget, err := renderer.Build(ctx, node)
443 457
444 // Assert458 // Assert
445 require.NoError(t, err)459 require.NoError(t, err)
@@ -448,6 +462,7 @@ func TestBuild_NilPaneViewFactory_ReturnsNilForLeaves(t *testing.T) {
448 462
449 func TestBuild_EmptyNodeID_NotStored(t *testing.T) {463 func TestBuild_EmptyNodeID_NotStored(t *testing.T) {
450 // Arrange464 // Arrange
465+ ctx := context.Background()
451 mockFactory := mocks.NewMockWidgetFactory(t)466 mockFactory := mocks.NewMockWidgetFactory(t)
452 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)467 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
453 mockWidget := mocks.NewMockWidget(t)468 mockWidget := mocks.NewMockWidget(t)
@@ -457,10 +472,10 @@ func TestBuild_EmptyNodeID_NotStored(t *testing.T) {
457 472
458 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()473 mockPaneViewFactory.EXPECT().CreatePaneView(node).Return(mockWidget).Once()
459 474
460- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())475+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
461 476
462 // Act477 // Act
463- widget, err := renderer.Build(node)478+ widget, err := renderer.Build(ctx, node)
464 479
465 // Assert480 // Assert
466 require.NoError(t, err)481 require.NoError(t, err)
@@ -471,6 +486,7 @@ func TestBuild_EmptyNodeID_NotStored(t *testing.T) {
471 func TestUpdateSplitRatio_ExistingNode(t *testing.T) {486 func TestUpdateSplitRatio_ExistingNode(t *testing.T) {
472 // Arrange487 // Arrange
473 mockFactory := mocks.NewMockWidgetFactory(t)488 mockFactory := mocks.NewMockWidgetFactory(t)
489+ ctx := context.Background()
474 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)490 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
475 mockPaned := mocks.NewMockPanedWidget(t)491 mockPaned := mocks.NewMockPanedWidget(t)
476 mockWidget1 := mocks.NewMockWidget(t)492 mockWidget1 := mocks.NewMockWidget(t)
@@ -503,8 +519,8 @@ func TestUpdateSplitRatio_ExistingNode(t *testing.T) {
503 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()519 mockPaned.EXPECT().ConnectMap(mock.Anything).Return(uint32(0)).Once()
504 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()520 mockPaned.EXPECT().AddTickCallback(mock.Anything).Return(uint(0)).Once()
505 521
506- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())522+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
507- _, _ = renderer.Build(splitNode)523+ _, _ = renderer.Build(ctx, splitNode)
508 524
509 // Act525 // Act
510 err := renderer.UpdateSplitRatio("split-node", 0.7)526 err := renderer.UpdateSplitRatio("split-node", 0.7)
@@ -516,9 +532,10 @@ func TestUpdateSplitRatio_ExistingNode(t *testing.T) {
516 func TestUpdateSplitRatio_NonExistentNode(t *testing.T) {532 func TestUpdateSplitRatio_NonExistentNode(t *testing.T) {
517 // Arrange533 // Arrange
518 mockFactory := mocks.NewMockWidgetFactory(t)534 mockFactory := mocks.NewMockWidgetFactory(t)
535+ ctx := context.Background()
519 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)536 mockPaneViewFactory := mocks.NewMockPaneViewFactory(t)
520 537
521- renderer := layout.NewTreeRenderer(mockFactory, mockPaneViewFactory, zerolog.Nop())538+ renderer := layout.NewTreeRenderer(ctx, mockFactory, mockPaneViewFactory)
522 539
523 // Act540 // Act
524 err := renderer.UpdateSplitRatio("non-existent", 0.7)541 err := renderer.UpdateSplitRatio("non-existent", 0.7)

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