feat(office): mail preview, infinite scroll, pane resize, and scrollbars
Release Please / Release Please (push) Skipped
Tests / Test (Go 1.22) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Release / GoReleaser (push) Failing after 38s
Release Please / Release Please (push) Skipped
Tests / Test (Go 1.22) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Release / GoReleaser (push) Failing after 38s
Polish the office TUI with proportional pane layout, drag resize, live filtering, HTML mail preview, paginated mail lists, overflow scrollbars, flattened navigation, and project save/status fixes; add UpdateProjectStatus. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestScrollbarMetricsHiddenWhenFits(t *testing.T) {
|
||||
show, _, _ := ScrollbarMetrics(5, 10, 0)
|
||||
if show {
|
||||
t.Fatal("expected no scrollbar when content fits")
|
||||
}
|
||||
}
|
||||
|
||||
func TestScrollbarMetricsVisibleWhenOverflow(t *testing.T) {
|
||||
show, start, end := ScrollbarMetrics(100, 10, 50)
|
||||
if !show || end <= start {
|
||||
t.Fatalf("expected thumb, got %d..%d", start, end)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyVerticalScrollbarAddsColumn(t *testing.T) {
|
||||
view := "line1\nline2\nline3"
|
||||
out := ApplyVerticalScrollbar(view, 12, 3, 10, 0)
|
||||
lines := strings.Split(out, "\n")
|
||||
if len(lines) != 3 {
|
||||
t.Fatalf("lines=%d", len(lines))
|
||||
}
|
||||
if !strings.HasSuffix(lines[0], "█") && !strings.HasSuffix(lines[0], "│") {
|
||||
t.Fatalf("expected scrollbar glyph: %q", lines[0])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user