Skip to content

Commit

Permalink
fix: update position constant in JoinHorizontal (#552)
Browse files Browse the repository at this point in the history
* fix: update position constant in JoinHorizontal

* fix: update position constant in JoinVertical
  • Loading branch information
aditipatelpro authored Sep 9, 2024
1 parent 85b4625 commit 6658cf1
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/soft/browse/browse.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (m *model) View() string {
}

if m.showFooter {
view = lipgloss.JoinVertical(lipgloss.Top, view, m.footer.View())
view = lipgloss.JoinVertical(lipgloss.Left, view, m.footer.View())
}

return m.common.Zone.Scan(style.Render(view))
Expand Down
4 changes: 2 additions & 2 deletions pkg/ssh/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ func (ui *UI) View() string {
view = "Unknown state :/ this is a bug!"
}
if ui.activePage == selectionPage {
view = lipgloss.JoinVertical(lipgloss.Top, ui.header.View(), view)
view = lipgloss.JoinVertical(lipgloss.Left, ui.header.View(), view)
}
if ui.showFooter {
view = lipgloss.JoinVertical(lipgloss.Top, view, ui.footer.View())
view = lipgloss.JoinVertical(lipgloss.Left, view, ui.footer.View())
}
return ui.common.Zone.Scan(
ui.common.Styles.App.Render(view),
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/components/code/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (r *Code) Init() tea.Cmd {
for i, l := range lines {
lines[i] = common.TruncateString(l, sideNoteWidth)
}
content = lipgloss.JoinHorizontal(lipgloss.Left, strings.Join(lines, "\n"), content)
content = lipgloss.JoinHorizontal(lipgloss.Top, strings.Join(lines, "\n"), content)
}

// Fix styles after hard wrapping
Expand Down
4 changes: 2 additions & 2 deletions pkg/ui/pages/repo/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (l *Log) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case LogDiffMsg:
l.currentDiff = msg
l.vp.SetContent(
lipgloss.JoinVertical(lipgloss.Top,
lipgloss.JoinVertical(lipgloss.Left,
l.renderCommit(l.selectedCommit),
renderSummary(msg, l.common.Styles, l.common.Width),
renderDiff(msg, l.common.Width),
Expand All @@ -290,7 +290,7 @@ func (l *Log) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
l.SetSize(msg.Width, msg.Height)
if l.selectedCommit != nil && l.currentDiff != nil {
l.vp.SetContent(
lipgloss.JoinVertical(lipgloss.Top,
lipgloss.JoinVertical(lipgloss.Left,
l.renderCommit(l.selectedCommit),
renderSummary(l.currentDiff, l.common.Styles, l.common.Width),
renderDiff(l.currentDiff, l.common.Width),
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/pages/repo/logitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (d LogItemDelegate) Render(w io.Writer, m list.Model, index int, listItem l
d.common.Zone.Mark(
i.ID(),
styles.Base.Render(
lipgloss.JoinVertical(lipgloss.Top,
lipgloss.JoinVertical(lipgloss.Left,
truncate.String(fmt.Sprintf("%s%s",
title,
hash,
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/pages/repo/refsitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (d RefItemDelegate) Render(w io.Writer, m list.Model, index int, listItem l
d.common.Zone.Mark(
i.ID(),
st.Base.Render(
lipgloss.JoinHorizontal(lipgloss.Left,
lipgloss.JoinHorizontal(lipgloss.Top,
truncate.String(selector+ref+desc+hash,
uint(m.Width()-horizontalFrameSize)),
),
Expand Down
6 changes: 3 additions & 3 deletions pkg/ui/pages/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (r *Repo) View() string {
"repo-main",
mainStyle.Render(main),
)
view := lipgloss.JoinVertical(lipgloss.Top,
view := lipgloss.JoinVertical(lipgloss.Left,
r.headerView(),
r.tabs.View(),
main,
Expand All @@ -334,7 +334,7 @@ func (r *Repo) headerView() string {
header = r.common.Styles.Repo.HeaderName.Render(header)
desc := strings.TrimSpace(r.selectedRepo.Description())
if desc != "" {
header = lipgloss.JoinVertical(lipgloss.Top,
header = lipgloss.JoinVertical(lipgloss.Left,
header,
r.common.Styles.Repo.HeaderDesc.Render(desc),
)
Expand All @@ -352,7 +352,7 @@ func (r *Repo) headerView() string {
urlStyle.Render(url),
)

header = lipgloss.JoinHorizontal(lipgloss.Left, header, url)
header = lipgloss.JoinHorizontal(lipgloss.Top, header, url)

style := r.common.Styles.Repo.Header.Width(r.common.Width)
return style.Render(
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/pages/repo/stash.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (s *Stash) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
s.currentPatch = msg
if msg.Diff != nil {
title := s.common.Styles.Stash.Title.Render(s.list.SelectedItem().(StashItem).Title())
content := lipgloss.JoinVertical(lipgloss.Top,
content := lipgloss.JoinVertical(lipgloss.Left,
title,
"",
renderSummary(msg.Diff, s.common.Styles, s.common.Width),
Expand Down

0 comments on commit 6658cf1

Please sign in to comment.