detached bdf3676

fix(lint): remove unused code and fix deprecated api usage

commit
bdf36764b6b4f2feaa4c173fb5fe2d2976fea1e6
author
bnema · · 2025-12-18 03:51 UTC
parent
bf6c325
signature
unsigned
6 files · +14 -40
M internal/application/usecase/manage_panes.go +10 -8
@@ -649,14 +649,15 @@ func (uc *ManagePanesUseCase) AddToStack(ctx context.Context, ws *entity.Workspa
649649 // direction: NavUp for previous, NavDown for next.
650650 func (uc *ManagePanesUseCase) NavigateStack(ctx context.Context, stackNode *entity.PaneNode, direction NavigateDirection) (*entity.Pane, error) {
651651 log := logging.FromContext(ctx)
652- log.Debug().
653- Str("stack_id", stackNode.ID).
654- Str("direction", string(direction)).
655- Msg("navigating stack")
656652
657653 if stackNode == nil {
658654 return nil, fmt.Errorf("stack node is required")
659655 }
656+
657+ log.Debug().
658+ Str("stack_id", stackNode.ID).
659+ Str("direction", string(direction)).
660+ Msg("navigating stack")
660661 if !stackNode.IsStacked {
661662 return nil, fmt.Errorf("node is not a stack")
662663 }
@@ -712,14 +713,15 @@ func (uc *ManagePanesUseCase) NavigateStack(ctx context.Context, stackNode *enti
712713 // If only one pane remains, the stack is dissolved.
713714 func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error {
714715 log := logging.FromContext(ctx)
715- log.Debug().
716- Str("stack_id", stackNode.ID).
717- Str("pane_id", string(paneID)).
718- Msg("removing pane from stack")
719716
720717 if stackNode == nil {
721718 return fmt.Errorf("stack node is required")
722719 }
720+
721+ log.Debug().
722+ Str("stack_id", stackNode.ID).
723+ Str("pane_id", string(paneID)).
724+ Msg("removing pane from stack")
723725 if !stackNode.IsStacked {
724726 return fmt.Errorf("node is not a stack")
725727 }
@@ -649,14 +649,15 @@ func (uc *ManagePanesUseCase) AddToStack(ctx context.Context, ws *entity.Workspa
649 // direction: NavUp for previous, NavDown for next.649 // direction: NavUp for previous, NavDown for next.
650 func (uc *ManagePanesUseCase) NavigateStack(ctx context.Context, stackNode *entity.PaneNode, direction NavigateDirection) (*entity.Pane, error) {650 func (uc *ManagePanesUseCase) NavigateStack(ctx context.Context, stackNode *entity.PaneNode, direction NavigateDirection) (*entity.Pane, error) {
651 log := logging.FromContext(ctx)651 log := logging.FromContext(ctx)
652- log.Debug().
653- Str("stack_id", stackNode.ID).
654- Str("direction", string(direction)).
655- Msg("navigating stack")
656 652
657 if stackNode == nil {653 if stackNode == nil {
658 return nil, fmt.Errorf("stack node is required")654 return nil, fmt.Errorf("stack node is required")
659 }655 }
656+
657+ log.Debug().
658+ Str("stack_id", stackNode.ID).
659+ Str("direction", string(direction)).
660+ Msg("navigating stack")
660 if !stackNode.IsStacked {661 if !stackNode.IsStacked {
661 return nil, fmt.Errorf("node is not a stack")662 return nil, fmt.Errorf("node is not a stack")
662 }663 }
@@ -712,14 +713,15 @@ func (uc *ManagePanesUseCase) NavigateStack(ctx context.Context, stackNode *enti
712 // If only one pane remains, the stack is dissolved.713 // If only one pane remains, the stack is dissolved.
713 func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error {714 func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error {
714 log := logging.FromContext(ctx)715 log := logging.FromContext(ctx)
715- log.Debug().
716- Str("stack_id", stackNode.ID).
717- Str("pane_id", string(paneID)).
718- Msg("removing pane from stack")
719 716
720 if stackNode == nil {717 if stackNode == nil {
721 return fmt.Errorf("stack node is required")718 return fmt.Errorf("stack node is required")
722 }719 }
720+
721+ log.Debug().
722+ Str("stack_id", stackNode.ID).
723+ Str("pane_id", string(paneID)).
724+ Msg("removing pane from stack")
723 if !stackNode.IsStacked {725 if !stackNode.IsStacked {
724 return fmt.Errorf("node is not a stack")726 return fmt.Errorf("node is not a stack")
725 }727 }
M internal/cli/model/cleanup.go +0 -19
@@ -2,7 +2,6 @@ package model
22
33 import (
44 "context"
5- "fmt"
65
76 tea "github.com/charmbracelet/bubbletea"
87 "github.com/charmbracelet/lipgloss"
@@ -133,21 +132,3 @@ func (m CleanupModel) View() string {
133132
134133 // Ensure interface compliance.
135134 var _ tea.Model = (*CleanupModel)(nil)
136-
137-// rangeLabelFor returns a human-readable label for cleanup range.
138-func rangeLabelFor(r styles.CleanupRange) string {
139- switch r {
140- case styles.CleanupRangeLastHour:
141- return "last hour"
142- case styles.CleanupRangeLast24Hours:
143- return "last 24 hours"
144- case styles.CleanupRangeLast7Days:
145- return "last 7 days"
146- case styles.CleanupRangeLast30Days:
147- return "last 30 days"
148- case styles.CleanupRangeAll:
149- return "all time"
150- default:
151- return fmt.Sprintf("range %d", r)
152- }
153-}
@@ -2,7 +2,6 @@ package model
2 2
3 import (3 import (
4 "context"4 "context"
5- "fmt"
6 5
7 tea "github.com/charmbracelet/bubbletea"6 tea "github.com/charmbracelet/bubbletea"
8 "github.com/charmbracelet/lipgloss"7 "github.com/charmbracelet/lipgloss"
@@ -133,21 +132,3 @@ func (m CleanupModel) View() string {
133 132
134 // Ensure interface compliance.133 // Ensure interface compliance.
135 var _ tea.Model = (*CleanupModel)(nil)134 var _ tea.Model = (*CleanupModel)(nil)
136-
137-// rangeLabelFor returns a human-readable label for cleanup range.
138-func rangeLabelFor(r styles.CleanupRange) string {
139- switch r {
140- case styles.CleanupRangeLastHour:
141- return "last hour"
142- case styles.CleanupRangeLast24Hours:
143- return "last 24 hours"
144- case styles.CleanupRangeLast7Days:
145- return "last 7 days"
146- case styles.CleanupRangeLast30Days:
147- return "last 30 days"
148- case styles.CleanupRangeAll:
149- return "all time"
150- default:
151- return fmt.Sprintf("range %d", r)
152- }
153-}
M internal/cli/styles/cleanup.go +1 -1
@@ -133,7 +133,7 @@ func (m CleanupModel) View() string {
133133 t := m.theme
134134
135135 // Build header
136- header := t.Title.Copy().
136+ header := t.Title.
137137 Foreground(t.Error).
138138 Render("Clear History")
139139
@@ -133,7 +133,7 @@ func (m CleanupModel) View() string {
133 t := m.theme133 t := m.theme
134 134
135 // Build header135 // Build header
136- header := t.Title.Copy().136+ header := t.Title.
137 Foreground(t.Error).137 Foreground(t.Error).
138 Render("Clear History")138 Render("Clear History")
139 139
M internal/cli/styles/list.go +2 -2
@@ -106,8 +106,8 @@ func (d HistoryDelegate) Render(w io.Writer, m list.Model, index int, item list.
106106 urlStyle := t.ListItemDesc
107107
108108 if isSelected {
109- titleStyle = titleStyle.Copy().Foreground(t.Accent).Bold(true)
110- urlStyle = urlStyle.Copy().Foreground(t.Text)
109+ titleStyle = titleStyle.Foreground(t.Accent).Bold(true)
110+ urlStyle = urlStyle.Foreground(t.Text)
111111 }
112112
113113 // First line: cursor + title
@@ -106,8 +106,8 @@ func (d HistoryDelegate) Render(w io.Writer, m list.Model, index int, item list.
106 urlStyle := t.ListItemDesc106 urlStyle := t.ListItemDesc
107 107
108 if isSelected {108 if isSelected {
109- titleStyle = titleStyle.Copy().Foreground(t.Accent).Bold(true)109+ titleStyle = titleStyle.Foreground(t.Accent).Bold(true)
110- urlStyle = urlStyle.Copy().Foreground(t.Text)110+ urlStyle = urlStyle.Foreground(t.Text)
111 }111 }
112 112
113 // First line: cursor + title113 // First line: cursor + title
M internal/ui/component/omnibox.go +0 -6
@@ -174,12 +174,6 @@ func (o *Omnibox) WidgetAsLayout(factory layout.WidgetFactory) layout.Widget {
174174 return factory.WrapWidget(&o.outerBox.Widget)
175175 }
176176
177-// updateSize sets the omnibox size based on parent window dimensions.
178-// Deprecated: use resizeAndCenter with row count instead.
179-func (o *Omnibox) updateSize() {
180- o.resizeAndCenter(omniboxMaxResults)
181-}
182-
183177 // resizeAndCenter adjusts the omnibox size based on content and centers it.
184178 // rowCount is the number of result rows to display (0 = no content, max 10).
185179 func (o *Omnibox) resizeAndCenter(rowCount int) {
@@ -174,12 +174,6 @@ func (o *Omnibox) WidgetAsLayout(factory layout.WidgetFactory) layout.Widget {
174 return factory.WrapWidget(&o.outerBox.Widget)174 return factory.WrapWidget(&o.outerBox.Widget)
175 }175 }
176 176
177-// updateSize sets the omnibox size based on parent window dimensions.
178-// Deprecated: use resizeAndCenter with row count instead.
179-func (o *Omnibox) updateSize() {
180- o.resizeAndCenter(omniboxMaxResults)
181-}
182-
183 // resizeAndCenter adjusts the omnibox size based on content and centers it.177 // resizeAndCenter adjusts the omnibox size based on content and centers it.
184 // rowCount is the number of result rows to display (0 = no content, max 10).178 // rowCount is the number of result rows to display (0 = no content, max 10).
185 func (o *Omnibox) resizeAndCenter(rowCount int) {179 func (o *Omnibox) resizeAndCenter(rowCount int) {
M internal/ui/coordinator/tab.go +1 -4
@@ -136,10 +136,7 @@ func (c *TabCoordinator) SwitchNext(ctx context.Context) error {
136136 c.mainWindow.TabBar().SetActive(c.tabs.ActiveTabID)
137137 }
138138
139- // Switch workspace view
140- if c.onTabCreated != nil {
141- // TODO: Add onTabSwitched callback for workspace view switching
142- }
139+ // TODO: Add onTabSwitched callback for workspace view switching
143140
144141 log.Debug().Str("tab_id", string(c.tabs.ActiveTabID)).Msg("switched to next tab")
145142 return nil
@@ -136,10 +136,7 @@ func (c *TabCoordinator) SwitchNext(ctx context.Context) error {
136 c.mainWindow.TabBar().SetActive(c.tabs.ActiveTabID)136 c.mainWindow.TabBar().SetActive(c.tabs.ActiveTabID)
137 }137 }
138 138
139- // Switch workspace view139+ // TODO: Add onTabSwitched callback for workspace view switching
140- if c.onTabCreated != nil {
141- // TODO: Add onTabSwitched callback for workspace view switching
142- }
143 140
144 log.Debug().Str("tab_id", string(c.tabs.ActiveTabID)).Msg("switched to next tab")141 log.Debug().Str("tab_id", string(c.tabs.ActiveTabID)).Msg("switched to next tab")
145 return nil142 return nil

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