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:
1 parent
2d36790fe1
commit
2216f37422
13 files changed
+724
-20
No files matched your search
@@ -0,0 +1,21 @@
|
||||
const stack: symbol[] = []
|
||||
let savedOverflow = ''
|
||||
|
||||
export function pushDialog(id: symbol) {
|
||||
if (stack.length === 0) {
|
||||
savedOverflow = document.body.style.overflow
|
||||
document.body.style.overflow = 'hidden'
|
||||
}
|
||||
stack.push(id)
|
||||
}
|
||||
|
||||
export function removeDialog(id: symbol) {
|
||||
const index = stack.indexOf(id)
|
||||
if (index === -1) return
|
||||
stack.splice(index, 1)
|
||||
if (stack.length === 0) document.body.style.overflow = savedOverflow
|
||||
}
|
||||
|
||||
export function isTopDialog(id: symbol) {
|
||||
return stack[stack.length - 1] === id
|
||||
}
|
||||
Reference in new issue
Block a user