Skip to content

basalt/v0.12.4

Choose a tag to compare

@erikjuhani erikjuhani released this 09 Apr 18:49
· 107 commits to main since this release
6794063

This release focused on improving the configurability of basalt, and allowing it be more usable in degraded systems.
The symbols used in basalt can now be configured through presets and symbols map that is documented in: https://github.com/erikjuhani/basalt/blob/6794063/docs/Configuration/Symbols.md

Example user configuration in ~/.basalt.toml:

[symbols]
preset = "nerd-font"
task_checked = "[x]"
task_unchecked = "[ ]"

For degraded mode you can set the preset to "ascii".

For full list of options check the Symbols documentation: https://github.com/erikjuhani/basalt/blob/6794063/docs/Configuration/Symbols.md

Example with following configs:

[symbols]
wrap_marker = ""
preset = "nerd-font"

basalt-0-12-4

Added

Introduces symbols and symbol presets as the foundation for
configurable UI symbols. Each preset provides a complete set of defaults
for all visual glyphs used across the interface. Users pick a preset in
[symbols] and optionally override individual fields on top of it.

Also added derives PartialEq and serde::Deserialize on FontStyle
so heading and title font styles can be configured from toml.

Related to #424

Previously config parsing errors were silently swallowed. Now we return
warnings alongside the config so they can be shown to the user. Invalid
config files produce an InvalidConfig error with the TOML parser's
message. The UserConfigNotFound case is still silently ignored since
most users won't have a config file.

Additionally toasts now support word-wrapped multi-line messages via
textwrap and compute their height dynamically instead of using a fixed
constant. This lets longer error messages display fully rather than
getting truncated. Toast stacking in render_toasts accounts for
variable heights.

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

  • 7d3e968 Add auto-detection for symbol preset based on terminal capabilities by @erikjuhani

Extend Preset with an Auto variant that detects terminal capabilities at
startup by inspecting TERM, LC_ALL, LC_CTYPE and LANG environment
variables to choose between Unicode and Ascii presets.

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

Changed

Setting rust-version lets Cargo emit a clear error when someone
tries to build with a toolchain older than 1.91.0 and enables
version-aware dependency resolver behavior.

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

Related to #424

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

All render functions now take &Symbols parameter so application
symbols are read from config instead of being hardcoded.

List markers cycle through the configured list based on nesting depth.
VirtualDocument stores a Symbols instance and uses it for the title
font style and horizontal rule.

Additionally add support for cycling through list markers so different
depth levels of list indentation have different markers. Can
define n-amount of symbols.

Related to #424

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

Replaces hardcoded symbols in the explorer with configurable ones.
Unselected files also render symbols.unselected instead of blank space
so the collapsed view is consistent across presets.

Added more emphasis on selected note with bold and underline styles.

Related to #424

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

Replaces hardcoded glyphs with configurable symbols.

Related to #424

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

Config is now loaded once in App::start and passed into App::new so
that config.symbols is available when constructing component state.
The default config sets preset = "unicode" in config.toml.

Related to #424

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

Previously border style was hardcoded in code, however, this is now also
controllable from the symbols map.

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com

Toast icons were hardcoded. This commit adds toast_success, toast_info,
toast_error and toast_warning fields to the symbol config so each preset
can define appropriate icons. ASCII uses simple text characters, Unicode
keeps the existing icons, and NerdFont uses its own glyph variants. The
icon is resolved at render time from the active symbols config.

Signed-off-by: Erik Kinnunen erik.kinn@gmail.com