id stringlengths 20 30 | source stringclasses 1
value | chunk_index int64 0 520k | token_count int32 154 512 | content stringlengths 185 57.5k |
|---|---|---|---|---|
rust_dataset_chunk_2600 | rust_dataset.txt | 2,600 | 512 | let rows = source.search(&roots("")).await.unwrap();
let title = |id: &str| {
rows.iter().find(|r| r.handle == handle(id)).map(|r| r.title.text.clone()).unwrap()
};
assert_eq!(title("root"), "fix the flaky sync test");
assert_eq!(title("brief"), "Rewrite the sync_down... |
rust_dataset_chunk_2601 | rust_dataset.txt | 2,601 | 512 | await.unwrap();
assert_eq!(preview.first_prompt.as_deref(), Some("fix the flaky sync test"));
assert_eq!(preview.last_assistant.as_deref(), Some("switched to a fixed clock"));
assert_eq!(source.find_by_id("ro").await.unwrap().len(), 1);
assert!(source.find_by_id("r%").await.unwrap().is_e... |
rust_dataset_chunk_2602 | rust_dataset.txt | 2,602 | 512 | io::test]
async fn the_host_mode_keeps_this_hosts_unrecorded_sessions() {
const OTHER: &str = "0190bbbb0000700080000000000000b1";
let host = |id: &str| HostId(Uuid::try_parse(id).unwrap());
let db = AiSessionDatabase::in_memory().await.unwrap();
for (i, (id, on)) in
[("he... |
rust_dataset_chunk_2603 | rust_dataset.txt | 2,603 | 512 | ("src");
let db = AiSessionDatabase::in_memory().await.unwrap();
for (i, (id, on)) in [("here", HOST), ("there", OTHER)].into_iter().enumerate() {
let mut m = message(id, None, Role::User, "words", i64::try_from(i).unwrap());
m.cwd = Some(cwd.clone());
m.host = Some(... |
rust_dataset_chunk_2604 | rust_dataset.txt | 2,604 | 512 | agent (`agent:`)
/// and model (`m:`). With [`DbFilter::roots_only`], forks and subagents are grouped under
/// their roots (counted in [`SessionRow::children`]; a child's match is its root's).
pub db: DbFilter,
/// Maximum rows; 0 for unbounded.
pub limit: usize,
}
/// How a session relates to th... |
rust_dataset_chunk_2605 | rust_dataset.txt | 2,605 | 512 | Buf>,
/// The git repository root the session ran in, if any. Only looked up for this host's
/// sessions.
pub git_root: Option<PathBuf>,
pub branch: Option<String>,
pub model: Option<String>,
/// The host the session was recorded on, by id (a UUID's simple form; see
/// [`super::simple_host... |
rust_dataset_chunk_2606 | rust_dataset.txt | 2,606 | 512 | -> bool {
row.title.text.trim().is_empty()
}
/// The preview for one session: its opening prompt and where it left off. Tool calls and
/// reasoning never appear here.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct SessionPreview {
pub first_prompt: Option<String>,
pub last_assistant: Option<S... |
rust_dataset_chunk_2607 | rust_dataset.txt | 2,607 | 512 | ;
}
fn push(&mut self, entry: TranscriptEntry) {
self.transcript.entries.push(entry);
self.transcript.messages.push(self.at);
}
/// `text` as an entry of the kind `entry` makes, unless it's blank.
fn text(&mut self, text: &str, entry: fn(String) -> TranscriptEntry) {
if !te... |
rust_dataset_chunk_2608 | rust_dataset.txt | 2,608 | 512 | atuin_threads_list" | "atuin_ai_session_list" => "🐢 atuin threads list",
"atuin_threads_read" | "atuin_ai_session_read" => "🐢 atuin threads read",
_ => name,
}
}
/// Where the picker's sessions come from.
#[async_trait]
pub trait SessionSource: Send + Sync {
/// Root rows matching `filter`: b... |
rust_dataset_chunk_2609 | rust_dataset.txt | 2,609 | 512 | doesn't know them.
async fn analyse(&self, _session: &HarnessSession) -> eyre::Result<Option<Analysis>> {
Ok(None)
}
/// Something that changes whenever the sessions may have: an idle picker searches again only
/// once it does. `None` when the source can't tell, so it always does.
fn stam... |
rust_dataset_chunk_2610 | rust_dataset.txt | 2,610 | 512 | match harness {
HarnessKind::ClaudeCode => Some("claude"),
HarnessKind::Codex => Some("codex"),
HarnessKind::Grok => Some("grok"),
HarnessKind::Opencode => Some("opencode"),
HarnessKind::Pi => Some("pi"),
HarnessKind::Omp => Some("omp"),
HarnessKind::Copilot =... |
rust_dataset_chunk_2611 | rust_dataset.txt | 2,611 | 512 | as _;
use atuin_domain::record::HostId;
use crossterm::event::{Event, KeyEvent, KeyEventKind, MouseButton, MouseEvent, MouseEventKind};
use jiff::Timestamp;
use ratatui::buffer::Buffer;
use ratatui::layout::{Position, Rect};
use super::chooser::{Chooser, Destination};
use super::keymap::{Action, Keymap, KeymapSet};
u... |
rust_dataset_chunk_2612 | rust_dataset.txt | 2,612 | 512 | under the list, the detail pane beside it on
/// wide terminals, and Inspect's conversation.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Pane {
Strip = 0,
Side = 1,
Inspect = 2,
}
const PANES: [Pane; 3] = [Pane::Strip, Pane::Side, Pane::Inspect];
/// A pane's scroll position, and where and how ... |
rust_dataset_chunk_2613 | rust_dataset.txt | 2,613 | 512 | self.len
} else {
self.len.saturating_sub(self.height)
}
}
/// Scroll by `by` lines (up when negative), within the text.
fn scroll(&mut self, by: isize) {
let offset = self.offset.saturating_add_signed(by);
self.offset = offset.min(self.max_offset());
}
}
/... |
rust_dataset_chunk_2614 | rust_dataset.txt | 2,614 | 512 | keys, with a cursor, and scrolls.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ChildrenView {
/// The session whose children these are: selecting another collapses the list.
pub session: HarnessSession,
pub cursor: usize,
/// The first row shown.
pub offset: usize,
/// How many rows showed... |
rust_dataset_chunk_2615 | rust_dataset.txt | 2,615 | 512 | the workspace has none: only for the first results,
/// and only until the user picks a mode with ctrl-r.
workspace_fallback: bool,
/// The generation of the newest search sent to the worker.
pub issued: u64,
/// The generation whose results are on screen.
pub applied: u64,
last_filter: Op... |
rust_dataset_chunk_2616 | rust_dataset.txt | 2,616 | 512 | String,
/// Whether the results on screen are narrowed by chips (`b:`, `m:`, `h:`) as well.
pub applied_chips: bool,
/// The session whose preview was shown last, and when a frame was first drawn with another
/// selected: the preview keeps showing it for [`HOLD`] after the selection moves to one not
... |
rust_dataset_chunk_2617 | rust_dataset.txt | 2,617 | 512 | , while it's open.
pub chooser: Option<Chooser>,
/// What continuing each session elsewhere would flatten, once read (see
/// [`Request::Flatten`](super::worker::Request::Flatten)); `Err` when it can't be read.
pub flattened: HashMap<HarnessSession, Result<Flattened, String>>,
/// The last flattenin... |
rust_dataset_chunk_2618 | rust_dataset.txt | 2,618 | 512 | keymaps: KeymapSet::defaults(settings),
pending_vim_key: None,
tab_index: 0,
list: ListState::default(),
results: Vec::new(),
context,
mode: FilterMode::Global,
workspace_fallback: false,
issued: 0,
a... |
rust_dataset_chunk_2619 | rust_dataset.txt | 2,619 | 512 | : FilterMode) -> bool {
match mode {
FilterMode::Workspace => self.context.git_root.is_some(),
FilterMode::Branch => self.context.git_root.is_some() && self.context.branch.is_some(),
FilterMode::Global | FilterMode::Host | FilterMode::Directory => true,
}
}
/... |
rust_dataset_chunk_2620 | rust_dataset.txt | 2,620 | 512 | ::Uuid::try_parse(&ctx.host_id).unwrap_or_default();
db.host = Some(HostId(id));
db.or_unrecorded = true;
}
FilterMode::Workspace => db.workspace.clone_from(&ctx.git_root),
FilterMode::Directory => db.directory = Some(ctx.cwd.clone()),
Filt... |
rust_dataset_chunk_2621 | rust_dataset.txt | 2,621 | 512 | arrowed = self.last_filter.is_some() && text.is_empty() && !chips;
if std::mem::take(&mut self.workspace_fallback) && rows.is_empty() && unnarrowed {
self.mode = FilterMode::Global;
self.status = Some((FELL_BACK.to_owned(), Meaning::Annotation));
return true;
}
... |
rust_dataset_chunk_2622 | rust_dataset.txt | 2,622 | 512 | }
/// Whether `session`'s preview is to be read: it isn't yet, or a refresh wants it again.
pub fn wants_preview(&self, session: &HarnessSession) -> bool {
!self.previews.contains_key(session) || self.stale.contains(session)
}
/// A preview read.
pub fn apply_preview(&mut self, session... |
rust_dataset_chunk_2623 | rust_dataset.txt | 2,623 | 512 | {
self.stale_transcripts.remove(&session);
let Ok(transcript) = read else {
// Unless one was read before, shown as it is.
self.unreadable.insert(session);
return;
};
self.unreadable.remove(&session);
if let Some(t) = self.transcripts.get_mut(... |
rust_dataset_chunk_2624 | rust_dataset.txt | 2,624 | 512 | /// to hold when the selection moves on; once it has, the hold runs from the first frame
/// drawn without it.
pub fn preview_drawn(&mut self, now: Instant) {
let Some(selected) = self.selected().cloned() else {
return;
};
if self.previews.contains_key(&selected.handle) {
... |
rust_dataset_chunk_2625 | rust_dataset.txt | 2,625 | 512 | id but which can't be resumed: it is selected, its
/// plan is the reason (shown in the status row), and it stays first until the query changes.
pub fn pin(&mut self, row: SessionRow, why: NotResumable) {
self.status =
Some((format!("can't resume {}: {why}", row.handle.session), Meaning::Al... |
rust_dataset_chunk_2626 | rust_dataset.txt | 2,626 | 512 | Settings, event: &Event) -> InputAction {
match event {
Event::Key(k) => self.handle_key_input(settings, k),
Event::Mouse(m) => self.handle_mouse_input(settings, *m),
Event::Paste(text) => {
// Not into the query while the chooser is open: as with keys, it's t... |
rust_dataset_chunk_2627 | rust_dataset.txt | 2,627 | 512 | Action::Continue, InputAction::CopyText);
}
_ => {}
}
// The chooser is for the session it opened on.
if self.chooser.is_some() {
return InputAction::Continue;
}
let down = match event.kind {
MouseEventKind::ScrollDown => true,
... |
rust_dataset_chunk_2628 | rust_dataset.txt | 2,628 | 512 | ctx));
(action, None)
} else if let KeyCodeValue::Char(c) = single.code
&& !single.ctrl
&& !single.alt
&& keymap.has_sequence_starting_with(&single)
{
(Some(Action::Noop), Some(c))
} else {
(keymap.resolve(&KeyInput::Single... |
rust_dataset_chunk_2629 | rust_dataset.txt | 2,629 | 512 | .clone(),
cursor: 0,
offset: 0,
height: 1,
});
}
/// A key while Inspect's children list is expanded: moving keys move in it, and esc
/// collapses it. `None` for the keys it leaves alone.
fn children_action(&mut self, action: Action) -> Option<InputAction> {... |
rust_dataset_chunk_2630 | rust_dataset.txt | 2,630 | 512 | Action::CursorStart => self.input.start(),
Action::CursorEnd => self.input.end(),
Action::DeleteCharBefore => {
self.input.back();
}
Action::DeleteCharAfter => {
self.input.remove();
}
Action::DeleteWordB... |
rust_dataset_chunk_2631 | rust_dataset.txt | 2,631 | 512 | (1);
let by = match action {
Action::PreviewUp => -1,
Action::PreviewDown => 1,
Action::PreviewPageUp => -page,
_ => page,
};
self.scroll_pane(pane, by);
... |
rust_dataset_chunk_2632 | rust_dataset.txt | 2,632 | 512 | uin_client::ai_session::HarnessKind;
use crossterm::event::{KeyCode, KeyModifiers};
use rstest::rstest;
use super::*;
use crate::resume_tui::fake;
fn settings() -> Settings {
Settings::utc()
}
fn state_in(context: ResumeContext) -> State {
State::new(&settings(), context, ... |
rust_dataset_chunk_2633 | rust_dataset.txt | 2,633 | 512 | let mut state = opened(Some(FilterMode::Workspace), true, true);
assert_eq!(state.filter().db.workspace, Some(PathBuf::from(fake::REPO)));
let (generation, _) = state.next_search().unwrap();
state.apply_results(generation, Vec::new());
assert_eq!(state.mode, FilterMode::Global);
... |
rust_dataset_chunk_2634 | rust_dataset.txt | 2,634 | 512 | ::CONTROL));
state.mode
})
.collect();
// From every session narrowing to the workspace, its branch and the directory.
assert_eq!(seen, vec![
FilterMode::Workspace,
FilterMode::Branch,
FilterMode::Directory,
FilterMo... |
rust_dataset_chunk_2635 | rust_dataset.txt | 2,635 | 512 | 1)));
assert_eq!(state.results.len(), 3, "old list stays until the newest answers");
assert_eq!(state.applied, g1);
assert!(state.apply_results(g3, rows(2)));
assert_eq!(state.results.len(), 2);
assert_eq!(state.applied, g3);
}
#[rstest]
fn refresh_keeps_the_selectio... |
rust_dataset_chunk_2636 | rust_dataset.txt | 2,636 | 512 | State::new(&settings(), fake::context(), "s7a1b2c");
let pinned = fake::row(HarnessKind::ClaudeCode, "s7a1b2c", "t");
state.pin(pinned.clone(), NotResumable::NotInstalled("claude".to_owned()));
assert_eq!(state.selected(), Some(&pinned));
assert!(state.status.as_ref().is_some_and(|(s, _... |
rust_dataset_chunk_2637 | rust_dataset.txt | 2,637 | 512 | ();
let other = rows(2).remove(1);
state.apply_results(generation, vec![pi.clone(), other.clone()]);
assert_eq!(state.results, vec![claude.clone(), pi, other]);
state.input = Cursor::from("other".to_owned());
let (generation, _) = state.next_search().unwrap();
state.appl... |
rust_dataset_chunk_2638 | rust_dataset.txt | 2,638 | 512 | fn panes_scroll_within_their_text() {
let mut scroll = PaneScroll {
session: Some(rows(1)[0].handle.clone()),
height: 4,
len: 10,
..PaneScroll::default()
};
scroll.scroll(-3);
assert_eq!(scroll.offset, 0);
scroll.scroll(100);
... |
rust_dataset_chunk_2639 | rust_dataset.txt | 2,639 | 512 | (KeyCode::Char('t'), KeyModifiers::CONTROL));
assert_eq!(state.input.as_str(), "flaky agent:codex");
// The short form is cycled too, and comes back as the long one.
state.input = Cursor::from("a:opencode flaky".to_owned());
let _ = state.handle_input(&s, &key(KeyCode::Char('t'), KeyModi... |
rust_dataset_chunk_2640 | rust_dataset.txt | 2,640 | 512 | , KeyCode::Esc, KeyModifiers::NONE), InputAction::Continue);
assert_eq!(state.tab_index, 0);
assert_eq!(
press(&mut state, KeyCode::Char('l'), KeyModifiers::CONTROL),
InputAction::Redraw
);
}
#[rstest]
fn typing_inserts_and_navigation_respects_invert() {
... |
rust_dataset_chunk_2641 | rust_dataset.txt | 2,641 | 512 | _input(&s, &key(KeyCode::Char('i'), KeyModifiers::NONE));
assert_eq!(state.keymap_mode, KeymapMode::VimInsert);
}
/// Drawn bottom-up, each root's forks come before it, last first, so they read top-down
/// beneath it on screen.
#[rstest]
fn forks_sit_beneath_their_root_bottom_up() {
... |
rust_dataset_chunk_2642 | rust_dataset.txt | 2,642 | 512 | input has come for as long. Each wait ends in about a
/// millisecond of busy polling (crossterm rounds what's left down to whole milliseconds, and polls
/// without a timeout until it's gone), so an idle picker waits longer. The cursor position queries
/// follow input (a resize, ctrl-l), and so still get their turn ... |
rust_dataset_chunk_2643 | rust_dataset.txt | 2,643 | 512 | /// Whether more input is waiting: the picker catches up with it before drawing again.
pub fn behind(&self) -> bool {
!self.rx.is_empty()
}
/// The next event; `None` once reading has failed.
pub async fn next(&mut self) -> Option<io::Result<Event>> {
self.rx.recv().await
}
}
impl... |
rust_dataset_chunk_2644 | rust_dataset.txt | 2,644 | 512 | bool)>> = Mutex::new(None);
fn take_setup() -> Option<(bool, bool)> {
SETUP.lock().take()
}
/// Put the terminal back as [`TuiStdout::new`] found it, before a panic is reported, so the report
/// is readable and the shell isn't left in raw mode with the mouse captured. Once per process;
/// it does nothing while... |
rust_dataset_chunk_2645 | rust_dataset.txt | 2,645 | 512 | Ok(Self {
writer,
inline_mode,
no_mouse,
})
}
}
impl Drop for TuiStdout {
fn drop(&mut self) {
// Already undone when a panic's hook got here first.
if take_setup().is_some() {
restore(&mut self.writer, self.inline_mode, self.no_mo... |
rust_dataset_chunk_2646 | rust_dataset.txt | 2,646 | 512 | ();
state.apply_results(generation, rows);
}
for row in &state.results {
state.previews.insert(row.handle.clone(), source.preview(&row.handle).await.unwrap());
let children = source.children(&row.handle).await.unwrap();
state.children.insert(row.handle.clone(), children);
... |
rust_dataset_chunk_2647 | rust_dataset.txt | 2,647 | 512 | h: u16) -> String {
let mut state = loaded(settings, query, tab).await;
text(&render(&mut state, settings, w, h))
}
#[rstest]
#[tokio::test]
async fn full_frame_has_history_search_chrome() {
let out = frame(&settings(), "", 0, 100, 30).await;
let lines: Vec<&str> = out.lines().collect();
assert!(l... |
rust_dataset_chunk_2648 | rust_dataset.txt | 2,648 | 512 | }");
// Every session: only clearing the search finds more.
state.mode = atuin_client::settings::AiSessionFilterMode::Global;
let out = text(&render(&mut state, &s, 140, 30));
assert!(out.contains(r#"No threads match "zzzqqq""#), "{out}");
assert!(!out.contains("ctrl-r to"), "{out}");
// In vim... |
rust_dataset_chunk_2649 | rust_dataset.txt | 2,649 | 512 | > ` (the scope's initial) in the ultracompact picker.
assert!(lines.iter().any(|l| l.contains("> ")), "{height} {step}: {out}");
let place = |l: &str| l.contains(" msgs") || l.contains(" msg ");
let heading = |l: &str| l.contains(" ────");
// A line with nothing on it but... |
rust_dataset_chunk_2650 | rust_dataset.txt | 2,650 | 512 | .contains(" > ")).unwrap();
let selected = lines[at];
assert!(selected.contains(" > Add an interactive resume picker"), "{selected}");
assert!(!selected.contains("142"), "the count is under the title: {selected}");
// When, the agent, where and how many messages, under the title.
assert!(lines[at + ... |
rust_dataset_chunk_2651 | rust_dataset.txt | 2,651 | 512 | out.lines().enumerate().find(|(_, l)| l.contains("Bisect the aarch64")).unwrap();
let x = u16::try_from(line.find("Bisect").unwrap()).unwrap();
let cell = &buf[(x, u16::try_from(y).unwrap())];
assert!(!cell.modifier.contains(ratatui::style::Modifier::DIM), "remote rows aren't dimmed");
let remote = st... |
rust_dataset_chunk_2652 | rust_dataset.txt | 2,652 | 512 | ::test]
async fn inspect_says_a_remote_session_is_restored() {
let mut s = settings();
s.threads.filter_mode = Some(atuin_client::settings::AiSessionFilterMode::Global);
let mut state = loaded(&s, "aarch64", 1).await;
let out = text(&render(&mut state, &s, 120, 30));
let line = out.lines().find(|l| ... |
rust_dataset_chunk_2653 | rust_dataset.txt | 2,653 | 512 | buf[(at("flaky"), y)].modifier.contains(ratatui::style::Modifier::BOLD));
assert!(!buf[(at("record"), y)].modifier.contains(ratatui::style::Modifier::BOLD));
}
#[rstest]
#[case("agent:codex")]
#[case("a:codex")]
#[tokio::test]
async fn tokens_render_as_chips(#[case] token: &str) {
let mut state = loaded(&setti... |
rust_dataset_chunk_2654 | rust_dataset.txt | 2,654 | 512 | test]
async fn the_detail_pane_and_inspect_render_markdown() {
let out = frame(&settings(), "", 0, 150, 50).await;
assert!(out.contains("│ • a preview pane with the first prompt and the last"), "{out}");
assert!(out.contains("Harness │ Forks │ Subagents"), "{out}");
assert!(out.contains("───────────... |
rust_dataset_chunk_2655 | rust_dataset.txt | 2,655 | 512 | out}");
assert!(!out.contains("Review the resume picker diff"), "{out}");
assert!(out.lines().any(|l| l.trim_matches(['│', ' ']) == "Messages 142"), "{out}");
// All the input, and what it was made of.
assert!(
out.contains(
"Tokens in 3.2M (327k uncached · 2.7M cache read · 17... |
rust_dataset_chunk_2656 | rust_dataset.txt | 2,656 | 512 | () {
let mut s = settings();
s.invert = true;
let out = frame(&s, "", 0, 100, 30).await;
let lines: Vec<&str> = out.lines().collect();
assert!(lines[1].contains("ctrl-r "), "input first when inverted: {out}");
// The newest is at the top, under today's heading, with where it ran under it.
as... |
rust_dataset_chunk_2657 | rust_dataset.txt | 2,657 | 512 | #[rstest]
#[tokio::test]
async fn wide_terminals_split_the_list_and_a_detail_pane() {
let out = frame(&settings(), "subagents", 0, 140, 30).await;
let lines: Vec<&str> = out.lines().collect();
// The divider joins the box's borders.
assert!(lines[1].contains('┬'), "{out}");
let selected = lines.iter... |
rust_dataset_chunk_2658 | rust_dataset.txt | 2,658 | 512 | , it starts at the first prompt.
let at = state.scrolls[Pane::Side as usize].offset;
assert!(at > 0);
state.scroll_pane(Pane::Side, -isize::try_from(at).unwrap());
let out = text(&render(&mut state, &s, 140, 30));
assert!(out.contains("Build atuin ai resume"), "{out}");
// Typing alone doesn't ... |
rust_dataset_chunk_2659 | rust_dataset.txt | 2,659 | 512 | as_ref().unwrap().len();
assert!(rendered < 300, "{rendered} lines rendered");
// Each frame at the top renders a couple of screens more above it.
let mut out = String::new();
for _ in 0..1000 {
state.scroll_pane(Pane::Side, -100_000);
out = text(&render(&mut state, &s, 140, 30));
... |
rust_dataset_chunk_2660 | rust_dataset.txt | 2,660 | 512 | .ready(&handle("d"), t3 + SETTLE / 2));
// Once it settles, the session it stopped on is asked for.
assert!(settle.ready(&handle("d"), t3 + SETTLE));
assert_eq!(settle.due, None);
}
// --- continuing in another harness ---------------------------------------------------------------
fn press(state: &mut St... |
rust_dataset_chunk_2661 | rust_dataset.txt | 2,661 | 512 | The selected session's chooser, opened by `action`, with what continuing flattens read.
async fn with_chooser(settings: &Settings, query: &str, action: super::state::Pending) -> State {
use atuin_common::harnesstools::continuation::Flattened;
let mut state = loaded(settings, query, 0).await;
// Idle: a se... |
rust_dataset_chunk_2662 | rust_dataset.txt | 2,662 | 512 | (&row).await);
state.open_chooser(&row, resumer.continue_targets(&row), true, Pending::Resume);
let (open, out) = at(&mut state);
assert!(out.contains("Continue in"), "inline: {out}");
assert_eq!(open, before, "{out}");
state.chooser = None;
let (closed, out) = at(&mut state);
assert_eq!(clo... |
rust_dataset_chunk_2663 | rust_dataset.txt | 2,663 | 512 | _search_to_clear() {
let mut s = settings();
s.threads.filter_mode = Some(atuin_client::settings::AiSessionFilterMode::Branch);
let mut state = loaded(&s, "", 0).await;
state.context.branch = Some("no-such-branch".to_owned());
while let Some((generation, filter)) = state.next_search() {
let ... |
rust_dataset_chunk_2664 | rust_dataset.txt | 2,664 | 512 | #[tokio::test]
async fn coming_back_opens_the_reader_at_the_match_again() {
let s = settings();
let mut state = loaded(&s, "subagents", 0).await;
read_transcript(&mut state).await;
let at_match = |out: &str| {
out.contains("Group forks and subagents") && !out.contains("Build atuin ai resume")
... |
rust_dataset_chunk_2665 | rust_dataset.txt | 2,665 | 512 | let _ = render(&mut state, &s, 140, 20);
}
let scroll = &state.scrolls[Pane::Side as usize];
assert!(!scroll.more && scroll.len > scroll.height, "{scroll:?}");
assert_eq!(scroll.offset + scroll.height, scroll.len, "{scroll:?}");
let reader = state.readers[Pane::Side as usize].as_ref().unwrap();
... |
rust_dataset_chunk_2666 | rust_dataset.txt | 2,666 | 512 | &s, 120, 30)).lines().next().unwrap().to_owned();
assert!(header(&mut state).contains("enter resume · tab edit command · esc back"));
press(&mut state, &s, "f");
assert!(header(&mut state).contains("enter fork ·"), "{}", header(&mut state));
press(&mut state, &s, "down");
assert!(header(&mut state)... |
rust_dataset_chunk_2667 | rust_dataset.txt | 2,667 | 512 | _matches(['│', ' ']).ends_with("repo"), "{out}");
}
/// An untitled session says so in the pane beside the list and in Inspect, as in the list.
#[rstest]
#[tokio::test]
async fn untitled_shows_everywhere() {
let s = settings();
let mut state = loaded(&s, "", 0).await;
state.results[0].title.text = String::... |
rust_dataset_chunk_2668 | rust_dataset.txt | 2,668 | 512 | 1].contains("│╰──"), "{out}");
assert!(!out.contains("╭ Resume in"), "no popup: {out}");
assert!(out.contains(" 2 Claude Code fork: new session, same history"), "{out}");
// The other agents under a titled rule.
let lines: Vec<&str> = out.lines().collect();
let codex = lines.iter().position(|l| l... |
rust_dataset_chunk_2669 | rust_dataset.txt | 2,669 | 512 | 5"), picked(&state, Some(HarnessKind::Pi), Pending::Resume));
let mut state = with_chooser(&s, "", Pending::Resume).await;
assert_eq!(press(&mut state, &s, "esc"), InputAction::Continue);
assert!(state.chooser.is_none(), "esc goes back to the list");
}
/// Opened with tab, the chooser edits whichever line... |
rust_dataset_chunk_2670 | rust_dataset.txt | 2,670 | 512 | ::test]
async fn an_original_that_cant_resume_is_dimmed_and_passed_over() {
use atuin_client::ai_session::HarnessKind;
use atuin_common::harnesstools::resume::ResumeError;
use super::resumer::NotResumable;
use super::state::{InputAction, Pending};
let s = chooser_settings();
let mut state = lo... |
rust_dataset_chunk_2671 | rust_dataset.txt | 2,671 | 512 | press(&mut state, &s, "down");
press(&mut state, &s, "up");
}
state.plans.insert(row.handle.clone(), plan.clone());
state.settle_chooser();
assert_eq!(state.chooser.as_ref().unwrap().selected, selected, "moved: {moved}");
state.plans.remove(&row.handle);
}
/... |
rust_dataset_chunk_2672 | rust_dataset.txt | 2,672 | 512 | , 100, 30));
assert!(out.contains("> 2 Claude Code fork: new session, same history"), "{out}");
assert_eq!(press(&mut state, &s, key), fork(&state, action), "{key}");
}
let mut state = with_chooser(&s, "", Pending::Edit).await;
assert_eq!(press(&mut state, &s, "2"), fork(&state, Pending::Ed... |
rust_dataset_chunk_2673 | rust_dataset.txt | 2,673 | 512 | FakeResumer::default();
state.open_chooser(&row, resumer.continue_targets(&row), true, Pending::Resume);
assert_eq!(state.chooser.as_ref().unwrap().selected, usize::from(fork));
}
/// A session with no conversation to fork (what continuing it would flatten found none) has its
/// fork line dimmed: no key pick... |
rust_dataset_chunk_2674 | rust_dataset.txt | 2,674 | 512 | row.host_id = fake::THIS_HOST_ID.to_owned();
row.active_at = fake::now();
let at = state.list.selected;
state.results[at] = row.clone();
state.plans.insert(row.handle.clone(), FakeResumer::default().plan(&row).await);
let targets = FakeResumer::default().continue_targets(&row);
state.open_choos... |
rust_dataset_chunk_2675 | rust_dataset.txt | 2,675 | 512 | tokio::test]
async fn a_picked_fork_is_written_then_resumed() {
use std::sync::Arc;
use atuin_client::ai_session::HarnessKind;
use super::chooser::Destination;
use super::resumer::ForkFrom;
use super::state::{Pending, Picked};
use super::{Outcome, finish_continuation, finish_fork, pick, worker... |
rust_dataset_chunk_2676 | rust_dataset.txt | 2,676 | 512 | use super::{Outcome, accept, worker};
let mut s = settings();
s.threads.filter_mode = Some(atuin_client::settings::AiSessionFilterMode::Global);
let resumer = Arc::new(FakeResumer::default());
let (requests, _responses) = worker::spawn(Arc::new(FakeSource::new()), resumer.clone());
let mut state ... |
rust_dataset_chunk_2677 | rust_dataset.txt | 2,677 | 512 | , and writes nothing.
#[rstest]
#[tokio::test]
async fn a_session_from_another_machine_is_restored_first() {
use std::sync::Arc;
use super::state::{Pending, RESTORE};
use super::worker::Response;
use super::{Outcome, accept, apply_response, resume_line, worker};
let mut s = settings();
s.threa... |
rust_dataset_chunk_2678 | rust_dataset.txt | 2,678 | 512 | an idle refresh
/// whose results no longer have the session (or the list moved under the selection): the answer,
/// when it comes, still resumes the session the enter was pressed on.
#[rstest]
#[case::plan("", true)]
#[case::restore("aarch64 release build", false)]
#[tokio::test]
async fn a_refresh_does_not_drop_a_w... |
rust_dataset_chunk_2679 | rust_dataset.txt | 2,679 | 512 | Source::new(), &row, &restore).await;
Response::Restored(row.handle.clone(), plan)
};
let outcome = respond(&mut state, answer, resumer.as_ref(), &requests);
let Some(Outcome::Resume(plan)) = outcome else {
panic!("{outcome:?}");
};
let id = row.handle.session.to_string();
if her... |
rust_dataset_chunk_2680 | rust_dataset.txt | 2,680 | 512 | Event::Key(KeyEvent::new(KeyCode::Char(c), modifiers))
}
/// An enter waiting on its session's plan, then the user changing the search (typing, or ctrl-r
/// for the next mode) before it comes: new results may select another session, so the enter is
/// dropped with its status line, and the plan, when it comes, do... |
rust_dataset_chunk_2681 | rust_dataset.txt | 2,681 | 512 | est]
#[tokio::test]
async fn changing_the_search_drops_a_continuation() {
use std::sync::Arc;
use atuin_client::ai_session::HarnessKind;
use super::chooser::Destination;
use super::state::{Pending, Picked};
use super::{finish_continuation, handle_input, pick, worker};
let s = settings();
... |
rust_dataset_chunk_2682 | rust_dataset.txt | 2,682 | 512 | requests, false), None);
// ctrl-a moves the input's cursor to the start: the search is the same.
let ctrl = crossterm::event::KeyModifiers::CONTROL;
handle_input(&mut state, &s, &key_event('a', ctrl), &requests);
assert!(state.pending.is_some());
assert!(state.status.is_some());
}
/// A [`FakeRes... |
rust_dataset_chunk_2683 | rust_dataset.txt | 2,683 | 512 | is busy restoring one, then on a
/// third, then on the second again: the second's restore, dropped for the third's before it
/// started, is asked for again, runs, and the picker resumes it rather than waiting forever.
#[rstest]
#[tokio::test]
async fn a_restore_dropped_for_another_sessions_is_asked_for_again() {
... |
rust_dataset_chunk_2684 | rust_dataset.txt | 2,684 | 512 | plan:?}");
restored.push(session.clone());
}
Response::Abandoned(session) => abandoned.push(session.clone()),
other => panic!("unexpected {other:?}"),
}
if let Some(outcome) = respond(&mut state, response, resumer.as_ref(), &requests) {
bre... |
rust_dataset_chunk_2685 | rust_dataset.txt | 2,685 | 512 | 2));
let mut answered = Vec::new();
while !answered.contains(&c) {
let next = tokio::time::timeout(Duration::from_secs(10), responses.recv());
let response = next.await.expect("C's restore never came").expect("the worker stopped");
answered.push(match &response {
Response::R... |
rust_dataset_chunk_2686 | rust_dataset.txt | 2,686 | 512 | , status) = finish_continuation(&mut state, id, continued).unwrap();
assert_eq!(status, "continuing in Codex: 42 tool calls become notes");
let plan = match (outcome, run) {
(Outcome::Resume(plan), true) | (Outcome::Edit(plan), false) => plan,
(other, _) => panic!("{other:?}"),
... |
rust_dataset_chunk_2687 | rust_dataset.txt | 2,687 | 512 | start_continuation(&mut state, row.clone(), HarnessKind::Codex, Pending::Resume, &requests);
let first = state.continued;
start_continuation(&mut state, row.clone(), HarnessKind::Pi, Pending::Edit, &requests);
let second = state.continued;
assert_ne!(first, second);
let codex = resumer.continue... |
rust_dataset_chunk_2688 | rust_dataset.txt | 2,688 | 512 | row: row.clone(),
line: if fork {
Destination::Fork(None)
} else {
Destination::Continue(HarnessKind::Codex)
},
action: Pending::Resume,
};
assert_eq!(pick(&mut state, picked, resumer.as_ref(), &requests), None);
let id = state.continued;
... |
rust_dataset_chunk_2689 | rust_dataset.txt | 2,689 | 512 | await;
let row = state.selected().unwrap().clone();
let plan = state.plans.remove(&row.handle).expect("planned");
let picked = |line| Picked {
row: row.clone(),
line,
action: Pending::Resume,
};
let first = if fork {
Destination::Fork(None)
} else {
Desti... |
rust_dataset_chunk_2690 | rust_dataset.txt | 2,690 | 512 | worker::spawn(Arc::new(FakeSource::new()), resumer.clone());
for line in ["enter", "3"] {
let mut state = with_chooser(&s, "", Pending::Resume).await;
let chosen = state.selected().unwrap().clone();
// The refresh drops it, and the selection lands on another session.
state.results.... |
rust_dataset_chunk_2691 | rust_dataset.txt | 2,691 | 512 | ();
let theme = themes.load_theme("default");
let lines = super::panel::tree_lines(
&root.handle,
&[child],
fake::now(),
&jiff::tz::TimeZone::UTC,
90,
theme,
);
let line: String = lines[0].spans.iter().map(|s| s.content.as_ref()).collect();
assert!(lin... |
rust_dataset_chunk_2692 | rust_dataset.txt | 2,692 | 512 | .
#[rstest]
#[tokio::test]
async fn inspect_collapses_a_long_children_list() {
let s = settings();
let mut state = loaded(&s, "", 1).await;
many_children(&mut state, 17);
let out = text(&render(&mut state, &s, 100, 34));
assert!(out.contains(" 17 forks"), "{out}");
assert!(out.contains("Fork num... |
rust_dataset_chunk_2693 | rust_dataset.txt | 2,693 | 512 | ");
assert_eq!(state.tab_index, 1, "esc collapses first");
assert!(state.expanded_children().is_none());
press(&mut state, &s, "up");
assert_ne!(state.list.selected, selected, "collapsed, the arrows move between sessions");
press(&mut state, &s, "esc");
assert_eq!(state.tab_index, 0);
}
/// Wit... |
rust_dataset_chunk_2694 | rust_dataset.txt | 2,694 | 512 | .session.as_ref(), "fork-00");
assert_eq!(press(&mut state, &s, "enter"), InputAction::Resume);
assert!(resumes(&mut state, Pending::Resume).ends_with("fork-00"));
assert_eq!(press(&mut state, &s, "tab"), InputAction::ReturnCommand);
assert!(resumes(&mut state, Pending::Edit).ends_with("fork-00"));
... |
rust_dataset_chunk_2695 | rust_dataset.txt | 2,695 | 512 | state.results =
(0..SEARCH_LIMIT).map(|i| fake::row(HarnessKind::Codex, &format!("s{i}"), "t")).collect();
let out = text(&render(&mut state, &s, 100, 30));
assert!(out.lines().next().unwrap().ends_with("500+ threads"), "{out}");
}
/// A session used in the last [`LIVE_SECS`](super::state::LIVE_SEC... |
rust_dataset_chunk_2696 | rust_dataset.txt | 2,696 | 512 | █'), "{out}");
assert!(!out.contains("tokens"), "{out}");
// This host goes without saying.
assert!(!out.contains("@wintermute"), "{out}");
}
// --- scrolling the preview, and keeping it steady -------------------------------------------------
fn wheel(state: &mut State, settings: &Settings, down: bool, c... |
rust_dataset_chunk_2697 | rust_dataset.txt | 2,697 | 512 | render(&mut state, &s, 100, 30));
let end = strip(&out);
assert!(end.contains("Tool calls and reasoning stay out of the preview."), "{end}");
let scroll = &state.scrolls[Pane::Strip as usize];
assert!(!scroll.more);
assert_eq!(scroll.offset, scroll.len - scroll.height, "clamped to the end");
//... |
rust_dataset_chunk_2698 | rust_dataset.txt | 2,698 | 512 | ::state::WHEEL_LINES);
assert_eq!(state.list.selected, 0, "the selection stays");
draw(&mut state);
wheel(&mut state, &s, false, area.x + 5, area.bottom() - 1);
assert_eq!(state.scrolls[Pane::Strip as usize].offset, 0);
// Over the list (a few rows above the strip): the selection moves up, as it lo... |
rust_dataset_chunk_2699 | rust_dataset.txt | 2,699 | 512 | }");
assert_eq!(state.list.selected, 0, "the selection stays");
let _ = press(&mut state, &s, "shift-pageup");
let _ = press(&mut state, &s, "alt-up");
let _ = press(&mut state, &s, "shift-up");
let _ = press(&mut state, &s, "shift-up");
assert_eq!(text(&render(&mut state, &s, width, 30)), top);... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.