luxe 0.1.5: a provider picker, model ids, and a guided review that says less

The dock's provider row opens a list of providers, and the model picker opens on the provider in use, with tab to widen it; signing in opens it on the provider just signed in to. Models go by their id unless config names them, and the model row wears its maker's mark.

The guided review's guide prompt is shorter, the pull request brief shows the start of the description with the rest behind p, its commits drop the Luxe-review and Luxe-revision lines, and the weakened-gates signal is gone.

luxe update reruns the installer it was installed with, in place of luxe-cli-update. The preview's FILE tab reads files the session changed outside the project, and only those. Smaller fixes: bash headers are highlighted, the preview loses a blank row, the launcher divider sits inside its frame, and the phone app's top bar is clear of iOS's blur.

rustls-webpki 0.103.16 and webpki-roots 1.0.10 fix RUSTSEC-2026-0381 and RUSTSEC-2026-0382, and vite 8.3.4 fixes GHSA-587h-7wmj-h5pm, GHSA-698v-4r3x-3vcv and GHSA-r825-w8mm-5pxw.
This commit is contained in:
Evan Whittaker
2026-10-22 13:25:32 -05:00
parent 4705c2abaa
commit f3ed35beb5
123 changed files with 3788 additions and 1745 deletions

View File

@@ -1,4 +1,6 @@
use super::meta::meta_suffix;
use super::*;
use ratatui::layout::Rect;
fn entry(provider: &str, id: &str, configured: bool) -> ModelEntry {
ModelEntry {
@@ -111,6 +113,153 @@ fn a_refreshed_catalog_keeps_the_query_and_the_row_under_the_cursor() {
);
}
/// The catalog as served by two providers that both offer `claude-sonnet-4-6`.
fn shared_catalog() -> Vec<ModelEntry> {
let mut models = catalog();
models.push(entry("github-copilot", "claude-sonnet-4-6", false));
models
}
/// The picker on Anthropic's `claude-sonnet-4-6`, opened on `start`.
fn on_sonnet(start: PickerStart) -> ModelPickerState {
let active = Some(ModelRef::new("anthropic", "claude-sonnet-4-6"));
ModelPickerState::open(shared_catalog(), active).starting_on(start)
}
fn press(picker: &mut ModelPickerState, codes: &[KeyCode]) -> ModelPickerOutcome {
codes.iter().map(|code| picker.on_key(&key(*code))).last().expect("a key")
}
/// The model step is about the provider in use, and `tab` widens it to every provider and back,
/// keeping the cursor on the model it was on.
#[test]
fn the_model_step_shows_the_provider_in_use_until_tab_widens_it() {
let mut picker = on_sonnet(PickerStart::Models);
assert_eq!(picker.match_count(), 2, "anthropic's two");
let chosen = || Some("anthropic/claude-sonnet-4-6".to_owned());
assert_eq!(picker.selected_entry().map(ModelEntry::qualified_id), chosen());
press(&mut picker, &[KeyCode::Tab]);
assert_eq!(picker.match_count(), 5, "every provider's");
assert_eq!(picker.selected_entry().map(ModelEntry::qualified_id), chosen());
press(&mut picker, &[KeyCode::Tab]);
assert_eq!(picker.match_count(), 2, "and back");
// With no model in use there is no provider to be about
let unset = ModelPickerState::open(catalog(), None).starting_on(PickerStart::Models);
assert_eq!(unset.match_count(), 4);
}
/// A login opens on the provider it signed in to, at the top with nothing chosen, even when the
/// model in use is another provider's. `tab` still reaches everything else.
#[test]
fn a_login_opens_on_the_provider_it_signed_in_to() {
let active = Some(ModelRef::new("anthropic", "claude-sonnet-4-6"));
let mut picker = ModelPickerState::open(shared_catalog(), active).about_provider("openai");
assert_eq!(picker.match_count(), 1, "openai's own");
let shown = picker.selected_entry().map(ModelEntry::qualified_id);
assert_eq!(shown.as_deref(), Some("openai/gpt-5-codex"));
assert_eq!(picker.cursor(), 0);
press(&mut picker, &[KeyCode::Tab]);
assert_eq!(picker.match_count(), 5, "and tab widens it");
}
/// A local server's models land a moment after the picker opens, so a provider that serves nothing
/// yet shows every model until they arrive, then narrows to them.
#[test]
fn a_provider_whose_models_arrive_late_is_scoped_when_they_do() {
let mut picker = ModelPickerState::open(catalog(), None).about_provider("ollama");
assert_eq!(picker.match_count(), 4, "nothing of ollama's yet, so everything");
let mut arrived = catalog();
arrived.push(entry("ollama", "qwen3-coder", false));
picker.refresh(arrived);
assert_eq!(picker.match_count(), 1, "narrowed once they land");
}
/// The provider step lists each provider once, by name, with the cursor on the one in use.
#[test]
fn the_provider_step_lists_each_provider_once() {
let picker = on_sonnet(PickerStart::Providers);
assert!(picker.choosing_provider());
assert_eq!(picker.match_count(), 4, "anthropic, github-copilot, lmstudio, openai");
assert_eq!(picker.cursor(), 0, "on anthropic, the one in use");
let screen = drawn(&picker, Rect::new(0, 0, 120, 30));
assert!(screen.contains("Select provider"), "{screen}");
assert!(screen.contains("anthropic 2 models"), "{screen}");
assert!(screen.contains("lmstudio 1 model "), "{screen}");
}
/// Another provider serving the model in use switches to it there at once: the model was never
/// the question, so nothing asks it again.
#[test]
fn a_provider_serving_the_same_model_switches_to_it_there() {
let mut picker = on_sonnet(PickerStart::Providers);
match press(&mut picker, &[KeyCode::Down, KeyCode::Enter]) {
ModelPickerOutcome::Select(info) => {
assert_eq!(info.r#ref, ModelRef::new("github-copilot", "claude-sonnet-4-6"));
}
other => panic!("expected the same model from copilot, got {other:?}"),
}
}
/// A provider without the model in use opens on its own models, and `esc` goes back to the
/// providers it came from before it closes anything.
#[test]
fn a_provider_without_the_model_opens_on_its_models() {
let mut picker = on_sonnet(PickerStart::Providers);
let outcome =
press(&mut picker, &[KeyCode::Down, KeyCode::Down, KeyCode::Down, KeyCode::Enter]);
assert_eq!(outcome, ModelPickerOutcome::Consumed);
assert!(!picker.choosing_provider());
let shown = picker.selected_entry().map(ModelEntry::qualified_id);
assert_eq!(shown.as_deref(), Some("openai/gpt-5-codex"), "openai's, and only those");
assert_eq!(picker.match_count(), 1);
assert_eq!(press(&mut picker, &[KeyCode::Esc]), ModelPickerOutcome::Consumed);
assert!(picker.choosing_provider(), "back to the providers");
assert_eq!(press(&mut picker, &[KeyCode::Esc]), ModelPickerOutcome::Close);
}
/// Choosing the provider already in use is asking to see its models, not a switch to nothing new.
#[test]
fn the_provider_in_use_opens_on_its_models() {
let mut picker = on_sonnet(PickerStart::Providers);
assert_eq!(press(&mut picker, &[KeyCode::Enter]), ModelPickerOutcome::Consumed);
assert!(!picker.choosing_provider());
assert_eq!(picker.match_count(), 2);
}
/// `←` reaches the providers from a model step opened anywhere; `esc` there closes, since
/// nothing led to it.
#[test]
fn left_reaches_the_providers_from_the_model_step() {
let mut picker = on_sonnet(PickerStart::Models);
press(&mut picker, &[KeyCode::Left]);
assert!(picker.choosing_provider());
assert_eq!(picker.cursor(), 0, "on the provider the models were from");
assert_eq!(press(&mut picker, &[KeyCode::Esc]), ModelPickerOutcome::Close);
}
/// A row names its provider only while the list mixes them, and its id only when a configured
/// name stands in for it: a model is never written out twice.
#[test]
fn a_row_says_only_what_its_label_does_not() {
let mut picker = on_sonnet(PickerStart::Models);
let area = Rect::new(0, 0, 120, 30);
let scoped = drawn(&picker, area);
assert!(scoped.contains("Select model · anthropic"), "{scoped}");
assert!(!scoped.contains("anthropic/"), "{scoped}");
assert!(scoped.contains("tab every provider"), "{scoped}");
press(&mut picker, &[KeyCode::Tab]);
let every = drawn(&picker, area);
assert!(every.contains("gpt-5-codex openai"), "{every}");
assert!(every.contains("tab only anthropic"), "{every}");
let named =
ModelEntry { label: "sonnet".into(), ..entry("anthropic", "claude-sonnet-4-6", true) };
let picker = ModelPickerState::open(vec![named], None);
assert!(drawn(&picker, area).contains("sonnet anthropic/claude-sonnet-4-6"));
}
/// The opening line is measured, not guessed at: a panel sized without it clips its own
/// hint row out through the bottom border, and one sized to the rows alone truncates it.
#[test]
@@ -164,7 +313,8 @@ fn a_row_too_long_for_the_frame_is_shortened_inside_it() {
assert_eq!(rows.len(), 2, "{screen}");
for row in &rows {
let inside = row.trim_end().strip_suffix('│').expect("the frame's edge");
assert!(inside.trim_end_matches(['▌', ' ']).ends_with('…'), "{screen}");
// The label is what gives way; a provider short enough to fit after it still shows
assert!(inside.contains("fit-in-s…"), "{screen}");
}
assert!(rows[0].trim_end().ends_with("▌│"), "the cursor's row keeps its cap: {screen}");
}