Use natural numbering in /fork picker

This commit is contained in:
Yaroslav Volovich
2026-02-23 19:31:36 +00:00
parent c621fcf2a6
commit 81ef5ff08e
2 changed files with 8 additions and 9 deletions

View File

@@ -318,7 +318,7 @@ impl ForkTurnPickerScreen {
if display_number == 0 || display_number > self.turns.len() {
return;
}
let idx = self.turns.len().saturating_sub(display_number);
let idx = display_number.saturating_sub(1);
self.select_index(idx);
}
@@ -384,7 +384,7 @@ impl ForkTurnPickerScreen {
key_hint::plain(KeyCode::Enter).into(),
" to fork, ".dim(),
key_hint::plain(KeyCode::Esc).into(),
" to cancel, digits jump (1 = latest)".dim(),
" to cancel, digits jump to row".dim(),
]);
Paragraph::new(hints)
.wrap(Wrap { trim: false })
@@ -394,7 +394,7 @@ impl ForkTurnPickerScreen {
fn render_turn_list(&self, area: Rect, buf: &mut Buffer) {
let block = Block::default()
.borders(Borders::ALL)
.title("Turns (oldest to newest, 1 = latest)");
.title("Turns (oldest to newest)");
let inner = block.inner(area);
block.render(area, buf);
@@ -487,7 +487,7 @@ impl ForkTurnPickerScreen {
Line::from(vec![
"Selected: ".dim(),
format!("{display_number}:").cyan(),
if display_number == 1 {
if self.selected + 1 == self.turns.len() {
Span::from(" (latest)").dim()
} else {
Span::from("")
@@ -508,7 +508,7 @@ impl ForkTurnPickerScreen {
}
fn display_turn_number(&self, idx: usize) -> usize {
self.turns.len().saturating_sub(idx)
idx.saturating_add(1)
}
}

View File

@@ -5,8 +5,8 @@ expression: terminal.backend()
/fork select a turn
Choose a turn from the current conversation to fork after.
3 turns available. The newest turn is selected by default.
┌Turns (oldest to newest, 1 = latest)──────────────────────────────────────┐
3: Initial bug report with stack trace and repro steps │
┌Turns (oldest to newest)──────────────────────────────────────────────────┐
1: Initial bug report with stack trace and repro steps │
│ Short answer: not via the current app-server protocol. │
│› 2: Please also handle macOS path edge cases when filenames contain ... │
│ Acknowledged. I will cover macOS path handling and spaces. │
@@ -22,5 +22,4 @@ Choose a turn from the current conversation to fork after.
│ │
│Forking here omits 1 newer turn from the new thread. │
└──────────────────────────────────────────────────────────────────────────┘
Use ↑/↓ (or j/k) to choose, enter to fork, esc to cancel, digits jump (1 =
latest)
Use ↑/↓ (or j/k) to choose, enter to fork, esc to cancel, digits jump to row