The owner asked for this design, and for it to replace the row 535371c8f
added ("这个页面已经有一个重复的解释 claude code 运行方式的了,那个其实
可以用你这个代替掉"). The provider editor's Claude subscription now has
one "Claude Code runs as" row, above Accounts. It has:
- a pill, green when the interactive mode (TUI) is in use, else "claude -p";
- a line beside it with why -p, or how the last request went ("Last request
3 min ago: interactive mode", "… ran as -p: the request asked for a JSON
schema");
- on hover or focus of the pill, a card with both modes, the one in use
marked, each with what it is, its advantage and (for -p) its cost, and
where it is switched;
- when it is off in Settings, Change in Settings, which opens Settings ›
Models at #claudeTuiRow.
Gateway: GET /api/claude/mode gains last {tui, why, at}, the last
request's mode. claudeTUI returns the code why a request is -p (the
machine's: off, broken, os, wsl-home, missing; or the request's:
safeguards, cache, schema, image, big; wslread), and a TUI start that
fell back to -p records "start". main's row and its 9 strings per
language are gone; the 2 kept ones are reused.
openSettingsAt looked a selector up before Settings had drawn from its
read, so a row Settings draws anew (#claudeTuiRow) was found stale and
the lit row was gone; it now looks it up once show()'s read is in
(settingsLoad).
Budget: the core is 1,533,105 (147 over), with the comment cut; raised
to it with no room added.
Run at 2e9df9b1b (rebased on origin/main just fetched), on mote:
- gofmt -l: clean; go vet darwin, GOOS=windows, GOOS=linux -tags nogui
for internal/gateway and internal/gui: ok
- go test ./internal/gateway -run Claude: ok (TestClaudeModeLast,
TestClaudeTUICodes new)
- go test ./internal/gui: TestCoreScriptBudget ok after the raise; red
TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestMainWindowCorners
(#3949), TestColdTurnsTaken (#4510), each known on main
- GUI: claude-mode.test.cjs 54/54 (Chromium and WebKit; en, zh, zh-TW,
ja, de; 900 and 420 wide; Codex and Only switch read nothing),
old-webkit ok, i18n-keys red only on "Unmarked" (#4524)
Again at 0565c0bba (main moved before the push): the budgets and
go test ./internal/gateway -run Claude ok; claude-mode, old-webkit and
i18n-keys 64/64, i18n-keys green now that #4524 is fixed.
v0.1.2443 was first pushed at 3525a6542, this commit before that
rebase, while main's push was refused; it was moved here at once.
Broken by hand, each red: the pill's mouseenter (hover test, both
engines), the settingsLoad lookup (Change in Settings' lit row, both
engines), noteClaudeRun("start") (TestClaudeModeLast).
Not tried: the real app with a real Claude subscription; the pill and
card are drawn from the faked /api/claude/mode.