superhtoooth (macOS): 保存方案设置了方案名字,但是应用方案没有用这个名字。
menu 里面变成了方案 1,方案 2。而且在应用里面没有显示当前使用的方案.
The bug: the tray panel's Profiles button showed the number of saved
profiles next to its label ("方案" + "2"), which reads as a profile
named 方案 2. Profiles were saved and applied under the typed name all
along; nothing anywhere said which profile was in use.
What changed:
- profile.InUse: a profile is in use while applying it would change
nothing on this computer - every detected agent's saved field is as
the profile has it (compared with the same renamed-ref spelling Apply
writes), its model lists are held (provider.ModelListsHeld, a dry run
of SetModelLists via the extracted putModelLists) and its library
setup is as saved (library.Holds, the mirror of Restore). A profile
that touches no agent here is not in use.
- Why not "last applied": that would stay ticked after the user changes
a model by hand, a tick that lies. With this definition a profile
saved from the current setup is in use at once, a hand change clears
the tick, and applying puts it back. Two identical profiles are both
ticked; the button names the first.
- GUI: /api/state carries inUse. The panel's button names the profile
in use (a pop-up button showing what is picked), else counts them as
before; its chip gets a check mark and aria-current, in panel and
window; the chip's tooltip and its details say "In use" (string
already in every language). CLI `magpie profiles` marks it, the TUI
notes "in use". Docs (reference, start en/zh/ja) say so.
What was run:
- go test ./internal/profile (new TestProfileInUse: save, hand change,
apply, hidden model list, library instructions, absent agents) and
./internal/gui (new TestStateProfileInUse through the HTTP handler),
scratch HOME. Broken by hand: field compare, ModelListsHeld,
library.Holds and state's InUse each turned a test red.
- go test -tags nogui ./... in a scratch HOME (the four slow packages
rerun with -timeout 40m under load ~45).
- GUI: new profile-in-use.test.cjs (reporter's steps in the panel at
360px, every language, plus the window) and panel-profiles,
profile-confirm, profile-details, old-webkit, i18n-keys, gui-zh-tw,
gui-ja, gui-de in chromium and webkit: all pass. Old app.js fails the
new test.
- Real CLI in a sandbox HOME with a codex config: save/use/profiles
show the mark, and it goes after a hand edit.
- gofmt; go vet darwin, linux (nogui), windows.
Not tried: the real tray app with real agents, and Windows/Linux at
runtime.