detached f7c186f

chore(cli): avoid app shadow lint warnings

commit
f7c186f1184000ff001c11f7b8d9ee7c189ca865
author
brice · · 2026-06-25 12:02 UTC
parent
89e934d
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +48 -48
M internal/cli/cmd/sessions.go +33 -33
@@ -39,29 +39,29 @@ func init() {
3939 }
4040
4141 func runSessions(_ *cobra.Command, _ []string) error {
42- app := GetApp()
43- if app == nil {
42+ cliApp := GetApp()
43+ if cliApp == nil {
4444 return fmt.Errorf("app not initialized")
4545 }
4646
47- if app.ListSessionsUC == nil {
47+ if cliApp.ListSessionsUC == nil {
4848 return fmt.Errorf("session management not available")
4949 }
5050
5151 // Get current session ID (empty if not running as browser)
5252 var currentSessionID entity.SessionID
53- if active, err := app.SessionUC.GetActiveSession(app.Ctx()); err == nil && active != nil {
53+ if active, err := cliApp.SessionUC.GetActiveSession(cliApp.Ctx()); err == nil && active != nil {
5454 currentSessionID = active.ID
5555 }
5656
5757 // Run interactive TUI
58- m := model.NewSessionsModel(app.Ctx(), app.Theme, model.SessionsModelConfig{
59- ListSessionsUC: app.ListSessionsUC,
60- RestoreUC: app.RestoreUC,
61- DeleteSessionUC: app.DeleteSessionUC,
62- SessionSpawner: app.SessionSpawner,
58+ m := model.NewSessionsModel(cliApp.Ctx(), cliApp.Theme, model.SessionsModelConfig{
59+ ListSessionsUC: cliApp.ListSessionsUC,
60+ RestoreUC: cliApp.RestoreUC,
61+ DeleteSessionUC: cliApp.DeleteSessionUC,
62+ SessionSpawner: cliApp.SessionSpawner,
6363 CurrentSession: currentSessionID,
64- MaxExitedSessions: app.Config.Session.MaxExitedSessions,
64+ MaxExitedSessions: cliApp.Config.Session.MaxExitedSessions,
6565 })
6666
6767 p := tea.NewProgram(m, tea.WithAltScreen())
@@ -89,13 +89,13 @@ func init() {
8989 }
9090
9191 func runSessionsList(_ *cobra.Command, _ []string) error {
92- app := GetApp()
93- if app == nil {
92+ cliApp := GetApp()
93+ if cliApp == nil {
9494 return fmt.Errorf("app not initialized")
9595 }
96- renderer := styles.NewSessionsCLIRenderer(app.Theme)
96+ renderer := styles.NewSessionsCLIRenderer(cliApp.Theme)
9797
98- if app.ListSessionsUC == nil {
98+ if cliApp.ListSessionsUC == nil {
9999 err := fmt.Errorf("session management not available")
100100 fmt.Fprintln(os.Stderr, renderer.RenderError(err))
101101 return wrapPrintedError(err)
@@ -103,11 +103,11 @@ func runSessionsList(_ *cobra.Command, _ []string) error {
103103
104104 // Get current session ID (empty if not running as browser)
105105 var currentSessionID entity.SessionID
106- if active, err := app.SessionUC.GetActiveSession(app.Ctx()); err == nil && active != nil {
106+ if active, err := cliApp.SessionUC.GetActiveSession(cliApp.Ctx()); err == nil && active != nil {
107107 currentSessionID = active.ID
108108 }
109109
110- output, err := app.ListSessionsUC.Execute(app.Ctx(), currentSessionID, sessionsLimit)
110+ output, err := cliApp.ListSessionsUC.Execute(cliApp.Ctx(), currentSessionID, sessionsLimit)
111111 if err != nil {
112112 wrappedErr := fmt.Errorf("list sessions: %w", err)
113113 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))
@@ -151,13 +151,13 @@ func init() {
151151 }
152152
153153 func runSessionsRestore(_ *cobra.Command, args []string) error {
154- app := GetApp()
155- if app == nil {
154+ cliApp := GetApp()
155+ if cliApp == nil {
156156 return fmt.Errorf("app not initialized")
157157 }
158- renderer := styles.NewSessionsCLIRenderer(app.Theme)
158+ renderer := styles.NewSessionsCLIRenderer(cliApp.Theme)
159159
160- if app.RestoreUC == nil || app.ListSessionsUC == nil {
160+ if cliApp.RestoreUC == nil || cliApp.ListSessionsUC == nil {
161161 err := fmt.Errorf("session restoration not available")
162162 fmt.Fprintln(os.Stderr, renderer.RenderError(err))
163163 return wrapPrintedError(err)
@@ -173,7 +173,7 @@ func runSessionsRestore(_ *cobra.Command, args []string) error {
173173 sessionID := sessionInfo.Session.ID
174174
175175 // Validate the session has restorable state
176- _, err = app.RestoreUC.Execute(app.Ctx(), usecase.RestoreInput{SessionID: sessionID})
176+ _, err = cliApp.RestoreUC.Execute(cliApp.Ctx(), usecase.RestoreInput{SessionID: sessionID})
177177 if err != nil {
178178 wrappedErr := fmt.Errorf("restore session: %w", err)
179179 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))
@@ -181,12 +181,12 @@ func runSessionsRestore(_ *cobra.Command, args []string) error {
181181 }
182182
183183 // Spawn a new dumber instance with the session
184- if app.SessionSpawner == nil {
184+ if cliApp.SessionSpawner == nil {
185185 err := fmt.Errorf("session spawner not available")
186186 fmt.Fprintln(os.Stderr, renderer.RenderError(err))
187187 return wrapPrintedError(err)
188188 }
189- if err := app.SessionSpawner.SpawnWithSession(sessionID); err != nil {
189+ if err := cliApp.SessionSpawner.SpawnWithSession(sessionID); err != nil {
190190 wrappedErr := fmt.Errorf("spawn browser: %w", err)
191191 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))
192192 return wrapPrintedError(wrappedErr)
@@ -219,13 +219,13 @@ func init() {
219219 }
220220
221221 func runSessionsDelete(_ *cobra.Command, args []string) error {
222- app := GetApp()
223- if app == nil {
222+ cliApp := GetApp()
223+ if cliApp == nil {
224224 return fmt.Errorf("app not initialized")
225225 }
226- renderer := styles.NewSessionsCLIRenderer(app.Theme)
226+ renderer := styles.NewSessionsCLIRenderer(cliApp.Theme)
227227
228- if app.DeleteSessionUC == nil || app.ListSessionsUC == nil {
228+ if cliApp.DeleteSessionUC == nil || cliApp.ListSessionsUC == nil {
229229 err := fmt.Errorf("session management not available")
230230 fmt.Fprintln(os.Stderr, renderer.RenderError(err))
231231 return wrapPrintedError(err)
@@ -240,12 +240,12 @@ func runSessionsDelete(_ *cobra.Command, args []string) error {
240240
241241 // Get current session ID
242242 var currentSessionID entity.SessionID
243- if active, activeErr := app.SessionUC.GetActiveSession(app.Ctx()); activeErr == nil && active != nil {
243+ if active, activeErr := cliApp.SessionUC.GetActiveSession(cliApp.Ctx()); activeErr == nil && active != nil {
244244 currentSessionID = active.ID
245245 }
246246
247247 // Delete using use case (handles validation internally)
248- if err := app.DeleteSessionUC.Execute(app.Ctx(), usecase.DeleteSessionInput{
248+ if err := cliApp.DeleteSessionUC.Execute(cliApp.Ctx(), usecase.DeleteSessionInput{
249249 SessionID: sessionInfo.Session.ID,
250250 CurrentSessionID: currentSessionID,
251251 }); err != nil {
@@ -261,19 +261,19 @@ func runSessionsDelete(_ *cobra.Command, args []string) error {
261261 // findSessionByIDOrSuffix finds a session by exact ID or unique suffix.
262262 // Users typically identify sessions by the last few characters (e.g., "dee5").
263263 func findSessionByIDOrSuffix(idOrSuffix string) (*entity.SessionInfo, error) {
264- app := GetApp()
265- if app == nil || app.ListSessionsUC == nil {
264+ cliApp := GetApp()
265+ if cliApp == nil || cliApp.ListSessionsUC == nil {
266266 return nil, fmt.Errorf("app not initialized")
267267 }
268268
269269 // Get current session ID (empty if not running as browser)
270270 var currentSessionID entity.SessionID
271- if active, err := app.SessionUC.GetActiveSession(app.Ctx()); err == nil && active != nil {
271+ if active, err := cliApp.SessionUC.GetActiveSession(cliApp.Ctx()); err == nil && active != nil {
272272 currentSessionID = active.ID
273273 }
274274
275275 // List all sessions
276- output, err := app.ListSessionsUC.Execute(app.Ctx(), currentSessionID, defaultSessionsLimit*5)
276+ output, err := cliApp.ListSessionsUC.Execute(cliApp.Ctx(), currentSessionID, defaultSessionsLimit*5)
277277 if err != nil {
278278 return nil, fmt.Errorf("list sessions: %w", err)
279279 }
@@ -39,29 +39,29 @@ func init() {
39 }39 }
40 40
41 func runSessions(_ *cobra.Command, _ []string) error {41 func runSessions(_ *cobra.Command, _ []string) error {
42- app := GetApp()42+ cliApp := GetApp()
43- if app == nil {43+ if cliApp == nil {
44 return fmt.Errorf("app not initialized")44 return fmt.Errorf("app not initialized")
45 }45 }
46 46
47- if app.ListSessionsUC == nil {47+ if cliApp.ListSessionsUC == nil {
48 return fmt.Errorf("session management not available")48 return fmt.Errorf("session management not available")
49 }49 }
50 50
51 // Get current session ID (empty if not running as browser)51 // Get current session ID (empty if not running as browser)
52 var currentSessionID entity.SessionID52 var currentSessionID entity.SessionID
53- if active, err := app.SessionUC.GetActiveSession(app.Ctx()); err == nil && active != nil {53+ if active, err := cliApp.SessionUC.GetActiveSession(cliApp.Ctx()); err == nil && active != nil {
54 currentSessionID = active.ID54 currentSessionID = active.ID
55 }55 }
56 56
57 // Run interactive TUI57 // Run interactive TUI
58- m := model.NewSessionsModel(app.Ctx(), app.Theme, model.SessionsModelConfig{58+ m := model.NewSessionsModel(cliApp.Ctx(), cliApp.Theme, model.SessionsModelConfig{
59- ListSessionsUC: app.ListSessionsUC,59+ ListSessionsUC: cliApp.ListSessionsUC,
60- RestoreUC: app.RestoreUC,60+ RestoreUC: cliApp.RestoreUC,
61- DeleteSessionUC: app.DeleteSessionUC,61+ DeleteSessionUC: cliApp.DeleteSessionUC,
62- SessionSpawner: app.SessionSpawner,62+ SessionSpawner: cliApp.SessionSpawner,
63 CurrentSession: currentSessionID,63 CurrentSession: currentSessionID,
64- MaxExitedSessions: app.Config.Session.MaxExitedSessions,64+ MaxExitedSessions: cliApp.Config.Session.MaxExitedSessions,
65 })65 })
66 66
67 p := tea.NewProgram(m, tea.WithAltScreen())67 p := tea.NewProgram(m, tea.WithAltScreen())
@@ -89,13 +89,13 @@ func init() {
89 }89 }
90 90
91 func runSessionsList(_ *cobra.Command, _ []string) error {91 func runSessionsList(_ *cobra.Command, _ []string) error {
92- app := GetApp()92+ cliApp := GetApp()
93- if app == nil {93+ if cliApp == nil {
94 return fmt.Errorf("app not initialized")94 return fmt.Errorf("app not initialized")
95 }95 }
96- renderer := styles.NewSessionsCLIRenderer(app.Theme)96+ renderer := styles.NewSessionsCLIRenderer(cliApp.Theme)
97 97
98- if app.ListSessionsUC == nil {98+ if cliApp.ListSessionsUC == nil {
99 err := fmt.Errorf("session management not available")99 err := fmt.Errorf("session management not available")
100 fmt.Fprintln(os.Stderr, renderer.RenderError(err))100 fmt.Fprintln(os.Stderr, renderer.RenderError(err))
101 return wrapPrintedError(err)101 return wrapPrintedError(err)
@@ -103,11 +103,11 @@ func runSessionsList(_ *cobra.Command, _ []string) error {
103 103
104 // Get current session ID (empty if not running as browser)104 // Get current session ID (empty if not running as browser)
105 var currentSessionID entity.SessionID105 var currentSessionID entity.SessionID
106- if active, err := app.SessionUC.GetActiveSession(app.Ctx()); err == nil && active != nil {106+ if active, err := cliApp.SessionUC.GetActiveSession(cliApp.Ctx()); err == nil && active != nil {
107 currentSessionID = active.ID107 currentSessionID = active.ID
108 }108 }
109 109
110- output, err := app.ListSessionsUC.Execute(app.Ctx(), currentSessionID, sessionsLimit)110+ output, err := cliApp.ListSessionsUC.Execute(cliApp.Ctx(), currentSessionID, sessionsLimit)
111 if err != nil {111 if err != nil {
112 wrappedErr := fmt.Errorf("list sessions: %w", err)112 wrappedErr := fmt.Errorf("list sessions: %w", err)
113 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))113 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))
@@ -151,13 +151,13 @@ func init() {
151 }151 }
152 152
153 func runSessionsRestore(_ *cobra.Command, args []string) error {153 func runSessionsRestore(_ *cobra.Command, args []string) error {
154- app := GetApp()154+ cliApp := GetApp()
155- if app == nil {155+ if cliApp == nil {
156 return fmt.Errorf("app not initialized")156 return fmt.Errorf("app not initialized")
157 }157 }
158- renderer := styles.NewSessionsCLIRenderer(app.Theme)158+ renderer := styles.NewSessionsCLIRenderer(cliApp.Theme)
159 159
160- if app.RestoreUC == nil || app.ListSessionsUC == nil {160+ if cliApp.RestoreUC == nil || cliApp.ListSessionsUC == nil {
161 err := fmt.Errorf("session restoration not available")161 err := fmt.Errorf("session restoration not available")
162 fmt.Fprintln(os.Stderr, renderer.RenderError(err))162 fmt.Fprintln(os.Stderr, renderer.RenderError(err))
163 return wrapPrintedError(err)163 return wrapPrintedError(err)
@@ -173,7 +173,7 @@ func runSessionsRestore(_ *cobra.Command, args []string) error {
173 sessionID := sessionInfo.Session.ID173 sessionID := sessionInfo.Session.ID
174 174
175 // Validate the session has restorable state175 // Validate the session has restorable state
176- _, err = app.RestoreUC.Execute(app.Ctx(), usecase.RestoreInput{SessionID: sessionID})176+ _, err = cliApp.RestoreUC.Execute(cliApp.Ctx(), usecase.RestoreInput{SessionID: sessionID})
177 if err != nil {177 if err != nil {
178 wrappedErr := fmt.Errorf("restore session: %w", err)178 wrappedErr := fmt.Errorf("restore session: %w", err)
179 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))179 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))
@@ -181,12 +181,12 @@ func runSessionsRestore(_ *cobra.Command, args []string) error {
181 }181 }
182 182
183 // Spawn a new dumber instance with the session183 // Spawn a new dumber instance with the session
184- if app.SessionSpawner == nil {184+ if cliApp.SessionSpawner == nil {
185 err := fmt.Errorf("session spawner not available")185 err := fmt.Errorf("session spawner not available")
186 fmt.Fprintln(os.Stderr, renderer.RenderError(err))186 fmt.Fprintln(os.Stderr, renderer.RenderError(err))
187 return wrapPrintedError(err)187 return wrapPrintedError(err)
188 }188 }
189- if err := app.SessionSpawner.SpawnWithSession(sessionID); err != nil {189+ if err := cliApp.SessionSpawner.SpawnWithSession(sessionID); err != nil {
190 wrappedErr := fmt.Errorf("spawn browser: %w", err)190 wrappedErr := fmt.Errorf("spawn browser: %w", err)
191 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))191 fmt.Fprintln(os.Stderr, renderer.RenderError(wrappedErr))
192 return wrapPrintedError(wrappedErr)192 return wrapPrintedError(wrappedErr)
@@ -219,13 +219,13 @@ func init() {
219 }219 }
220 220
221 func runSessionsDelete(_ *cobra.Command, args []string) error {221 func runSessionsDelete(_ *cobra.Command, args []string) error {
222- app := GetApp()222+ cliApp := GetApp()
223- if app == nil {223+ if cliApp == nil {
224 return fmt.Errorf("app not initialized")224 return fmt.Errorf("app not initialized")
225 }225 }
226- renderer := styles.NewSessionsCLIRenderer(app.Theme)226+ renderer := styles.NewSessionsCLIRenderer(cliApp.Theme)
227 227
228- if app.DeleteSessionUC == nil || app.ListSessionsUC == nil {228+ if cliApp.DeleteSessionUC == nil || cliApp.ListSessionsUC == nil {
229 err := fmt.Errorf("session management not available")229 err := fmt.Errorf("session management not available")
230 fmt.Fprintln(os.Stderr, renderer.RenderError(err))230 fmt.Fprintln(os.Stderr, renderer.RenderError(err))
231 return wrapPrintedError(err)231 return wrapPrintedError(err)
@@ -240,12 +240,12 @@ func runSessionsDelete(_ *cobra.Command, args []string) error {
240 240
241 // Get current session ID241 // Get current session ID
242 var currentSessionID entity.SessionID242 var currentSessionID entity.SessionID
243- if active, activeErr := app.SessionUC.GetActiveSession(app.Ctx()); activeErr == nil && active != nil {243+ if active, activeErr := cliApp.SessionUC.GetActiveSession(cliApp.Ctx()); activeErr == nil && active != nil {
244 currentSessionID = active.ID244 currentSessionID = active.ID
245 }245 }
246 246
247 // Delete using use case (handles validation internally)247 // Delete using use case (handles validation internally)
248- if err := app.DeleteSessionUC.Execute(app.Ctx(), usecase.DeleteSessionInput{248+ if err := cliApp.DeleteSessionUC.Execute(cliApp.Ctx(), usecase.DeleteSessionInput{
249 SessionID: sessionInfo.Session.ID,249 SessionID: sessionInfo.Session.ID,
250 CurrentSessionID: currentSessionID,250 CurrentSessionID: currentSessionID,
251 }); err != nil {251 }); err != nil {
@@ -261,19 +261,19 @@ func runSessionsDelete(_ *cobra.Command, args []string) error {
261 // findSessionByIDOrSuffix finds a session by exact ID or unique suffix.261 // findSessionByIDOrSuffix finds a session by exact ID or unique suffix.
262 // Users typically identify sessions by the last few characters (e.g., "dee5").262 // Users typically identify sessions by the last few characters (e.g., "dee5").
263 func findSessionByIDOrSuffix(idOrSuffix string) (*entity.SessionInfo, error) {263 func findSessionByIDOrSuffix(idOrSuffix string) (*entity.SessionInfo, error) {
264- app := GetApp()264+ cliApp := GetApp()
265- if app == nil || app.ListSessionsUC == nil {265+ if cliApp == nil || cliApp.ListSessionsUC == nil {
266 return nil, fmt.Errorf("app not initialized")266 return nil, fmt.Errorf("app not initialized")
267 }267 }
268 268
269 // Get current session ID (empty if not running as browser)269 // Get current session ID (empty if not running as browser)
270 var currentSessionID entity.SessionID270 var currentSessionID entity.SessionID
271- if active, err := app.SessionUC.GetActiveSession(app.Ctx()); err == nil && active != nil {271+ if active, err := cliApp.SessionUC.GetActiveSession(cliApp.Ctx()); err == nil && active != nil {
272 currentSessionID = active.ID272 currentSessionID = active.ID
273 }273 }
274 274
275 // List all sessions275 // List all sessions
276- output, err := app.ListSessionsUC.Execute(app.Ctx(), currentSessionID, defaultSessionsLimit*5)276+ output, err := cliApp.ListSessionsUC.Execute(cliApp.Ctx(), currentSessionID, defaultSessionsLimit*5)
277 if err != nil {277 if err != nil {
278 return nil, fmt.Errorf("list sessions: %w", err)278 return nil, fmt.Errorf("list sessions: %w", err)
279 }279 }
M internal/cli/cmd/setup.go +8 -8
@@ -57,12 +57,12 @@ func init() {
5757 }
5858
5959 func runSetupInstall(_ *cobra.Command, _ []string) error {
60- app := GetApp()
61- if app == nil {
60+ cliApp := GetApp()
61+ if cliApp == nil {
6262 return fmt.Errorf("app not initialized")
6363 }
6464
65- theme := app.Theme
65+ theme := cliApp.Theme
6666
6767 // Check if installed via package manager
6868 switch {
@@ -87,7 +87,7 @@ func runSetupInstall(_ *cobra.Command, _ []string) error {
8787 IconData: assets.LogoSVG,
8888 }
8989
90- result, err := uc.Execute(app.Ctx(), input)
90+ result, err := uc.Execute(cliApp.Ctx(), input)
9191 if err != nil {
9292 fmt.Printf("%s %s\n", theme.ErrorStyle.Render("\u2717"), err.Error())
9393 return err
@@ -124,16 +124,16 @@ func runSetupInstall(_ *cobra.Command, _ []string) error {
124124 }
125125
126126 func runSetupDefault(_ *cobra.Command, _ []string) error {
127- app := GetApp()
128- if app == nil {
127+ cliApp := GetApp()
128+ if cliApp == nil {
129129 return fmt.Errorf("app not initialized")
130130 }
131131
132- theme := app.Theme
132+ theme := cliApp.Theme
133133 adapter := desktop.New()
134134 uc := usecase.NewSetDefaultBrowserUseCase(adapter)
135135
136- result, err := uc.Execute(app.Ctx())
136+ result, err := uc.Execute(cliApp.Ctx())
137137 if err != nil {
138138 errMsg := err.Error()
139139 fmt.Printf("%s %s\n", theme.ErrorStyle.Render("\u2717"), errMsg)
@@ -57,12 +57,12 @@ func init() {
57 }57 }
58 58
59 func runSetupInstall(_ *cobra.Command, _ []string) error {59 func runSetupInstall(_ *cobra.Command, _ []string) error {
60- app := GetApp()60+ cliApp := GetApp()
61- if app == nil {61+ if cliApp == nil {
62 return fmt.Errorf("app not initialized")62 return fmt.Errorf("app not initialized")
63 }63 }
64 64
65- theme := app.Theme65+ theme := cliApp.Theme
66 66
67 // Check if installed via package manager67 // Check if installed via package manager
68 switch {68 switch {
@@ -87,7 +87,7 @@ func runSetupInstall(_ *cobra.Command, _ []string) error {
87 IconData: assets.LogoSVG,87 IconData: assets.LogoSVG,
88 }88 }
89 89
90- result, err := uc.Execute(app.Ctx(), input)90+ result, err := uc.Execute(cliApp.Ctx(), input)
91 if err != nil {91 if err != nil {
92 fmt.Printf("%s %s\n", theme.ErrorStyle.Render("\u2717"), err.Error())92 fmt.Printf("%s %s\n", theme.ErrorStyle.Render("\u2717"), err.Error())
93 return err93 return err
@@ -124,16 +124,16 @@ func runSetupInstall(_ *cobra.Command, _ []string) error {
124 }124 }
125 125
126 func runSetupDefault(_ *cobra.Command, _ []string) error {126 func runSetupDefault(_ *cobra.Command, _ []string) error {
127- app := GetApp()127+ cliApp := GetApp()
128- if app == nil {128+ if cliApp == nil {
129 return fmt.Errorf("app not initialized")129 return fmt.Errorf("app not initialized")
130 }130 }
131 131
132- theme := app.Theme132+ theme := cliApp.Theme
133 adapter := desktop.New()133 adapter := desktop.New()
134 uc := usecase.NewSetDefaultBrowserUseCase(adapter)134 uc := usecase.NewSetDefaultBrowserUseCase(adapter)
135 135
136- result, err := uc.Execute(app.Ctx())136+ result, err := uc.Execute(cliApp.Ctx())
137 if err != nil {137 if err != nil {
138 errMsg := err.Error()138 errMsg := err.Error()
139 fmt.Printf("%s %s\n", theme.ErrorStyle.Render("\u2717"), errMsg)139 fmt.Printf("%s %s\n", theme.ErrorStyle.Render("\u2717"), errMsg)
M internal/cli/cmd/update.go +7 -7
@@ -203,12 +203,12 @@ func (updateModel) checkForUpdates() tea.Cmd {
203203 return checkResultMsg{err: fmt.Errorf("failed to create applier: %w", err)}
204204 }
205205
206- app := GetApp()
207- if app == nil {
206+ cliApp := GetApp()
207+ if cliApp == nil {
208208 return checkResultMsg{err: fmt.Errorf("app not initialized")}
209209 }
210210
211- checkUC := usecase.NewCheckUpdateUseCase(checker, applier, app.BuildInfo)
211+ checkUC := usecase.NewCheckUpdateUseCase(checker, applier, cliApp.BuildInfo)
212212 result, err := checkUC.Execute(ctx, usecase.CheckUpdateInput{})
213213
214214 return checkResultMsg{output: result, err: err}
@@ -240,15 +240,15 @@ func (m updateModel) downloadUpdate() tea.Cmd {
240240 }
241241
242242 func runUpdate(_ *cobra.Command, _ []string) error {
243- app := GetApp()
244- if app == nil {
243+ cliApp := GetApp()
244+ if cliApp == nil {
245245 return fmt.Errorf("app not initialized")
246246 }
247247
248- renderer := styles.NewUpdateRenderer(app.Theme)
248+ renderer := styles.NewUpdateRenderer(cliApp.Theme)
249249
250250 // Create and run the bubbletea program.
251- m := newUpdateModel(renderer, app.Theme.Accent, updateForce)
251+ m := newUpdateModel(renderer, cliApp.Theme.Accent, updateForce)
252252 p := tea.NewProgram(m)
253253
254254 finalModel, err := p.Run()
@@ -203,12 +203,12 @@ func (updateModel) checkForUpdates() tea.Cmd {
203 return checkResultMsg{err: fmt.Errorf("failed to create applier: %w", err)}203 return checkResultMsg{err: fmt.Errorf("failed to create applier: %w", err)}
204 }204 }
205 205
206- app := GetApp()206+ cliApp := GetApp()
207- if app == nil {207+ if cliApp == nil {
208 return checkResultMsg{err: fmt.Errorf("app not initialized")}208 return checkResultMsg{err: fmt.Errorf("app not initialized")}
209 }209 }
210 210
211- checkUC := usecase.NewCheckUpdateUseCase(checker, applier, app.BuildInfo)211+ checkUC := usecase.NewCheckUpdateUseCase(checker, applier, cliApp.BuildInfo)
212 result, err := checkUC.Execute(ctx, usecase.CheckUpdateInput{})212 result, err := checkUC.Execute(ctx, usecase.CheckUpdateInput{})
213 213
214 return checkResultMsg{output: result, err: err}214 return checkResultMsg{output: result, err: err}
@@ -240,15 +240,15 @@ func (m updateModel) downloadUpdate() tea.Cmd {
240 }240 }
241 241
242 func runUpdate(_ *cobra.Command, _ []string) error {242 func runUpdate(_ *cobra.Command, _ []string) error {
243- app := GetApp()243+ cliApp := GetApp()
244- if app == nil {244+ if cliApp == nil {
245 return fmt.Errorf("app not initialized")245 return fmt.Errorf("app not initialized")
246 }246 }
247 247
248- renderer := styles.NewUpdateRenderer(app.Theme)248+ renderer := styles.NewUpdateRenderer(cliApp.Theme)
249 249
250 // Create and run the bubbletea program.250 // Create and run the bubbletea program.
251- m := newUpdateModel(renderer, app.Theme.Accent, updateForce)251+ m := newUpdateModel(renderer, cliApp.Theme.Accent, updateForce)
252 p := tea.NewProgram(m)252 p := tea.NewProgram(m)
253 253
254 finalModel, err := p.Run()254 finalModel, err := p.Run()

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