diff --git a/README.md b/README.md index ca5fde8..da8adbe 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,9 @@ or, from a checkout, `cargo build --release`, which writes download a GGUF for you, smallest quantization first; set `HF_TOKEN` in your environment for gated repositories. 3. Run `computearena`. In a terminal this opens the full-screen interface: - arrow keys move, Enter selects, Esc goes back, Ctrl+C leaves, and the - wheel or PgUp/PgDn scrolls long output. It asks which + arrow keys move, Enter selects, Esc goes back, Ctrl+C leaves, and + PgUp/PgDn scrolls long output. The terminal retains the mouse, so URLs can + be clicked and text can be selected and copied normally. It asks which runtime to use only when the answer is not obvious — one installed, or the one you used last — shows the executable it found (or offers to install one), and opens a menu: run benchmarks, submit previous benchmarks, list diff --git a/crates/computearena-cli/src/tui/app.rs b/crates/computearena-cli/src/tui/app.rs index c129a90..cf009ac 100644 --- a/crates/computearena-cli/src/tui/app.rs +++ b/crates/computearena-cli/src/tui/app.rs @@ -739,11 +739,6 @@ impl App { // ---- key handling ---------------------------------------------------- - /// A wheel notch, or any other coarse scroll. - pub(crate) fn scroll(&mut self, delta: isize) { - self.move_cursor(delta); - } - pub(crate) fn on_key(&mut self, key: ratatui::crossterm::event::KeyEvent) -> Result<()> { use ratatui::crossterm::event::{KeyCode, KeyModifiers}; if key.modifiers.contains(KeyModifiers::CONTROL) && matches!(key.code, KeyCode::Char('c')) { diff --git a/crates/computearena-cli/src/tui/draw.rs b/crates/computearena-cli/src/tui/draw.rs index 8e10e19..47f3937 100644 --- a/crates/computearena-cli/src/tui/draw.rs +++ b/crates/computearena-cli/src/tui/draw.rs @@ -124,11 +124,7 @@ fn header(frame: &mut Frame, area: Rect, app: &App) { ..bar }; let name = wordmark("ComputeArena"); - let links = format!( - "{} · {} ", - COMPUTEARENA_WEBSITE.trim_start_matches("https://"), - COMPUTEARENA_DISCORD.trim_start_matches("https://") - ); + let links = format!("{} · {} ", COMPUTEARENA_WEBSITE, COMPUTEARENA_DISCORD); frame.render_widget( Paragraph::new(Line::from(Span::styled( format!(" {name}"), @@ -203,13 +199,13 @@ fn footer(frame: &mut Frame, area: Rect, app: &App) { "↑/↓ move · Space tick · a all · Enter preview · Esc back" } Screen::Reports { .. } => "↑/↓ move · Enter verify · Esc back", - Screen::Preview { .. } => "↑/↓ or wheel scroll · Enter submit · Esc back", + Screen::Preview { .. } => "↑/↓ scroll · Enter submit · Esc back", // While a job runs, Enter and Esc do nothing; once it is done, Enter // is the way on, so the footer leads with it. Screen::Running if app.job.as_ref().is_none_or(Job::finished) => { - "Enter continue · ↑/↓ or wheel scroll · PgUp/PgDn page · Esc back" + "Enter continue · ↑/↓ scroll · PgUp/PgDn page · Esc back" } - Screen::Running => "↑/↓ or wheel scroll · PgUp/PgDn page · Ctrl+C quit", + Screen::Running => "↑/↓ scroll · PgUp/PgDn page · Ctrl+C quit", Screen::Loading { .. } => "working…", Screen::HubSearch { .. } => "type a search · Enter search · Esc back", Screen::HubModels { .. } => "↑/↓ move · Enter list files · Esc back", diff --git a/crates/computearena-cli/src/tui/mod.rs b/crates/computearena-cli/src/tui/mod.rs index c01fcce..3d214fc 100644 --- a/crates/computearena-cli/src/tui/mod.rs +++ b/crates/computearena-cli/src/tui/mod.rs @@ -12,9 +12,7 @@ use crate::adapters::Runtime; use crate::reports::Paths; use anyhow::{Context, Result}; use app::App; -use ratatui::crossterm::event::{ - self, DisableMouseCapture, EnableMouseCapture, Event, KeyEventKind, MouseEventKind, -}; +use ratatui::crossterm::event::{self, Event, KeyEventKind}; use ratatui::crossterm::execute; use ratatui::crossterm::terminal::{ disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen, @@ -29,9 +27,6 @@ use std::time::Duration; /// a duplicate of the terminal taken before any of that happens. type Screen = Terminal>; -/// Lines moved per wheel notch. -const SCROLL_LINES: isize = 3; - pub(crate) fn session( runtime: Runtime, choose_runtime: bool, @@ -60,7 +55,7 @@ fn install_panic_hook() { std::panic::set_hook(Box::new(move |info| { let _ = disable_raw_mode(); if let Ok(mut file) = job::tty() { - let _ = ratatui::crossterm::execute!(file, DisableMouseCapture, LeaveAlternateScreen); + let _ = ratatui::crossterm::execute!(file, LeaveAlternateScreen); } previous(info); })); @@ -70,19 +65,15 @@ fn start() -> Result { install_panic_hook(); let mut file = job::tty()?; enable_raw_mode()?; - // Mouse capture is what delivers wheel events; the terminal's own text - // selection still works with Shift held. - execute!(file, EnterAlternateScreen, EnableMouseCapture)?; + // Leave mouse events with the terminal so URLs are clickable and normal + // drag selection/copy works without requiring a modifier key. + execute!(file, EnterAlternateScreen)?; Ok(Terminal::new(CrosstermBackend::new(file))?) } fn stop(terminal: &mut Screen) { let _ = disable_raw_mode(); - let _ = execute!( - terminal.backend_mut(), - DisableMouseCapture, - LeaveAlternateScreen - ); + let _ = execute!(terminal.backend_mut(), LeaveAlternateScreen); let _ = terminal.show_cursor(); let _ = terminal.backend_mut().flush(); } @@ -96,11 +87,6 @@ fn run(terminal: &mut Screen, app: &mut App) -> Result<()> { if event::poll(idle)? { match event::read()? { Event::Key(key) if key.kind == KeyEventKind::Press => app.on_key(key)?, - Event::Mouse(mouse) => match mouse.kind { - MouseEventKind::ScrollUp => app.scroll(-SCROLL_LINES), - MouseEventKind::ScrollDown => app.scroll(SCROLL_LINES), - _ => {} - }, Event::Resize(_, _) => {} _ => {} }