refactor(cli): remove deprecated stage_spinner, migrate remaining callers to v2
Phase 7 cleanup: migrate timeline.rs and main.rs search spinner from stage_spinner() to stage_spinner_v2() with proper icon labels, then remove the now-unused stage_spinner() function and its tests. No external callers remain for the old numbered-stage API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,14 +32,10 @@ impl GlyphMode {
|
||||
/// Precedence:
|
||||
/// 1. Explicit `--icons` CLI value (passed as `cli_flag`)
|
||||
/// 2. `LORE_ICONS` environment variable
|
||||
/// 3. Auto-detect: Nerd if `$TERM_PROGRAM` matches known Nerd-capable terminals
|
||||
/// 3. Force ASCII fallback if `force_ascii` is true (robot mode)
|
||||
/// 4. Auto-detect: Nerd if `$TERM_PROGRAM` matches known Nerd-capable terminals
|
||||
/// or `$NERD_FONTS=1`; otherwise Unicode
|
||||
/// 4. Force ASCII if `force_ascii` is true (robot mode or `--color never`)
|
||||
pub fn detect(cli_flag: Option<&str>, force_ascii: bool) -> Self {
|
||||
if force_ascii {
|
||||
return Self::Ascii;
|
||||
}
|
||||
|
||||
// 1. CLI flag
|
||||
if let Some(flag) = cli_flag {
|
||||
return Self::from_str_lossy(flag);
|
||||
@@ -50,7 +46,12 @@ impl GlyphMode {
|
||||
return Self::from_str_lossy(&val);
|
||||
}
|
||||
|
||||
// 3. Auto-detect
|
||||
// 3. Robot-safe fallback
|
||||
if force_ascii {
|
||||
return Self::Ascii;
|
||||
}
|
||||
|
||||
// 4. Auto-detect
|
||||
if Self::detect_nerd_capable() {
|
||||
Self::Nerd
|
||||
} else {
|
||||
@@ -1252,8 +1253,14 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn glyph_mode_force_ascii_overrides_cli_flag() {
|
||||
assert_eq!(GlyphMode::detect(Some("nerd"), true), GlyphMode::Ascii);
|
||||
fn glyph_mode_force_ascii_is_fallback_when_no_explicit_icon_mode() {
|
||||
assert_eq!(GlyphMode::detect(None, true), GlyphMode::Ascii);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn glyph_mode_force_ascii_does_not_override_cli_flag() {
|
||||
assert_eq!(GlyphMode::detect(Some("nerd"), true), GlyphMode::Nerd);
|
||||
assert_eq!(GlyphMode::detect(Some("unicode"), true), GlyphMode::Unicode);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user