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 | |||
| 649 | 649 | // direction: NavUp for previous, NavDown for next. | |
| 650 | 650 | func (uc *ManagePanesUseCase) NavigateStack(ctx context.Context, stackNode *entity.PaneNode, direction NavigateDirection) (*entity.Pane, error) { | |
| 651 | 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 | 653 | if stackNode == nil { | |
| 658 | 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 | 661 | if !stackNode.IsStacked { | |
| 661 | 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 | 713 | // If only one pane remains, the stack is dissolved. | |
| 713 | 714 | func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error { | |
| 714 | 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 | 717 | if stackNode == nil { | |
| 721 | 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 | 725 | if !stackNode.IsStacked { | |
| 724 | 726 | return fmt.Errorf("node is not a stack") | |
| 725 | 727 | } | |
| @@ -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 | |||
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "context" | |
| 5 | - | "fmt" | |
| 6 | 5 | ||
| 7 | 6 | tea "github.com/charmbracelet/bubbletea" | |
| 8 | 7 | "github.com/charmbracelet/lipgloss" | |
| @@ -133,21 +132,3 @@ func (m CleanupModel) View() string { | |||
| 133 | 132 | ||
| 134 | 133 | // Ensure interface compliance. | |
| 135 | 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 | - | } | |
| @@ -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 { | |||
| 133 | 133 | t := m.theme | |
| 134 | 134 | ||
| 135 | 135 | // Build header | |
| 136 | - | header := t.Title.Copy(). | |
| 136 | + | header := t.Title. | |
| 137 | 137 | Foreground(t.Error). | |
| 138 | 138 | Render("Clear History") | |
| 139 | 139 | ||
| @@ -133,7 +133,7 @@ func (m CleanupModel) View() string { | |||||
| 133 | t := m.theme | 133 | t := m.theme | ||
| 134 | 134 | ||||
| 135 | // Build header | 135 | // 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. | |||
| 106 | 106 | urlStyle := t.ListItemDesc | |
| 107 | 107 | ||
| 108 | 108 | 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) | |
| 111 | 111 | } | |
| 112 | 112 | ||
| 113 | 113 | // 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.ListItemDesc | 106 | 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 + title | 113 | // 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 { | |||
| 174 | 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 | 177 | // resizeAndCenter adjusts the omnibox size based on content and centers it. | |
| 184 | 178 | // rowCount is the number of result rows to display (0 = no content, max 10). | |
| 185 | 179 | 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 { | |||
| 136 | 136 | c.mainWindow.TabBar().SetActive(c.tabs.ActiveTabID) | |
| 137 | 137 | } | |
| 138 | 138 | ||
| 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 | |
| 143 | 140 | ||
| 144 | 141 | log.Debug().Str("tab_id", string(c.tabs.ActiveTabID)).Msg("switched to next tab") | |
| 145 | 142 | 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 view | 139 | + | // 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 nil | 142 | return nil | ||