feat: pick the room model from a catalog dialog

The room model was a free-text field. It now opens a dialog that lists the provider's live catalog through the same adapter a turn uses, with context, output, price, and vision from models.dev. Rows filter by text, vision, or free price, and a custom id remains available when the provider lists nothing.

The dialog is nested over room settings, so BaseDialog now gives Escape and the focus trap to the top dialog only. Clearing the model stores NULL, which returns the room to the provider's default.
This commit is contained in:
vhaudiquet committed 2026-11-28 17:21:48 +01:00
1 parent 2d36790fe1
commit 2216f37422
13 files changed
+724 -20

No files matched your search

+5 -6
View File
@@ -341,12 +341,11 @@ pub async fn update(
}
if let Some(model) = body.model.as_deref() {
let model = model.trim();
if !model.is_empty() {
state.db.conn().execute(
"UPDATE rooms SET model = ?1 WHERE id = ?2",
rusqlite::params![model, id],
)?;
}
let model = (!model.is_empty()).then_some(model);
state.db.conn().execute(
"UPDATE rooms SET model = ?1 WHERE id = ?2",
rusqlite::params![model, id],
)?;
}
if let Some(steps) = body.max_turn_steps {
state.db.conn().execute(