luxe 0.1.4: remembered models, wheel-driven lists, and a steadier phone app
- luxe starts on the model you last chose in this project, then the last one anywhere. Signing in opens the model picker instead of choosing for you. - Every list in a modal takes the mouse wheel and a draggable scrollbar. - The phone app shows reasoning in full, stays put while you read back through a long session, and shows a question's answer on its card. - On Windows, luxe update replaces the running luxe, and a signed-in install no longer sees setup again. - The file tree no longer shows "engine busy" in a large project, loop output is easier to follow, and the name is written lowercase. The CHANGELOG has the full list.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//! Glyph detection — what the terminal and its fonts can draw: braille, Nerd Font icons, kitty.
|
||||
|
||||
use super::spinner::SPINNER_BRAILLE;
|
||||
use super::{GlyphTier, EVERY_ICON};
|
||||
use super::{GlyphTier, EVERY_ICON, RECENT_BRANDS};
|
||||
|
||||
/// Whether the terminal in front of the reader can draw the braille sweep.
|
||||
///
|
||||
@@ -109,8 +109,20 @@ pub(super) fn nerd_icons_available() -> bool {
|
||||
return true;
|
||||
}
|
||||
// Derived from the table, so an icon added in a range nothing else uses extends the probe
|
||||
// rather than slipping past it.
|
||||
fontconfig_has_all(EVERY_ICON.iter().filter_map(|icon| icon.at(GlyphTier::Nerd).chars().next()))
|
||||
// rather than slipping past it. The recent brands are asked about on their own
|
||||
let probed = EVERY_ICON.iter().filter(|icon| !RECENT_BRANDS.contains(icon));
|
||||
fontconfig_has_all(probed.filter_map(|icon| icon.at(GlyphTier::Nerd).chars().next()))
|
||||
}
|
||||
|
||||
/// Whether one installed font has every recent brand mark, which only Nerd Fonts 3.5 and later do.
|
||||
///
|
||||
/// fontconfig is the only way to ask, so without it (stock macOS, Windows) the answer is no and
|
||||
/// each brand falls back to a mark every v3 font has. Not kitty's shortcut either: the symbol font
|
||||
/// it bundles is as old as the kitty.
|
||||
pub(super) fn brands_available() -> bool {
|
||||
fontconfig_has_all(
|
||||
RECENT_BRANDS.iter().filter_map(|icon| icon.at(GlyphTier::Nerd).chars().next()),
|
||||
)
|
||||
}
|
||||
|
||||
/// Whether this is kitty — the one terminal that answers the question above by itself.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Glyph state — the vocabulary and braille switch every glyph call reads, set once at startup.
|
||||
|
||||
use super::detect::braille_available;
|
||||
use super::GlyphTier;
|
||||
use super::detect::{braille_available, brands_available};
|
||||
use super::{GlyphTier, Icon};
|
||||
use luxe_core::config::GlyphStyle;
|
||||
use std::sync::atomic::{AtomicU8, Ordering};
|
||||
|
||||
@@ -21,8 +21,30 @@ static BRAILLE: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::n
|
||||
/// and `/reload`. Setting the tier and forgetting the sweep is the mistake this exists to make
|
||||
/// impossible.
|
||||
pub fn resolve_vocabulary(preference: GlyphStyle) {
|
||||
set_tier(GlyphTier::resolve(preference));
|
||||
let tier = GlyphTier::resolve(preference);
|
||||
set_tier(tier);
|
||||
set_braille(braille_available());
|
||||
set_brands(matches!(tier, GlyphTier::Nerd | GlyphTier::NerdWide) && brands_available());
|
||||
}
|
||||
|
||||
/// Brand marks newer than the rest of the vocabulary: OpenAI's and Claude's arrived in Nerd Fonts
|
||||
/// 3.5, Copilot's after 3.0. They stay out of the nerd-tier probe, so an older font keeps every
|
||||
/// other icon, and are drawn only when [`brands`] says a font on the machine has them.
|
||||
pub const RECENT_BRANDS: &[Icon] =
|
||||
&[Icon::ProviderOpenAi, Icon::ProviderAnthropic, Icon::ProviderCopilot];
|
||||
|
||||
/// Whether the [`RECENT_BRANDS`] may be drawn. Off by default for the same reason as [`BRAILLE`]:
|
||||
/// a test or a site asset draws the same on any machine.
|
||||
static BRANDS: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
|
||||
/// Whether the recent brand marks are drawn, rather than the mark each falls back to.
|
||||
pub fn brands() -> bool {
|
||||
BRANDS.load(Ordering::Relaxed)
|
||||
}
|
||||
|
||||
/// Turns the recent brand marks on or off. Exposed for tests and for the startup probe.
|
||||
pub fn set_brands(available: bool) {
|
||||
BRANDS.store(available, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
/// Whether the spinner is currently drawing its braille sweep.
|
||||
|
||||
@@ -501,7 +501,7 @@ fn each_sweep_keeps_the_cadence_it_was_drawn_for() {
|
||||
/// The process tier is what the ~150 render sites read, so moving it has to move them.
|
||||
#[test]
|
||||
fn the_process_tier_selects_the_vocabulary() {
|
||||
assert_eq!(tier(), GlyphTier::Nerd, "the default is the look Luxe ships with");
|
||||
assert_eq!(tier(), GlyphTier::Nerd, "the default is the look luxe ships with");
|
||||
for at in TIERS {
|
||||
set_tier(at);
|
||||
assert_eq!(tier(), at, "{at:?} does not survive the round trip");
|
||||
|
||||
Reference in New Issue
Block a user