repos / pico

pico services mono repo
git clone https://github.com/picosh/pico.git

commit
2e01b84
parent
6a6b81e
author
Eric Bower
date
2025-04-25 09:12:44 -0400 EDT
fix(tui): list overflow pubkeys and tokens
2 files changed,  +7, -5
M pkg/tui/pubkeys.go
+3, -2
 1@@ -145,7 +145,8 @@ func (m *PubkeysPage) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) {
 2 	root.AddChild(0, ah, headerSurf)
 3 	ah += int(headerSurf.Size.Height)
 4 
 5-	listSurf, _ := m.list.Draw(ctx)
 6+	footerHeight := 3
 7+	listSurf, _ := m.list.Draw(createDrawCtx(ctx, ctx.Max.Height-uint16(ah)-uint16(footerHeight)))
 8 	root.AddChild(0, ah, listSurf)
 9 
10 	segs := []vaxis.Segment{}
11@@ -165,7 +166,7 @@ func (m *PubkeysPage) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) {
12 
13 	footer := richtext.New(segs)
14 	footerSurf, _ := footer.Draw(ctx)
15-	root.AddChild(0, int(h)-3, footerSurf)
16+	root.AddChild(0, int(h)-footerHeight, footerSurf)
17 
18 	return root, nil
19 }
M pkg/tui/tokens.go
+4, -3
 1@@ -125,7 +125,8 @@ func (m *TokensPage) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) {
 2 	root.AddChild(0, ah, headerSurf)
 3 	ah += int(headerSurf.Size.Height)
 4 
 5-	listSurf, _ := m.list.Draw(ctx)
 6+	footerHeight := 3
 7+	listSurf, _ := m.list.Draw(createDrawCtx(ctx, ctx.Max.Height-uint16(ah)-uint16(footerHeight)))
 8 	root.AddChild(0, ah, listSurf)
 9 
10 	segs := []vaxis.Segment{}
11@@ -144,8 +145,8 @@ func (m *TokensPage) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) {
12 	segs = append(segs, vaxis.Segment{Text: "\n"})
13 
14 	footer := richtext.New(segs)
15-	footerSurf, _ := footer.Draw(createDrawCtx(ctx, 3))
16-	root.AddChild(0, int(h)-3, footerSurf)
17+	footerSurf, _ := footer.Draw(createDrawCtx(ctx, uint16(footerHeight)))
18+	root.AddChild(0, int(h)-footerHeight, footerSurf)
19 
20 	return root, nil
21 }