works now

This commit is contained in:
Robin Olsen
2026-03-18 11:58:31 +01:00
parent 40d25cc716
commit 3e9a903506
24 changed files with 154 additions and 99 deletions

View File

@@ -21,7 +21,6 @@ func (h Header) View(width int) string {
lipgloss.Left,
title,
lipgloss.WithWhitespaceChars("─"),
lipgloss.WithWhitespaceForeground(styles.Primary),
)
}

View File

@@ -17,7 +17,7 @@ type IssueDetail struct {
}
func NewIssueDetail() IssueDetail {
vp := viewport.New(0, 0)
vp := viewport.New(viewport.WithWidth(0), viewport.WithHeight(0))
return IssueDetail{
viewport: vp,
}
@@ -35,8 +35,7 @@ func (i *IssueDetail) SetComments(comments []*models.Comment) {
}
func (i *IssueDetail) SetSize(width, height int) {
i.viewport.Height = height
i.viewport.Width = width
i.viewport = viewport.New(viewport.WithWidth(width), viewport.WithHeight(height))
i.refreshContent()
}
@@ -102,19 +101,21 @@ func formatCommentTime(t time.Time) string {
func (i IssueDetail) View() string {
content := i.viewport.View()
vpWidth := i.viewport.Width()
vpHeight := i.viewport.Height()
if i.focused {
return styles.DetailsContainerStyle.
BorderForeground(styles.PrimaryBorder).
Width(i.viewport.Width).
Height(i.viewport.Height).
MaxHeight(i.viewport.Height).
Width(vpWidth).
Height(vpHeight).
MaxHeight(vpHeight).
Render(content)
}
return styles.DetailsContainerStyle.
Width(i.viewport.Width).
Height(i.viewport.Height).
MaxHeight(i.viewport.Height).
Width(vpWidth).
Height(vpHeight).
MaxHeight(vpHeight).
Render(content)
}

View File

@@ -177,10 +177,6 @@ func NewIssueList(app *app.App, width, height int) IssueList {
l.SetShowHelp(false)
l.SetShowStatusBar(false)
l.SetFilteringEnabled(true)
l.FilterInput.PromptStyle = styles.FilterPromptStyle
l.FilterInput.Cursor.Style = styles.FilterStyle
l.FilterInput.TextStyle = styles.FilterInputStyle
l.FilterInput.Prompt = "🔍 "
return IssueList{
list: l,
@@ -208,10 +204,6 @@ func NewIssueListFromIssues(app *app.App, issues []*models.Issue, width, height
l.SetShowHelp(false)
l.SetShowStatusBar(false)
l.SetFilteringEnabled(true)
l.FilterInput.PromptStyle = styles.FilterPromptStyle
l.FilterInput.Cursor.Style = styles.FilterStyle
l.FilterInput.TextStyle = styles.FilterInputStyle
l.FilterInput.Prompt = "🔍 "
return IssueList{
list: l,
app: app,