Skip to content

Statusbar badge symbols should use the symbols map #457

@erikjuhani

Description

@erikjuhani

The statusbar renders powerline-style glyphs (U+E0B6 and U+E0B4) as left/right badge corners around the active component name. These are hardcoded in statusbar.rs and not part of the Symbols struct, so they render as tofu in ASCII mode.

Problem

basalt/src/statusbar.rs:42-49 — the badge is built with literal powerline chars:

let active_component = [
    Span::from("").dark_gray(),       // U+E0B6
    Span::from(" ").bg(Color::DarkGray),
    Span::from(state.active_component_name)...,
    Span::from(" ").bg(Color::DarkGray),
    Span::from("").dark_gray(),       // U+E0B4
];

These are Private Use Area codepoints from the powerline/nerd font range. They only render in terminals with a patched font. On the ASCII preset they show as replacement characters.

The StatusBar widget currently takes no reference to Config or Symbols — it is constructed via StatusBar::default() and rendered without symbol access (basalt/src/app.rs:638).

Design

Add two new fields to Symbols:

Field ASCII Unicode / NerdFont
statusbar_badge_left `` (U+E0B6)
statusbar_badge_right `` (U+E0B4)

Thread &Symbols (or just the two strings) into StatusBar so it can use them instead of hardcoded literals.

The ASCII fallback uses whitespace string, which pair naturally with the reversed-color background that's already applied to give space.

Pseudo code

// config/symbol.rs — add to Symbols struct
pub statusbar_badge_left: String,
pub statusbar_badge_right: String,

// ascii()
statusbar_badge_left: " ".into(),
statusbar_badge_right: " ".into(),

// unicode() and nerd_font()
statusbar_badge_left: "\u{e0b6}".into(),
statusbar_badge_right: "\u{e0b4}".into(),

Also add corresponding Option<String> fields to TomlSymbols and entries in the override_if_set! macro so users can customize them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions