Edit a preset's tiers from the bar panel
The gear on every preset row now opens an editor: the four tiers with the model each maps to, and for each one field that filters the provider's catalogue as you type (every word must match; arrows and Enter work), listed inline with context length and price, and that also takes any id typed by hand. LM Studio's server form moves one click inside the editor. The panel card moves from PopupCard to KeyboardPanel. PopupCard is an xdg-popup, which only receives keys after focus is routed through its parent surface, so no text field in it could ever be typed into - the existing server URL form included. KeyboardPanel primes layer-shell keyboard focus on open, which is why every shell panel with a text field uses it. Esc now closes the panel. The picker reads ~/.claude-mode/models-cache.json, which or_catalogue and lms_catalogue now write as a side effect, so models, doctor, setup and the menu's picker all keep it fresh and the panel never hits the network itself. One node per provider with its own fetchedAt/ok; a failed fetch keeps the old list, an LM Studio list is tied to its server, and no key or key name is ever stored. `models` gains --preset, --refresh and --json, and the Z.AI list now lives in one place. A tier edit to the active preset re-applies without the running-sessions prompt: that prompt guards against the endpoint or key moving, and a tier edit moves neither (preset url/auth still ask). A failed re-apply now says the edit was saved. `preset set` on an unknown name no longer creates it. Panel edits run through one chain that stops on the first failure and refreshes health.json at the end. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -111,6 +111,21 @@ BarWidget {
|
||||
onLoadFailed: root.fallbackState = null
|
||||
}
|
||||
|
||||
// The model catalogue the panel's picker offers. claude-mode leaves it
|
||||
// behind whenever it fetches a provider's list anyway, so reading it here
|
||||
// costs no network - and nothing here polls a provider on a timer.
|
||||
property var modelsCache: null
|
||||
|
||||
FileView {
|
||||
id: modelsFile
|
||||
path: root.cmRoot + "/models-cache.json"
|
||||
watchChanges: true
|
||||
printErrors: false
|
||||
onFileChanged: reload()
|
||||
onLoaded: root.parseInto("modelsCache", text())
|
||||
onLoadFailed: root.modelsCache = null
|
||||
}
|
||||
|
||||
// claude-mode writes health.json itself, so a switch launched from the panel
|
||||
// lands back here through the FileView above. This only covers the case
|
||||
// where the file was never written at all.
|
||||
@@ -179,6 +194,7 @@ BarWidget {
|
||||
function refresh() {
|
||||
healthFile.reload()
|
||||
stateFile.reload()
|
||||
modelsFile.reload()
|
||||
if (!root.health) seedProc.running = true
|
||||
root.scanSessions()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user