LR-EDIT-DETAIL-DENOISE: list settings tabs from TABS; fix the SAM 3 worker's wasm check
The unknown-tab error now names every Settings tab (it missed AI Denoise after the faces merge). lightcraft-sam3-worker (#359) only builds its server off wasm32, so `cargo xtask wasm` passes again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1e1eb5fe16
commit
7dcfbed05c
|
|
@ -3,6 +3,7 @@
|
|||
#![forbid(unsafe_code)]
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut args = std::env::args().skip(1);
|
||||
let dir = args.next().ok_or("usage: lightcraft-sam3-worker MODEL_DIR [127.0.0.1:8793]")?;
|
||||
|
|
@ -11,3 +12,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
lightcraft_segment::remote::serve(address, std::path::Path::new(&dir), device)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The worker serves a local GPU over a socket; there is nothing to serve in a browser.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -465,7 +465,8 @@ pub fn run_ui_command(app: &mut LightcraftApp, id: &str, p: &Value) -> Option<Re
|
|||
"app.settings" => {
|
||||
let tab = p.get("tab").and_then(Value::as_str).unwrap_or("general");
|
||||
if !crate::panels::settings::TABS.iter().any(|(id, _)| *id == tab) {
|
||||
return Some(Err(format!("unknown settings tab `{tab}` (general|import|performance|interface|faces)")));
|
||||
let tabs: Vec<&str> = crate::panels::settings::TABS.iter().map(|(id, _)| *id).collect();
|
||||
return Some(Err(format!("unknown settings tab `{tab}` ({})", tabs.join("|"))));
|
||||
}
|
||||
app.ui.dialog = Some(Dialog::Settings { tab: tab.into() });
|
||||
Ok(Value::Null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue