feat(ui): add configurable scrollback lines and new‑message alert badge

Introduce `ui.scrollback_lines` (default 2000) to cap the number of chat lines kept in memory, with `0` disabling trimming. Implement automatic trimming of older lines, maintain a scroll offset, and show a “↓ New messages (press G)” badge when new messages arrive off‑screen. Update core UI settings, TUI rendering, chat app state, migrations, documentation, and changelog to reflect the new feature.
This commit is contained in:
2025-10-12 14:23:04 +02:00
parent 82078afd6d
commit 60c859b3ab
6 changed files with 170 additions and 3 deletions

View File

@@ -708,6 +708,8 @@ pub struct UiSettings {
pub show_onboarding: bool,
#[serde(default = "UiSettings::default_input_max_rows")]
pub input_max_rows: u16,
#[serde(default = "UiSettings::default_scrollback_lines")]
pub scrollback_lines: usize,
}
impl UiSettings {
@@ -738,6 +740,10 @@ impl UiSettings {
const fn default_input_max_rows() -> u16 {
5
}
const fn default_scrollback_lines() -> usize {
2000
}
}
impl Default for UiSettings {
@@ -750,6 +756,7 @@ impl Default for UiSettings {
wrap_column: Self::default_wrap_column(),
show_onboarding: Self::default_show_onboarding(),
input_max_rows: Self::default_input_max_rows(),
scrollback_lines: Self::default_scrollback_lines(),
}
}
}