summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-05-02 19:08:49 +0200
committerewy <ewy0@protonmail.com>2026-05-02 19:08:49 +0200
commitd1633e905a1487e8845088c03db8faf53d587e46 (patch)
tree38024375e7bc7a826b4c382c246ec7668f96ab46
parentaa9031ab0deb1535875fe3ca2530428f485dbf9d (diff)
trim right side space in viewport
-rw-r--r--.pik/web/update.sh2
-rw-r--r--menu/source.go6
-rw-r--r--menu/state.go3
-rw-r--r--menu/style/debug.go9
-rw-r--r--viewport/viewport.go10
-rw-r--r--web/index.html6
6 files changed, 29 insertions, 7 deletions
diff --git a/.pik/web/update.sh b/.pik/web/update.sh
index 62d41a9..aa38c61 100644
--- a/.pik/web/update.sh
+++ b/.pik/web/update.sh
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# update files on website
set -euo pipefail
-ssh git@ewy.one -- cd /srv/pik/pik "&&" bash .pik/web/web.sh \ No newline at end of file
+ssh git@ewy.one -- cd /srv/pik/pik "&&" git pull "&&" bash .pik/web/deploy.sh \ No newline at end of file
diff --git a/menu/source.go b/menu/source.go
index e4026e9..9e0f56a 100644
--- a/menu/source.go
+++ b/menu/source.go
@@ -18,7 +18,7 @@ var (
st := lipgloss.NewStyle()
return st
- })
+ }).Debug()
SourceLabelStyle = style.New(func() lipgloss.Style {
st := lipgloss.NewStyle().Border(lipgloss.OuterHalfBlockBorder(), false, false, false, true).Background(SourceHeaderBackground).BorderBackground(SourceHeaderBackground).PaddingRight(1).PaddingLeft(1).MarginRight(1)
return st
@@ -63,7 +63,5 @@ func (m *Model) Source(src *model.HydratedSource) string {
parts = append(parts, Git(src.Git))
}
- return SourceStyle.Render(lipgloss.JoinVertical(lipgloss.Top,
- parts...,
- ))
+ return SourceStyle.Render(strings.Join(parts, "\n"))
}
diff --git a/menu/state.go b/menu/state.go
index 3a46132..55da10b 100644
--- a/menu/state.go
+++ b/menu/state.go
@@ -19,9 +19,12 @@ func (m *Model) State() string {
sources := make([]string, 0, len(st.Sources))
for i, hs := range st.HydratedSources {
src := m.Source(hs)
+
+ // do not pad the bottom source, the motd goes there
if i != len(st.HydratedSources)-1 {
src += "\n"
}
+
sources = append(sources, src)
}
diff --git a/menu/style/debug.go b/menu/style/debug.go
new file mode 100644
index 0000000..ded4c72
--- /dev/null
+++ b/menu/style/debug.go
@@ -0,0 +1,9 @@
+package style
+
+import "github.com/charmbracelet/lipgloss"
+
+func (s Style) Debug() Style {
+ return New(func() lipgloss.Style {
+ return s.builder().Foreground(lipgloss.Color("2")).Background(lipgloss.Color("1"))
+ })
+}
diff --git a/viewport/viewport.go b/viewport/viewport.go
index 7b897e7..da7832e 100644
--- a/viewport/viewport.go
+++ b/viewport/viewport.go
@@ -17,7 +17,15 @@ func Process(input string, height int) string {
cropped, top, bottom := Crop(input, lines, height)
return WithScroll(cropped, int(top*float32(height)), int(bottom*float32(height)))
}
- return input
+ return TrimSpaceRight(input)
+}
+
+func TrimSpaceRight(input string) string {
+ lines := strings.Split(input, "\n")
+ for i, l := range lines {
+ lines[i] = strings.TrimRight(l, " ")
+ }
+ return strings.Join(lines, "\n")
}
func Focus(lines []string, needle string) int {
diff --git a/web/index.html b/web/index.html
index 8394c85..1dd9bc9 100644
--- a/web/index.html
+++ b/web/index.html
@@ -55,7 +55,8 @@
</header>
<main>
<section>
- <img src="img/pik.svg" alt="an animation of the program 'pik' being used, at first in the terminal interface, and then invoking a target through arguments" />
+ <img src="https://uwu.ewy.one/satty-20260502-18:45:46.png" alt="screenshot of the pik terminal interface" style="margin-top: -8px;"/>
+ <small>these assets were all created during development and might look different</small>
</section>
<section class="important">
<p>
@@ -93,6 +94,9 @@
</ul>
</section>
<section>
+ <img src="img/pik.svg" alt="an animation of the program 'pik' being used, at first in the terminal interface, and then invoking a target through arguments" />
+ </section>
+ <section>
<figure>
<img src="https://uwu.ewy.one/satty-20260417-00:10:15.png" />
<blockquote>fig. 1: the pik tui</blockquote>