Skip to content

Commit d64b8b6

Browse files
fix: address review findings and improve help footer layout
- Use maybePrefetch helper in handlePageDownKey for consistency - Clamp flex column widths to min 1 in both queue and tasks views - Add 'o' key to keyboard shortcuts help overlay (queue and tasks) - Move 'o options' next to 'F fix' in queue help footer - Split tasks help footer into two balanced rows Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6a64a15 commit d64b8b6

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

cmd/roborev/tui/handlers.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,12 @@ func (m model) handlePageDownKey() (tea.Model, tea.Cmd) {
474474
m.selectedIdx = nextIdx
475475
}
476476
m.updateSelectedJobID()
477-
if m.canPaginate() {
478-
if reachedEnd || m.countVisibleJobsAfter(m.selectedIdx) < queuePrefetchBuffer {
479-
m.loadingMore = true
480-
return m, m.fetchMoreJobs()
481-
}
477+
if reachedEnd && m.canPaginate() {
478+
m.loadingMore = true
479+
return m, m.fetchMoreJobs()
480+
}
481+
if cmd := m.maybePrefetch(m.selectedIdx); cmd != nil {
482+
return m, cmd
482483
}
483484
case viewReview:
484485
m.reviewScroll += pageSize

cmd/roborev/tui/render_log.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ func helpLines() []string {
130130
{"x", "Cancel running/queued job"},
131131
{"r", "Re-run completed/failed job"},
132132
{"F", "Trigger fix for selected review"},
133+
{"o", "Column options (visibility, order, borders)"},
133134
{"T", "Open Tasks view"},
134135
{"D", "Toggle distraction-free mode"},
135136
},
@@ -186,6 +187,7 @@ func helpLines() []string {
186187
{"R", "Re-trigger fix (rebase)"},
187188
{"l", "View agent log"},
188189
{"x", "Cancel running/queued fix job"},
190+
{"o", "Column options (order, borders)"},
189191
{"esc/T", "Back to queue"},
190192
},
191193
},

cmd/roborev/tui/render_queue.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ func (m model) getVisibleJobs() []storage.ReviewJob {
3030
func (m model) queueHelpRows() [][]helpItem {
3131
row1 := []helpItem{
3232
{"x", "cancel"}, {"r", "rerun"}, {"l", "log"}, {"p", "prompt"},
33-
{"c", "comment"}, {"y", "copy"}, {"m", "commit msg"}, {"F", "fix"},
33+
{"c", "comment"}, {"y", "copy"}, {"m", "commit msg"}, {"F", "fix"}, {"o", "options"},
3434
}
3535
row2 := []helpItem{
3636
{"↑/↓", "nav"}, {"↵", "review"}, {"a", "handled"},
3737
}
3838
if !m.lockedRepoFilter || !m.lockedBranchFilter {
3939
row2 = append(row2, helpItem{"f", "filter"})
4040
}
41-
row2 = append(row2, helpItem{"h", "hide"}, helpItem{"o", "options"}, helpItem{"D", "focus"}, helpItem{"T", "tasks"}, helpItem{"?", "help"}, helpItem{"q", "quit"})
41+
row2 = append(row2, helpItem{"h", "hide"}, helpItem{"D", "focus"}, helpItem{"T", "tasks"}, helpItem{"?", "help"}, helpItem{"q", "quit"})
4242
return [][]helpItem{row1, row2}
4343
}
4444
func (m model) queueHelpLines() int {
@@ -337,9 +337,9 @@ func (m model) renderQueueView() string {
337337
continue
338338
}
339339
if flexContentTotal > 0 {
340-
colWidths[c] = remaining * contentWidth[c] / flexContentTotal
340+
colWidths[c] = max(remaining*contentWidth[c]/flexContentTotal, 1)
341341
} else {
342-
colWidths[c] = remaining / totalFlex
342+
colWidths[c] = max(remaining/totalFlex, 1)
343343
}
344344
distributed += colWidths[c]
345345
}

cmd/roborev/tui/render_tasks.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ func (m model) renderTasksView() string {
164164

165165
// Help row calculation for visible rows
166166
tasksHelpRows := [][]helpItem{
167-
{{"enter", "view"}, {"P", "parent"}, {"p", "patch"}, {"A", "apply"}, {"l", "log"}, {"x", "cancel"}, {"o", "options"}, {"?", "help"}, {"T/esc", "back"}},
167+
{{"enter", "view"}, {"P", "parent"}, {"p", "patch"}, {"A", "apply"}, {"l", "log"}},
168+
{{"x", "cancel"}, {"o", "options"}, {"?", "help"}, {"T/esc", "back"}},
168169
}
169170
tasksHelpLines := len(reflowHelpRows(tasksHelpRows, m.width))
170171
visibleRows := m.height - (6 + tasksHelpLines) // title + header + separator + status + scroll + help(N)
@@ -247,9 +248,9 @@ func (m model) renderTasksView() string {
247248
distributed := 0
248249
for _, c := range flexCols {
249250
if flexContentTotal > 0 {
250-
colWidths[c] = remaining * contentWidth[c] / flexContentTotal
251+
colWidths[c] = max(remaining*contentWidth[c]/flexContentTotal, 1)
251252
} else {
252-
colWidths[c] = remaining / totalFlex
253+
colWidths[c] = max(remaining/totalFlex, 1)
253254
}
254255
distributed += colWidths[c]
255256
}

0 commit comments

Comments
 (0)