Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat(agent-tui): drop the wave glyph, throbber and elapsed time from the input row

Akarshan Biswas74d8fb7bd78b
diff --git a/docs/src/pages/docs/agent/console.mdx b/docs/src/pages/docs/agent/console.mdx
index 5e8481804..50a0ea5fc 100644
--- a/docs/src/pages/docs/agent/console.mdx
+++ b/docs/src/pages/docs/agent/console.mdx
@@ -62,34 +62,16 @@ Type while it's working and your message queues rather than being dropped - see
### The working row
-While a turn runs, the input row shows an action word that turns over every few seconds, with a πŸ‘‹
-sweeping back and forth along it, so a long turn does not read as a hung UI. A brightness sweep
-crosses the word, and after it come the turn's elapsed time (`12s`, `1m 05s`, `1h 02m`) and the
-key that cancels it, <kbd>Esc</kbd>. On a narrow terminal the row drops the long hint first, then
-the short one, then the elapsed time, so it always stays one line.
-
-Pick a different glyph from `/settings > wave`, or set it in `~/.jan/config.toml` directly:
-
-```toml
-wave = "πŸ‘‹"
-```
-
-Any string of up to three characters works - `"🍌"`, `"~"`, `"<o>"`, `"πŸ‘οΈπŸ‘„πŸ‘οΈ"`. The limit counts
-what you see, so a single emoji built from several code points still counts as one. The glyph
-replaces the Braille throbber rather than joining it, and covers the characters it passes over
-instead of pushing them along, so the row never changes width no matter how wide the glyph is.
-
-Unlike most settings, this one applies the moment you save it, with no restart.
-
-To go back to the plain Braille throbber - if your terminal lacks the font and draws a
-missing-character box - clear the field in `/settings` and save. That writes `wave = ""`, which is
-the off switch. Pressing <kbd>x</kbd> on the row is the other direction: it removes the key, so the
-default πŸ‘‹ comes back.
+While a turn runs, the input row shows an action word that turns over every few seconds, with a
+brightness sweep crossing it, so a long turn does not read as a hung UI. After the word comes the
+key that cancels it, <kbd>Esc</kbd>; the turn's elapsed time (`12s`, `1m 05s`, `1h 02m`) is in the
+header. On a narrow terminal the row drops the long hint first, then the short one, so it always
+stays one line.
### Motion
-The working row, the `[thinking]` badge and a running tool row animate: a throbber turns and a
-brightness sweep crosses the label. The sweep changes colour only, never width, so nothing beside
+The working row, the `[thinking]` badge and a running tool row animate: a brightness sweep crosses
+the label, and a running tool row also has a throbber. The sweep changes colour only, never width, so nothing beside
it moves. It is skipped on a 16-colour terminal, which has no shades in between to sweep through.
To hold everything still, set this in `~/.jan/config.toml`:
@@ -99,8 +81,7 @@ To hold everything still, set this in `~/.jan/config.toml`:
animations = false
```
-The throbber then shows a static `β€’`, the wave glyph is dropped, and every label keeps its resting
-colour. Jan also turns animations off at launch when the OS asks for reduced motion: on macOS
+Throbbers then show a static `β€’` and every label keeps its resting colour. Jan also turns animations off at launch when the OS asks for reduced motion: on macOS
(System Settings > Accessibility > Display > Reduce motion) and on GNOME-family Linux desktops
(animations off). Windows is not detected yet, so use the key there. Restart Jan after changing
either.
diff --git a/docs/src/pages/docs/agent/slash-commands.mdx b/docs/src/pages/docs/agent/slash-commands.mdx
index 7d68b48c7..cf75d18ff 100644
--- a/docs/src/pages/docs/agent/slash-commands.mdx
+++ b/docs/src/pages/docs/agent/slash-commands.mdx
@@ -75,7 +75,7 @@ See [Run modes](/docs/agent/run-modes), [Goals and todos](/docs/agent/goals-and-
| `/login` | Sign in to Tokamak and save the API key |
| `/config [what you want]` | View provider config (`~/.jan/config.toml`). With words, it is `/vibe-setting` |
| `/terminal-setup` | Configure this terminal so <kbd>Shift</kbd>+<kbd>Enter</kbd> inserts a newline and, on macOS, <kbd>Option</kbd>+<kbd>Delete</kbd> deletes a word. Writes the terminal's own config where it can (VS Code, kitty, Ghostty, tmux) and prints the manual step where it cannot. Idempotent |
-| `/settings [what you want]` | With words (other than the `max_parallel_subagents N` shortcut), it is `/vibe-setting`. Bare, it opens the menu to edit settings in an interactive menu - the project's `agent.toml` (`[agent]` knobs `context_window`, `compaction_ratio`, `compaction_reserve_tokens`, `max_tokens`, `max_parallel_subagents`, `[budget]` limits, the `[tools]` / `[skills]` toggles) and user-wide `~/.jan/config.toml` keys such as `wave` and `ask_timeout_secs` in the one list (Enter edits a row, `x` resets to default, Esc cancels, clearing the field unsets - except `wave`, where an empty field is the "no sweep" value and `x` restores the default πŸ‘‹). The leading `providers` row opens a manager for OpenAI-compatible providers in `~/.jan/config.toml`: `a` adds, Enter edits, `d` twice deletes. `max_parallel_subagents N` works as a one-shot shortcut. Writes apply on the next session (or after `/reload config` for the `[agent]`/`[budget]` limits), except cosmetic ones like `wave` that apply immediately |
+| `/settings [what you want]` | With words (other than the `max_parallel_subagents N` shortcut), it is `/vibe-setting`. Bare, it opens the menu to edit settings in an interactive menu - the project's `agent.toml` (`[agent]` knobs `context_window`, `compaction_ratio`, `compaction_reserve_tokens`, `max_tokens`, `max_parallel_subagents`, `[budget]` limits, the `[tools]` / `[skills]` toggles) and user-wide `~/.jan/config.toml` keys such as `ask_timeout_secs` in the one list (Enter edits a row, `x` resets to default, Esc cancels, clearing the field unsets). The leading `providers` row opens a manager for OpenAI-compatible providers in `~/.jan/config.toml`: `a` adds, Enter edits, `d` twice deletes. `max_parallel_subagents N` works as a one-shot shortcut. Writes apply on the next session (or after `/reload config` for the `[agent]`/`[budget]` limits) |
| `/vibe-setting <what you want>` | Say what you want in plain words and the agent proposes the settings changes that get it. `/settings <words>` and `/config <words>` do the same. See [below](#vibe-setting) |
### `/vibe-setting`
@@ -103,7 +103,6 @@ each one applies:
| Keys | Applies |
| --- | --- |
-| `wave` | Now |
| `context_window`, `compaction_ratio`, `compaction_reserve_tokens`, `max_tokens`, `send_reasoning`, `budget.max_tokens` | After `/reload config`, from the next run |
| Everything else (`max_parallel_subagents`, `tools.default`, `show_reasoning`, ...) | When Jan restarts |
diff --git a/src-tauri/src/core/agent/global_config.rs b/src-tauri/src/core/agent/global_config.rs
index ee3877723..9bf9502f3 100644
--- a/src-tauri/src/core/agent/global_config.rs
+++ b/src-tauri/src/core/agent/global_config.rs
@@ -56,21 +56,16 @@ const GLOBAL_CONFIG_TEMPLATE: &str = r#"# Jan Agent global provider config.
# memory_cross_project = false # hide other projects' memory from the
# # agent (the root ~/.jan/MEMORY.md lists
# # them by default)
-# wave = "πŸ‘‹" # sweep this glyph along the working row
-# # instead of the static throbber. Up to
-# # 3 characters ("🍌", "~", "πŸ‘οΈπŸ‘„πŸ‘οΈ").
-# # Defaults to πŸ‘‹; set "" for the plain
-# # throbber if your terminal draws tofu
# prune_threads = true # delete old saved threads at TUI start,
# # under each project's agent.toml
# # thread_retention_days / max_threads.
# # Off by default: nothing is deleted
#
# [tui]
-# animations = false # hold the TUI still: no shimmer, a
-# # static glyph for the throbber and the
-# # wave. On by default; the OS reduce-
-# # motion setting also turns it off
+# animations = false # hold the TUI still: no shimmer and
+# # static throbbers. On by default; the
+# # OS reduce-motion setting also turns
+# # it off
#
# [telemetry] # opt-in OpenTelemetry (OTLP) export of
# enabled = true # usage metrics and events to YOUR
@@ -163,16 +158,6 @@ struct GlobalConfigToml {
/// memory to itself (user-wide `user:` notes still apply everywhere).
#[serde(default, skip_serializing_if = "Option::is_none")]
memory_cross_project: Option<bool>,
- /// Glyph swept along the working row while a turn runs, in place of the
- /// static Braille throbber. Absent = `WAVE_DEFAULT`; `""` = off, the
- /// throbber. See `wave_glyph` for why those are two different things.
- ///
- /// Any string up to `WAVE_MAX_GRAPHEMES` clusters is accepted -- `"🍌"`,
- /// `"~"`, `"<o>"` -- because what reads as a wave is a matter of taste,
- /// and the renderer measures whatever it is given rather than assuming
- /// one cell.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- wave: Option<String>,
/// Prune old saved threads at TUI start. `None` = the default, off: a
/// deleted thread is not recoverable, so removing the user's history is
/// something they turn on, not something they find out about.
@@ -224,7 +209,7 @@ struct GlobalConfigToml {
/// `[tui]` in `~/.jan/config.toml`. Each key is `None` when unset.
#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq)]
struct TuiSection {
- /// Animate the TUI (shimmer, throbbers, the wave). `None` = on.
+ /// Animate the TUI (shimmer, throbbers). `None` = on.
#[serde(default, skip_serializing_if = "Option::is_none")]
animations: Option<bool>,
}
@@ -604,61 +589,6 @@ pub(crate) fn ask_timeout() -> Option<std::time::Duration> {
.map(std::time::Duration::from_secs)
}
-/// The default glyph swept along the working row when `wave` is absent.
-pub(crate) const WAVE_DEFAULT: &str = "πŸ‘‹";
-
-/// The most grapheme clusters a `wave` may hold. Three is the width of the
-/// small ASCII-art faces the feature is for (`πŸ‘οΈπŸ‘„πŸ‘οΈ`); past that the glyph
-/// stops reading as a traveller and starts overwriting the word it sweeps.
-pub(crate) const WAVE_MAX_GRAPHEMES: usize = 3;
-
-/// Grapheme-cluster count, which is what "characters" means to the person
-/// typing: `πŸ‘οΈπŸ‘„πŸ‘οΈ` is 3 to them and 5 `char`s to Rust, and an emoji with a
-/// skin-tone or ZWJ sequence is worse. Counting `char`s would reject glyphs
-/// that visibly fit.
-pub(crate) fn wave_len(glyph: &str) -> usize {
- use unicode_segmentation::UnicodeSegmentation;
- glyph.graphemes(true).count()
-}
-
-/// Validate a candidate `wave`, returning the reason it is unusable. Empty is
-/// valid and means "no sweep" -- the deliberate off switch, distinct from the
-/// key being absent, which takes the default.
-pub(crate) fn wave_error(glyph: &str) -> Option<String> {
- let len = wave_len(glyph);
- (len > WAVE_MAX_GRAPHEMES)
- .then(|| format!("at most {WAVE_MAX_GRAPHEMES} characters (got {len})"))
-}
-
-/// The glyph to sweep along the working row (`wave` in `~/.jan/config.toml`).
-///
-/// Three states, because the key has to distinguish "never touched it" from
-/// "turned it off":
-///
-/// - absent -> `WAVE_DEFAULT`, the wave is on out of the box
-/// - `""` -> `None`, the static Braille throbber, chosen deliberately
-/// - a glyph -> that glyph
-///
-/// An all-whitespace glyph is `None` too: an invisible traveller reads as
-/// letters going missing, which is the bug this feature had the first time
-/// round.
-///
-/// A value past the length cap falls back to the default rather than
-/// erroring. `/settings` rejects an over-long glyph at the point of entry, so
-/// this only fires for a hand-edited file, and a display preference must never
-/// block startup.
-pub(crate) fn wave_glyph() -> Option<String> {
- let Ok(config) = load_raw() else {
- return Some(WAVE_DEFAULT.to_string());
- };
- match config.wave {
- None => Some(WAVE_DEFAULT.to_string()),
- Some(glyph) if glyph.trim().is_empty() => None,
- Some(glyph) if wave_error(&glyph).is_some() => Some(WAVE_DEFAULT.to_string()),
- Some(glyph) => Some(glyph),
- }
-}
-
/// Root-level (non-`[providers.*]`) keys of `~/.jan/config.toml`, used to spot
/// the one mistake this file invites: appending a top-level key to the end of
/// the file, where it silently lands inside whichever `[providers.*]` table
@@ -673,7 +603,6 @@ const ROOT_KEYS: &[&str] = &[
"theme",
"ask_timeout_secs",
"terminal_hint",
- "wave",
"hooks",
];
@@ -1139,85 +1068,6 @@ mod tests {
});
}
- #[test]
- fn wave_defaults_to_the_hand_and_reads_the_toml_key() {
- with_temp_home(|_| {
- assert_eq!(
- wave_glyph().as_deref(),
- Some(WAVE_DEFAULT),
- "missing file -> the default sweep, not off"
- );
- let path = ensure_global_config().expect("ensure");
- assert_eq!(
- wave_glyph().as_deref(),
- Some(WAVE_DEFAULT),
- "scaffolded file only comments the key, so the default still applies"
- );
-
- // Any string within the cap, not a fixed set: the point of the key
- // is the user's own glyph.
- std::fs::write(&path, "wave = \"🍌\"\n").unwrap();
- assert_eq!(wave_glyph().as_deref(), Some("🍌"));
- std::fs::write(&path, "wave = \"<o>\"\n").unwrap();
- assert_eq!(wave_glyph().as_deref(), Some("<o>"));
- // Three clusters that are five `char`s: the cap counts what the
- // eye counts, so this fits.
- std::fs::write(&path, "wave = \"πŸ‘οΈπŸ‘„πŸ‘οΈ\"\n").unwrap();
- assert_eq!(wave_glyph().as_deref(), Some("πŸ‘οΈπŸ‘„πŸ‘οΈ"));
-
- // An explicit empty string is the off switch, and the one case
- // that must not fall back to the default.
- std::fs::write(&path, "wave = \"\"\n").unwrap();
- assert_eq!(wave_glyph(), None, "empty is a deliberate off");
-
- // A blank glyph would sweep an invisible traveller along the row,
- // which reads as characters going missing.
- std::fs::write(&path, "wave = \" \"\n").unwrap();
- assert_eq!(wave_glyph(), None, "whitespace is off too");
-
- // Hand-edited past the cap: a display preference must not break
- // the console, so it reverts rather than erroring.
- std::fs::write(&path, "wave = \"abcd\"\n").unwrap();
- assert_eq!(
- wave_glyph().as_deref(),
- Some(WAVE_DEFAULT),
- "over the cap falls back to the default"
- );
-
- std::fs::write(&path, "not valid toml [[[").unwrap();
- assert_eq!(
- wave_glyph().as_deref(),
- Some(WAVE_DEFAULT),
- "an unreadable config keeps the default"
- );
- });
- }
-
- #[test]
- fn wave_length_counts_grapheme_clusters() {
- // The whole reason the cap is not `chars().count()`: each of these is
- // one thing to the person typing it.
- assert_eq!(wave_len(""), 0);
- assert_eq!(wave_len("~"), 1);
- assert_eq!(wave_len("πŸ‘‹"), 1);
- assert_eq!(wave_len("πŸ‘‹πŸ½"), 1, "skin-tone modifier joins the cluster");
- assert_eq!(wave_len("πŸ‘οΈ"), 1, "variation selector joins the cluster");
- assert_eq!(wave_len("πŸ‘¨β€πŸ‘©β€πŸ‘§"), 1, "ZWJ family is one cluster");
- assert_eq!(wave_len("πŸ‘οΈπŸ‘„πŸ‘οΈ"), 3, "5 chars, 3 clusters");
-
- assert!(
- wave_error("").is_none(),
- "empty is the off switch, not an error"
- );
- assert!(wave_error("πŸ‘οΈπŸ‘„πŸ‘οΈ").is_none(), "exactly at the cap");
- assert!(wave_error("<o>").is_none());
- let err = wave_error("abcd").expect("over the cap");
- assert!(
- err.contains('3') && err.contains('4'),
- "names cap and actual: {err}"
- );
- }
-
/// A root key appended to the end of the file lands inside the last
/// `[providers.*]` table, and `toml`'s own error says only "duplicate key
/// ... in table `providers.opencode`" - true, but it never says the key
@@ -1265,26 +1115,24 @@ mod tests {
let path = ensure_global_config().expect("ensure");
std::fs::write(&path, "# keep me\n[providers.openai]\napi_key = \"sk-x\"\n").unwrap();
- set_global_key("wave", Some(toml_edit::value("🍌"))).expect("set");
+ set_global_key("stream_reasoning", Some(toml_edit::value(false))).expect("set");
let raw = std::fs::read_to_string(&path).unwrap();
assert!(
raw.contains("# keep me"),
"comment survives the write: {raw}"
);
assert!(raw.contains("sk-x"), "provider survives the write: {raw}");
- assert_eq!(
- wave_glyph().as_deref(),
- Some("🍌"),
+ assert!(
+ !stream_reasoning_enabled(),
"key must parse as a document key, not a provider field: {raw}"
);
- assert_eq!(global_value("wave").as_deref(), Some("🍌"));
+ assert_eq!(global_value("stream_reasoning").as_deref(), Some("false"));
- set_global_key("wave", None).expect("unset");
- assert_eq!(global_value("wave"), None, "None removes the key");
- assert_eq!(
- wave_glyph().as_deref(),
- Some(WAVE_DEFAULT),
- "a removed key falls back to the default, not to off"
+ set_global_key("stream_reasoning", None).expect("unset");
+ assert_eq!(global_value("stream_reasoning"), None, "None removes the key");
+ assert!(
+ stream_reasoning_enabled(),
+ "a removed key falls back to the default"
);
let raw = std::fs::read_to_string(&path).unwrap();
assert!(raw.contains("sk-x"), "unset leaves the rest alone: {raw}");
@@ -1299,10 +1147,10 @@ mod tests {
let path = home.join(".jan").join("config.toml");
assert!(!path.exists(), "starting from no config");
- set_global_key("wave", Some(toml_edit::value("~"))).expect("set");
+ set_global_key("stream_reasoning", Some(toml_edit::value(false))).expect("set");
let raw = std::fs::read_to_string(&path).unwrap();
assert!(raw.contains("Jan Agent global provider config"), "{raw}");
- assert_eq!(wave_glyph().as_deref(), Some("~"));
+ assert!(!stream_reasoning_enabled());
});
}
diff --git a/src-tauri/src/core/cli/tui.rs b/src-tauri/src/core/cli/tui.rs
index e0873805d..ed083a648 100644
--- a/src-tauri/src/core/cli/tui.rs
+++ b/src-tauri/src/core/cli/tui.rs
@@ -2739,85 +2739,6 @@ const SPINNER: [&str; 10] = ["β ‹", "β ™", "β Ή", "β Έ", "β Ό", "β ΄", "β ¦", "
/// Milliseconds per spinner frame, decoupled from the 50ms render tick.
const SPINNER_ADVANCE_MS: u64 = 80;
-/// Sweep the configured glyph back and forth along `message`, replacing the
-/// characters it covers rather than displacing them.
-///
-/// The first cut of this (#8726) inserted the glyph in place of exactly one
-/// `char`. An emoji is two cells wide, so every frame made the row one cell
-/// wider than the text it was drawn from: the tail shifted right, and at the
-/// frame's own width the last character fell off the edge. That is the
-/// "letters vanish" bug the feature was reverted for.
-///
-/// The fix is to spend the glyph's *display width* out of the message: a
-/// 2-cell glyph covers two 1-cell characters, so the composed line is always
-/// exactly as wide as `message`. Whatever the user configured is measured, so a
-/// 1-cell `"~"` covers one character and a 3-cell `"<o>"` covers three.
-///
-/// The glyph is clamped to the message rather than allowed to overhang, so the
-/// last frames of a sweep do not grow the row either.
-fn wave_sweep_line(message: &str, glyph: &str, frame: usize, text_style: Style) -> Line<'static> {
- use unicode_width::{UnicodeWidthChar, UnicodeWidthStr};
-
- let glyph_width = glyph.width().max(1);
- let chars: Vec<char> = message.chars().collect();
- // Character offsets the glyph can start at without overhanging the end.
- let mut stops: Vec<usize> = Vec::new();
- for i in 0..chars.len() {
- let mut width = 0usize;
- for c in &chars[i..] {
- width += c.width().unwrap_or(0);
- if width >= glyph_width {
- break;
- }
- }
- if width >= glyph_width {
- stops.push(i);
- }
- }
- if stops.is_empty() {
- return Line::from(vec![Span::styled(message.to_string(), text_style)]);
- }
-
- // Ping-pong across the stops: forward to the end, then back, so the glyph
- // reverses instead of jumping back to the start.
- let cycle = stops.len().saturating_mul(2).saturating_sub(2).max(1);
- let step = frame % cycle;
- let index = if step < stops.len() {
- step
- } else {
- cycle - step
- };
- let start = stops[index];
-
- // Spend the glyph's width out of the message, so the row's total width is
- // unchanged no matter how wide the glyph is.
- let mut end = start;
- let mut spent = 0usize;
- while end < chars.len() && spent < glyph_width {
- spent += chars[end].width().unwrap_or(0);
- end += 1;
- }
-
- let head: String = chars[..start].iter().collect();
- let tail: String = chars[end..].iter().collect();
- // A glyph landing on a wider character than itself leaves a gap; pad it so
- // the tail does not slide left under the glyph.
- let pad = " ".repeat(spent.saturating_sub(glyph_width));
-
- let mut spans = Vec::with_capacity(4);
- if !head.is_empty() {
- spans.push(Span::styled(head, text_style));
- }
- spans.push(Span::styled(glyph.to_string(), Style::new().cyan()));
- if !pad.is_empty() {
- spans.push(Span::styled(pad, text_style));
- }
- if !tail.is_empty() {
- spans.push(Span::styled(tail, text_style));
- }
- Line::from(spans)
-}
-
/// Rotating action words for the running input placeholder, replacing a static
/// "working…" so a long turn does not read as a hung UI.
const WORKING_WORDS: [&str; 12] = [
@@ -3468,7 +3389,7 @@ impl App {
/// `FRAME_SAFETY_REDRAW` late):
///
/// - a live run (Running or Parked, or a run clock still set): spinner,
- /// shimmer, wave, rotating action word, elapsed time and the header
+ /// shimmer, rotating action word, elapsed time and the header
/// wall clock, the `[thinking]` / `thought for` badges and their TTL, the
/// lingering reasoning step's fold timer, a running tool group's clock
/// and live shell boxes, and the retry countdown;
@@ -9852,65 +9773,6 @@ fn think_tags_parsed() -> bool {
PARSE_THINK_TAGS.load(std::sync::atomic::Ordering::Relaxed)
}
-/// The glyph swept along the working row, or `None` for the static throbber.
-/// Process-wide for the same reason as `PARSE_THINK_TAGS`: `input_box` is a free
-/// function with no session in hand. Resolved from the config on first use
-/// rather than per frame, since the row redraws every 50ms and this would
-/// otherwise be a file read on each one.
-///
-/// Behind a lock rather than a `LazyLock` value because `/settings` edits it
-/// live: a glyph you have to restart the console to see is not a toggle.
-static WAVE_GLYPH: std::sync::LazyLock<std::sync::RwLock<Option<String>>> =
- std::sync::LazyLock::new(|| {
- std::sync::RwLock::new(crate::core::agent::global_config::wave_glyph())
- });
-
-/// Apply a new wave glyph to the process, as `/settings` does on save.
-///
-/// `None` means the key was removed, so the default sweep comes back -- not
-/// that the sweep is off. Off is `Some("")`, which resolves to no glyph here
-/// for the reason `wave_glyph` gives: an all-whitespace traveller reads as
-/// letters going missing.
-pub(crate) fn set_wave_glyph(glyph: Option<&str>) {
- let value = match glyph {
- None => Some(crate::core::agent::global_config::WAVE_DEFAULT.to_string()),
- Some(g) if g.trim().is_empty() => None,
- Some(g) => Some(g.to_string()),
- };
- if let Ok(mut slot) = WAVE_GLYPH.write() {
- *slot = value;
- }
-}
-
-#[cfg(test)]
-thread_local! {
- /// Per-test override, for the same reason as `PARSE_THINK_TAGS_OVERRIDE`: a
- /// test sets its own thread's glyph rather than the shared cell, which is
- /// resolved once per process and reads the real `~/.jan/config.toml`.
- static WAVE_GLYPH_OVERRIDE: std::cell::RefCell<Option<Option<String>>> =
- const { std::cell::RefCell::new(None) };
-}
-
-fn wave_glyph() -> Option<String> {
- #[cfg(test)]
- {
- if let Some(over) = WAVE_GLYPH_OVERRIDE.with(|c| c.borrow().clone()) {
- return over;
- }
- }
- WAVE_GLYPH.read().ok().and_then(|g| g.clone())
-}
-
-/// Run `f` with `glyph` as this thread's wave setting.
-#[cfg(test)]
-fn with_wave_glyph<T>(glyph: Option<&str>, f: impl FnOnce() -> T) -> T {
- let value = glyph.map(str::to_string);
- WAVE_GLYPH_OVERRIDE.with(|c| *c.borrow_mut() = Some(value));
- let out = f();
- WAVE_GLYPH_OVERRIDE.with(|c| *c.borrow_mut() = None);
- out
-}
-
/// Run `f` with `<think>` parsing off on this thread only.
#[cfg(test)]
fn without_think_tags<T>(f: impl FnOnce() -> T) -> T {
@@ -13143,15 +13005,9 @@ async fn handle_key(
};
match write_setting(def, &toml_path, None) {
Ok(()) => {
- // `None`, not `""`: this removed the key, so a `Glyph`
- // goes back to its default rather than to off, which
- // is what a cleared edit field means.
- let when = if apply_live_unset(def) {
- "in effect now"
- } else {
- "takes effect on the next run"
- };
- app.note(&format!("{key} unset (default applies); {when}"));
+ app.note(&format!(
+ "{key} unset (default applies); takes effect on the next run"
+ ));
if let Some(picker) = app.picker.as_mut() {
picker.items = build_agent_settings_items(&toml_path);
picker.selected =
@@ -14845,14 +14701,6 @@ enum AgentSettingKind {
default: Option<u64>,
min: u64,
},
- /// Short display glyph with a grapheme cap, and the one kind where an
- /// empty field is a *value* rather than an unset: `""` is the deliberate
- /// "off", distinct from the key being absent, which takes the default.
- /// `x` on the row still removes the key.
- Glyph {
- default: &'static str,
- max: usize,
- },
Text {
default: &'static str,
},
@@ -14992,16 +14840,6 @@ const AGENT_SETTINGS: &[AgentSettingDef] = &[
kind: AgentSettingKind::Bool { default: false },
scope: SettingScope::Global,
},
- AgentSettingDef {
- key: "wave",
- label: "wave",
- desc: "glyph swept along the working row (up to 3 chars; empty = throbber)",
- kind: AgentSettingKind::Glyph {
- default: crate::core::agent::global_config::WAVE_DEFAULT,
- max: crate::core::agent::global_config::WAVE_MAX_GRAPHEMES,
- },
- scope: SettingScope::Global,
- },
AgentSettingDef {
key: "ask_timeout_secs",
label: "ask_timeout_secs",
@@ -15630,43 +15468,12 @@ fn setting_path(def: &AgentSettingDef, toml_path: &std::path::Path) -> String {
}
}
-/// Apply a just-saved setting to the running process where that is possible,
-/// returning whether it took. Most keys are snapshotted at session start and
-/// genuinely need a restart; a purely cosmetic one like `wave` does not, and
-/// telling someone to restart to see a glyph they just picked would be a lie
-/// the code does not have to tell. `entered` is the trimmed field; empty is an
-/// unset for most kinds and a written "off" for a `Glyph`, which is why this
-/// passes `Some` either way and lets the setter read it.
-fn apply_live_setting(def: &AgentSettingDef, entered: &str) -> bool {
- match def.key {
- "wave" => {
- set_wave_glyph(Some(entered));
- true
- }
- _ => false,
- }
-}
-
-/// Apply a just-removed setting to the running process, returning whether it
-/// took. Separate from `apply_live_setting` because removing a key and saving
-/// an empty one are different outcomes for a `Glyph`: the first restores the
-/// default, the second is the off switch.
-fn apply_live_unset(def: &AgentSettingDef) -> bool {
- match def.key {
- "wave" => {
- set_wave_glyph(None);
- true
- }
- _ => false,
- }
-}
-
/// `/settings` dispatcher: bare opens the interactive settings menu (an
/// `AgentSettings` picker over every def, project-scoped or user-wide; Enter on
/// a row docks an edit prompt); `max_parallel_subagents <N>` still works as a
/// one-shot shortcut. Writes are format-preserving and take effect on the next
-/// run (the current run snapshotted its config at start), except the cosmetic
-/// ones `apply_live_setting` handles. Runs only while idle, like every command.
+/// run (the current run snapshotted its config at start). Runs only while idle,
+/// like every command.
fn settings_command(app: &mut App, arg: &str) {
let toml_path = app.agent_dir.join("agent.toml");
let arg = arg.trim();
@@ -15798,18 +15605,10 @@ fn open_provider_settings(app: &mut App) {
});
}
-/// Truncate to the first `n` grapheme clusters. Slicing by byte or `char`
-/// would split an emoji mid-sequence and leave a different glyph on screen.
-fn grapheme_prefix(s: &str, n: usize) -> String {
- use unicode_segmentation::UnicodeSegmentation;
- s.graphemes(true).take(n).collect()
-}
-
/// Parse what was typed for a `/settings` row into the TOML item to write, the
/// one validator every settings writer shares (`/settings` and `/vibe-setting`).
-/// `Ok(None)` is an unset -- the key is removed so its default applies -- except
-/// for a `Glyph`, where an empty field is the written "off" value. `Err` is the
-/// message to show, naming the valid range.
+/// `Ok(None)` is an unset -- the key is removed so its default applies. `Err` is
+/// the message to show, naming the valid range.
fn parse_setting_input(
def: &AgentSettingDef,
input: &str,
@@ -15846,15 +15645,6 @@ fn parse_setting_input(
Err(_) => Err(format!("'{input}' is not a number")),
}
}
- AgentSettingKind::Glyph { .. } => {
- // Not trimmed to empty-means-unset like `Text`: a cleared field
- // writes `""`, which is the off switch. `x` on the row is how you
- // get back to the default.
- if let Some(err) = crate::core::agent::global_config::wave_error(trimmed) {
- return Err(err);
- }
- Ok(Some(toml_edit::value(trimmed.to_string())))
- }
AgentSettingKind::Text { .. } => {
Ok((!trimmed.is_empty()).then(|| toml_edit::value(trimmed.to_string())))
}
@@ -15883,8 +15673,7 @@ fn parse_setting_input(
}
/// Keyboard for the `/settings` edit dock: chars/backspace edit the field,
-/// Enter validates and writes (an empty field clears the key, except for a
-/// `Glyph`, where it writes the off value), Esc cancels. Mirrors
+/// Enter validates and writes (an empty field clears the key), Esc cancels. Mirrors
/// `handle_login_key`, minus the secret/verify machinery.
fn handle_settings_key(app: &mut App, key: KeyEvent, ctrl: bool) {
if (key.code == KeyCode::Esc || (ctrl && key.code == KeyCode::Char('c')))
@@ -15909,20 +15698,12 @@ fn handle_settings_key(app: &mut App, key: KeyEvent, ctrl: bool) {
match write_setting(prompt.def(), &toml_path, value) {
Ok(()) => {
let entered = prompt.input.trim().to_string();
- let glyph_kind = matches!(prompt.def().kind, AgentSettingKind::Glyph { .. });
- let what = match (entered.is_empty(), glyph_kind) {
- // A cleared glyph is a written value, not an unset, so
- // saying "default applies" would be a lie.
- (true, true) => format!("{} off (throbber)", prompt.key),
- (true, false) => format!("{} unset (default applies)", prompt.key),
- (false, _) => format!("{} = {entered} written", prompt.key),
- };
- let when = if apply_live_setting(prompt.def(), &entered) {
- "in effect now"
+ let what = if entered.is_empty() {
+ format!("{} unset (default applies)", prompt.key)
} else {
- "takes effect on the next run"
+ format!("{} = {entered} written", prompt.key)
};
- app.note(&format!("{what}; {when}"));
+ app.note(&format!("{what}; takes effect on the next run"));
app.settings_prompt = None;
}
Err(e) => {
@@ -15932,29 +15713,9 @@ fn handle_settings_key(app: &mut App, key: KeyEvent, ctrl: bool) {
}
}
KeyCode::Backspace => {
- // Whole cluster for a glyph field: popping one `char` off `πŸ‘οΈ`
- // leaves `πŸ‘`, so the row looks unchanged and the key reads as
- // broken. Other kinds keep the plain char pop.
- if matches!(prompt.def().kind, AgentSettingKind::Glyph { .. }) {
- let keep =
- crate::core::agent::global_config::wave_len(&prompt.input).saturating_sub(1);
- prompt.input = grapheme_prefix(&prompt.input, keep);
- } else {
- prompt.input.pop();
- }
- }
- KeyCode::Char(ch) if !ctrl => {
- prompt.input.push(ch);
- // Checked on the result rather than by counting up: a skin-tone
- // modifier or ZWJ joins the cluster before it, so the string can
- // grow by a `char` without growing by a grapheme, and that must
- // still be allowed at the cap.
- if let AgentSettingKind::Glyph { max, .. } = prompt.def().kind {
- if crate::core::agent::global_config::wave_len(&prompt.input) > max {
- prompt.input.pop();
- }
- }
+ prompt.input.pop();
}
+ KeyCode::Char(ch) if !ctrl => prompt.input.push(ch),
_ => {}
}
}
@@ -20786,9 +20547,6 @@ fn settings_prompt_lines(
.unwrap_or_else(|| "unset".to_string());
format!("default: {d} Β· valid: {min}-{max}")
}
- AgentSettingKind::Glyph { default, max } => {
- format!("default: {default} Β· valid: up to {max} chars, empty = off")
- }
AgentSettingKind::Text { default } => format!("default: {default}"),
AgentSettingKind::Enum { options, default } => {
format!("default: {default} Β· valid: {}", options.join(" | "))
@@ -21411,11 +21169,6 @@ fn draw_picker(
.unwrap_or_else(|| "unset".to_string());
format!("default: {d} Β· valid: {min}-{max} Β· current: {current}")
}
- AgentSettingKind::Glyph { default, max } => {
- format!(
- "default: {default} Β· valid: up to {max} chars, empty = off Β· current: {current}"
- )
- }
AgentSettingKind::Text { default } => {
format!("default: {default} Β· current: {current}")
}
@@ -22370,10 +22123,10 @@ const WORKING_HINTS: [&str; 2] = [
" (Esc to cancel)",
];
-/// The running row: throbber (or wave), action word, elapsed time and the
-/// cancel hint, always one row. What does not fit `width` is dropped in order
-/// of importance -- the long hint, then the short one, then the elapsed time --
-/// so the row never wraps or changes height.
+/// The running row: shimmering action word and the cancel hint, always one
+/// row. The run's elapsed time lives in the header, not here. A hint that does
+/// not fit `width` drops to the shorter one, then to none, so the row never
+/// wraps or changes height.
fn working_row(app: &App, width: u16) -> Line<'static> {
let mode = motion::mode();
// The spinner carries the fast motion; the action word turns over on a
@@ -22396,23 +22149,11 @@ fn working_row(app: &App, width: u16) -> Line<'static> {
motion::Tint::Muted,
)
};
- // With `wave` set, the glyph travels along the action word in place of the
- // leading throbber: one moving thing per row, not two. Reduced motion
- // keeps the word and drops the traveller, so the row is as wide as it is
- // animated.
+ // The shimmer alone carries the motion: no throbber, so the row is as wide
+ // animated as it is still.
let message = format!("{word}…");
- let lead = match (wave_glyph(), mode) {
- (Some(glyph), motion::MotionMode::Animated) => {
- wave_sweep_line(&message, &glyph, app.spinner_frame, style)
- }
- (Some(_), motion::MotionMode::Reduced) => Line::from(Span::styled(message, style)),
- (None, _) => Line::from(vec![
- Span::styled(format!("{} ", app.spinner()), Style::new().fg(theme::accent())),
- Span::styled(message, style),
- ]),
- };
let mut spans = motion::shimmer_styled(
- vec![lead],
+ vec![Line::from(Span::styled(message, style))],
style,
tint,
motion::frame_time(app.spinner_frame),
@@ -22421,16 +22162,8 @@ fn working_row(app: &App, width: u16) -> Line<'static> {
)
.remove(0)
.spans;
- let room = width as usize;
- let elapsed = app
- .run_started
- .map(|t| Span::styled(format!(" {}", format_elapsed(t.elapsed().as_secs())), Style::new().dim()))
- .filter(|e| spans_width(&spans) + e.width() <= room);
- if let Some(e) = elapsed {
- spans.push(e);
- }
let used = spans_width(&spans);
- if let Some(hint) = WORKING_HINTS.iter().find(|h| used + h.len() <= room) {
+ if let Some(hint) = WORKING_HINTS.iter().find(|h| used + h.len() <= width as usize) {
spans.push(Span::styled(*hint, Style::new().dim().italic()));
}
Line::from(spans)
@@ -22440,38 +22173,32 @@ fn input_box(app: &App, width: u16) -> Paragraph<'static> {
let block = Block::default();
if let Some(kind) = app.compacting.filter(|_| app.input.is_empty()) {
// Compaction puts nothing in the transcript while it runs, so the input
- // row carries the throbber and the elapsed seconds.
+ // row carries the label and the elapsed seconds.
let elapsed = app
.compact_started
.map(|t| format!(" {}", format_elapsed(t.elapsed().as_secs())))
.unwrap_or_default();
- Paragraph::new(Line::from(vec![
- Span::styled(format!("{} ", app.spinner()), Style::new().magenta()),
- Span::styled(
- format!("{} conversation…{elapsed}", kind.label()),
- Style::new().dim().italic(),
- ),
- ]))
+ Paragraph::new(Line::from(Span::styled(
+ format!("{} conversation…{elapsed}", kind.label()),
+ Style::new().dim().italic(),
+ )))
.block(block)
} else if let Some(started) = app.run_compacting.filter(|_| app.input.is_empty()) {
- Paragraph::new(Line::from(vec![
- Span::styled(format!("{} ", app.spinner()), Style::new().magenta()),
- Span::styled(
- format!(
- "compacting conversation… {}",
- format_elapsed(started.elapsed().as_secs())
- ),
- Style::new().dim().italic(),
+ Paragraph::new(Line::from(Span::styled(
+ format!(
+ "compacting conversation… {}",
+ format_elapsed(started.elapsed().as_secs())
),
- ]))
+ Style::new().dim().italic(),
+ )))
.block(block)
} else if let Some(wait) = app.retrying.as_ref().filter(|_| app.input.is_empty()) {
// Without this the row reads "working" through up to the whole retry
// budget, indistinguishable from a slow model.
- Paragraph::new(Line::from(vec![
- Span::styled(format!("{} ", app.spinner()), Style::new().fg(theme::warning())),
- Span::styled(retry_wait_label(wait, Instant::now()), Style::new().dim().italic()),
- ]))
+ Paragraph::new(Line::styled(
+ retry_wait_label(wait, Instant::now()),
+ Style::new().dim().italic(),
+ ))
.block(block)
} else if app.picker.is_some() {
Paragraph::new(Line::styled("selecting…", Style::new().dim().italic())).block(block)
@@ -22481,13 +22208,10 @@ fn input_box(app: &App, width: u16) -> Paragraph<'static> {
Paragraph::new(working_row(app, width)).block(block)
} else {
let n = app.message_queue.len();
- Paragraph::new(Line::from(vec![
- Span::styled(format!("{} ", app.spinner()), Style::new().fg(theme::warning())),
- Span::styled(
- format!("⏳ Pending ({n}) β€” /cancel to remove, type to steer"),
- Style::new().fg(theme::warning()),
- ),
- ]))
+ Paragraph::new(Line::styled(
+ format!("⏳ Pending ({n}) β€” /cancel to remove, type to steer"),
+ Style::new().fg(theme::warning()),
+ ))
.block(block)
}
} else if let Some(what) = app.blocking_dock() {
@@ -22727,8 +22451,8 @@ mod tests {
split_reasoning, starting_call_lines, startup_modes, strip_system_xml_tags,
subagent_activity, subagent_name_from_run_id, summarize_result, sync_output_for,
thinking_open, tilde_path, tokens_per_second, tool_activity, tool_finished,
- transcript_top_padding, unescape_partial_json_string, user_content_parts, wave_sweep_line,
- with_wave_glyph, without_think_tags, worktree_command, App, CompactKind, ContextReport,
+ transcript_top_padding, unescape_partial_json_string, user_content_parts,
+ without_think_tags, worktree_command, App, CompactKind, ContextReport,
ContextSegment, CurrentRun, Readout, McpField, McpPrompt, MonitorSet, Pending,
PendingImage, PickerKind, ProviderField, ReasoningSeg, ResumeRequest, ResumeTarget, Row,
RowKind, Selection, SelectionMode, SnapshotJob, Status, Worktree, AGENT_SETTINGS,
@@ -28945,7 +28669,7 @@ mod tests {
r#"{"changes": [
{"key": "context_window", "scope": "project", "new_value": 1000000, "reason": "1M window"},
{"key": "show_reasoning", "scope": "project", "new_value": true},
- {"key": "wave", "scope": "global", "new_value": "~"}
+ {"key": "ask_timeout_secs", "scope": "global", "new_value": 30}
]}"#,
);
assert!(app.vibe_confirm.is_some(), "the diff docks");
@@ -28964,18 +28688,16 @@ mod tests {
assert!(doc.contains("# keep me"), "format-preserving: {doc}");
assert!(doc.contains("show_reasoning = true"), "{doc}");
let global = std::fs::read_to_string(home.join(".jan/config.toml")).unwrap();
- assert!(global.contains("wave = \"~\""), "{global}");
+ assert!(global.contains("ask_timeout_secs = 30"), "{global}");
let note = transcript_text(&app);
assert!(note.contains("wrote 3 setting(s)"), "{note}");
let flat = note.split_whitespace().collect::<Vec<_>>().join(" ");
- assert!(flat.contains("wave in effect now"), "{flat}");
+ assert!(flat.contains("show_reasoning, ask_timeout_secs apply when jan restarts"), "{flat}");
assert!(flat.contains("run /reload config to apply context_window"), "{flat}");
- assert!(flat.contains("show_reasoning applies when jan restarts"), "{flat}");
// A side call, not a turn: the conversation -- and so the cached
// request prefix -- is exactly what it was before the command.
assert!(app.history.is_empty(), "{:?}", app.history);
assert!(!app.want_start);
- super::set_wave_glyph(None);
let _ = std::fs::remove_dir_all(&app.agent_dir);
});
}
@@ -29108,76 +28830,49 @@ mod tests {
let _ = std::fs::remove_dir_all(&app.agent_dir);
}
- /// `wave` lives in `~/.jan/config.toml`, not the project's agent.toml, so
- /// the row has to write across scopes. It is also the one setting that
- /// applies live: a cosmetic glyph you must restart to see is not a toggle,
- /// and the note must not claim a restart is needed.
+ /// `ask_timeout_secs` lives in the user-wide config, not the project's
+ /// agent.toml, so the row has to write across scopes, and the note says it
+ /// takes effect on the next run.
#[test]
- fn settings_prompt_writes_a_global_scope_key_and_applies_it_live() {
+ fn settings_prompt_writes_a_global_scope_key() {
crate::core::agent::global_config::with_temp_home(|home| {
let mut app = test_app();
std::fs::create_dir_all(&app.agent_dir).unwrap();
let toml_path = app.agent_dir.join("agent.toml");
std::fs::write(&toml_path, "[agent]\n").unwrap();
- let def = AGENT_SETTINGS.iter().find(|d| d.key == "wave").unwrap();
+ let def = AGENT_SETTINGS
+ .iter()
+ .find(|d| d.key == "ask_timeout_secs")
+ .unwrap();
app.settings_prompt = Some(super::SettingsPrompt::new(def, None));
- super::handle_settings_key(&mut app, key(KeyCode::Char('~')), false);
+ super::handle_settings_key(&mut app, key(KeyCode::Char('9')), false);
super::handle_settings_key(&mut app, key(KeyCode::Enter), false);
assert!(app.settings_prompt.is_none(), "Enter closes the dock");
- let global = std::fs::read_to_string(home.join(".jan").join("config.toml")).unwrap();
+ let global = std::fs::read_to_string(crate::core::agent::global_config::global_config_path().unwrap()).unwrap();
+ let _ = home;
assert!(
- global.contains("wave = \"~\""),
+ global.contains("ask_timeout_secs = 9"),
"written globally: {global}"
);
let project = std::fs::read_to_string(&toml_path).unwrap();
assert!(
- !project.contains("wave"),
+ !project.contains("ask_timeout_secs"),
"a global key must not land in agent.toml: {project}"
);
- assert_eq!(super::wave_glyph().as_deref(), Some("~"), "applied live");
let note = transcript_text(&app);
- assert!(note.contains("wave = ~ written"), "{note}");
- assert!(
- note.contains("in effect now"),
- "no restart is needed: {note}"
- );
+ assert!(note.contains("ask_timeout_secs = 9 written"), "{note}");
+ assert!(note.contains("takes effect on the next run"), "{note}");
- // Clearing the field writes the off value, live. It does *not*
- // remove the key: absent means the default πŸ‘‹ comes back, which is
- // the opposite of what someone clearing the glyph asked for.
- app.settings_prompt = Some(super::SettingsPrompt::new(def, Some("~")));
+ // Clearing the field removes the key.
+ app.settings_prompt = Some(super::SettingsPrompt::new(def, Some("9")));
super::handle_settings_key(&mut app, key(KeyCode::Backspace), false);
super::handle_settings_key(&mut app, key(KeyCode::Enter), false);
- assert_eq!(super::wave_glyph(), None, "off applied live");
- // Asserted through the reader, not the raw text: the scaffolded
- // template carries a commented `# wave = ...` example line that a
- // substring check would match forever.
- assert_eq!(
- crate::core::agent::global_config::global_value("wave").as_deref(),
- Some(""),
- "cleared field persists as the off value"
- );
- let note = transcript_text(&app);
- assert!(
- note.contains("wave off (throbber)"),
- "off, not unset: {note}"
- );
-
- // Removing the key is the other path, and it restores the default
- // rather than leaving the sweep off.
- crate::core::agent::global_config::set_global_key("wave", None).expect("unset");
- super::set_wave_glyph(None);
assert_eq!(
- crate::core::agent::global_config::global_value("wave"),
+ crate::core::agent::global_config::global_value("ask_timeout_secs"),
None,
- "key removed from the file"
- );
- assert_eq!(
- super::wave_glyph().as_deref(),
- Some(crate::core::agent::global_config::WAVE_DEFAULT),
- "a removed key brings the default sweep back"
+ "cleared field unsets the key"
);
let _ = std::fs::remove_dir_all(&app.agent_dir);
@@ -29200,22 +28895,26 @@ mod tests {
std::fs::write(app.agent_dir.join("agent.toml"), "[agent]\n").unwrap();
std::fs::create_dir_all(home.join(".jan")).unwrap();
let global_path = home.join(".jan").join("config.toml");
- std::fs::write(&global_path, "wave = \"🍌\"\n").unwrap();
+ std::fs::write(&global_path, "ask_timeout_secs = 5\n").unwrap();
super::settings_command(&mut app, "");
let picker = app.picker.as_ref().expect("picker opens");
let row = picker
.items
.iter()
- .find(|i| i.value == "wave")
- .expect("wave row present");
- assert_eq!(row.hint.as_deref(), Some("= 🍌"), "hint reads ~/.jan");
+ .find(|i| i.value == "ask_timeout_secs")
+ .expect("ask_timeout_secs row present");
+ assert_eq!(row.hint.as_deref(), Some("= 5"), "hint reads the global config");
- let idx = picker.items.iter().position(|i| i.value == "wave").unwrap();
+ let idx = picker
+ .items
+ .iter()
+ .position(|i| i.value == "ask_timeout_secs")
+ .unwrap();
app.picker.as_mut().unwrap().selected = idx;
rt.block_on(press(&mut app, KeyCode::Char('x'), KeyModifiers::NONE));
assert_eq!(
- crate::core::agent::global_config::global_value("wave"),
+ crate::core::agent::global_config::global_value("ask_timeout_secs"),
None,
"x unsets globally"
);
@@ -29225,8 +28924,8 @@ mod tests {
.expect("picker stays open")
.items
.iter()
- .find(|i| i.value == "wave")
- .expect("wave row present");
+ .find(|i| i.value == "ask_timeout_secs")
+ .expect("ask_timeout_secs row present");
assert_eq!(row.hint.as_deref(), Some("(unset)"));
let _ = std::fs::remove_dir_all(&app.agent_dir);
@@ -29256,64 +28955,6 @@ mod tests {
let _ = std::fs::remove_dir_all(&app.agent_dir);
}
- /// The glyph field stops accepting input at the cap rather than letting a
- /// long string be typed and rejected on Enter, and it counts what the eye
- /// counts: `πŸ‘οΈπŸ‘„πŸ‘οΈ` is three characters, not five.
- #[test]
- fn settings_glyph_field_caps_at_three_graphemes() {
- let mut app = test_app();
- let def = AGENT_SETTINGS.iter().find(|d| d.key == "wave").unwrap();
- app.settings_prompt = Some(super::SettingsPrompt::new(def, None));
-
- for ch in "πŸ‘οΈπŸ‘„πŸ‘οΈ".chars() {
- super::handle_settings_key(&mut app, key(KeyCode::Char(ch)), false);
- }
- fn input(app: &App) -> String {
- app.settings_prompt.as_ref().unwrap().input.clone()
- }
- assert_eq!(
- input(&app),
- "πŸ‘οΈπŸ‘„πŸ‘οΈ",
- "three clusters of five chars all fit"
- );
-
- // One past the cap is dropped, and the field is left exactly as it was
- // rather than half-appended.
- super::handle_settings_key(&mut app, key(KeyCode::Char('x')), false);
- assert_eq!(input(&app), "πŸ‘οΈπŸ‘„πŸ‘οΈ", "a fourth cluster is refused");
-
- // Backspace removes a whole cluster: popping one `char` off `πŸ‘οΈ` would
- // leave `πŸ‘`, which looks like nothing happened.
- super::handle_settings_key(&mut app, key(KeyCode::Backspace), false);
- assert_eq!(input(&app), "πŸ‘οΈπŸ‘„", "backspace drops the whole cluster");
- }
-
- /// A hand-typed over-long glyph is rejected inline with a reason, not
- /// silently truncated: truncation would save something the user did not
- /// type.
- #[test]
- fn settings_glyph_rejects_an_over_long_paste() {
- crate::core::agent::global_config::with_temp_home(|_| {
- let mut app = test_app();
- let def = AGENT_SETTINGS.iter().find(|d| d.key == "wave").unwrap();
- let mut prompt = super::SettingsPrompt::new(def, None);
- // Set directly: the key handler caps typing, so an over-long value
- // can only arrive from a paste or a hand-edited file.
- prompt.input = "abcd".to_string();
- app.settings_prompt = Some(prompt);
-
- super::handle_settings_key(&mut app, key(KeyCode::Enter), false);
- let prompt = app.settings_prompt.as_ref().expect("dock stays open");
- let error = prompt.error.as_deref().expect("inline error");
- assert!(error.contains('3'), "names the cap: {error}");
- assert_eq!(
- crate::core::agent::global_config::global_value("wave"),
- None,
- "nothing written on a rejected value"
- );
- });
- }
-
#[test]
fn settings_prompt_cleared_field_unsets_key() {
let mut app = test_app();
@@ -34774,7 +34415,7 @@ mod tests {
}
#[test]
- fn a_running_compaction_shows_a_throbber() {
+ fn a_running_compaction_is_labelled_in_the_input_row() {
let mut app = test_app();
let idle = render_rows(&mut app, 80, 12).join("\n");
assert!(!idle.contains("compacting"), "got: {idle}");
@@ -34787,8 +34428,8 @@ mod tests {
"the input row must say what is happening: {out}"
);
assert!(
- out.contains(SPINNER[app.spinner_frame % SPINNER.len()]),
- "the input row must carry the throbber: {out}"
+ !SPINNER.iter().any(|f| out.contains(f)),
+ "the input row carries no throbber: {out}"
);
}
@@ -35387,53 +35028,27 @@ mod tests {
}
/// The running placeholder is the row a user stares at during a long turn.
- /// A static "working…" reads as a hung UI, so it animates on the same
- /// cadence as every other throbber: the spinner glyph rotates, and the
- /// action word cycles through synonyms of "working".
+ /// A static "working…" reads as a hung UI, so the action word cycles through
+ /// synonyms of "working" and shimmers (colour only, see
+ /// `working_synonym_rotates_across_frames`). The row carries no throbber.
#[test]
- fn working_placeholder_animates() {
+ fn working_placeholder_has_a_synonym_and_no_throbber() {
let mut app = test_app();
app.submit_user("go".into());
assert_eq!(app.status, Status::Running);
- // Pinned off: these assert on the spinner glyph and the intact action
- // word, both of which the sweep overwrites a cell of. `wave` is on by
- // default now, so the sweep has its own tests and these keep testing
- // the row underneath it.
- let frame_of = |app: &mut App| {
- with_wave_glyph(None, || {
- render_rows(app, 80, 12)
- .into_iter()
- .find(|r| r.contains("(Esc to cancel, type to steer the agent)"))
- .expect("running placeholder present")
- })
- };
-
app.spinner_frame = 0;
- let first = frame_of(&mut app);
- assert!(
- first.contains(SPINNER[0]),
- "expected frame 0 glyph: {first:?}"
- );
-
- // While a plain turn is running (no reasoning), the row shows a
- // rotating synonym of "working".
- assert!(
- WORKING_WORDS.iter().any(|w| first.contains(w)),
- "expected a working synonym in: {first:?}"
- );
-
- app.spinner_frame = 3;
- let later = frame_of(&mut app);
+ let row = render_rows(&mut app, 80, 12)
+ .into_iter()
+ .find(|r| r.contains("(Esc to cancel, type to steer the agent)"))
+ .expect("running placeholder present");
assert!(
- later.contains(SPINNER[3]),
- "expected frame 3 glyph: {later:?}"
+ WORKING_WORDS.iter().any(|w| row.contains(w)),
+ "expected a working synonym in: {row:?}"
);
- assert_ne!(first, later, "row must change as the frame advances");
-
assert!(
- later.contains("(Esc to cancel, type to steer the agent)"),
- "{later:?}"
+ !SPINNER.iter().any(|f| row.contains(f)),
+ "no throbber on the input row: {row:?}"
);
}
@@ -35446,14 +35061,10 @@ mod tests {
app.apply(StreamEvent::Token {
text: "<think>ponder the plan".into(),
});
- // Pinned off for the same reason as `working_placeholder_animates`:
- // the sweep replaces a letter of the word being matched.
- let row = with_wave_glyph(None, || {
- render_rows(&mut app, 80, 12)
- .into_iter()
- .find(|r| r.contains("(Esc to cancel, type to steer the agent)"))
- .expect("running placeholder present")
- });
+ let row = render_rows(&mut app, 80, 12)
+ .into_iter()
+ .find(|r| r.contains("(Esc to cancel, type to steer the agent)"))
+ .expect("running placeholder present");
assert!(
THINKING_WORDS.iter().any(|w| row.contains(w)),
"expected a thinking synonym in: {row:?}"
@@ -35475,11 +35086,7 @@ mod tests {
text: "<think>ponder the plan".into(),
});
let mut terminal = Terminal::new(TestBackend::new(80, 12)).unwrap();
- // Pinned off: the row is located by matching the intact word, which
- // the sweep breaks.
- with_wave_glyph(None, || {
- terminal.draw(|f| super::draw(f, &mut app)).unwrap();
- });
+ terminal.draw(|f| super::draw(f, &mut app)).unwrap();
let buf = terminal.backend().buffer().clone();
// Locate the placeholder row, then assert the action word's cells are
// orange (the trailing hint stays dim, so only the word carries it).
@@ -35500,14 +35107,10 @@ mod tests {
app.submit_user("go".into());
let mut word_at = |frame: usize| {
app.spinner_frame = frame;
- // Pinned off: the sweep would eat a letter of the very word this
- // looks up.
- let row = with_wave_glyph(None, || {
- render_rows(&mut app, 80, 12)
- .into_iter()
- .find(|r| r.contains("(Esc to cancel, type to steer the agent)"))
- .expect("running placeholder present")
- });
+ let row = render_rows(&mut app, 80, 12)
+ .into_iter()
+ .find(|r| r.contains("(Esc to cancel, type to steer the agent)"))
+ .expect("running placeholder present");
WORKING_WORDS
.iter()
.find(|w| row.contains(*w))
@@ -35519,18 +35122,20 @@ mod tests {
assert_ne!(a, b, "working word must rotate as frames advance: {a}");
}
- /// A queued-message row is still a running row, so it animates too.
+ /// A queued-message row is a running row too, with no throbber of its own.
#[test]
- fn queued_placeholder_animates() {
+ fn queued_placeholder_has_no_throbber() {
let mut app = test_app();
app.submit_user("go".into());
app.message_queue.push_back("next".into());
- app.spinner_frame = 5;
let row = render_rows(&mut app, 80, 12)
.into_iter()
.find(|r| r.contains("Pending"))
.expect("queued row present");
- assert!(row.contains(SPINNER[5]), "expected frame 5 glyph: {row:?}");
+ assert!(
+ !SPINNER.iter().any(|f| row.contains(f)),
+ "no throbber on the queued row: {row:?}"
+ );
}
/// Native reasoning events (a dedicated `reasoning_content` field) drive the
@@ -35543,16 +35148,10 @@ mod tests {
app.apply(StreamEvent::Reasoning {
text: "ponder the plan".into(),
});
- // Pinned off: this asserts on the *word*, and the sweep overwrites a
- // letter of it with the travelling glyph. `wave` is on by default now,
- // so leaving it to the process state makes this test depend on
- // whichever config the shared cell resolved first.
- let row = with_wave_glyph(None, || {
- render_rows(&mut app, 80, 12)
- .into_iter()
- .find(|r| r.contains("(Esc to cancel, type to steer the agent)"))
- .expect("running placeholder present")
- });
+ let row = render_rows(&mut app, 80, 12)
+ .into_iter()
+ .find(|r| r.contains("(Esc to cancel, type to steer the agent)"))
+ .expect("running placeholder present");
assert!(
THINKING_WORDS.iter().any(|w| row.contains(w)),
"expected a thinking synonym while reasoning: {row:?}"
@@ -39073,9 +38672,10 @@ mod tests {
assert_eq!(format_elapsed(3720), "1h 02m");
}
- /// The working row carries the elapsed time and the cancel hint on one
- /// row, is exactly as wide in both motion modes, and sheds the hint, then
- /// the elapsed time, as the terminal narrows instead of wrapping.
+ /// The working row carries the cancel hint on one row, is exactly as wide
+ /// in both motion modes, and sheds the hint as the terminal narrows instead
+ /// of wrapping. The elapsed time is the header's alone: the input row never
+ /// shows it.
#[test]
fn the_working_row_keeps_its_width_and_degrades_by_width() {
use super::motion::{with_mode, MotionMode};
@@ -39085,48 +38685,44 @@ mod tests {
let text = |line: &Line<'static>| -> String {
line.spans.iter().map(|s| s.content.as_ref()).collect()
};
- for glyph in [None, Some("\u{1f44b}")] {
- with_wave_glyph(glyph, || {
- for frame in [0, 7, 19] {
- app.spinner_frame = frame;
- let moving = with_mode(MotionMode::Animated, || super::working_row(&app, 120));
- let still = with_mode(MotionMode::Reduced, || super::working_row(&app, 120));
- assert_eq!(
- spans_width(&moving.spans),
- spans_width(&still.spans),
- "glyph {glyph:?} frame {frame}: {:?} vs {:?}",
- text(&moving),
- text(&still)
- );
- assert!(text(&moving).contains("1m 05s"), "{}", text(&moving));
- assert!(text(&moving).contains("Esc to cancel, type to steer"));
- }
- });
+ for frame in [0, 7, 19] {
+ app.spinner_frame = frame;
+ let moving = with_mode(MotionMode::Animated, || super::working_row(&app, 120));
+ let still = with_mode(MotionMode::Reduced, || super::working_row(&app, 120));
+ assert_eq!(
+ spans_width(&moving.spans),
+ spans_width(&still.spans),
+ "frame {frame}: {:?} vs {:?}",
+ text(&moving),
+ text(&still)
+ );
+ assert!(!text(&moving).contains("1m 05s"), "{}", text(&moving));
+ assert!(text(&moving).contains("Esc to cancel, type to steer"));
}
app.spinner_frame = 0;
- with_wave_glyph(None, || {
- for width in 0..120u16 {
- let row = super::working_row(&app, width);
- let t = text(&row);
- if t.contains("cancel") || t.contains("1m 05s") {
- let w = spans_width(&row.spans);
- assert!(w <= width as usize, "optional parts must fit: {width}: {t}");
- }
- }
- // "<glyph> working... 1m 05s" is 17 cells; the short hint adds 16.
- let mid = text(&super::working_row(&app, 34));
- assert!(mid.contains("(Esc to cancel)") && !mid.contains("steer"), "{mid}");
- let narrow = text(&super::working_row(&app, 22));
- assert!(narrow.contains("1m 05s") && !narrow.contains("Esc"), "{narrow}");
- let tiny = text(&super::working_row(&app, 12));
- assert!(!tiny.contains("1m"), "{tiny}");
- });
- // Rendered: still one row in the input box.
- let rows = with_wave_glyph(None, || render_rows(&mut app, 40, 12));
+ for width in 0..120u16 {
+ let row = super::working_row(&app, width);
+ let t = text(&row);
+ if t.contains("cancel") {
+ let w = spans_width(&row.spans);
+ assert!(w <= width as usize, "optional parts must fit: {width}: {t}");
+ }
+ }
+ // "working…" is 8 cells; the short hint adds 16.
+ let mid = text(&super::working_row(&app, 34));
+ assert!(mid.contains("(Esc to cancel)") && !mid.contains("steer"), "{mid}");
+ let narrow = text(&super::working_row(&app, 20));
+ assert!(!narrow.contains("Esc"), "{narrow}");
+ // Rendered: still one row in the input box, and the elapsed time
+ // appears once -- in the header, not beside the hint.
+ let rows = render_rows(&mut app, 60, 12);
+ let working: Vec<_> = rows.iter().filter(|r| r.contains("Esc to cancel")).collect();
+ assert_eq!(working.len(), 1, "{rows:#?}");
+ assert!(!working[0].contains("1m 05s"), "{rows:#?}");
assert_eq!(
- rows.iter().filter(|r| r.contains("Esc to cancel")).count(),
+ rows.iter().filter(|r| r.contains("1m 05s")).count(),
1,
- "{rows:#?}"
+ "header keeps the elapsed time: {rows:#?}"
);
}
@@ -43697,117 +43293,30 @@ mod tests {
assert!(clamped.spans.last().unwrap().content.ends_with('\u{2026}'));
}
- /// The bug #8726 was reverted for: a 2-cell emoji stood in for a 1-cell
- /// character, so every frame was a cell wider than the text and the tail
- /// slid right until the last character fell off the row. The sweep must
- /// occupy exactly the width of the message it travels along, at every frame.
- #[test]
- fn a_wide_glyph_never_changes_the_row_width() {
- let message = "working…";
- let plain = message.width();
- for glyph in ["πŸ‘‹", "🍌", "~", "<o>"] {
- for frame in 0..40 {
- let line = wave_sweep_line(message, glyph, frame, Style::default());
- assert_eq!(
- spans_width(&line.spans),
- plain,
- "glyph {glyph:?} frame {frame} changed the row width"
- );
- }
- }
- }
-
- /// The glyph covers characters instead of deleting them: every frame keeps
- /// the message's own width, and the characters it is not standing on are
- /// still there in order.
- #[test]
- fn the_sweep_covers_characters_without_dropping_the_rest() {
- let line = wave_sweep_line("working…", "πŸ‘‹", 0, Style::default());
- let text = line_text(&line);
- assert!(text.starts_with('πŸ‘‹'), "{text}");
- // "πŸ‘‹" is two cells, so it stands on "wo" and the rest survives.
- assert!(text.ends_with("rking…"), "{text}");
- }
-
- /// A 1-cell glyph spends one character, so a narrow ASCII wave is exact
- /// rather than padded.
- #[test]
- fn a_narrow_glyph_covers_exactly_one_character() {
- let line = wave_sweep_line("abc", "~", 0, Style::default());
- assert_eq!(line_text(&line), "~bc");
- }
-
- /// The sweep reverses at both ends instead of jumping back to the start,
- /// and never runs off the message.
- #[test]
- fn the_sweep_reverses_at_both_ends() {
- let seen: Vec<String> = (0..8)
- .map(|frame| line_text(&wave_sweep_line("abcd", "~", frame, Style::default())))
- .collect();
- assert_eq!(
- seen,
- vec!["~bcd", "a~cd", "ab~d", "abc~", "ab~d", "a~cd", "~bcd", "a~cd"]
- );
- }
-
- /// Multi-byte characters are covered on character boundaries, so a sweep
- /// over non-ASCII text cannot slice a `char` in half and panic.
- #[test]
- fn the_sweep_respects_character_boundaries() {
- for frame in 0..12 {
- let line = wave_sweep_line("Γ©xé…", "~", frame, Style::default());
- assert_eq!(spans_width(&line.spans), "Γ©xé…".width());
- }
- }
-
- /// A message narrower than the glyph has nowhere to sweep, so it is left
- /// alone rather than being overwritten by a glyph wider than itself.
- #[test]
- fn a_message_narrower_than_the_glyph_is_left_alone() {
- let line = wave_sweep_line("a", "πŸ‘‹", 0, Style::default());
- assert_eq!(line_text(&line), "a");
- }
-
- /// Unset `wave` leaves the Braille throbber in place: the sweep is opt-in,
- /// so a terminal with no emoji font is unaffected by default.
+ /// The working row is the shimmering action word alone: no throbber and no
+ /// travelling glyph, in either motion mode.
///
/// Anchored on "Esc to cancel", which only the input row carries: the header
/// also shows `[working]` and the brand wave, and matching those would test
/// the wrong row.
#[test]
- fn the_working_row_keeps_its_throbber_until_a_wave_is_configured() {
- let mut app = test_app();
- app.status = Status::Running;
- let rows = with_wave_glyph(None, || render_rows(&mut app, 80, 12));
- let row = rows
- .iter()
- .find(|r| r.contains("Esc to cancel"))
- .expect("working row")
- .clone();
- assert!(
- SPINNER.iter().any(|s| row.contains(s)),
- "expected a throbber in {row:?}"
- );
- assert!(!row.contains('πŸ‘‹'), "{row}");
- }
-
- /// With `wave` set the glyph replaces the throbber rather than joining it:
- /// two moving things on one row read as jitter.
- #[test]
- fn a_configured_wave_replaces_the_throbber() {
+ fn the_working_row_has_no_throbber_or_traveller() {
+ use super::motion::{with_mode, MotionMode};
let mut app = test_app();
app.status = Status::Running;
- let rows = with_wave_glyph(Some("🍌"), || render_rows(&mut app, 80, 12));
- let row = rows
- .iter()
- .find(|r| r.contains("Esc to cancel"))
- .expect("working row")
- .clone();
- assert!(row.contains('🍌'), "expected the wave in {row:?}");
- assert!(
- !SPINNER.iter().any(|s| row.contains(s)),
- "throbber still present in {row:?}"
- );
+ for mode in [MotionMode::Animated, MotionMode::Reduced] {
+ let rows = with_mode(mode, || render_rows(&mut app, 80, 12));
+ let row = rows
+ .iter()
+ .find(|r| r.contains("Esc to cancel"))
+ .expect("working row");
+ assert!(
+ !SPINNER.iter().any(|s| row.contains(s)) && !row.contains('\u{2022}'),
+ "{mode:?}: throbber in {row:?}"
+ );
+ assert!(!row.contains('\u{1f44b}'), "{mode:?}: {row}");
+ assert!(WORKING_WORDS.iter().any(|w| row.contains(w)), "{mode:?}: {row}");
+ }
}
// ── Session-scoped providers (gateway launches) ─────────────────────────
diff --git a/src-tauri/src/core/cli/tui/tests/snapshot.rs b/src-tauri/src/core/cli/tui/tests/snapshot.rs
index e7a75fac4..a28056671 100644
--- a/src-tauri/src/core/cli/tui/tests/snapshot.rs
+++ b/src-tauri/src/core/cli/tui/tests/snapshot.rs
@@ -16,7 +16,7 @@
//! reviewer has to re-read on every intentional change. One or two
//! representative states (and widths, where the layout reflows) per surface.
//!
-//! Every snapshot renders with motion reduced, the wave glyph off and a pinned
+//! Every snapshot renders with motion reduced and a pinned
//! theme (dark truecolor unless the test is about another), and avoids
//! anything read from the clock or the machine: no running `run_started`
//! (the header shows the wall clock while a run is timed), no git branch, no
@@ -48,12 +48,10 @@ const ANSI16: Theme = Theme {
depth: ColorDepth::Ansi16,
};
-/// Run `f` with every process-wide render input pinned: motion reduced, no
-/// wave glyph (it is read from the user's config otherwise) and `theme`.
+/// Run `f` with every process-wide render input pinned: motion reduced and
+/// `theme`.
fn pinned<T>(theme: Theme, f: impl FnOnce() -> T) -> T {
- with_mode(MotionMode::Reduced, || {
- with_wave_glyph(None, || with_theme(theme, f))
- })
+ with_mode(MotionMode::Reduced, || with_theme(theme, f))
}
/// A fresh app with the machine-dependent inputs cleared: the branch is read
diff --git a/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_diff_ansi16.snap b/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_diff_ansi16.snap
index 2e3ac3a66..93ddcde79 100644
--- a/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_diff_ansi16.snap
+++ b/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_diff_ansi16.snap
@@ -21,7 +21,7 @@ expression: render_snapshot(buf)
|β”‚ Allow always (this thread) β”‚|
|β”‚ Deny β”‚|
|╰────────────────────────────────────────────────────────────────────╯|
-|β€’ working… (Esc to cancel, type to steer the agent) |
+|working… (Esc to cancel, type to steer the agent) |
| |
| ↑/↓ select Enter confirm Esc deny Ctrl-C cancel |
@@ -82,8 +82,7 @@ expression: render_snapshot(buf)
17 0..1 fg=Yellow
17 69..70 fg=Yellow
18 0..70 fg=Yellow
-19 0..2 fg=Cyan
-19 2..51 mod=DIM | ITALIC
+19 0..49 mod=DIM | ITALIC
21 1..4 fg=Yellow mod=BOLD
21 4..11 mod=DIM
21 14..19 fg=Yellow mod=BOLD
diff --git a/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_exec.snap b/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_exec.snap
index fdd051902..9e5aa5b3d 100644
--- a/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_exec.snap
+++ b/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_exec.snap
@@ -19,7 +19,7 @@ expression: render_snapshot(buf)
|β”‚ Allow all 'cargo', 'git' commands (this thread) β”‚|
|β”‚ Deny β”‚|
|╰──────────────────────────────────────────────────────────────────────────────╯|
-|β€’ working… (Esc to cancel, type to steer the agent) |
+|working… (Esc to cancel, type to steer the agent) |
| |
|πŸ“‚ /snapshot/repo ↑/↓ select Enter confirm Esc deny Ctrl-C cancel|
@@ -47,8 +47,7 @@ expression: render_snapshot(buf)
15 0..1 fg=#E5C07B
15 79..80 fg=#E5C07B
16 0..80 fg=#E5C07B
-17 0..2 fg=#56B6C2
-17 2..51 mod=DIM | ITALIC
+17 0..49 mod=DIM | ITALIC
19 0..1 fg=#808080
19 2..17 fg=#808080
19 27..30 fg=#E5C07B mod=BOLD
diff --git a/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_subagent_queued.snap b/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_subagent_queued.snap
index 293e7f9f0..3cab0e5b6 100644
--- a/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_subagent_queued.snap
+++ b/src-tauri/src/core/cli/tui/tests/snapshots/permission_prompt_subagent_queued.snap
@@ -17,7 +17,7 @@ expression: render_snapshot(buf)
|β”‚ β–Ά Allow once β”‚|
|β”‚ Deny β”‚|
|╰──────────────────────────────────────────────────────────────────────╯|
-|β€’ working… (Esc to cancel, type to steer the agent) |
+|working… (Esc to cancel, type to steer the agent) |
| |
| ↑/↓ select Enter confirm Esc deny Ctrl-C cancel |
@@ -48,8 +48,7 @@ expression: render_snapshot(buf)
13 0..1 fg=#E5C07B
13 71..72 fg=#E5C07B
14 0..72 fg=#E5C07B
-15 0..2 fg=#56B6C2
-15 2..51 mod=DIM | ITALIC
+15 0..49 mod=DIM | ITALIC
17 1..4 fg=#E5C07B mod=BOLD
17 4..11 mod=DIM
17 14..19 fg=#E5C07B mod=BOLD
diff --git a/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_single_phase.snap b/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_single_phase.snap
index bcf39d840..de9161613 100644
--- a/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_single_phase.snap
+++ b/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_single_phase.snap
@@ -15,7 +15,7 @@ expression: render_snapshot(buf)
| ☐ write the docs |
| β˜’ support windows xp |
|────────────────────────────────────────────────────────────────────────────────|
-|β€’ working… (Esc to cancel, type to steer the agent) |
+|working… (Esc to cancel, type to steer the agent) |
| |
|πŸ“‚ /snapshot/repo Esc/Ctrl-C cancel PgUp/PgDn scroll Ctrl-O expand all|
@@ -35,8 +35,7 @@ expression: render_snapshot(buf)
9 1..18 fg=#56B6C2
10 1..17 mod=DIM
11 1..21 fg=Red mod=CROSSED_OUT
-13 0..2 fg=#56B6C2
-13 2..51 mod=DIM | ITALIC
+13 0..49 mod=DIM | ITALIC
15 0..1 fg=#808080
15 2..17 fg=#808080
15 24..34 fg=#56B6C2 mod=BOLD
diff --git a/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_split_with_agents.snap b/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_split_with_agents.snap
index 64eb488d9..bf2bc48bc 100644
--- a/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_split_with_agents.snap
+++ b/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_split_with_agents.snap
@@ -17,7 +17,7 @@ expression: render_snapshot(buf)
| ☐ routes β”‚ review the file |
| ☐ auth β”‚ read src/mod_5.rs |
|────────────────────────────────────────────────────────────────────────────────────────────────────|
-|β€’ working… (Esc to cancel, type to steer the agent) |
+|working… (Esc to cancel, type to steer the agent) |
| |
|πŸ“‚ /snapshot/repo Esc/Ctrl-C cancel PgUp/PgDn scroll Ctrl-O expand all|
@@ -47,8 +47,7 @@ expression: render_snapshot(buf)
13 1..7 mod=DIM
13 48..51 fg=#808080
13 54..71 mod=DIM
-15 0..2 fg=#56B6C2
-15 2..51 mod=DIM | ITALIC
+15 0..49 mod=DIM | ITALIC
17 0..1 fg=#808080
17 2..17 fg=#808080
17 44..54 fg=#56B6C2 mod=BOLD
diff --git a/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_stacked_narrow.snap b/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_stacked_narrow.snap
index 3c5d4bef9..438939a92 100644
--- a/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_stacked_narrow.snap
+++ b/src-tauri/src/core/cli/tui/tests/snapshots/todo_panel_stacked_narrow.snap
@@ -17,7 +17,7 @@ expression: render_snapshot(buf)
| review the file |
| read src/mod_1.rs |
|────────────────────────────────────────────────────────────|
-|β€’ working… (Esc to cancel, type to steer the agent) |
+|working… (Esc to cancel, type to steer the agent) |
| |
| Esc/Ctrl-C cancel PgUp/PgDn scroll Ctrl-O expand all |
@@ -41,8 +41,7 @@ expression: render_snapshot(buf)
11 12..21 fg=#808080
12 3..18 mod=DIM | ITALIC
13 3..20 mod=DIM
-15 0..2 fg=#56B6C2
-15 2..51 mod=DIM | ITALIC
+15 0..49 mod=DIM | ITALIC
17 1..11 fg=#56B6C2 mod=BOLD
17 11..18 mod=DIM
17 21..30 fg=#56B6C2 mod=BOLD
diff --git a/src-tauri/src/core/cli/tui/vibe_setting.rs b/src-tauri/src/core/cli/tui/vibe_setting.rs
index 0d31863cf..713520dd1 100644
--- a/src-tauri/src/core/cli/tui/vibe_setting.rs
+++ b/src-tauri/src/core/cli/tui/vibe_setting.rs
@@ -18,8 +18,7 @@ use ratatui::widgets::Paragraph;
use serde_json::{json, Value};
use super::{
- apply_live_setting, apply_live_unset, current_setting_value, parse_setting_input,
- setting_path, wrap_spans_hard, write_setting, AgentSettingDef, AgentSettingKind, App, KeyCode,
+ current_setting_value, parse_setting_input, setting_path, wrap_spans_hard, write_setting, AgentSettingDef, AgentSettingKind, App, KeyCode,
KeyEvent, SettingScope, AGENT_SETTINGS,
};
@@ -121,10 +120,6 @@ fn kind_text(def: &AgentSettingDef) -> (String, String) {
format!("number {min}-{max}"),
opt(default.map(|d| d.to_string())),
),
- AgentSettingKind::Glyph { default, max } => (
- format!("string of up to {max} characters, \"\" = off"),
- default.to_string(),
- ),
AgentSettingKind::Text { default } => ("string".to_string(), default.to_string()),
AgentSettingKind::Enum { options, default } => {
(format!("one of {}", options.join(" | ")), default.to_string())
@@ -446,29 +441,22 @@ pub(super) fn handle_key(app: &mut App, key: KeyEvent, ctrl: bool) {
}
}
-/// Write every change through the `/settings` writer, then report which took
-/// effect now, which `/reload config` applies, and which wait for a restart.
+/// Write every change through the `/settings` writer, then report which
+/// `/reload config` applies and which wait for a restart.
fn apply(app: &mut App) {
let Some(proposal) = app.vibe_confirm.take() else {
return;
};
let toml_path = app.agent_dir.join("agent.toml");
let mut written: Vec<String> = Vec::new();
- let mut live: Vec<String> = Vec::new();
let mut reloadable: Vec<String> = Vec::new();
let mut restart: Vec<String> = Vec::new();
let mut failed: Vec<String> = Vec::new();
for change in &proposal.changes {
match write_setting(change.def, &toml_path, change.item.clone()) {
Ok(()) => {
- let now_live = match &change.new_value {
- Some(value) => apply_live_setting(change.def, value),
- None => apply_live_unset(change.def),
- };
let key = change.def.key.to_string();
- if now_live {
- live.push(key);
- } else if RELOAD_CONFIG_KEYS.contains(&change.def.key) {
+ if RELOAD_CONFIG_KEYS.contains(&change.def.key) {
reloadable.push(key);
} else {
restart.push(key);
@@ -485,7 +473,7 @@ fn apply(app: &mut App) {
)),
}
}
- let when = apply_when(&live, &reloadable, &restart);
+ let when = apply_when(&reloadable, &restart);
if !written.is_empty() {
app.note(&format!(
"β—ˆ vibe-setting Β· wrote {} setting(s); {when}",
@@ -501,11 +489,8 @@ fn apply(app: &mut App) {
}
/// The "when does it apply" half of the result note, one clause per bucket.
-fn apply_when(live: &[String], reloadable: &[String], restart: &[String]) -> String {
+fn apply_when(reloadable: &[String], restart: &[String]) -> String {
let mut parts: Vec<String> = Vec::new();
- if !live.is_empty() {
- parts.push(format!("{} in effect now", live.join(", ")));
- }
if !reloadable.is_empty() {
parts.push(format!("run /reload config to apply {}", reloadable.join(", ")));
}
@@ -518,7 +503,6 @@ fn apply_when(live: &[String], reloadable: &[String], restart: &[String]) -> Str
fn shown(def: &AgentSettingDef, value: Option<&str>) -> String {
match value {
- Some("") if matches!(def.kind, AgentSettingKind::Glyph { .. }) => "\"\" (off)".to_string(),
Some(v) => v.to_string(),
None => format!("default ({})", kind_text(def).1),
}
@@ -618,18 +602,17 @@ mod tests {
#[test]
fn apply_when_names_each_bucket() {
let v = |xs: &[&str]| xs.iter().map(|x| x.to_string()).collect::<Vec<_>>();
- assert_eq!(apply_when(&v(&["wave"]), &[], &[]), "wave in effect now");
assert_eq!(
- apply_when(&[], &v(&["context_window", "max_tokens"]), &[]),
+ apply_when(&v(&["context_window", "max_tokens"]), &[]),
"run /reload config to apply context_window, max_tokens"
);
assert_eq!(
- apply_when(&[], &[], &v(&["show_reasoning", "tools.default"])),
+ apply_when(&[], &v(&["show_reasoning", "tools.default"])),
"show_reasoning, tools.default apply when jan restarts"
);
assert_eq!(
- apply_when(&v(&["wave"]), &v(&["max_tokens"]), &v(&["show_reasoning"])),
- "wave in effect now; run /reload config to apply max_tokens; show_reasoning applies when jan restarts"
+ apply_when(&v(&["max_tokens"]), &v(&["show_reasoning"])),
+ "run /reload config to apply max_tokens; show_reasoning applies when jan restarts"
);
}
@@ -654,7 +637,7 @@ mod tests {
});
let system = body["messages"][0]["content"].as_str().unwrap();
assert!(system.contains("- context_window | project | integer >= 1 | 128000 | 200000 |"));
- assert!(system.contains("- wave | global |"));
+ assert!(system.contains("- ask_timeout_secs | global |"));
assert!(!system.contains("claude_code_alias"), "{system}");
assert_eq!(body["messages"][1]["content"], "show me its thinking");
assert_eq!(body["messages"].as_array().unwrap().len(), 2);