4806e6424ec3

spread seven entries evenly over the whole screen instead of leaving an empty band, about 15% tighter than Koh 2's six (3.0.68)

time
2026-09-26 13:31 UTC · 2 weeks ago
machine
Junes-MacBook-Pro.local
agent
claude-opus-5-5
session
history view
parent
501b0f6898df
4 files VERSION+1 −1src/view/view.v+6 −8src/view/view_test.v+11 −5v.mod+1 −1
VERSION+1 −1
@@ -1 +1 @@1-3.0.671+3.0.68

view file

src/view/view.v+6 −8
@@ -393,15 +393,15 @@393393 	return lines.map(fmt.fit(it, cols))394394 }395395 396-// list_body lays the entries out in up to six equal blocks, each a header, a397-// message, the selected entry's details and a separator, with the spare rows398-// split above and below. Koh 2 spread the blocks over the whole body; June399-// asked for them 15% tighter, which leaves the last rows empty.396+// list_body lays the entries out in up to seven equal blocks, each a header,397+// a message, the selected entry's details and a separator, with the spare rows398+// split above and below so the list fills the screen. Koh 2 had six; seven is399+// the 15% tighter spacing June asked for, without leaving an empty band.400400 fn list_body(screen Screen, body int, cols int) []string {401401 	if screen.items.len == 0 {402402 		return ['  ${fmt.muted('no results')}']403403 	}404-	slots := if body / 4 < 6 { body / 4 } else { 6 }404+	slots := if body / 4 < 7 { body / 4 } else { 7 }405405 	if slots == 0 {406406 		return [entry_header(screen.items[screen.selected], true, screen)]407407 	}@@ -409,9 +409,7 @@409409 	start := window_start(screen.selected, slots, screen.items.len)410410 	mut lines := []string{}411411 	for slot in 0 .. slots {412-		spread := body / slots + if slot < body % slots { 1 } else { 0 }413-		tighter := (spread * 85 + 50) / 100414-		height := if tighter > 4 { tighter } else { spread }412+		height := body / slots + if slot < body % slots { 1 } else { 0 }415413 		spare := if height > 4 { height - 4 } else { 0 }416414 		for _ in 0 .. spare / 2 {417415 			lines << ''

view file

src/view/view_test.v+11 −5
@@ -289,9 +289,9 @@289289 	assert fmt.visible_width(last) <= 50290290 }291291 292-// Koh 2 spreads six entries over the whole body; June asked for them 15%293-// tighter, with the rows that frees left empty below the list.294-fn test_entries_sit_fifteen_percent_tighter_than_koh_2() {292+// Koh 2 spreads six entries over the whole body. June asked for them 15%293+// tighter with no empty band left: seven entries, still filling the screen.294+fn test_entries_sit_fifteen_percent_tighter_and_still_fill_the_screen() {295295 	mut items := []history.Save{}296296 	for i in 0 .. 10 {297297 		items << save('id${i:09}', 'message ${i}', false)@@ -301,13 +301,19 @@301301 	lines := plain(frame_lines(session))302302 	assert lines.len == 51303303 	mut headers := []int{}304+	mut separators := []int{}304305 	for i, line in lines {305306 		if line.starts_with('  · ') || line.starts_with('  ▸ ') {306307 			headers << i307308 		}309+		if line.starts_with('─') {310+			separators << i311+		}308312 	}309-	assert headers.len == 6313+	assert headers.len == 7310314 	for i in 1 .. headers.len {311-		assert headers[i] - headers[i - 1] == 7315+		assert headers[i] - headers[i - 1] in [6, 7]312316 	}317+	// The last block ends at the bottom of the body, right above the status bar.318+	assert lines.len - 2 - separators.last() <= 1313319 }

view file

v.mod+1 −1
@@ -1,6 +1,6 @@11 Module {22 	name: 'koh3'3-	version: '3.0.67'3+	version: '3.0.68'44 	description: 'One SQLite file per repo, one line of history.'55 	license: 'MIT'66 }

view file