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

@@ -211,36 +211,47 @@ fn walk(folder: &Path, ignoring: bool) -> impl Iterator<Item = ignore::DirEntry>
/// Read one project-relative file for the preview.
pub fn read_file(root: &Path, relative: &str) -> Result<ProjectFile, ProjectFileFailure> {
read_at(&resolve(root, relative)?, normalized(relative))
}
/// Reads the file at `path` for the preview, answered under `label`. Whether `path` may be read at
/// all is the caller's question, already settled.
pub(crate) fn read_at(path: &Path, label: String) -> Result<ProjectFile, ProjectFileFailure> {
use std::io::Read;
let path = resolve(root, relative)?;
if !path.is_file() {
let meta = std::fs::metadata(path).map_err(|error| match error.kind() {
std::io::ErrorKind::NotFound => ProjectFileFailure::NotFound,
_ => unreadable(error),
})?;
if !meta.is_file() {
return Err(ProjectFileFailure::WrongKind);
}
let bytes = std::fs::metadata(&path).map(|meta| meta.len()).map_err(unreadable)?;
let mut content = Vec::new();
std::fs::File::open(&path)
std::fs::File::open(path)
.map_err(unreadable)?
.take(MAX_FILE_BYTES as u64)
.read_to_end(&mut content)
.map_err(unreadable)?;
let truncated = meta.len() > content.len() as u64;
let (text, binary) = decode(content);
Ok(ProjectFile { path: label, text, bytes: meta.len(), truncated, binary })
}
/// The text in `content` and whether it is binary instead, in which case the text is empty.
fn decode(content: Vec<u8>) -> (String, bool) {
let binary = content.iter().take(BINARY_SNIFF).any(|byte| *byte == 0)
|| std::str::from_utf8(&content).is_err_and(|error| error.error_len().is_some());
let truncated = bytes > content.len() as u64;
let text = match binary {
true => String::new(),
// A cut can land inside a character; drop the partial one rather than the whole file
false => match String::from_utf8(content) {
Ok(text) => text,
Err(error) => {
let valid = error.utf8_error().valid_up_to();
let mut bytes = error.into_bytes();
bytes.truncate(valid);
String::from_utf8(bytes).unwrap_or_default()
}
},
};
Ok(ProjectFile { path: normalized(relative), text, bytes, truncated, binary })
if binary {
return (String::new(), true);
}
// A cut can land inside a character; drop the partial one rather than the whole file
let text = String::from_utf8(content).unwrap_or_else(|error| {
let valid = error.utf8_error().valid_up_to();
let mut bytes = error.into_bytes();
bytes.truncate(valid);
String::from_utf8(bytes).unwrap_or_default()
});
(text, false)
}
/// `relative` under `root`, refused when it climbs out lexically or through a symlink.