mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:23:33 +00:00
fix(tui/auto): randomize placeholder and tweak spinner style
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use rand::{rng, Rng};
|
||||
|
||||
const AUTO_DRIVE_PHRASES: [&str; 60] = [
|
||||
"Plotting course…",
|
||||
@@ -63,11 +63,12 @@ const AUTO_DRIVE_PHRASES: [&str; 60] = [
|
||||
"Envisioning next move…",
|
||||
];
|
||||
|
||||
static PHRASE_COUNTER: AtomicU64 = AtomicU64::new(0);
|
||||
|
||||
pub fn next_auto_drive_phrase() -> &'static str {
|
||||
let idx = (PHRASE_COUNTER.fetch_add(1, Ordering::Relaxed) as usize)
|
||||
% AUTO_DRIVE_PHRASES.len();
|
||||
let len = AUTO_DRIVE_PHRASES.len();
|
||||
if len == 0 {
|
||||
return "";
|
||||
}
|
||||
let idx = rng().random_range(0..len);
|
||||
AUTO_DRIVE_PHRASES[idx]
|
||||
}
|
||||
|
||||
|
||||
@@ -250,9 +250,7 @@ impl AutoCoordinatorView {
|
||||
}
|
||||
}
|
||||
let title_y = area.y;
|
||||
let style = Style::default()
|
||||
.fg(colors::info())
|
||||
.add_modifier(Modifier::BOLD);
|
||||
let style = Style::default().fg(colors::info());
|
||||
let mut x = start_x;
|
||||
for ch in trimmed.chars() {
|
||||
if x >= area.x.saturating_add(area.width) {
|
||||
@@ -464,7 +462,6 @@ impl AutoCoordinatorView {
|
||||
total += Self::wrap_count(prompt, inner_width).max(1);
|
||||
}
|
||||
if ctx.button.is_some() {
|
||||
total += 1; // spacer before button block
|
||||
total += button_height;
|
||||
}
|
||||
if ctrl_height > 0 {
|
||||
@@ -477,7 +474,6 @@ impl AutoCoordinatorView {
|
||||
total += Self::wrap_count(text, inner_width);
|
||||
}
|
||||
if ctx.button.is_some() {
|
||||
total += 1; // spacer before button block
|
||||
total += button_height;
|
||||
}
|
||||
if ctx.manual_hint.is_some() {
|
||||
|
||||
Reference in New Issue
Block a user