feat(cli-rs): show the home prompt placeholder examples

This commit is contained in:
Simon Klee
2026-11-06 23:31:33 +01:00
Unverified
parent 57c42054c8
commit 0931da4646
55 changed files with 137 additions and 186 deletions
@@ -37,6 +37,10 @@ use crate::app::Tui;
const INTERRUPT_WINDOW: Duration = Duration::from_secs(5);
/// Clearing a prompt keeps it in history from this many characters on (`DRAFT_RETENTION_MIN_CHARS`).
const CLEAR_RETENTION_CHARS: usize = 20;
/// The home prompt's examples (`routes/home.tsx:20-23`); a session's prompt passes none.
const PLACEHOLDERS: [&str; 3] =
["Fix a TODO in the codebase", "What is the tech stack of this project?", "Fix broken tests"];
const SHELL_PLACEHOLDERS: [&str; 3] = ["ls -la", "git status", "pwd"];
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Mode {
@@ -121,6 +125,8 @@ pub struct Inner {
/// The scanner, only while the session runs, as `<Show when={busy}>` mounts it; dropping it stops its timer.
spinner: RefCell<Option<Spinner>>,
pub(crate) mode: Cell<Mode>,
/// The random index of the placeholder example, picked again on entering shell mode.
pub(crate) placeholder: Cell<usize>,
/// The `PromptInfo` being edited; `text` follows the textarea.
pub(crate) prompt: RefCell<Value>,
interrupt: Cell<u32>,
@@ -327,6 +333,7 @@ pub fn mount(tui: &Tui, session: Option<&SessionID>) -> Prompt {
busy: Cell::new(false),
spinner: RefCell::new(None),
mode: Cell::new(Mode::Normal),
placeholder: Cell::new(rand::random::<u32>() as usize),
prompt: RefCell::new(empty_prompt()),
interrupt: Cell::new(0),
interrupt_timer: Cell::new(None),
@@ -648,6 +655,9 @@ impl Inner {
self.frame.border_color(border);
self.bottom.border_color(border);
self.metadata.set(&theme, mode, &display, highlight, self.app.size().0);
if self.session.is_none() {
self.textarea.placeholder(self.placeholder_text());
}
let running = self.running(tui);
self.busy.set(running);
@@ -694,6 +704,27 @@ impl Inner {
self.app.request_redraw();
}
/// `placeholderText`: the example cut to the textarea's width (`component/prompt/index.tsx:1617-1629`).
fn placeholder_text(&self) -> String {
let (label, examples) = match self.mode.get() {
Mode::Shell => ("Run a command…", SHELL_PLACEHOLDERS),
Mode::Normal => ("Ask anything…", PLACEHOLDERS),
};
let text = format!("{label} \"{}\"", examples[self.placeholder.get() % examples.len()]);
let width = usize::from(self.app.size().0);
let width =
if width < 44 { width.saturating_sub(5) } else { 75.min(width.saturating_sub(4)).saturating_sub(5) };
let mut used = 0;
let cut: String = text
.chars()
.take_while(|char| {
used += unicode_width::UnicodeWidthChar::width(*char).unwrap_or(0);
used <= width.max(1)
})
.collect();
cut.trim_end().to_owned()
}
/// The scanner in the agent's color, `[⋯]` with animations off (`component/prompt/index.tsx:1913-1919`). It
/// mounts when the session starts running and drops when it stops, so it starts at its first frame each time
/// and no timer runs while idle.
@@ -18,7 +18,12 @@ pub fn layers(inner: &Rc<Inner>, target: FocusId) -> Vec<KeymapLayer<FocusId>> {
Condition::when(move || weak.upgrade().is_some_and(|prompt| check(&prompt)))
};
let set = |mode: Mode| {
bind!(inner, |prompt, _: Option<&str>, _: Option<&opentui::prelude::KeyEvent>| prompt.set_mode(mode))
bind!(inner, |prompt, _: Option<&str>, _: Option<&opentui::prelude::KeyEvent>| {
if mode == Mode::Shell {
prompt.placeholder.set(rand::random::<u32>() as usize);
}
prompt.set_mode(mode)
})
};
let inline = |key: &str, title: &str, mode: Mode| TuiCommand::inline(key, set(mode)).title(title).group("Prompt");
vec![
@@ -407,6 +407,25 @@ fn home_prompt_creates_a_session_and_opens_it() {
assert!(!toast, "{}", setup.app.text());
}
#[test]
fn home_prompt_shows_a_placeholder_example_and_a_shell_one_in_shell_mode() {
let setup = Setup::new(Route::Home);
setup.ready();
let screen = setup.wait_for("Ask anything… \"");
let examples = ["Fix a TODO in the codebase", "What is the tech stack of this project?", "Fix broken tests"];
assert!(examples.iter().any(|example| screen.contains(&format!("Ask anything… \"{example}\""))), "{screen}");
setup.app.type_text("!");
let screen = setup.wait_for("Run a command… \"");
assert!(
["ls -la", "git status", "pwd"].iter().any(|example| screen.contains(&format!("\"{example}\""))),
"{screen}"
);
// A session's prompt has none.
let setup = Setup::new(session_route());
setup.ready();
assert!(!setup.app.text().contains("Ask anything"), "{}", setup.app.text());
}
#[test]
fn enter_before_the_catalog_loads_submits_once_it_has() {
let setup = Setup::held(Route::Home);
@@ -1,12 +0,0 @@
# T17: the home prompt draws no placeholder
TypeScript: the home passes its placeholders to the prompt (`packages/tui/src/routes/home.tsx:20-23`), so the
empty prompt shows `Ask anything… "<one picked at random>"` in the muted color.
Rust: E.1 builds the home as TS does (the logo, the prompt slot of at most 75 columns, the footer with the
version), and E.2's prompt fills the slot cell for cell. The prompt has no placeholder yet, so its first row is
empty. The P-APP and P-TUI scenarios that show the home mask that row with a rectangle (the TS text is random
anyway), or its first three cells where a dialog covers the rest.
Reason: not built yet. The prompt (E.2's `prompt/editor.rs`) takes the placeholders; then the masks keep only
the random text, and this file goes.
+1 -1
View File
@@ -113,7 +113,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "C.13/auto/home"
+4 -4
View File
@@ -94,7 +94,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.1/events/home"
@@ -137,7 +137,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.1/events/toast"
@@ -187,7 +187,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.1/events/deleted"
@@ -214,7 +214,7 @@
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.1/events/command"
+1 -1
View File
@@ -21,7 +21,7 @@
"y": 16,
"width": 38,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.1/home-narrow/narrow"
+1 -1
View File
@@ -21,7 +21,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.1/home/wide"
+1 -1
View File
@@ -44,7 +44,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.1/mcp-toast/failed"
+1 -1
View File
@@ -23,7 +23,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.1/model-invalid/toast"
@@ -78,7 +78,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.11a/session-list/home"
@@ -113,15 +113,6 @@
{
"checkpoint": "changes",
"until": "old.txt",
"masks": [
{
"x": 16,
"y": 16,
"width": 3,
"height": 1,
"reason": "not drawn yet in Rust (T17-home-prompt)"
}
],
"fixture": "E.11b/worktree-delete/changes"
},
{
@@ -82,15 +82,6 @@
{
"checkpoint": "name",
"until": "Name worktree",
"masks": [
{
"x": 16,
"y": 16,
"width": 3,
"height": 1,
"reason": "not drawn yet in Rust (T17-home-prompt)"
}
],
"fixture": "E.11b/worktrees/name"
},
{
+1 -1
View File
@@ -228,7 +228,7 @@
"y": 17,
"width": 72,
"height": 1,
"reason": "the home placeholder: random in TS, not drawn in Rust (T17-home-prompt)"
"reason": "the home placeholder example: random in TS and Rust"
}
],
"fixture": "E.12/tab-strip/new"
+1 -1
View File
@@ -55,7 +55,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.14/home-footer/counts"
+1 -1
View File
@@ -75,7 +75,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.14/stats/home"
@@ -69,7 +69,7 @@
"y": 16,
"width": 86,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.15a/image/home"
@@ -176,7 +176,7 @@
"y": 16,
"width": 94,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.15a/route/home"
@@ -87,7 +87,7 @@
"y": 16,
"width": 74,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.15b/base/home"
@@ -69,7 +69,7 @@
"y": 16,
"width": 94,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.15b/menu/home"
@@ -21,7 +21,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.19a/failed-toast-other/home"
@@ -54,7 +54,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.19a/failed-toast-other/failed"
+2 -2
View File
@@ -29,7 +29,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.20/reload/home"
@@ -48,7 +48,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.20/reload/reloaded"
+1 -55
View File
@@ -29,7 +29,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.20/toggles/home"
@@ -47,15 +47,6 @@
{
"checkpoint": "settings",
"until": "Search settings",
"masks": [
{
"x": 16,
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder's first word: random in TS, not drawn yet in Rust (T17-home-prompt)"
}
],
"fixture": "E.20/toggles/settings"
},
{
@@ -64,15 +55,6 @@
{
"checkpoint": "animations",
"until": "Animations",
"masks": [
{
"x": 16,
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder's first word: random in TS, not drawn yet in Rust (T17-home-prompt)"
}
],
"fixture": "E.20/toggles/animations"
},
{
@@ -95,15 +77,6 @@
{
"checkpoint": "wrapping",
"until": "Wrapping",
"masks": [
{
"x": 16,
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder's first word: random in TS, not drawn yet in Rust (T17-home-prompt)"
}
],
"fixture": "E.20/toggles/wrapping"
},
{
@@ -125,15 +98,6 @@
{
"checkpoint": "editor",
"until": "Editor context",
"masks": [
{
"x": 16,
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder's first word: random in TS, not drawn yet in Rust (T17-home-prompt)"
}
],
"fixture": "E.20/toggles/editor"
},
{
@@ -160,15 +124,6 @@
{
"checkpoint": "pastes",
"until": "Large pastes",
"masks": [
{
"x": 16,
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder's first word: random in TS, not drawn yet in Rust (T17-home-prompt)"
}
],
"fixture": "E.20/toggles/pastes"
},
{
@@ -193,15 +148,6 @@
{
"checkpoint": "title",
"until": "Window title",
"masks": [
{
"x": 16,
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder's first word: random in TS, not drawn yet in Rust (T17-home-prompt)"
}
],
"fixture": "E.20/toggles/title"
}
],
@@ -21,7 +21,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.20/working-directory/home"
@@ -41,7 +41,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.20/working-directory/dialog"
@@ -59,7 +59,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "E.20/working-directory/closed"
+1 -1
View File
@@ -143,7 +143,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "H.2/home-sessions/home"
+1 -1
View File
@@ -27,7 +27,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "P.1/slot/home"
@@ -98,7 +98,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/cursor-dark-events/home"
@@ -141,7 +141,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/cursor-dark-events/toast"
@@ -191,7 +191,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/cursor-dark-events/deleted"
@@ -218,7 +218,7 @@
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/cursor-dark-events/command"
@@ -98,7 +98,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/opencode2-dark-events/home"
@@ -141,7 +141,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/opencode2-dark-events/toast"
@@ -191,7 +191,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/opencode2-dark-events/deleted"
@@ -218,7 +218,7 @@
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/opencode2-dark-events/command"
@@ -98,7 +98,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/tokyonight-dark-events/home"
@@ -141,7 +141,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/tokyonight-dark-events/toast"
@@ -191,7 +191,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/tokyonight-dark-events/deleted"
@@ -218,7 +218,7 @@
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/tokyonight-dark-events/command"
@@ -98,7 +98,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/tokyonight-light-events/home"
@@ -141,7 +141,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/tokyonight-light-events/toast"
@@ -191,7 +191,7 @@
"y": 16,
"width": 84,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/tokyonight-light-events/deleted"
@@ -218,7 +218,7 @@
"y": 16,
"width": 3,
"height": 1,
"reason": "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)"
"reason": "the placeholder example: random in TS and Rust"
}
],
"fixture": "rs-theme-colors/tokyonight-light-events/command"
+1 -1
View File
@@ -15,7 +15,7 @@ export default defineApp({
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
+2 -2
View File
@@ -7,14 +7,14 @@ const here = { directory: "/tmp/opencode/packages/tui" }
const event = (id: string, type: string, data: unknown, location: unknown = here) => ({
event: { id, created: 3, type, location, data },
})
// The home prompt's placeholder row (T17-home-prompt).
// The home prompt's placeholder row: its example is random.
const prompt = [
{
x: 16,
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
]
+1 -1
View File
@@ -14,7 +14,7 @@ export default defineApp({
y: 16,
width: 38,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
+1 -1
View File
@@ -12,7 +12,7 @@ export default defineApp({
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
+2 -2
View File
@@ -5,14 +5,14 @@ const location = {
directory: "/tmp/opencode/packages/tui",
project: { id: "proj_test", directory: "/tmp/opencode", canonical: "/tmp/opencode" },
}
// The home prompt's placeholder row (T17-home-prompt).
// The home prompt's placeholder row: its example is random.
const prompt = [
{
x: 16,
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
]
+2 -2
View File
@@ -1,14 +1,14 @@
// `--model` without a provider (T27): a warning toast on the home.
import { defineApp } from "../../lib/app"
// The home prompt's placeholder row (T17-home-prompt).
// The home prompt's placeholder row: its example is random.
const prompt = [
{
x: 16,
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
]
@@ -7,7 +7,7 @@ const placeholder = {
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
}
export default defineApp({
@@ -8,7 +8,7 @@ const placeholder = {
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
}
const leader = { press: "x", modifiers: { ctrl: true } } as const
const remove = { press: "d", modifiers: { ctrl: true } } as const
@@ -3,7 +3,7 @@
// refuses that too, which shows the failure toast and the list again.
import { defineApp } from "../../lib/app"
// The TS placeholder picks a random example; the Rust home prompt draws none yet (T17-home-prompt).
// The home placeholder picks a random example.
const placeholder = [{ x: 16, y: 16, width: 74, height: 1, reason: "random placeholder example" }]
const refused = {
@@ -41,12 +41,7 @@ export default defineApp({
{ keys: ["enter"] },
{ checkpoint: "list", until: "opencode-spike" },
{ keys: ["down", "ctrl+d", "ctrl+d"] },
// Beside the dialog, the placeholder shows its first word.
{
checkpoint: "changes",
until: "old.txt",
masks: [{ ...placeholder[0], width: 3, reason: "not drawn yet in Rust (T17-home-prompt)" }],
},
{ checkpoint: "changes", until: "old.txt" },
{ keys: ["d"] },
{ checkpoint: "failed", until: "Failed to delete worktree" },
],
@@ -3,7 +3,7 @@
// for the first submit, which the footer shows as "(new worktree)".
import { defineApp } from "../../lib/app"
// The TS placeholder picks a random example; the Rust home prompt draws none yet (T17-home-prompt).
// The home placeholder picks a random example.
const placeholder = [{ x: 16, y: 16, width: 74, height: 1, reason: "random placeholder example" }]
export default defineApp({
@@ -25,12 +25,7 @@ export default defineApp({
{ keys: ["down", "ctrl+d"] },
{ checkpoint: "marked", until: "again to confirm" },
{ keys: ["down", "ctrl+a"] },
// Beside the dialog, the placeholder shows its first word.
{
checkpoint: "name",
until: "Name worktree",
masks: [{ ...placeholder[0], width: 3, reason: "not drawn yet in Rust (T17-home-prompt)" }],
},
{ checkpoint: "name", until: "Name worktree" },
{ type: "My Spike" },
{ keys: ["enter"] },
{ checkpoint: "staged", until: "(new worktree)", masks: placeholder },
+2 -2
View File
@@ -11,9 +11,9 @@ const select = (id: string, sessionID: string) => ({
const messages = (text: string) => ({
json: { data: [assistant("msg_2", text), user("msg_1", "Why?")], cursor: {} },
})
// The home prompt draws no placeholder (T17).
// The home placeholder's example is random.
const home = [
{ x: 16, y: 17, width: 72, height: 1, reason: "the home placeholder: random in TS, not drawn in Rust (T17-home-prompt)" },
{ x: 16, y: 17, width: 72, height: 1, reason: "the home placeholder example: random in TS and Rust" },
]
// Read by the prompt as soon as the session is the open one: idle at 5, never viewed.
const unread = { ...session("ses_b", "Write the docs", { updated: 2 }), time: { created: 2, updated: 5, idle: 5 } }
+1 -1
View File
@@ -11,7 +11,7 @@ const placeholder = {
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
}
export default defineApp({
+1 -1
View File
@@ -47,7 +47,7 @@ export default defineApp({
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
+1 -1
View File
@@ -20,7 +20,7 @@ export default defineSim({
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
@@ -36,7 +36,7 @@ export default defineApp({
y: 16,
width: 86,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
@@ -70,7 +70,7 @@ export default defineApp({
y: 16,
width: 94,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
@@ -37,7 +37,7 @@ export default defineApp({
y: 16,
width: 74,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
@@ -35,7 +35,7 @@ export default defineApp({
y: 16,
width: 94,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
@@ -9,7 +9,7 @@ const masks = [
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
]
+1 -1
View File
@@ -8,7 +8,7 @@ const placeholder = {
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
}
export default defineApp({
+7 -16
View File
@@ -9,17 +9,8 @@ const placeholder = {
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
}
// Beside a dialog, the placeholder shows its first word.
const beside = {
x: 16,
y: 16,
width: 3,
height: 1,
reason: "the placeholder's first word: random in TS, not drawn yet in Rust (T17-home-prompt)",
}
const behind = { masks: [beside] }
const clear = (text: string) => ({ keys: Array.from(text, () => "backspace") })
export default defineApp({
@@ -41,20 +32,20 @@ export default defineApp({
masks: [placeholder],
},
{ keys: ["f5", "f6", "f7", "f8", "f9", "f10"] },
{ checkpoint: "settings", until: "Search settings", ...behind },
{ checkpoint: "settings", until: "Search settings" },
{ type: "animations" },
{ checkpoint: "animations", until: "Animations", ...behind },
{ checkpoint: "animations", until: "Animations" },
clear("animations"),
{ type: "diff wrap" },
{ checkpoint: "wrapping", until: "Wrapping", ...behind },
{ checkpoint: "wrapping", until: "Wrapping" },
clear("diff wrap"),
{ type: "editor context" },
{ checkpoint: "editor", until: "Editor context", ...behind },
{ checkpoint: "editor", until: "Editor context" },
clear("editor context"),
{ type: "large pastes" },
{ checkpoint: "pastes", until: "Large pastes", ...behind },
{ checkpoint: "pastes", until: "Large pastes" },
clear("large pastes"),
{ type: "window title" },
{ checkpoint: "title", until: "Window title", ...behind },
{ checkpoint: "title", until: "Window title" },
],
})
@@ -3,14 +3,13 @@
// option is chosen: copying and opening reach the system, which the Rust tests cover with a sink.
import { defineApp } from "../../lib/app"
// The home prompt behind the dialog: its placeholder is random in TS and not drawn in Rust yet
// (T17-home-prompt).
// The home prompt behind the dialog: its placeholder example is random.
const placeholder = {
x: 16,
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
}
export default defineApp({
+1 -1
View File
@@ -7,7 +7,7 @@ const placeholder = {
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
}
export default defineApp({
@@ -32,7 +32,7 @@ export default defineSim({
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},
+1 -1
View File
@@ -15,7 +15,7 @@ export default defineApp({
y: 16,
width: 84,
height: 1,
reason: "the placeholder: random in TS, not drawn yet in Rust (T17-home-prompt)",
reason: "the placeholder example: random in TS and Rust",
},
],
},