Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/ui/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func (s *Shell) viewHistory(c *ui.Context, _ *ui.Route) {
p.apply()
}

ui.Box(c).Height(space.Px8)
// 原型的历史记录是 `noHead` 的分组列表:没有表头,每组只有组头。
p.rows.View(c)
})
Expand Down
3 changes: 3 additions & 0 deletions internal/ui/searchpage.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ func (s *Shell) viewSearchResultsBody(c *ui.Context, tab int, keyword string, le
ui.Box(c).Height(space.Px8)
t.list.Header(c, "search:header:"+strconv.Itoa(tab))
}
if tab == searchTabUser {
ui.Box(c).Height(space.Px8)
}
t.list.View(c)
}

Expand Down
22 changes: 22 additions & 0 deletions internal/ui/searchpage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,28 @@ func TestClickingAUserCardGoesToTheirSpace(t *testing.T) {
}
}

// TestSearchUserCardsKeepClearanceBelowTheToolbar locks the user result cards below
// the sorting toolbar instead of letting the first row touch it.
func TestSearchUserCardsKeepClearanceBelowTheToolbar(t *testing.T) {
s, tt := newSearchPage(t, "周杰伦", newSearchStub(24, 24))
settleText(t, tt, "第 1 页 第 1 首")
if err := tt.Click("UP 主"); err != nil {
t.Fatal(err)
}
waitFrames(t, tt, "用户结果加载完", loadedTo(s, searchTabUser, 1))
toolbar, ok := tt.Find("默认排序")
if !ok {
t.Fatal("找不到 UP 主排序控件")
}
card, ok := tt.Find("打开 " + stubTitle(1, 0) + " 的空间")
if !ok {
t.Fatal("找不到第一张 UP 主卡")
}
if gap := card.Y - (toolbar.Y + toolbar.H); gap < 8 {
t.Fatalf("排序控件和第一张 UP 主卡之间只有 %.1fpx,至少需要 8px", gap)
}
}

// TestFirstSearchTabVisitKeepsViewport 锁定首次切到结果足够多的标签时不应跳回顶部。
func TestFirstSearchTabVisitKeepsViewport(t *testing.T) {
s, tt := newSearchPage(t, "周杰伦", newSearchStub(72, 72))
Expand Down
Loading