Commit Graph
2271 Commits
Author SHA1 Message Date
yetone 2ff85f8a2b gui: a page's bar room comes out of its right padding, so both sides match
v0.1.1904 had every page keep its scrollbar's room, so nothing moves
when a page grows past the window. The owner asked whether the clear
bar now makes the sides uneven: it did, by the bar's width (8px on the
Mac, 10px on Windows and Linux), and the centred pages sat 4px to the
left.

layout.js measures the bar of a .view into --bar (again on resize, so
a text-size zoom is followed), and app.css takes it from each page's
right padding: the panel's 12px, the window's 16px, the centred pages'
max(16px, 50% - 600px) and the phone web's safe-area right. The heads
and strips that reach over the padding (Library's and Settings' sticky
heads, Providers' after-list fade, the masking record's bar) reach that
much less on the right, or they would run the page sideways. A plugin's
page, whose frame scrolls itself, shows a bar only when it needs one.

layout.js's measuring adds 254 bytes to the core's scripts; the budget is
raised by exactly that, with no room added.

page-width-steady.test.cjs now checks every page's left gap against its
right gap with the bar (chromium and webkit, the Mac's 8px bar and the
10px one, 1100 and 1600 wide) and that no page scrolls sideways; that
check found Providers' after-list fade running 4px past the page. With
v0.1.1904's CSS it is red ("agents: 16px on the left, 24px on the
right (bar 8px)", 26px with the 10px bar, 94/102 centred). page-width's
"centred" check compared paddings only, and now counts the bar too.

Run on mote at this head (f70cb6825's tree, on origin/main 174250b27):
page-width-steady, page-width, inner-scroll-contain, settings-tabs-stick,
library-all, agent-layout, i18n-keys, text-size, view-scrollbar: 168 of
168 pass; go test ./internal/gui -run Budget ok. Before the last rebase,
209 GUI files that reach pages, heads, panels, providers, masking,
library, settings and the gateway (3087 tests) had 29 reds; the same
files on origin/main d4f1d6480 had the same ones, apart from flakes:
gateway-key-limit and gateway-key-cycle (#4072, from f835bd713),
gateway-older (waits for #gateway .dot, which f835bd713 replaced; filed
with #4072's fix next), menu-input-scroll (#3402), header-centre webkit
(a ResizeObserver loop message, red on main too), account-mask chromium
zh, and gateway-caller-keys / gateway-key-models reading the page right
after a resize to 560 (#3523, #3797).
Not tried: the real Windows and Linux apps.
2026-10-28 22:44:22 +08:00
yetone e8e9245ecf agents: Install another agent says Plugins has more agents, and opens them
The owner, on the Agents page: 因为我们支持Agent插件了,这里是不是也应该
显示插件中有更多? Install another agent listed only the agents magpie has
an install command for; the agents a plugin adds were nowhere on that page.

- GET /api/plugins/agents names the suggested agent plugins (the market's
  kind "agent") not installed here. One installed but turned off, or
  pinned to a version, counts as installed: Plugins turns it on.
- Install another agent counts them in its header and ends with one row,
  "More in Plugins" with their names, as the Providers add sheet does for
  subscriptions. The row opens Plugins › Discover scrolled to its Agents,
  only while the click is fresh (scrollOnPurpose), on the section drawn
  last, since npm's answers draw it again.
- The list is fetched beside the install commands, not before them, so a
  slow market never holds the commands back. With no install command left,
  the section shows the plugins' row alone and no install note.
- Budgets: app.js 1,311,681 and the core 1,530,449 (+1,430 / +2,408 over main),
  the Agents page and Plugins page are the core's own, no room added.

Run at this tree, rebased on e2efbd357 (on mote):
- go test -tags nogui ./internal/gui -count=1: ok (budgets included);
  GOOS=linux and GOOS=windows go vet ./internal/gui: ok; gofmt -l: none.
- TestPluginAgentsNotInstalled: a fake registry with every kind, installed,
  turned-off and pinned agents; all installed gives [], never null.
- agent-plugin-agents.test.cjs: chromium and webkit, en zh zh-TW ja de,
  1100 and 420px: count, row order, words, tooltip, one line, name not cut,
  no sideways scroll, the click landing Agents at the top and staying.
- 69 GUI files that reach this (install section, Plugins Discover, strict
  fixtures, i18n), 1044 tests: 1033 pass. The reds were i18n-keys' #4053
  (fixed in the next commit) and mobile-web, whose copy had no .git for
  origin/main; run again with one fetched (d4f1d64): 30/30.

Broken by hand: main's assets under the new GUI test, 11/11 red; the
scroll line taken out, 11/11 red (webkit); the Go installed filter taken
out, TestPluginAgentsNotInstalled red.

Not run: the whole GUI suite (mote was busy with other sessions' suites),
and the real app with the live market.
2026-10-28 22:34:52 +08:00
yetone e2efbd3571 gui: a plugin page's host start reads its starter before it goes off on its own
pageHost starts the plugin host in a goroutine that can outlive the
page's wait, and that goroutine read the package's warmHost when it
ran. TestPluginPageStartsItsHost puts warmHost back in its cleanup,
so under -race the late read raced the write (seen in a whole race
run of internal/gui on mote). pageHost now reads it before the
goroutine starts.

Run on mote, at this tree (on origin/main 97b6a36c5 plus the maskrec
commit before it):
- go test -race -count=40 -run 'TestPluginPageStartsItsHost$'
  ./internal/gui: ok. With pageHost as it was: 1 DATA RACE in 40.
- go vet -tags nogui ./internal/gui for linux, windows, darwin: ok

Not changed: TestPluginPageReadsWhatItDeclared fails on its second
run in one binary (-count=2: "pageSetAllowed"); with -count=1 it
passes. Filed as #4076.
2026-10-28 22:32:07 +08:00
yetone 97b6a36c5b gui: the sidebar's gateway names the LAN address while it is shared
coeo91 on Discord: with "Share on local network" on, the sidebar's line
still said "Gateway 127.0.0.1:3425". Shared, it now names where other
machines reach it: MAGPIE_PUBLIC_URL if set, else the address picked in
Settings (magpie.lanAddress), else the first LAN address. Its tooltip
names that and this computer's url. Not shared, it is unchanged.

- api.go: boot.js's sideGateway carries lan and lanURLs when shared, so
  the first paint is right.
- plugins/gateway/settings.js: sideLAN() picks the address and redraws
  the boot line once loaded (it loads after app.js); turning sharing
  on/off re-reads /api/providers and redraws, and picking an address
  redraws. The choice lives in the plugin so app.js and the core script
  budget stay under their limits (TestCoreScriptBudget passes); no budget
  raised, no new strings.
- app.js renderSideGw: uses self.sideLAN?.(g), tooltip adds " · " + url.

Run at this commit's tree, rebased on d4f1d6480 (after 581d64b7d's
lanPublic and the Gateway card; conflicts in settings.js and
public-url-default kept both sides), on mote (macOS 27, Playwright 1.62,
Chromium + WebKit, 5 languages):
- side-gateway-lan, public-url-default, public-url, sidebar,
  gateway-port, connect-address-kept, lan-public, lan-docker,
  gateway-card, browser-access, plugin-gateway, gateway-connect-keys,
  gateway-keys-empty, gateway-caller-keys, i18n-keys: 195 pass, 1 fail
  (i18n-keys "a plugin's words are its own", #4053, red on main).
- go test -timeout 45m ./internal/gui/...: only TestMainWindowCorners
  (#3949); budgets pass. gofmt -l clean; go vet ./internal/gui darwin,
  GOOS=windows, GOOS=linux -tags nogui ok.

Before the rebase (base 51e3169fb):
- side-gateway-lan (new), public-url-default, sidebar, gateway-port,
  connect-address-kept: 82 pass, 0 fail.
- gateway-caller-keys, i18n-keys, plugin-gateway, gateway-connect-keys,
  gateway-keys-empty: 47 pass, 1 fail (i18n-keys "a plugin's words are
  its own", red on origin/main 6104e88aa, #4053). gateway-caller-keys
  chromium en failed once at :137 in an earlier run and passed on the
  next; base 6104e88aa is red at the same line in webkit (#3797).
- go test -timeout 45m ./internal/gui/...: only TestMainWindowCorners
  fails, red on base too (#3949). TestCoreScriptBudget and
  TestBootSaysWhereItsGatewayListens pass.
- gofmt -l clean; go vet darwin, GOOS=windows ./..., GOOS=linux -tags
  nogui ./... ok (Go unchanged since).
- Full GUI suite: stopped at ~8,400 results under load 25-105 from other
  sessions (20 not ok). Each red file was rerun on base 6104e88aa; red
  there: gateway-key-models (#2648), header-centre (#3479), i18n-keys
  (#4053), key-replace webkit (#3476), menu-input-scroll (#3402),
  mobile-web (#3952), models-fold webkit (#4071, filed), quota-count-wrap
  webkit (#3404). credit-days, library-row-remove and plugin-github
  passed on rerun.

Broken by hand: origin/main's app.js -> side-gateway-lan red 10/10 at the
first-paint check (:35); without settings.js's /api/providers refresh ->
red 10/10 at the sharing-off check (:57); without the load-time redraw ->
red 10/10 at :35.

Not tried: the real app on a real LAN, the Linux and Windows GUIs, and
the rest of the full GUI suite past where it was stopped.
2026-10-28 22:26:02 +08:00
yetone 581d64b7d0 gateway: sharing lists this network's addresses first, and names one on the internet
The user whose network card holds a static public address (203.236.50.70,
27bf14790) asked on Discord, on the latest version, whether "Share on
local network" should be exposed at a public address. LANHosts kept the
interfaces' order, so the public address came first: Settings offered it
as the share address by default, and the Gateway page listed it under
"Local network". The gateway does answer there while shared (it listens
on every address), behind a gateway key, and nothing said so.

- LANHosts puts private addresses first (RFC 1918, 100.64/10 for
  Tailscale, 198.18/15 for proxy TUNs), the public ones after in the
  interfaces' order; LANURLs, magpie web's links and the CLI follow.
- gateway.PublicIP / PublicURLs name the internet ones; /api/settings
  and /api/providers' gateway give them as lanPublic.
- Settings marks such an address "On the internet" in the picker, and
  picked, the row says anyone online can reach magpie there with a key
  and to list the network's range under Allowed addresses (or, with a
  list, that only it gets in). The Gateway page lists it under "On the
  internet", not "Local network". zh, zh-TW, ja, de.
- Not changed: with no allow list every address is still let in.
  Refusing internet peers by default would shut out networks whose
  computers all hold public addresses (campus networks, this user's ISP
  setup), so the address is named and the allow list pointed to instead.

Run on mote at 4ca64c21b plus this change: gofmt; go vet ./internal/gateway
./internal/gui; GOOS=windows go vet ./internal/gateway ./internal/gui;
GOOS=linux go vet ./internal/gateway; go test ./internal/gateway -run
'LAN|Lan|URL|TLS|Public|Network|Share|Allow|Container' ok; go test -tags
nogui ./internal/gui ./internal/cli ok; node --test lan-public (new),
lan-docker, gateway-card, gateway-connect-keys, public-url,
browser-access, i18n-keys: 73/74, the red is i18n-keys' "a plugin's
words are its own" on routing's "masking…", #4053, red on main. Every
file using the caller-keys fixture (changed: lanPublic) at a8c71f198:
the reds are gateway-key-cycle, gateway-key-limit and a flaky
connect-snippet-shell, the same on untouched a8c71f198, filed as #4072.
Broken by hand: public-first order turns TestLANHostsKeepAPublicAddress
red; no Settings note, or no Gateway-page split, turns lan-public red
(3/3 chromium).
Not tried: a real machine with a public address on its card.
2026-10-28 22:15:00 +08:00
yetone a8c71f1987 library: an opaque logo has no white corners
The user's MCP servers page drew Linear's, Context7's and GitHub's
logos (GitHub avatars, opaque) with a white fringe at each of the four
corners. The tile (.mk-icon) had a white background under the picture,
and its rounded clip's soft edge let that white through. The white now
sits on a plate 1px inside the tile (::before, border-radius inherit),
which the clip never reaches, so an opaque logo meets the row's own
background at its corners. A logo with see-through parts (an .svg) still
sits on white, an initial keeps its grey (no plate), and the skeleton
looks as before. The same tile is the library rows' 26px/24px logo, the
market cards' 36px and the market sheet's 44px.

Tried first in a page of the three real avatars at 2x in WebKit and
Chromium: background:none removed the fringe, clip-path inset(round)
beside or instead of overflow:hidden did not.

New: internal/gui/tests/market-icon-corners.test.cjs, dark theme, 2x,
every language, both engines. It reads the tile's own pixels: no corner
of an opaque black logo is brighter than the card plus 30, an svg tile
is white along its edges, and an initial's tile is not white.

Run (mote, at this commit's tree on origin/main ca499953e):
- market-icon-corners: 8/8 ok.
- Broken by hand: the old library.css with the new test, 8/8 red
  ("corner at 0,0: 76 against the card's 35" in Chromium, 75 in WebKit).
- Every GUI file that loads the library page, its market or MCP views,
  plus i18n and the font files: 60 files, 1018 tests, 1017 ok. The one
  red, i18n-keys "a plugin's words are its own", is red the same at a
  fresh origin/main 6104e88aa (#4053, a masking.go comment).
- go test ./internal/gui: TestMainWindowCorners/macOS_26_SDK red, the
  same at origin/main 6104e88aa (#3949, macOS 27); everything else ok.

Rebased after the run onto 6104e88aa, which changes internal/usage only.

Not run: the whole GUI suite (the change is one plugin's stylesheet;
the files above are every one that loads it or reads .mk-icon); the
real app on Linux WebKitGTK.
2026-10-28 22:00:25 +08:00
yetone ca499953e7 gui: a plugin page with a host part starts the host when it opens
guesssssssswhat on X: the Magiczerowxy/magpie-chat page ("对话") sits
on its loading text and never opens. The page says hello and then
navigates its frame to http://127.0.0.1:3477, a server the plugin's
index.mjs starts inside the Bun host. The host was started only by a
call: at launch while providers are first read, and after a Restart
(a plugin installed, updated or set, a Bun update) or a crash only once
something asked a plugin again. With the host down, WebKit (the macOS
window's WKWebView, WebKitGTK) leaves a frame whose navigation is
refused on its old document with no error, and the hello had already
cleared the 10s broken timer, so the page waits forever. Chromium shows
chrome-error instead.

Now serving the entry HTML of a page or panel whose plugin is not
page-only starts the host if none is up (plugin.Warm), waiting at most
7s, then serves the page. Page-only plugins, and the page's other files
and the bridge, don't touch the host.

Reproduced on mote (sandbox HOME, magpie web on a free port, plugin
0.1.16 from GitHub): with its 3477 listener killed, old main's page
stays on "正在连接到本地对话服务…" in Playwright WebKit (chrome-error
in Chromium); the fixed build restarts the host on open and the chat UI
loads in both engines. In the real macOS app (wails://) the frame
reaches 127.0.0.1 (seen by a logging server). TestPluginPageStartsItsHost
is red with the pageHost call removed by hand.

Run at this head (84a6a2c42 + this), on mote: gofmt -l clean; go vet,
GOOS=linux go vet -tags nogui, GOOS=windows go vet; go build,
GOOS=linux go build -tags nogui, GOOS=windows go build; go test ./...
-timeout 45m: every package ok except internal/gui's
TestMainWindowCorners/macOS_26_SDK, red on macOS 27 and filed as #3949
(titlebar, untouched here). plugin-page.test.cjs and
plugin-kinds-discover.test.cjs, Chromium and WebKit, 14/14 each.
Rebased on 29181eb78 (usage, gateway; no file here), then go vet and
go test ./internal/gui/ ./internal/plugin/ again: same, only #3949 red.
Pushed on b586fdf1e, whose two commits (app.css, usage pricing) weren't run with this.
win-run: go test -run 'TestPluginPage|TestWindowPage' ./internal/gui/
./internal/plugin/ ok.

Not tried: the reporter's OS and magpie version; the real Windows and
Linux app windows (wsl-run can't build internal/gui: no gtk4 or
webkitgtk-6.0 dev packages in magpie-desktop, internal/plugin ok); a
real Restart in the background (simulated by killing the host); the
full GUI suite (no asset changed). magpie-chat 0.1.9 to 0.1.13 had no
main or exports, so they are page-only and no host ever starts them;
0.1.14 restored main, and that's for the plugin to tell its users.
2026-10-28 21:27:47 +08:00
yetone b586fdf1eb gui: every page keeps its scrollbar's room, so nothing opening in it narrows the page
The owner, on Agents: opening an agent's details ran the page past the
window, the scrollbar appeared, and the whole page went 8px narrower in
one frame (and back when it closed). Every page had this; only Usage
and Routing kept the bar's room (87d83e7ab).

- .view is overflow-y: scroll everywhere, so the bar's room is always
  kept. Its track is transparent (the app's own thin bar, 8px on the
  Mac, 10px on Windows and Linux), so a page that fits shows nothing
  there. The Usage/Routing rule it replaces is gone.
- A framed dialog's fields did the same on Windows and Linux; they keep
  the 10px too, out of their right padding, as the Mac's already did.
- Between 601 and 640px the agent row's start-model picker is 184px,
  not 196px, so the name keeps the 150px agent-layout holds it to.

Test: page-width-steady, both engines, Mac's bar and Windows' bar:
every page this fixture opens (>= 8) grown past the window keeps its
width, and so does a framed dialog's body; an agent's details opened
past the window move its row by 0px, in all five languages.

Run on mote at this head (29181eb78 + this): page-width-steady,
agent-layout, heatmap-scrollbar, routing-ctx-still 40 of 40; go test
-run Budget ./internal/gui ok. Before the last rebase, 49 GUI files
that measure widths or scrollbars (panel-*, gui-* languages and
others), both engines: 593 of 600; the reds were agent-layout webkit
en at 601px (fixed above, then 24 of 24) and usage-ledger's "newest
live route" in both engines, red the same on the base (#3104).

Broken by hand: the old app.css with the new test is red in all 16
(8px narrower on the Mac, 10px with Windows' bar); without only the
dialog rule, the two Windows cases are red (fields 10px narrower).

Not tried: the whole GUI suite (mote is running another session's;
it runs after this push), and the real Windows and Linux apps.
2026-10-28 21:26:37 +08:00
yetone 012c584cc1 usage: clear a model's usage, or all of it, from the Usage page
CrazyMouse_TT on X asked for a way to clear usage, all of it or one
model's, to measure a local model fresh after deploying it.

The Usage page's Models list has a "…" on each row (and a right-click
menu) with "Clear usage…", and "Clear all usage…" sits under the lists
below the "Counted from…" note. Each asks first, in a confirmation that
says what is deleted, that it can't be undone, and that key spending
limits and allowances still count the calls.

A clear is a mark in settings (usageCleared: provider, model, unix ms),
read at read time; usage.jsonl is never rewritten. The Overview hides
calls up to the mark in summarizeFrom; the Requests page, heatmap and
ledger/CSV hide them in Filter.keepsRow, their one choke point, and the
request index's meta carries the marks so its cache is dropped. Key
budgets, window holds and Codex reads go through usage.Visit and the raw
log, so a clear never resets a key's spending limit or a quota. A later
clear of the same model or of everything takes the place of an earlier
one. The marks ride the settings part of a sync (sync-backup.md) and a
save of the Settings page keeps them (api.go's keep list; the guard
test TestSettingsSaveKeepsWhatItDoesNotSend caught it missing).
gateway-sessions.md and sync-backup.md say so.

Run on mote (mote-run) at this tree, rebased on origin/main c26b2992e
(the Go packages and usage-clear.test.cjs; vet and the 68 GUI files
ran at the earlier base f835bd713, four commits behind):
- go test -tags nogui -timeout 45m ./internal/usage ./internal/settings
  ./internal/usageapi ./internal/gui: all ok after the
  keep-list fix (before it, TestSettingsSaveKeepsWhatItDoesNotSend red).
- gofmt -l: clean. GOOS=linux go vet -tags nogui ./... and
  GOOS=windows go vet ./...: exit 0. (Linux vet without nogui fails in
  wails' cgo, as on main.)
- usage-clear.test.cjs: 32/32 in Chromium and WebKit, en/zh/zh-TW/ja/de,
  at 1200, 560 and 390 (web). With the old page.js/client.js/i18n.js it
  fails (TimeoutError).
- 68 GUI files the change can reach (every usage-*, gui-de/ja/zh-tw,
  i18n-keys, click-scroll, idle-ticks, mobile-web, panel-usage,
  sessions-purge): 941/980. The reds are filed and red on main
  (usage-ledger run alone at origin/main 84a6a2c42 too): i18n-keys "masking…" (#4053), mobile-web
  (#3952), usage-agents-hide (#2276, #3414), usage-ledger "newest live
  route needs no return-to-live button" (#3104, run alone at main too).
  i18n-keys first also named "Clear usage…" in Go comments of this
  change; reworded.
Broken by hand, each red: hides() always false (usage and gui tests),
keepsRow's clear check removed ("Requests after the clear: 5 rows"),
clearedKey out of the request meta ("after clearing everything: 3"),
the api.go keep line removed (UsageCleared [] after a save).

Not tried: the full go ./... suite and the whole GUI suite (mote was
busy with other sessions' full suites), the real app, a sync between
two computers. usage.jsonl doesn't shrink, and the Sessions tab's
figures are not cleared.
2026-10-28 21:13:09 +08:00
yetone f835bd713d gui: the Gateway page is one compact card, shares on the network from itself, and a key's copy sits by the key
The owner on the Gateway page: "一点都不精致、优雅", the key row's copy
button "很奇怪的位置,太突兀了", the gateway icon ugly, Connect should
start folded, and "Share on local network" should be picked on this page
with the LAN addresses shown. Agreed on a canvas first.

- The status row has the sidebar's server glyph in a 28px tile with two
  lights (green running, amber not), the state beside it and the fix
  button at the right. The address pill left the row.
- Under it, in the same card: Share on local network as This computer /
  Local network segments (settings/lan, as Settings does), and every
  address the gateway answers on, each with its own copy: this computer
  (or the public address on the web), then the LAN addresses, or a line
  saying there are none. Settings' container note comes from the same
  lanShown(). The "open LAN settings" button is gone.
- A key's row: its copy right after the masked key; Rotate key and
  Remove moved into a "…" (Key actions) row menu at the end.
- Connect starts folded; opening it is remembered
  (magpie.gwConnectFolded).
- At narrow widths the status row wraps and the address list is a
  label/value grid, so no language overflows at 420px.

Tests: new gateway-card (5 languages x 1100/420 x chromium/webkit): the
lights, Connect folded, sharing from the card with every address and a
copy of a LAN one, no scroll, the copy within 6px of the key, the … last
with its menu, nothing overflowing, no left borders. Tests that used
Connect open now open it; Rotate/Remove go through the menu
(fixtures' keyAction).

Run on mote, at the tree before the last rebase (51e3169fb + this):
gateway-card 52 of 52 over both engines; every GUI file this touches
in both engines green except gateway-caller-keys' webkit en 560px
overflow, red 3 of 3 at the base too (#3797). go test ./internal/gui:
budgets ok; TestMainWindowCorners/macOS_26_SDK red on mote's macOS 27
alone (#3949). At this head (0dc4cec85 + this; main touched no GUI
file since): gateway-card, gateway-fold, gateway-caller-keys 26 of 26,
go test -run Budget ./internal/gui ok.

Broken by hand: the copy moved after the spacer -> "the copy follows
the masked key" red; the fold default put back -> gateway-card and
gateway-fold red; the LAN addresses not rendered -> gateway-card times
out.

Screenshots looked at: zh 1100 and de 420, shared.

Not tried yet: the whole GUI suite (mote was busy with another
session's; it runs after this push), and the real Linux/Windows apps;
the change is CSS and DOM in a page the GUI suite loads as the app does.
2026-10-28 20:46:38 +08:00
yetone 27bf14790f gui: the page's links for other computers are at the gateway's addresses
A user's computer has a static public address from its ISP on the
network card itself (203.236.50.70) as well as a private one
(10.77.70.2). Settings › Network & sharing listed 203.236.50.70 as the
gateway's address but only 10.77.70.2 under "Open magpie in a browser",
and they asked why the two differ. The gateway's list
(gateway.LANURLs) took every IPv4 address on an interface that is up;
the page's (gui.LANAddrs) took private ones only, through
net.InterfaceAddrs, down interfaces included. The page server in LAN
mode listens on 0.0.0.0, so the public address serves it too.

Now one list makes both: gateway.LANHosts, every interface that is up,
IPv4, not loopback or link-local, in the interfaces' order.
gui.LANAddrs (and so NetworkLinks, the CLI's `magpie web` and daemon
links) returns it, MAGPIE_PUBLIC_URL's host still first when set.
The page's links now also show a CGNAT/Tailscale 100.64.x address, as
the gateway's already did.

Run, on mote: go vet ./internal/gateway ./internal/gui ./internal/cli;
GOOS=windows go vet ./internal/gateway ./internal/gui; GOOS=linux go vet
./internal/gateway; go test -run
"LAN|Lan|URL|TLS|Public|Network|Share|Allow|Container"
./internal/gateway ok; go test ./internal/gui ./internal/cli: cli ok,
gui ok but for TestMainWindowCorners/macOS_26_SDK, #3949 (macOS 27,
not about addresses). On xiaomi-gpu (Windows): the gateway's LANHosts,
PublicURL and TLS address tests ok.
New: TestLANHostsKeepAPublicAddress (a stubbed public, private, CGNAT,
link-local, loopback and IPv6 address) and
TestNetworkLinksAtTheGatewaysHosts.
Broken by hand: LANHosts keeping private addresses only, as the page's
list did, turns TestLANHostsKeepAPublicAddress red (got [10.77.70.2]).
Not run: GOOS=linux vet of internal/gui (needs cgo; the WSL box lacks
gtk4 and webkitgtk-6.0 headers); not tried on the reporter's machine.
2026-10-28 19:54:53 +08:00
yetone 053d0d37f8 library: Install RTK uses brew only when Homebrew has rtk's bottle, and keeps why it failed on the card (Scott__D on X)
Scott__D on X: "Magpie 里的这个 RTK 安装一直都不成功". The RTK card sat on
"Installing RTK… this can take a minute." over `brew install rtk`.

Cause: Homebrew bottles rtk only for Apple silicon on the newest macOS
(arm64_sequoia, arm64_tahoe, arm64_golden_gate, and Linux). On an Intel Mac
or macOS 14 and older, `brew install rtk` builds rtk from source, and first
the 19 formulae it builds with, rust, llvm and python among them: hours.
InstallRTK gives the installer five minutes, so each try was ended, said so
in a status line gone after ten seconds, and the next try started over.
Reproduced on mote with a sandbox Homebrew (HOME and prefix of its own)
and HOMEBREW_FAKE_MACOS=14.7: brew info rtk says "stable 1.1.0, HEAD" with
no "(bottled)", brew install rtk lists 19 dependencies to build, and
magpie's InstallRTK spent 3m43s in it before failing.

Fix:
- rtkInstaller asks `brew info rtk` and uses brew only when it says
  "(bottled)", brew's own word for pouring the bottle here. Otherwise, and
  when brew fails or doesn't answer in 30s, it is rtk's own script
  (install.sh from rtk-ai/rtk's README, which downloads rtk's release for
  darwin x86_64/aarch64 and Linux). The answer is kept an hour per brew,
  since ReadRTK asks on every read while rtk isn't installed.
- A failed brew says Homebrew's first Error: line and what it says to do,
  not the support-tier notice its output ends with.
- The card keeps "The install failed: {why}" beside Get RTK until the
  next try (as the upgrade's error already did), in every language.
- The five-minute bound on the installer was already there and stays.

Run on mote (macOS 27.2, arm64):
- real InstallRTK, sandbox HOME, sandbox Homebrew, HOMEBREW_FAKE_MACOS=14.7:
  chose rtk's script, installed rtk 1.1.0 into the sandbox ~/.local/bin in
  12.2s (`rtk --version`: rtk 1.1.0); the card then offers Put RTK on PATH.
- real InstallRTK, same sandbox, macOS 27 as it is: chose brew (bottled),
  installed rtk 1.1.0 in 10.7s.
- go test ./internal/library (TestRTK*): ok. New tests:
  TestRTKInstallsWithBrewOnlyFromItsBottle (brew info output read from the
  real brew, bottled and not), TestRTKBrewInfoThatHangs,
  TestRTKBrewInstallSaysBrewsError (brew's real output on mote).
- GUI: library-rtk-install.test.cjs, 5 languages x 1100/420, Chromium and
  WebKit: 22/22. All library-*, gui-de/ja/zh-tw and i18n-keys files: 770 of
  771; the one red is i18n-keys "a plugin's words are its own" on
  plugins/routing "masking…", red on origin/main too (#4053).
- gofmt -l: nothing. go vet ./internal/library ./internal/gui;
  GOOS=linux and GOOS=windows go vet ./internal/library: ok.
- Full suite on mote, go test -tags nogui -count=1 -timeout 45m ./...
  at base df9376592: 77 packages ok, exit 0. Rebased on 874b86653 (no
  change under internal/library or the library plugin); at the pushed
  tree: go test ./internal/library ok, GOOS=linux go vet -tags nogui ./...
  ok, library-rtk-install + i18n-keys 25 of 26 (the one red is #4053).

Broken by hand: rtkInstaller back to "brew when there is one": all four
bottle cases, the hang test and (with brewError off) the error test red.
The kept answer dropped: "brew asked 2 times". The card's error line
dropped: library-rtk-install red in every language.

Not tried: a real Intel Mac or a real macOS 14 (simulated with
HOMEBREW_FAKE_MACOS); Scott__D's own Mac, macOS version and network; a
network where GitHub downloads fail (the script's error then shows on the
card).
2026-10-28 19:28:44 +08:00
yetone df9376592d routing: a group's member may offer several reasoning levels for the agent to pick among
Garydesu on X: "能不能让路由组里的模型设置多个可选推理强度,现在只能选一个或者整个
路由组的". A member was one fixed `:effort` or followed the group's levels.

A member's suffix may now join several levels with "+",
`provider/model:low+xhigh`, kept lowest first, each once. provider.MemberLevels
splits it into Member.Levels and leaves Effort empty, so the member isn't
fixed; one level is a fixed effort as before. The whole stays the member's
id, so rules, fast, off, weights, share and the CLI key it as any member.
The gateway fits the agent's ask to the member's own levels (groupLevels
returns the candidate's levels first; ofMember, the quiet check and the
trace see them), and the group lists them to agents (buildGroupEntries),
intersected with the other members' as usual. In the Routing page's group
editor the member's reasoning menu has "Several levels…", a menu that stays
open with each level ticked or not; a fixed level picked from the first menu
replaces the old one as before. i18n in zh, zh-TW, ja, de; CLI help and
docs/subsystems/gateway-routing.md say it.

Run on mote (mote-run). Rebased on efb55b5c9 (past e1721d640, which
changed the group editor) and run again there: provider, gateway, cli ok;
gofmt clean; GUI group-member-levels, group-member-fast,
group-member-weight, group-from-model-add and i18n-keys 53 of 54, the red
being i18n-keys' "masking…" from e296211b8, red on main (#4053). Linux
and Windows vet were clean at 7fe98c2af. Earlier, at the first base:
- go test -tags nogui -timeout 45m ./internal/provider ./internal/gateway
  ./internal/cli ./internal/tui ./internal/gui: all ok (gateway 525s).
  internal/cli again after the help wording below: ok.
- gofmt -l: nothing.
- GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go vet
  ./...: clean (darwin prints cgo warnings only).
- Whole GUI suite (node --test "internal/gui/tests/*.test.cjs", both
  engines, load 140 at its peak): 13,931 tests, 119 red in 31 files. One
  was this change: i18n-keys' "a plugin's words are its own", because the
  CLI help said "the agent picks among them" too; reworded the help, and
  i18n-keys passes. The other 30 files, run alone at --test-concurrency=4
  at this tree and at its parent e8c7dddcb: the same files red on both
  (97 and 100 cases, the routing-rule ones a random subset each run, all
  waiting on clicks), each with an open issue (#3527 lists the pattern;
  segs-press-redraw #3922, routing-story-shrinks #3954).
  group-from-model-add, account-*, login-import and signin-* pass alone.
- group-member-levels.test.cjs: 30 of 30 (5 languages, both engines,
  1100px and 420px); group-member-fast.test.cjs 4 of 4.

Broken by hand:
- groupLevels without the member's levels: TestMemberSeveralLevelsFollowAgent
  red (asked high, sent high, not xhigh).
- buildGroupEntries without the member's levels: TestMemberSeveralLevels red
  (offered all four, not low and xhigh).
- main's routing client.js: group-member-levels red 3 of 3 (chromium en).

Not tried: a real agent picking among a member's levels against a real
vendor; the TUI (its reasoning toggle cycles a "low+high" member back to
following the group, unchanged code).
2026-10-28 18:52:39 +08:00
yetone e1721d6404 routing: a weighted group's editor sorts its members by weight once (Norcleeh)
Norcleeh (Discord #general) asked for a way to order a By weight
group's members by weight. The order matters there: it is the
fallback's when a model fails.

Now the group editor has a "Sort by weight" text button beside Add
another model. It shows while the group routes By weight and the order
would change. A press puts the named members heaviest first (no weight
counts as 1, equal weights keep their order, one switched off is
sorted too; a pattern's members stay after them) and draw()s. The
button then goes. It is a one-off reorder of the draft, saved with the
group's Save; no mode is stored. Its title says the order is the
fallback's. Strings in zh, zh-TW, ja and de. The routing plugin's
client.js isn't a core script; no budget changed.

Run (mote-run, at this head on a1f06bd78):
- group-member-weight.test.cjs, Chromium and WebKit, en/zh 1100px and
  en/de 420px: In order offers no sort. By weight it does and fits.
  The press orders glm-5 (6), gpt (3), kimi (2, off), o4-mini (1),
  each keeps its weight, the button goes, and Save sends that member
  order. Every new string has its four translations. 8/8.
- Red on origin/main's client.js: 8/8 fail (no button). Broken by hand,
  the button kept while sorted: 4/4 Chromium red at "sorted, it has
  nothing to do".
- The routing GUI files (group-*, routing-*, panel-routing*), i18n-keys and
  gui-de/ja/zh-tw, both engines, at load ~230: 1879 of 1913 passed.
  Adding the button into .rt-gadds made routing-intent-entry count 3
  buttons, so the row has its own class, rt-madds; that file passes.
  The reds left are in routing-flood, -levels, -row-swap, -rule-drag,
  -rule-remove, -rules-line, -steady and -story-shrinks. The same 27
  fail at a1f06bd78 without this change, and rule-drag, row-swap and
  steady fail 7/7 at 7fcf642ee. Each has an open issue: #2215, #3620,
  #3799, #3789, #3096/#3094, #3593, #3412/#1804 and #3954.
- go test -tags nogui ./internal/gui: ok. gofmt -l: clean.
- Again after the rebase onto 7fe98c2af: go build ./..., go test
  ./internal/gui ok; group-member-weight 8/8, routing-intent-entry 8/8,
  group-context 4/4. i18n-keys is 3/4: its "a plugin's words are its
  own" is red on main, from a masking.go comment that quotes "masking…"
  (e296211b8), not from these strings. Filed as #4053.

Not tried: the real desktop app, and a group with members by pattern
(those aren't sorted, by the code).
2026-10-28 18:33:46 +08:00
yetone 76218200af gui: a demo's made-up account is never blurred by Hide accounts (data-no-pii)
outloudvi on Discord (#feedback, 1564923315095732276): with Hide accounts
on, the masking demo's letter on Insights › Masking had its account
(yetone@example.com) blurred and its password (hunter2-prod) not. The
blur is hideAccounts, which masks every address in the window's body.
It isn't the demo's own masking. The demo's values are made up, and
showing them is the point of it.

An element marked data-no-pii, and everything inside it, is now skipped
by the text walker and the tooltip pass. The demo's section carries the
marker. The class: any illustration with made-up accounts takes the same
attribute. A search of the GUI assets found no other drawn one. The only
other fake address is ops@company.com, in input placeholders, which the
blur never touches. Text added later in a marked element stays unmasked
too: the observer's mask(e) passes through the same checks.

New test masking-demo-unblurred: Hide accounts on, an address elsewhere
on the page still masked, the demo played (reduced motion on and off),
its account and password slots both readable, and no .pii in #maskDemo.
A generic [data-no-pii] element with a title and text changed after
masking stays unmasked. It runs en and zh, in both engines.

Run on mote:
- masking-demo-unblurred and masking-demo at this tree: green.
- go test -tags nogui -run Budget ./internal/gui: ok (no budget raised).
- The 124-file GUI run in the commit before, at this tree: none of its
  reds in masking files (masking-records zh-TW was green when rerun).
Broken by hand:
- Marker removed from client.js: red, account slot "ilottn@aamital.cmd"
  in webkit (the reporter's blur).
- Walker and title checks removed from app.js: red.
Not tried: Linux and Windows.
2026-10-28 17:58:50 +08:00
yetone a6f6e86e80 gui: an account's eye shows that provider's account, and a Kiro account's eye works
outloudvi on Discord (#feedback, 1564924864052207627): on Usage's overview
with Hide accounts on, Kiro's eye did nothing, and one username on two
platforms was shown or hidden by either card's eye.

- Kiro: the plugin names an account "email (Google)" (nameOf in
  packages/kiro). The finder tried the address pattern first, so only the
  address was hidden. The eye kept the whole name, which never matched
  what was hidden. A name with an address in it is now found whole,
  before the address pattern.
- One name on two providers: shown was keyed by the account alone, and
  kin() gathered names from every provider. Each entry is now keyed
  "provider\naccount". eye(u, p) takes the provider id at every call: the
  provider editor, the account button, the panel's quota card and Usage's
  quotaWho. Text by an eye (its row, or its card one level down) follows
  that eye's provider. Text that is near no eye, like a sentence elsewhere
  in the window, shows when the account is shown under any provider, as
  before.

New test account-eye-provider: Usage cards for Kiro (one email, Google
and GitHub), Codex and ZCode (the same address) are rendered with Hide
accounts on. It runs en and zh, at 900 and 360px, in both engines.

Run on mote:
- account-eye-provider at this tree: 4/4.
- go test -tags nogui -run Budget ./internal/gui: ok (no budget raised).
- 124 GUI files the masking, Usage, panel and storage code reaches, both
  engines, run with the next commit on top: 1761/1792. All 7 red top-level
  tests are in quota-count-wrap (#3404, #2228), usage-agents-hide (#3414,
  #2276) and usage-ledger (#3104), plus one masking-records zh-TW and one
  quota-refresh-order. Those five files were run again at origin/main
  33af28ed6 and at this tree: the same 29 reds on both. masking-records
  and quota-refresh-order were green in that rerun (quota-refresh-order
  had failed on keep(), fixed in the commit before).
Broken by hand:
- Back to the old eye and finder: every case red at "the Kiro account's
  eye shows it" (chromium and webkit, en and zh).
- Only the provider keying undone: every case red at "the same address
  on ZCode stays hidden".
Not tried: a real Kiro account (the name's shape comes from the plugin's
source), and Linux and Windows.
2026-10-28 17:58:50 +08:00
yetone 3ebdc5df9e gui: what a page keeps in localStorage as JSON is read and written by two helpers
kept(k, d) reads magpie.<k> as JSON and gives d when nothing is stored,
when the value is a different kind from d, or when it can't be read.
keep(k, v) writes it, and a write that fails holds only for this time.
They replace eleven try/JSON.parse/getItem and setItem copies: the
discovery ignore list, model favourites, Usage's folds (usageOpen,
usageAccounts, usageAcctsOpened, usageKeysAll, usageAcctsAll) and the
panel's folded options. The three Usage fold reads, which were written
out twice, are now one usageFolds(). The star's write had no try at all.
This is the room for the next two commits (outloudvi's two masking
reports), so the app.js budget doesn't go up. app.js shrinks by 1,062
bytes, to 1,308,386 at eb6d1d8d9.

The panel's last allowances (magpie.panelQuotas) keep their own read and
write. quota-refresh-order runs loadQuotas in a vm with only localStorage
stubbed, and keep() isn't there.

Run on mote, at this tree on eb6d1d8d9:
- go test -tags nogui -run Budget ./internal/gui: ok.
- node --test on favorite-star, provider-discovery, panel-options-fold,
  panel-quota-kept, usage-accounts-fold, usage-fold and usage-keys-fold,
  both engines: 96/96.
- Inside the 124-file run listed in the next commit.
Broken by hand: kept() made to return d and keep() made a no-op. 27 of 48
chromium tests went red (panel-options-fold, panel-quota-kept,
provider-discovery's ignore tests, usage-accounts-fold, usage-fold and
usage-keys-fold). favorite-star stayed green because it doesn't reload.
Not tried: Linux WebKitGTK and Windows WebView2. One change in kind:
usageAccounts stored as an array now reads as {}, where before it was used
as an array.
2026-10-28 17:58:50 +08:00
yetone 33af28ed6b gui: the add sheet's Partners heading lights once an opening
The owner asked for an elegant light on the Partners heading each time
Add provider takes the view to the sheet, and picked the traced outline
of three drafts. A 1px hairline (a conic gradient on an animated
@property angle, masked to the border) runs once round the heading's
words over 1.8s and fades, over a faint wash of the accent; it follows
--accent, so it reads in both themes, and keeps to the heading's own
padding box, inside the sheet.

It plays when the heading is fully in view (an IntersectionObserver on
the providers view), once per opening of the sheet: a search or a reload
drawing the sheet again doesn't play it, closing and opening it does
(partnersShone, reset where partnersCounted is). With the system's
reduced motion or Settings' Reduce motion (#3813, calm() and holdStill)
it isn't drawn. The outline's elements are <i>, so the heading's hint
stays its only span, which the add-sheet and partners tests read.

The core's scripts are 1,528,076 bytes, their budget raised to it with
no room added; app.js stays under its own.

Run at this head, on mote: TestCoreScriptBudget ok; the 59 GUI files
that open the add sheet (grep addProvider|#addSheet) and
reduce-motion and settings-general, chromium and webkit: 826 of 826 ok
(at --test-concurrency=2; at 4, on mote at load ~230 from other runs,
8 chromium sign-in cases timed out at 5s and passed 28 of 28 alone).
add-partners-shine.test.cjs: en zh ja de at 900 and 440px, lit once on
open, not again after a search, again after close and reopen, the
outline round the words and inside the sheet, none under either reduced
motion.
Broken by hand: without the partnersShone check every redraw lights it
again, and the test is red in all 8 language/width cases.
Not run: the whole GUI suite (the change adds no API call and its
classes are scoped to the add sheet's heading); not seen on Windows'
WebView2 or WebKitGTK, where @property and mask-composite are supported
but the motion wasn't watched.
2026-10-28 17:52:16 +08:00
yetoneandtimonwong f561cc5d9b groups: a model unchecked in its provider's list is not a member to route to (#3911)
timonwong (#3911, also on Discord #feedback): with a group of a/x and
b/x, unchecking x in provider a's model list struck a/x on the Routing
page, but group/<id> still sent requests to a. membersOff resolved each
member through resolveIn, whose provider/model step takes any model of
a provider that is on, so that a request can name a model its list
lacks.

membersOff now skips a member whose provider has picks and whose served
models lack it (unpicked), as timonwong's fork did (38615ca9). A
provider with no picks still routes a model its list lacks (#2642), a
decision model (never in the catalog) is still a decision group's, and
a request naming a/x itself still reaches a. Every route mode goes
through membersOff (ordered, weighted, rotate, manual, nested groups,
found groups, count_tokens' group lookup), so all of them get it. The
entries map is built only when a member's provider has picks.

The Routing card's memberInfo (gui/groups.go) used Resolve too, so a
manual group's pick row showed an unchecked member as ready; it now
asks provider.ResolveRoute, the same check, and the group is not ready
when its picked member was unchecked.

Tests: group_model_pick_test.go (ordered, weight, rotate; nested; a/x
named directly still served; checked again comes back; a decision
group keeps a picked decider) and gui's
TestGroupMemberUncheckedInItsProvider.

Run (mote, at this tree plus the next commit):
- Red on c30e2a645 with only the tests: the three route modes, the
  nested case and the GUI test fail ("from ka"); direct and checked
  again pass, as they should.
- Broken by hand: without len(p.Models) > 0, seven gateway tests go
  red (TestNativeCompactionWriterThroughAGroupWhoseListLacksTheModel,
  TestCodexSpentMovesToNextGroupMember, TestWeightedGroupGivesALowGroupItsShare,
  TestVideoGroupMovesOnToTheNextMember, TestPolicyRefusalMovesToNextGroupMember,
  TestCodexSealedAgentHandoffGoesToGroupsChatGPTAccount,
  TestClaudeClientCacheGroupKeyKeepsMarks); without !DecidesModel,
  TestDecisionGroupKeepsAPickedDecider goes red.
- go vet (darwin, GOOS=linux, GOOS=windows) on provider, gateway, gui:
  clean; gofmt -l clean.
- go test -tags nogui -timeout 45m ./...: 76 packages ok; one red,
  internal/plugin TestGatewayHookMixedPiPackage "starting plugins:
  context deadline exceeded" at load ~134 (#2865, filed); it passes
  alone on the same tree (26s).

Not tried: the real GUI app with a real provider; no GUI JS changed,
so the Playwright suite was not run.

Co-authored-by: timonwong <timon86.wang@gmail.com>
2026-10-28 17:34:16 +08:00
yetone 62ce73250f gui tests: old-webkit knows webfonts.js is imported, not a page script
a1f06bd78 (Norcleeh's browser-tab fonts) added webfonts.js, which
app.js's loadFonts imports in a browser tab only. old-webkit's "compat.js
is the first of the page's own scripts" asks every asset .js to be in
index.html, so it has been red on main since: "webfonts.js is not loaded
by index.html". It now leaves webfonts.js out of that one check; the
syntax and built-in checks still read it.

Red on origin/main eb6d1d8d9 (mote). At this head on aca0f0d8a, mote:
node --test old-webkit (with nine other GUI files): 152 pass, 0 fail.
2026-10-28 17:22:10 +08:00
yetone be0fbfe08d gui: a menu with nothing to tick keeps no tick column in Safari 15.0 too (#4020)
v0.1.1855's old-webkit check failed on app.css's
`.proto-menu:not(:has(.on, [role=menuitemcheckbox])) .pm-tick` rule:
:has() is Safari 15.4+, so on macOS 12's Safari 15.0 the whole rule is
dropped and every plain menu kept an empty tick column. openProtoMenu
and the sessions combo's draw() now set .pm-bare on the box when no
item is on or a checkbox, and the CSS hides .pm-tick under it. The
three commits before this one dedupe app.js to make the room; the core
script budget is not raised.

Run at the pushed head (this commit + the old-webkit test fix after it,
on aca0f0d8a), on mote at load ~150:
- go test -run 'TestCoreScriptBudget|TestAppScriptBudget' ./internal/gui: ok
- node --test old-webkit, signin-paste-import, menu-scroll,
  proto-menu-overflow, sessions-convert, account-cap, window-cap,
  warm-at-own, model-price-edit, signin-close: 152 pass, 0 fail
One rebase earlier (on eb6d1d8d9), also: sess-agent-strip, purpose-filter,
side-effort, signin-paste-key, signin-proxy, copilot-ghe,
plugin-other-ways, zcode-site-layout, settings-groups, settings-search,
pool-ends, routing-held-member: pass; signin-paste-import's no-address
cancel timed out once at load 163 and passed 3 of 3 alone (#4035).

Red on clean origin/main e23ddddd5 too, not from this change:
menu-input-scroll (#3402) and gateway-key-models webkit en (#2648).
Not tried: a real macOS 12 Safari 15.0; old-webkit's checks stand in.
2026-10-28 17:22:10 +08:00
yetone 6e0bd5447d gui: capHeldNote writes the window's reset time once
Its three notes each built the same " · resets …" text; it is one
const now, which makes room under the core script budget for #4020
without raising it.
2026-10-28 17:22:10 +08:00
yetone 436fd03124 gui: one blurOnEnter for the four fields that commit on Enter
Four fields set the same keydown handler (keys kept from the page,
Enter blurs to commit). It is one helper now, which makes room under
the core script budget for #4020 without raising it.
2026-10-28 17:22:10 +08:00
yetone 02630a5a14 gui: one stopSignIn for the sign-in sheet's four cancels
The same 'tell the server the sign-in under way is given up' line
stood in four places; it is one helper now, which makes room under
the core script budget for #4020 without raising it.
2026-10-28 17:22:10 +08:00
yetone 6e080ca044 gateway: every model in /v1/models says it takes tools, a routing group too
psikent on Discord: an SSH client judges what a model can do from its
list entry, and a routing group, whose id is the user's own name, said
nothing of tools, so the client handed it none. /v1/models and
/v1/models/{id} now give every chat row models.dev's tool_call: true
(beside the reasoning it already had) and OpenRouter's
supported_parameters (tools, tool_choice, and reasoning when it thinks),
which Kilo's and Cline's list readers use (kilo.go reads the same field).
magpie has no model that takes no tools (a call written as text is read
back as one), so a group's members all take them and the group says so.
No `capabilities` key: Cursor Private Inference reads it as an object,
Ollama and LM Studio as arrays of their own words; magpie's Ollama
/api/show already says "tools". Desktop's, Science's and the decision
models' lists are unchanged.

windy on Discord: a 1M DeepSeek group with a 128K Trae member. A group's
window and output stay its largest member's, images any member's, as
#712, #756 and ARNO's truncation report decided: the gateway sends a
longer conversation only to members with room (roomy, withRoom), and
Context: Smallest model's tells agents the smallest. The editor's Context
hint now names the member a longer conversation skips when the windows
differ ("…longer than 128,000 skips Trae CN · DeepSeek-V4.1-Flash…"), in en, zh, zh-TW, ja, de.
Compaction written to agent configs follows the same window (CompactFor,
CompactSet takes the smallest threshold the user set); unchanged.

Run (mote unreachable all session, so on the other test boxes):
- TestGroupListedTakesTools on Linux (wsl-run): green; red on the old
  gateway.go (a/m, b/m, group/g and /v1/models/group/g: tool_call false,
  supported_parameters []).
- group-context.test.cjs on the Windows box, Playwright 1.62.0,
  Chromium + WebKit, en and zh: 4/4 green; 4/4 red with the old
  routing assets (the hint named neither 128,000 nor the member).
- Every GUI file that opens the group editor (56) plus i18n-keys, both
  engines, on Windows: 816 tests, 792 pass, 24 red (793/23 on the run
  before the hint named a member's provider). The red files with the old
  assets: the same tests red (25). They are #3402, #3412, #3789, #3096 and name-suffix-saved's
  WebKit provider editor, not this change.
- Full Go suite, -tags nogui -timeout 45m, on Linux: all ok but
  internal/agent (7 install-detection tests), internal/proc TestTreeRSS
  and internal/gateway TestUploadStillUnderwayIsNotCutByHealthPing; each
  red at origin/main eb6d1d8d9 on that box too (#4033, #3909).
- gofmt -l clean.
Not tried: psikent's SSH client itself (not named yet), the GUI on macOS
WebKit (mote down), a real group in the running app.
2026-10-28 17:20:24 +08:00
yetoneandJoeyWu-tech 761e0e0105 gui: a Settings option pressed through two redraws clicks its newest self (#3922)
Browser access draws twice per renderSettings: once at once, and once
more when its /api/web-page answer comes. When that answer landed
between the release and the click segs' pointerup sets off, the option
the release found was gone by the click and nothing was sent, which
segs-press-redraw's sweep saw on Network's web-page list. The click now
goes to the control's newest self (same segsWho, same option), found
again whether or not a draw came since; dragged off or gone still picks
nothing.

From Coffemon's patch on #3922 (JoeyWu-tech, fix/3922-segs-newest,
c1b5575af and e8c831736): the test's new redrawn-twice case, reveal()
waiting for each wheel's scroll to land, and the README entry, taken as
is. The app.js change is his, shorter: his kept b when still there and
looked up the newest self otherwise (+298 bytes); the lookup finds b
itself when b is still there, so it is used alone (+129 bytes). Main's
core had 18 bytes of room left when this landed; TestCoreScriptBudget
is green and no budget is raised.

What was run (mote, Playwright 1.62.0, Chromium and WebKit, en, zh, ja,
de, 900 and 440px):
- The new test on main's app.js: 22 of 42 red, both engines.
- With this change: 42 of 42.
- Broken by hand (the newest self's option taken as [0], not p.i):
  Chromium 17 red.
- go test -run TestCoreScriptBudget ./internal/gui: ok.

Not tried: the real app's webview, or a loaded Mac.

Co-authored-by: JoeyWu-tech <joey110551567@gmail.com>
2026-10-28 16:58:22 +08:00
yetone ae03279458 masking: the local model is on by default; the rules mask alone until it is downloaded
The owner's plan (10-28, after the xuanwo/_kaichen reports under the
masking demo): with AstrLink Guard picked, the Chinese-name heuristic
is off and only nicknames like 小王/老李 stay a rule; with Privacy Filter
it is as before; every format rule stays; the model is on by default,
masks with the rules alone until its download finishes, and no longer
answers 503 for it.

- masking.ModelWanted(st): on when the user turned it on, off when the
  user turned it off (new RedactModelOff, set by SetRedactModel(false),
  remove, and cancelling the default's own download), on when the
  default's download finished (RedactModelAuto). A settings file from
  before this, with a model name picked or files on disk and the model
  off, reads as the user's off: magpie's default doesn't override it.
- Until the picked model is installed, requests are masked by the rules
  alone and fetch starts its download (one try per model per hour,
  never under testing.Testing(), nothing where the model can't run).
  When it finishes, settings.UseDefaultRedactModel records the default
  (it refuses when the user has set anything) and the model warms.
- model(..., strict): a model that fails holds requests back (503)
  only when the user turned it on; under the default the rules mask
  alone. The Privacy page says which ("…the rules mask requests alone"
  in en, zh, zh-TW, ja, de; /api/privacy-model has `chosen`).
- redact.Options.NamesByModel (AstrLink Guard picked): zhNameSpans
  keeps only zhNick candidates (小/老 + a surname).
- KeepOwn and POST /api/settings keep both new fields.
- Docs: gateway-routing.md, site masking docs (en, zh, ja).

Run (mote, Go 1.26.8):
- gofmt clean; go vet of masking, settings, redact, gui; GOOS=linux go
  vet of masking, settings, redact; GOOS=windows go vet of the four.
  (GOOS=linux vet of internal/gui needs cgo, as on main.)
- go test -count=1 -timeout 45m ./... at base 7fd77a944: every package
  ok except internal/gui. Its reds: TestCoreScriptBudget (+64 bytes,
  fixed by dropping a comment, budget not raised), TestPrivacyModelPick
  and TestSettingsSaveKeepsWhatItDoesNotSend (updated for the new
  default and fields), TestMainWindowCorners (#3949, red on origin/main
  e8c7dddcb too), and three AppKit tests killed at 20-30s under load
  just before mote rebooted, which pass in the rerun.
- Rerun at base 6bec526f7: internal/gui (only #3949 red), masking,
  settings, redact ok. GUI node tests privacy-model, masking-records,
  masking-demo, routing-masking, i18n-keys, gui-zh-tw, gui-ja, gui-de:
  Chromium 199/199, WebKit 106/106.
- At the pushed base 9e33962c0: TestCoreScriptBudget, TestSettingsSave*,
  TestPrivacyModel* ok; i18n-keys and privacy-model 68/68 in both
  engines.
- At the pushed base 7fcf642ee (masking in the request archive):
  -run 'Mask|Redact|Archive|Privacy' in masking, gateway, redact ok.

Broken by hand, each red: the nick filter off
(TestChineseNamesByModelOnlyNicks), ModelWanted needing RedactModel
(TestModelOnByDefault), strict ignored (TestDefaultModelFailingIsTheRules,
TestNoModelYetMasksByTheRules).

Not tried: a real default download in a sandbox HOME (the tests fake the
model). Known limit: a user who turned the model on before model picks
existed and then deleted it has no name or files left, so reads as new
and gets the default on.
2026-10-28 16:55:24 +08:00
yetone a1f06bd780 gui: a browser tab offers the fonts of the computer it runs on (Norcleeh)
Norcleeh (Discord #general): magpie in Docker, used through the web GUI,
Settings' font menu doesn't list the fonts he installed on his own
computer; the app does. Cause, confirmed in the code: a tab's list is
/api/fonts, the server's families (none in a nogui build such as Docker)
plus commonFamilies, filtered by what the browser draws. A family that
is only on the browser's computer was never offered, and a choice the
server doesn't list was dropped by desktopFonts.available.

Now (webfonts.js, which only a browser tab loads; the app's windows are
unchanged):
- Where the Local Font Access API is (Chromium on https or localhost),
  the press that opens a family menu calls queryLocalFonts() once a
  page, and at load when the local-fonts permission is already given.
  The families join the list with their real styles ("SemiBold
  Condensed Italic" -> weight 600, 75%, italic).
- Elsewhere (Safari, Firefox, a plain-http LAN address, a refused
  permission) the menu's search says "Search or type a font name…" and
  offers Use "name" for a family the list lacks, enabled when the canvas
  probe says this browser draws it, greyed with "This browser can't find
  this font" when not; Enter takes it.
- A chosen family the server doesn't list stays in the tab's list on
  later loads while the browser draws it, so it keeps being applied.
- The app's menu (openProtoMenu), never a <select>. Strings in zh,
  zh-TW, ja and de. docs/subsystems/gui-shell.md says so.
Budget: no raise. here() moved out of fonts.js into webfonts.js, which
isn't a core script: loadFonts import()s it in a tab only (the page has
no CSP). The core is 106 bytes smaller than origin/main's.

Run (mote-run). At this head on e8c7dddcb: gofmt, go build ./... and
-tags nogui, go test -run 'Font|Budget|Boot|Asset' ./internal/gui
./internal/fonts ok; fonts, i18n-keys, web-page, settings-general,
inner-scroll-contain 114/114. Earlier, on 6af83172d (with a <script>
loader in place of the import):
- fonts, font-cascade, win-fonts, i18n-keys, settings-* (10 files),
  text-size, web-page, web-app-standalone, mobile-web, gui-de, gui-ja,
  gui-zh-tw, menu-scroll, omarchy, proto-menu-overflow: 311 tests
  before the rebase, 300 ok. Red: mobile-web's 8 "desktop
  matches origin/main" subtests (they read origin/main through git, and
  a mote-run copy has no .git), and settings-lines-wrap webkit zh 440px
  (a Models tab press timing out at 8s under load). At the rebased
  head: fonts, i18n-keys, settings-general, web-page,
  settings-lines-wrap: fonts' WebKit half and a lines-wrap zh-TW press
  timed out at mote load ~210 (the box then rebooted); rerun at load
  ~14, fonts WebKit 21/21 and settings-lines-wrap 20/20, the rest of the
  first run ok. The 8s press is filed as #4026.
- New tests in fonts.test.cjs, Chromium and WebKit, en and zh, 1000px
  and 440px: "a browser tab lists the fonts of the computer it runs on"
  (queryLocalFonts stubbed: not asked before the press, asked once in
  it, families and real styles offered, applied, no settings POST) and
  "a browser tab takes a typed font when the API is missing/refused".
  All 16 red on origin/main's assets (MAGPIE_FONT_ASSETS): this
  computer's families not offered, the search not taking a name.
- Broken by hand: merge() without the tab's own chosen families: the
  typed tests go red at "kept across a reload, though the server lists
  no such font" in all 8 cases.
- go build ./... and -tags nogui, gofmt -l, GOOS=linux go vet -tags
  nogui ./internal/gui, GOOS=windows go vet ./internal/gui ok; go test
  -tags nogui -run 'Font|Budget|Boot|Asset' ./internal/gui
  ./internal/fonts ok.
- Real use on mote: a nogui `magpie web` in a sandbox HOME (server list
  57 common families). Chromium with local-fonts granted: 204 families,
  185 only on this Mac; Baskerville picked, drawn, kept across a reload.
  WebKit (no API): typed Didot, offered and taken, kept across a reload.

Not tried: Chromium's real permission prompt (Playwright grants it),
Firefox, a browser on another computer than magpie's, a Docker image
run, the full Go suite (no Go change).
2026-10-28 16:55:01 +08:00
yetone 9e33962c05 gui: Settings has Reduce motion, stilling magpie as the system's does (#3813)
CupOfBread asked for a switch that turns magpie's motion off to save
resources on the desktop, and linull24 saw the Routing page keep a
phone's browser busy. magpie already stills its animations under the
system's Reduce Motion: 46 @media (prefers-reduced-motion: reduce)
rules across app.css and the plugins' styles, and calm() in the
scripts. Settings -> General now has "Reduce motion" (Off / On) that
does the same without the system setting.

- settings.json keeps reduceMotion; boot.js passes it; a POST that
  leaves it out keeps it, as the other prefs.
- theme.js's holdStill(on) sets data-motion="reduce" on <html> and sets
  the media of every stylesheet rule written for reduced motion to
  "all" (and back when turned off), so the same rules apply and no CSS
  is written twice. layout.js calls it before the first paint when the
  saved setting is on; applyPrefs calls it on a change.
- calm() is true when data-motion is reduce too, so the scripts'
  motion (Routing's stage, Library, Usage) holds still with it.
- routing.css: the reduced-motion rule for the live dot was
  .rt-livedot, which lost to .rt-livedot.on's animation; it is now
  .rt-livedot.on, so the dot stands still with either setting.

Measured on mote (Chromium 390x844, 4x CPU throttle, live Routing
traffic, CDP Performance over 10s, two runs each): main-thread task time
0.18 and 0.22 s/s with it off, 0.090 and 0.085 s/s on; style recalc
0.021/0.025 off, 0.008/0.011 on.

Tests: reduce-motion.test.cjs (new, both engines): saved on, the
reduced-motion rules apply from the start (a probe's live dot has no
animation, calm() is true); Off restores them and posts false; On again
posts true. TestSettingsReduceMotion: off by default, kept by a POST
that leaves it out, cleared by false, in settings.json and boot.js.
The Settings row is in settings-general's list of rows.

Run on mote at this head (rebased on e8c7dddcb): go test -run
"TestCoreScriptBudget|TestAppScriptBudget|TestSettings|TestBoot|TestI18n"
./internal/gui ./internal/settings: ok (the core budget not raised);
GOOS=linux, windows and darwin go vet -tags nogui of both: clean.
reduce-motion, settings-general, i18n-keys, routing-live-calm,
codex-descriptions, codex-predictions, codex-titles and old-webkit:
61 pass, 1 fail, the Safari 15.0 styles check below.
gofmt -l: clean.

Not tried: the real Linux (WebKitGTK) and Windows (WebView2) apps; the
setting changes only which existing CSS rules apply. old-webkit's
"Safari 15.0" check is red on origin/main from c490165b1's :has() in
.proto-menu (#4020), not from this change.
2026-10-28 16:50:16 +08:00
yetone ceaebd6b0b gui: Codex's descriptions, predictions and titles pickers are one function
renderCodexDescriptions, renderCodexPredictions and renderCodexTitles
were the same 20 lines three times, differing only in the setting's key,
the button's label, the Off note and the API path. They now call one
codexSidePick(s, key, aria, none, path). Each picker builds the same
button, options and request as before, in the same #<key>Pick slot.

It takes about 1.5KB out of the core scripts, room that the next commit
(#3813's Reduce motion) needs under TestCoreScriptBudget, which stays
where it is.

Run on mote at the tree of this and the next commit (before the rebase
onto origin/main; rerun after it is in the next commit's body):
codex-descriptions, codex-predictions and codex-titles in every engine
and language they cover, with reduce-motion, settings-general, i18n-keys
and routing-live-calm: 56 pass, 0 fail. go test -run
"TestCoreScriptBudget|TestAppScriptBudget|TestSettings|TestBoot|TestI18n"
./internal/gui ./internal/settings: ok. An earlier run of the same files
on a mote at load 30 to 56 timed the browsers out at 180s (webkit zh
passed there in 128s); the rerun after mote restarted passed whole.
2026-10-28 16:47:07 +08:00
yetone e8c7dddcb4 notices: the release carries the third-party licence notices
The owner asked for the licence notices in the release package (moejs
alpha.11 compiles Intl's data in, which carries its own notices).
THIRD_PARTY_NOTICES is embedded in the binary (main.go, //go:embed) and
handed to internal/notices; `magpie licenses` prints it, GET /api/notices
serves it, and Settings › About has an Open-source licenses row that
opens it in a dialog, in every language. `make app` copies the file into
the .app's Resources too. The core's scripts are 1,527,245 bytes, their
budget raised to it with no room added; app.js stays under its own.

Run at this head (rebased on origin/main):
- win-run (Windows 11): go vet -tags nogui . ./internal/notices
  ./internal/cli; go test TestNoticesFollowMoejs (.), ./internal/cli,
  TestCoreScriptBudget (./internal/gui): ok.
- wsl-run (Ubuntu 24.04): go vet -tags nogui ./..., go build -tags
  nogui: ok.
Run at the pre-rebase head 14e2d13fb, on mote (macOS):
- gofmt; make app's copy byte-identical to the file; `magpie licenses`
  output equal to the file; GOOS=linux/windows vet and build;
  go test . ./internal/cli: ok. ./internal/gui: only
  TestMainWindowCorners red, the same on origin/main (#3949).
- about-notices.test.cjs: chromium and webkit, en zh zh-TW ja de, 1100
  and 420px: all ok.
Broken by hand: TestNoticesFollowMoejs red with the embedded file cut.
Not run: the GUI suite at this head. The rebase met main's cancelAsk
helper where showNotices sat, and the dialog's Done now uses it (the
same stopPropagation + closeConfirmAsk). The whole GUI suite at
14e2d13fb was cut off when mote went down at load ~50: the files it
reached outside About had reds, most of them 180s browser-launch
timeouts, the rest passing in other languages or the other engine; they
are run again once mote is back, and any that stay red are filed.
2026-10-28 16:40:03 +08:00
yetone 1d7ca4c6b7 gui: every scroller in every stylesheet is held to keep the wheel; Safari 15 too
碳碳双键 (ysm119, Discord): a list scrolled to its top or foot by the
wheel went on to scroll the page, "in many places". d74ef5e04 (v0.1.1839)
already marks every box that scrolls and overflows between the pointer and
its .view (`holds`, app.js) and gives it overscroll-behavior-y: contain by
one rule in app.css. This makes that a guard and closes the one engine gap:

- inner-scroll-contain.test.cjs gains a test that reads every rule in every
  stylesheet under assets (app.css, plugins.css, context.css, omarchy.css
  and plugins/*/*.css; any not linked is added) that sets overflow or
  overflow-y to auto/scroll, builds a box from each selector (each compound
  an element; body classes put on body; @media rules tried at a size they
  hold for), fills it past its height, points at it, and requires
  overscroll-behavior-y: contain. 39 scrollers hold; .view is the one left
  to chain. A failure names the file and selector.
- compat.js: Safari 15 (macOS 12's WebKit until Safari is updated, #220)
  has no overscroll-behavior, so there a wheel over a .holds box already at
  its end in the wheel's direction is cancelled. Only where
  CSS.supports("overscroll-behavior-y", "contain") is false; Chromium,
  Safari 16+ and WebKitGTK 2.52.6 (probed on the Linux VM: true) never
  register it. There the Mac's bounce at the box's end is lost.
- app.js: the six "notice or ok" status lines share saidOk, to make room
  for compat.js under TestCoreScriptBudget (core 1,526,424 of 1,526,556 at the rebased head);
  no budget raised.

Run (mote, Playwright 1.62, Chromium and WebKit):
- inner-scroll-contain: the new guard and the Safari-15 test 4/4 alone;
  in the scroll batch 7/8, the one red a Chromium launch timeout (180s).
- Scroll batch (inner-scroll-contain, routing-scroll-end, click-scroll,
  view-wheel-*, menu-scroll, context-scroll-end, provider-levels-scroll,
  heatmap-scrollbar, ledger-hscroll*, old-webkit, view-trackpad-coast):
  195/209. Reds: 9 browser-launch timeouts (mote at load 30-60 with
  ~40 other test runners), old-webkit's ":has() in app.css" from
  c490165b1 on main (#4020, not this change), view-trackpad-coast
  chromium en ("the coast must ask for more than the 250ms": 6),
  view-wheel-unheard webkit 1 subtest, menu-scroll settings de 420px
  click timeout. None of those paths registers anything new in a modern
  engine; a rerun was cut off when mote dropped off the network.
- Agent batch (agent-connect/-disconnect/-leave-magpie/-notice-lang/
  -app-restart/-connect-no-models/-connect-all-hidden/-tweak-fold,
  claude-effort, tier-effort, subagent-effort, fast-ultra,
  hidden-agent-cleared, show-unset-agent, claude-signin, i18n-keys,
  panel-routing, routing-sessions, view-middle-autoscroll): every red
  but two a browser-launch timeout; agent-connect-all-hidden webkit zh
  and ja a click timeout under the same load.
- go test -tags nogui -count=1 ./internal/gui ok (budgets); gofmt -l clean.
Broken by hand: the :where(.holds) rule and the compat.js fallback
removed: the guard red for 25 scrollers per engine, the Safari-15 test
red in both. Fallback alone removed: only the Safari-15 test red. A rule
`.sess-new-list { max-height: 300px; overflow-y: auto; overscroll-behavior:
auto }` added to sessions.css: the guard red naming it, in both engines.
Not run: the full GUI suite; the agent batch's and scroll batch's
launch-timeout reds again (mote went down mid-rerun).
Not tried: a real Safari 15.0 WKWebView (the engine's lack is faked),
WebKitGTK and WebView2 in the app, a trackpad's momentum in the app,
plugin pages in their sandboxed frames (a plugin's own scroller is
the plugin's).
2026-10-28 16:36:28 +08:00
yetoneandJoeyWu-tech 6bec526f7a gui: a key's rename saves once on Enter and never on Escape (#3944)
A provider's key name was edited in an input whose Escape drew the
editor again and whose blur saved. Chromium blurs the input as that
redraw takes it out, so Escape after typing saved the typed name, and
Enter, or Enter twice before the save answered, sent keys/rename twice.
The account rename already guarded this with a once flag. Both now go
through one helper, renameIn: Enter saves a changed name, Escape keeps
it, and whichever comes first ends it, so the blur that follows does
nothing. Taking the two copies into one makes app.js 93 bytes smaller;
no budget is raised.

From Coffemon's patch on #3944 (JoeyWu-tech, joey/fix/3944): the test
key-rename-once.test.cjs and its README entry taken as is. The app.js
change differs: the patch copied the account rename's guard into the
key rename; this shares it instead, to keep core script inside its
budget.

What was run (mote, Playwright 1.62.0, Chromium and WebKit, en and zh):
- origin/main f02d92c7b: key-rename-once 8 of 16 red (Chromium's
  Escape after typing, Enter, Enter twice; WebKit's Enter twice).
- With this change: key-rename-once 16 of 16, account-arrange 2/2,
  account-alias 20/20, api-key-usage 4/4, api-key-theme 6/6,
  key-copy 8/8.
- Broken by hand (the once guard in renameIn taken out):
  key-rename-once 8 of 16 red; account-alias hung and was stopped.
- TestCoreScriptBudget green.

Not reproduced on mote: the issue's replaceChildren page error on an
unchanged Escape and account-arrange's red; both passed on main here.
Not tried: the real desktop app's webview.

Co-authored-by: JoeyWu-tech <joey110551567@gmail.com>
2026-10-28 16:27:00 +08:00
yetoneandJoeyWu-tech 8c983ee7b2 gui tests: four update-* files leave WebKit's ResizeObserver notice out of page errors (#3942)
update-download-percent, update-hide, update-notes-ask and update-wait
counted every page error, and WebKit's "ResizeObserver loop completed
with undelivered notifications" (a layout that outran its observers,
no fault of the page) turned them red under load. They now leave that
one notice out, with the same filter update-release-page and eleven
other files use; any other page error still fails them.

Patch from Coffemon (JoeyWu-tech) on #3942, c5033248, reviewed line by
line and taken as is. Test only.

What was run (mote, Playwright 1.62.0, WebKit, at origin/main
f02d92c7b):
- origin/main's four files and these, each alone, twice: all green on
  both (download-percent 3, hide 9, notes-ask 6, wait 11). mote didn't
  show the notice alone, so the red wasn't reproduced here; Coffemon's
  record has it red in every WebKit run on Linux under load (Playwright
  1.58.2), the notice 18 to 20 times a run.
- A loaded try (six runs of main's four files at once, load ~115 from
  other sessions too) hung past 30 minutes and was killed, so it says
  nothing either way.

Not tried: a loaded WebKit run that finishes, on mote.

Co-authored-by: JoeyWu-tech <joey110551567@gmail.com>
2026-10-28 16:27:00 +08:00
yetoneandJoeyWu-tech 63aca1802e gui: PenguinHarness's logo is a tile, and the app's own icons are no logos (#3858)
icon-tile was red on main: PenguinHarness's logo (3fd7e1698) is solid
to its edges but app.css's tile rule didn't name it, so it was drawn a
size bigger than a line logo beside it. It now has its alphabetical
place in the rule. The test also measured apple-touch-icon.png and
icon-512.png, the app's own icons that manifest.json lists for a
phone's home screen, which no .ic ever draws; it now leaves
manifest.json's icons out.

Patch from Coffemon (JoeyWu-tech) on #3858, 70707eed, reviewed line by
line and taken as is.

What was run (mote, Playwright 1.62.0, at origin/main f02d92c7b):
- origin/main: icon-tile red ("apple-touch-icon is solid to its edges
  but not in app.css's tile rule").
- This change: icon-tile 3 runs, 3 of 3 each; mono-icon-redraw 5,
  models-add-and-icons 4 and agent-grip 10, all pass.
- Broken by hand: penguin-color out of the rule: red, "penguin-color is
  solid to its edges but not in app.css's tile rule"; the manifest
  filter out is main's red above.

Not tried: looked at by eye with PenguinHarness installed.

Co-authored-by: JoeyWu-tech <joey110551567@gmail.com>
2026-10-28 16:27:00 +08:00
yetoneandJoeyWu-tech 84ada9dc80 gui tests: phone-web's tap scrolls by code once, as view-wheel-unheard does (#3876)
phone-web's "a tap's click is no flick" scrolled by code 40px a frame
for five frames after the click. Since a6d7e02c three scrolls put back
the same way with nothing redrawn are the reader's run, given back by
design, so the last three stood and the page read 591 for 711 in both
engines. a6d7e02c moved view-wheel-unheard's case to one scroll by code
for the same reason; phone-web now does the same (200px at once).

Patch from Coffemon (JoeyWu-tech) on #3876, 916064d0, reviewed line by
line and taken as is. Test only.

What was run (mote, Playwright 1.62.0, at origin/main f02d92c7b):
- origin/main: phone-web red in Chromium and WebKit, "591 !== 711".
- This change: 3 runs each engine, 3 of 3 every run.
- Broken by hand: the click no longer ending the lifted finger's window
  (purposeUntil = flingUntil = 0 made purposeUntil = 0): red in both
  engines, "511 !== 711", so the case still guards a tap's click.

Not tried: a real phone.

Co-authored-by: JoeyWu-tech <joey110551567@gmail.com>
2026-10-28 16:27:00 +08:00
yetoneandJoeyWu-tech 03a8d981ea gui tests: quota-refresh-order runs again, with seven more orders (#3679)
09c0a844 (#3160) gave the quota loader and quotaRefresh three names
quota-refresh-order's VM sandbox didn't have: the top-level quotasKept,
the page's mode, and a refresh button's classList.toggle. Every case
threw "quotasKept is not defined" before testing any order, 9 of 9
red since. The sandbox now has them, and the nine cases are unchanged.

Seven cases are added for orders the loader's comments promise that
hand edits to app.js passed unseen: the tray panel keeping the merged
reading it shows (magpie.panelQuotas), Refresh now behind a read on
its way, reads serialized, a newer card's marker kept after a read
lands, a renamed reply's replaced cards kept out, a background read
taking the asked one, and one card's reply leaving another's marker.
The README lists the file among the VM tests.

Patch from Coffemon (JoeyWu-tech) on #3679, 5ac2b9f7 (five commits,
squashed here into one), reviewed line by line and taken as is; the
README hunk applied to today's README.

What was run (mote, Node 22, no browser needed; at origin/main
f02d92c7b):
- origin/main: quota-refresh-order 0 of 9, each ReferenceError.
- This change: quota-refresh-order, usage-stale-answer and
  providers-fetching-retry 38 of 38.
- Broken by hand through MAGPIE_APP_JS: keepRefreshedQuotas skipped
  (the reply taken as it came): 10 of 16 red (1, 2, 6, 8, 9, 10, 13 to
  16); the panel saving the reply from before the merge: case 10 red,
  the other 15 green.

Not run: the Go checks (no Go file), the browser suite (no browser
test reads this file).

Co-authored-by: JoeyWu-tech <joey110551567@gmail.com>
2026-10-28 16:27:00 +08:00
yetone a8098a8862 gui tests: reach wheels the page over a point no inner box takes, and the routing editor is pressed once its motion has stopped (#3408, #3409)
Three Routing GUI files were red on main, bisected on mote from
b0b076421:

- routing-model-rest, 20 of 20 red since ca9b5048e (#3764). Its steps
  box now scrolls in 200px, and reader.cjs's reach sent every wheel at
  the view's centre, which sat on that box: the box scrolled, the view
  never moved, and reach gave up ("control did not come clear into
  sight", target y=1048 in a view of 826). Since d74ef5e04 an inner box
  at its end keeps the wheel too, so the pointer over any overflowing
  list stalls reach for good. wheeled now moves the pointer, before each
  wheel, to a point of the view with no box of its own that scrolls
  under it (d74ef5e04 did this by hand for routing-scroll-end alone).
- routing-intent-entry (#3408) and routing-manual (#3409), red since
  91b0be836: a group opening into its editor moves its height and parts
  for ~700ms, and the tests measured where to wheel and press while it
  moved. reader.cjs has a settled(page) now: two frames, then no running
  finite animation; both files wait on it before they measure.
  routing-pause and routing-rule-effort had the same cause (7b007e986).

Run on mote (Playwright 1.62, Chromium and WebKit), one file at a time:
- at the pushed head (rebased on dfb73a04e): routing-model-rest,
  routing-intent-entry, routing-manual, routing-scroll-end,
  inner-scroll-contain, click-scroll: 116/116.
- old code: routing-model-rest 20/20 red at f25871cdd; intent-entry
  and manual red in the bisect from 91b0be836 on.
- broken by hand: the first settled waited on the animations only,
  with no two frames first; routing-manual stayed red in WebKit
  ("element is not stable", then outside the viewport): WebKit lists an
  animation a click started a frame later.
- every GUI file that uses reach or wheelTo (89 files, before the
  rebase and before settled): 1580/1615. The 35 reds are in six files,
  and the same six are red on untouched f25871cdd run one at a time
  (118/150 there): mobile-web (#3952, it needs a .git that mote-run's
  copy hasn't, commented there), usage-ledger (#3104), routing-manual
  (#3409, fixed here), routing-rule-remove (#3094, #3096),
  routing-rules-line (#3593), segs-press-redraw (#3922). rule-remove
  and rules-line don't load reader.cjs.
- a run of the three files under load ~94 had two browsers not launch
  in 180s; routing-model-rest alone again: 20/20.

Not run: the whole GUI suite at the pushed head.
2026-10-28 16:14:28 +08:00
yetone 6af83172d3 gui: the masking demo shows no video where WebKitGTK can't play one (avk458 on X)
On Omarchy (Arch + Hyprland) without gst-plugins-good, opening Masking's
"How masking works" aborted WebKitWebProcess about 3s later: WebKitGTK
2.52.6 gives every <video>, muted ones too, an autoaudiosink, which lives
in libgstautodetect.so ("no such element factory autoaudiosink", then a
SIGABRT). The window was left frozen on its last frame ("一点就崩溃再点
magpie就卡死了").

Cause: b90e81da1's noVideo was only in GET /api/settings. The page's
state.settings comes from /api/state, which never carried it, so a demo
opened before Settings was visited set the webm src. The GUI fixture put
noVideo into /api/state's settings and hid it.

Now boot.js says noVideo (app only, not a browser tab) before the page
paints, and demo.js reads window.bootPrefs.noVideo; the poster shows
instead. Also, for BoyC338's memory question: folded, or with the page
left, the video lets go of its source (removeAttribute src + load), so
no decoder or buffer is held; opened again it goes on from where it was.

Run:
- mote: GUI masking-demo, masking-records, i18n-keys in Chromium and
  WebKit: 116 pass, 0 fail.
- mote: go test -run 'TestBootSaysNoVideo|TestBoot|TestSettings|
  TestFontSettingsAPIAndBoot|Budget' ./internal/gui ok; gofmt -l none;
  vet for darwin, GOOS=windows, GOOS=linux -tags nogui ok.
- WSL magpie-desktop: go test -tags gtk3 -run 'TestBootSaysNoVideo|
  TestGstAutodetect|TestWebkitDefaults|TestSettings' ./internal/gui ok.
- Real app on omarchy, v0.1.1840 release: Masking > demo row aborted
  WebKitWebProcess (coredump 07:10:10 UTC), window frozen. Built this
  tree with make release-linux in WSL and ran it there: demo opens with
  the poster and animates, fold/reopen, Agents and back to Masking all
  respond; no coredump, no autoaudiosink line, both web processes alive.
These ran at base ea53eb126; rebased onto 05ed578bd (redact/gateway
changes, none in internal/gui) and the budgets run again before push.

Broken by hand:
- demo.js reading state.settings?.noVideo: the poster test is red in
  both engines.
- hold() commented out: the folded test is red in WebKit.
- boot flag removed: TestBootSaysNoVideo is red.

Not tried: a Linux system with gst-plugins-good (the video path there
is unchanged); arm64 Linux. Recovering a window whose web process died
(web-process-terminated) is not handled by magpie or Wails; not in this
commit.
2026-10-28 15:25:53 +08:00
yetone d74ef5e04c gui: an inner list wheeled to its end keeps the wheel; the page stays put
碳碳双键 (ysm119, Discord): wheeling the Usage page's request list to its
top or bottom carried on into the whole page, and "this happens in many
places". It is the class: every box that scrolls inside a scrolling page.

app.js marks such a box `.holds` while it overflows vertically, on
pointerover and on each wheel (the box under the pointer and its
ancestors up to the .view), and app.css gives `:where(.holds)`
overscroll-behavior-y: contain, which keeps the Mac's bounce on the box.
Not one CSS rule for every overflow:auto box: in Chromium `contain` holds
the wheel even in a box that doesn't overflow, or is overflow:hidden, or
only scrolls sideways, so short lists and the heatmap's and ledger's
sideways scrollers would have stopped the page. The .view itself is never
marked. :where() weighs nothing, so .mchips in a short window
(@media max-height 640px, #833) still passes the wheel on.

The new test, inner-scroll-contain.test.cjs, wheels the Routing page's
requests list past each end (en and zh, 900x560 and 1300x600, under
"By session" / 未提供会话标识), and ten kinds of inner box, and asserts
the page's scrollTop didn't move. A short list, heat-scroll, led-wrap and
snip must still pass the wheel to the page. routing-scroll-end now wheels
over the page's gutter: at its view centre the pointer sat on the
requests' list, which now keeps the wheel at its end (600 of 1066).

Run (mote, Playwright 1.62, Chromium and WebKit):
- inner-scroll-contain 40/40.
- 17 files: inner-scroll-contain, click-scroll, routing-scroll-end,
  routing-sessions, view-wheel-after-click/-after-redraw/-unheard,
  heatmap-scrollbar, ledger-hscroll, ledger-hscroll-foot,
  context-scroll-end, menu-scroll, provider-levels-scroll, panel-usage,
  panel-routing, qoder-cn-tile, agent-disconnect: 268/287. Reds were
  routing-scroll-end (this change, fixed above) and panel-usage webkit zh
  (#3311, commented). Rerun of routing-scroll-end, panel-usage and
  inner-scroll-contain: 66/66.
- go test -tags nogui ./internal/gui ok (TestCoreScriptBudget passes at the rebased head:
  core under 1,526,556, app.js under 1,310,460; no budget raised).
Broken by hand: the old app.js and app.css: the requests list and every
held box red in both engines (mchips aside, it had contain already).
Only the CSS rule removed: red, "the page didn't move" x8 plus each held
box x2. Only the overflow check removed: a short rt-reqs red (Chromium),
led-wrap and snip red in both engines.
Not run: full GUI suite (mote was busy with another session's suite).
Not tried: WebKitGTK on Linux, WebView2 on Windows, a real Mac's
trackpad rubber band and momentum in the app, older macOS WKWebView,
touch; zh-TW/ja/de (no strings changed).
2026-10-28 14:54:09 +08:00
yetone f0d42fbe32 gui: one cancelAsk for a confirmation's dismiss-only buttons, one Qoder risk note
Twelve buttons in app.js (eight Cancels, three OKs and a Later) each had
their own copy of `(e) => { e.stopPropagation(); closeConfirmAsk(); }`;
they now share cancelAsk. The Qoder and Qoder CN rows carried the same
risk note twice; it is QODER_RISK now. Behaviour is unchanged. This
makes room under TestCoreScriptBudget for the next commit, without
raising the budget (core 1,526,515 of 1,526,556 before).

Run (mote): go test -tags nogui -count=1 ./internal/gui ok (budget and
asset tests). The GUI suite ran on the next commit, which holds this one.
Not tried: nothing by hand beyond the suite; the buttons' code is the
same function moved.
2026-10-28 14:53:40 +08:00
yetone a41d0d5098 redact: the demo's notebook has a square icon and its entries under the header
The owner's screenshot of the masking demo's "小鹊的小本本" box: the
notebook icon was stretched tall, and the two entries overlapped the
subtitle and each other.

- The icon carried the class "acc", which app.css already styles as an
  accounts row (flex, min-height 38px, padding), so the 22px tile came
  out 38px tall. It is xq-acc now; none of the demo's other short class
  names (on, done, hot, ok, hl, far) has an app.css rule of its own.
- The entries were placed at fixed tops (40 and 81) under a header that
  is ~41px tall in CJK fonts. They are a flowing list now, after the
  header: each entry is its placeholder pill over its value, 5px apart,
  and a highlighted entry gets a soft background instead of colliding.
  The flyers already land on the values' measured positions, so the
  animation follows.
- German's title "Notizbuch der kleinen Elster" wrapped to two lines
  in the 220px box and pushed the last entry 14px out of it (the
  existing no-clip check caught it). It is "Notizbuch der Elster".

Test: masking-demo's layout test checks every box icon is 22×22 and
that each notebook entry starts at least 4px below what is above it.

Run at this tree (a463b3ede + this change), on mote:
- masking-demo + masking-records, both engines: 110 of 110.
- gui-de, gui-ja, gui-zh-tw, i18n-keys, mask-actions, mask-emails,
  masking-demo, masking-records, redact-kinds, redact-rule-edit,
  redact-rule-row, redact-shape, redact-words-any-case,
  redact-words-whole: chromium 259 of 259; webkit 135 of 136. The red
  was mask-emails' page.goto at its 5s default on the Routing page,
  at load ~80; alone it passes 3 of 3 here and 2 of 2 on origin/main
  a463b3ede. Filed as #3995 (the class of #3525).
- Screenshots of the notebook at the demo's end in zh dark, en light,
  de light and ja dark, both engines: square icon, entries under the
  header, nothing clipped.

Rebased onto 58fb3a778 (it adds a Windows modal-backdrop rule to app.css),
then run again at the pushed tree: masking-demo, masking-records,
i18n-keys and gui-de, both engines: 117 of 117. 60520ddb3 (moejs's module path, no GUI
file) landed after; the push is rebased onto it.

Broken by hand: the old demo.js and redact.css with the new test are
red in every language (icon 22×38, gaps false); with only the class
renamed, the old fixed-top entries are still red (gaps false, false).

Not tried: the real desktop app; the change is CSS and DOM order in a
page the GUI suite loads as the app does.
2026-10-28 14:39:34 +08:00
yetone a3ee00c05c codex: its own GPT models stay in Codex's list when kept for routing groups
士奇 (Discord, 10-28): with a routing group on, the Agents page's Codex
list lost its Codex provider section and models, the model dropdown still
offered GPT, but the Codex app had none; with the group off they came back.

Cause: the codex provider's "Only through routing groups" (Provider.Unlisted,
只通过路由分组使用), or a group that lists itself alone (Group.Unlists), took
the ChatGPT account's own models out of Catalog(), so out of Codex's own
list too. With no Codex section, the own options were not magpie's, so the
own-models switch showed and the picker kept offering GPT; meanwhile #1602
(125dad5cb, CodexNativeUnlisted) dropped every one of them from the list
handed to Codex (backend /models, the model_catalog_json desk file,
spawn_agent). The picker and the app disagreed.

Why the earlier fixes missed it: aa766289b only stopped the GUI folding a
provider, and 508911e43 (TestCodexOwnModelsStayWithGroupOn) only kept
Served own options in the picker. Both covered a plain group; neither
touched Catalog's unlisting for Codex or the desk list's #1602 filter, and
neither test set Unlisted or Unlists.

Fix: Codex's lists start from catalogOf("codex"), which keeps CodexOwn
entries (ListedFor/CatalogFor, CodexNativeHidden, CodexOrder), and
CodexNativeUnlisted is removed with its filters in codexMerged,
spawnChoices and the list tag. Other agents and /v1/models still don't
see unlisted GPT models (checked for Claude Code in both tests).

Behaviour change for #1602: an unlisted codex provider no longer hides GPT
from Codex. The way to hide them from Codex is Codex's own list (its Codex
section's hide / only-picked), which CodexNativeHidden still applies; the
rewritten gateway test checks that and the ETag change.

Tests:
- gateway TestCodexModelListKeepsOwnForGroups (rewrites
  TestCodexModelListUnlistedForGroups): group Unlists and provider Unlisted
  keep gpt-6-sol/gpt-5.5 in Codex's /models and spawn_agent; Claude Code
  doesn't list them; hidden in Codex's list it goes and the ETag changes.
- gui TestCodexOwnModelsListedOnlyThroughGroups: agentModelList has the
  Codex section (Own) for every model, OwnModels is false, the picker has
  them, Claude Code doesn't list the unlisted ones.

Run (mote-run, -tags nogui): go build ./...; go vet for darwin, GOOS=linux
and GOOS=windows on provider/gateway/gui/agent; gofmt -l clean; go test
./internal/provider ./internal/gateway ./internal/gui ./internal/agent: ok.
Broken by hand: the five source files reverted to f20118304 with the new
tests in place: both tests red (gateway: gpt-5.5 and every own slug gone,
spawn offers only group/mine; gui: no Codex section, own switch shown).
Real codex 0.162.1 in a sandbox CODEX_HOME: `codex debug models` with
model_catalog_json pointed at the desk file CodexDesktopCatalog wrote with
the provider Unlisted and an Unlists group lists gpt-6-sol, gpt-5.6-sol and
group/mine (the old code dropped both GPT slugs).

Not run: full suite. Not tried: GUI Playwright files (no page changed), a
live ChatGPT sign-in or the Codex desktop app itself.
2026-10-28 14:26:18 +08:00
yetone 7323255b4e gui: the Windows app's confirmation backdrop goes without blur too (#3980)
Henry-916's change (the commit before) took the blur off the provider
editor's full-window backdrop in the Windows app, where WebView2 on an
Intel UHD D3D11 GPU stalled under it. The Remove/Sign out confirmation
(.action-confirm, a <dialog>) blurs the whole window behind it the same
way through ::backdrop, so it is scoped out by the same win/web rule.
modal-backdrop.test.cjs now shows that dialog and checks its ::backdrop.

Not changed: .pop, the panel's open profile chips and Settings' sticky
header blur too, but over a popover's or a header strip's area, not the
window's; nothing measured them as slow.

Run at this head (mote):
- node --test modal-backdrop: 24 of 24 ok. Broken by hand (the
  ::backdrop selector dropped): both Win32 desktop cases fail "nor the
  confirmation's".
- chromium: modal-backdrop, dialog-backdrop-drag, segment-press-dialog,
  gui-zh-tw, gui-ja, gui-de, i18n-keys, codex-signout,
  account-discovery: 93 ok, 0 fail. The same less modal-backdrop and
  i18n-keys with BROWSER=webkit: 37 ok, 0 fail.
- go test ./internal/gui: one red, TestMainWindowCorners/macOS_26_SDK on
  macOS 27, filed as #3949; nothing in it reads CSS.

Not tried: the real Windows app; the reporter measured the modal's
blur there (67 → 165 rAF callbacks a second).
2026-10-28 14:24:40 +08:00
Henry-916 824100f30f gui: keep Windows modal backdrops responsive without blur
Disable full-window modal backdrop filtering in Windows desktop windows
and tray panels, retaining the dimming veil. Browser pages and other
platforms keep their existing blur through the existing win/web markers.
Document the platform behavior in the GUI shell reference.

On an affected 0.1.1805 installation with WebView2 155.0.4283.62 and Intel
UHD D3D11, disabling the filter made provider tests visibly responsive.
The reporter confirmed the improvement. Scripted scrolling measured
roughly 67 to 165 rAF callbacks/s, not presented FPS.

Verification: modal-backdrop.test.cjs fails on the original CSS in both
Windows desktop Chromium cases (blur instead of none), with the other
10 cases passing. After the fix, 45 targeted tests pass across
Chromium and WebKit: modal-backdrop, dialog-backdrop-drag,
segment-press-dialog, gui-zh-tw, gui-ja and gui-de. node --check and
git diff --check pass. The full GUI suite, Go vet/build/test matrix and
native macOS/Linux tests were not run.
2026-10-28 14:24:40 +08:00
yetone 7b007e9866 gui tests: routing-pause and routing-rule-effort press once a group's editor has opened (#3410, #3411)
Both were red on main since 91b0be836 (10-23), filed as #3410 and #3411
with no owner. Bisected on mote from b0b076421 (green) to 3b10a403d:
91b0be836 is the first red. It opens a group's row into its editor in
~700ms of motion. press() read how far to wheel the page while the
editor was still growing, found it near enough, and clicked where the
target ended up after the growth: at y 3108 in a 1400px window, so
nothing. press() now waits for every finite animation to end before
it measures.

That let "a rule that pauses a model at some hours" reach its Save,
where c888ef272 (10-25) saves hours set in the browser with its zone.
The fixture never saw it, as the test stopped before. The page's zone
is pinned to Asia/Tokyo and the edited rule expects it; the untouched
rule keeps none.

Run on mote at this tree (origin/main 7b63feb90 + this):
routing-pause and routing-rule-effort --test-concurrency=1, both
engines, every language: 32/32. At 7b63feb90: 4 pass, 28 fail; the
same at 7dcc0aedc^, so not #3955.
Broken by hand: the wait moved after the measure (where the 300ms
settle was): 28 red again.
Not fixed here: routing-model-rest, -intent-entry, -manual, -row-swap,
-rule-drag are red alone on main too (16 pass / 28 fail), looked at
next.
2026-10-28 13:55:32 +08:00
yetone f201183047 tune: the compact window is Long conversations, one value for both agents
7eleven (Discord #help): the Usage page's "Tuned for you" compaction
value and the agents' sheet "Long conversations" window were two values
that could disagree. Codex's tune wrote model_auto_compact_token_limit
into config.toml beside the catalog's context_window that Long
conversations writes; Claude's read its own env.

One source of truth: settings.CompactAt / FullContext. Tune's compact
row for Codex and Claude Code now has source "long": its Current is
settings.Compact(), Use calls provider.SetCompactAt (Sync writes Codex's
catalog and Claude's CLAUDE_CODE_AUTO_COMPACT_WINDOW as before), Undo
puts back the CompactAt/Full it stashed under tune.long.compact. So a
value set on either page shows on the other and writes the same config.
writeCompact marks claude.compact_long when the env value came from
settings, so Claude's row reads it as ours, not as the user's.

Migration (Codex Sync, local place): an old tune.codex.compact stash
whose limit is still the one tune wrote moves into Long conversations.
At default or Full it takes tune's value; with a value the user set it
takes tune's only when smaller. config.toml gets the user's earlier
limit back or loses the key; the stash is forgotten. A limit the user
changed after tune wrote it, or wrote themselves, stays and reads
Locked. A provider's Compact at or the user's own Claude env stays
Locked too.

Run (mote, at this tree):
- go vet on agent, provider, gui, tune; GOOS=linux go vet -tags nogui
  ./...; GOOS=windows go vet ./...; go build ./... and -tags nogui: ok
- go test -tags nogui ./internal/agent ./internal/provider
  ./internal/tune ./internal/gui: ok (TestCoreScriptBudget within the
  budget, not raised; context.js is 33 bytes smaller)
- GUI: compact-one-value.test.cjs (new; Chromium and WebKit, en zh
  zh-TW ja de) and context-tune: 104/104 at the rebased head
Broken by hand: the Codex long branch, the Claude long env check and
the Sync migration call each turned red TestClaudeCompactAt,
TestCodexHomeEnvTakesThePick, TestTuneCodexCompact,
TestTuneCodexOwnLimit, TestTuneCodexMigrate (4 subtests),
TestTuneClaudeLong and TestTuneCodexMigrateOnSync. Old context.js and
i18n.js turn compact-one-value red ("You set 272K").
Not run: full suite, Go or GUI (shipped at once per owner; the GUI suite
is still running on mote, reds get their own issues).
Not tried: a real Codex or Claude Code session reading the written
config; the migration on Windows/WSL places (it runs for the local
place only).
2026-10-28 13:52:08 +08:00
yetone fcbbb8e479 gui: the start's warm-up and read-ahead look at each file once a second (#1665)
The warm-up after a start (sessions, usage, Codex effort) and the usage
read-ahead asked for settings.json, logins.json and the rest for each
session and row they read: a Windows sandbox's second start stat'ed
settings.json 677 times in 25s, 286 of them settings.load and
AccountDiscoveryOff under the warm-up. Both now hold what was read
(filememo.Hold), as the GUI's requests and a catalog sync's round do. A
write still reads the disk (edit.Read, settings' writes, logins.json
under loginsMu), so nothing is written from a held read; a file another
app changes is seen up to a second late while they run.

Measured on xiaomi-gpu (Windows 11), an empty sandbox HOME, magpie web
--gateway, second start, 27s, with a build counting each look at the
disk (instrumentation not committed):
  before   1113 looks, settings.json 677
  after     483 looks, settings.json 114
The catalog sync's round stays at ~100ms.

Run:
- TestWarmUpHoldsWhatItReads: red with the warm-up's Hold taken out by
  hand (the second read saw the other app's change), green with it.
- mote: gofmt -l internal/gui clean; GOOS=windows and darwin go vet
  ./internal/gui and GOOS=linux go vet -tags nogui ./internal/gui clean;
  go test -count=1 ./internal/gui ./internal/usage: usage ok, gui red
  only on TestMainWindowCorners (#3949, mote's macOS 27, red on main
  before this).
2026-10-28 13:51:37 +08:00
yetone 1a8048592e providers: a search for a model keeps the providers serving it and names the model under each (frankdeng, Neo)
frankdeng (Discord #general) wanted to type a model (opus 5.5) on the
Providers page and see who serves it; Neo had two providers serving
opus5.5 and couldn't tell which. The search already matched model ids,
but as one blob of the provider's text: "opus 5.5" kept a provider with
claude-opus-4-1 and gpt-5.5, and one with Opus 5.5 switched off, and no
row said which model matched.

Now the words a row doesn't say itself must all be one model's that is
on, separators aside ("opus 5.5", "opus5.5", "Opus-5.5" find
claude-opus-5-5 and opus-5.5), and the row gets a muted line "Serves
<ids>" (the existing .sub style, clipped with "…"). A search on the
provider's own name, host, account or key names no model. Changed: a
provider whose only match is a model it has switched off no longer shows.
"Serves {models}" is in zh, zh-TW, ja and de.

Size budgets not raised: renderProviders no longer sets the lists'
visibility and the fold's state, which findProviders (called at its end)
set again; findProviders' two branches for that are one. Core scripts
1,526,548 of 1,526,556; app.js 1,309,717 of its budget.

Run on mote, at this head (rebased on 8c5c83c9f):
- go build: ok. go test -tags nogui -run TestCoreScriptBudget
  ./internal/gui: ok. Before the rebase, go test -tags nogui
  ./internal/gui (whole package): ok.
- node --test provider-find-model, provider-find, i18n-keys: 28 pass,
  0 fail (Chromium and WebKit, en zh zh-TW ja de, 380px wide).
Broken by hand: with the model match taken out (hits always empty) the
new test fails on "opus 5.5" (actual [], expected anthropic, relay-a,
relay-off with their lines); against origin/main's app.js it fails with
relay-b and relay-c shown and no "Serves" line.
Not run: full GUI suite, full Go suite (shipped at once per owner). A
run of the 231 GUI files that reach the Providers list is still going on
mote; reds from it get their own issues.
Not tried: the real app with real providers.
2026-10-28 13:16:25 +08:00
yetone 8b95f7c3a9 usage: a subscription's windows are grids of their own, not a rows subgrid (#3955)
Each quota window was a subgrid of three rows of .quota-windows, so the
bars of two windows side by side lined up when one's name wrapped. That
is the layout that crashed Safari 16's WebKit sizing the Routing
requests (#3731). Now each window is a grid of its own. fitQuota, which
already runs a frame after the windows' ResizeObserver to stack the
counts, also gives each window's names the height of the tallest beside
them. The subgrid left 9px between a bar and its reset line, not the
4px the CSS declares, in both engines; kept, so the card looks as it
did.

quota-window-rows (new) checks that no rule of the windows says
subgrid, and at 1100, 700, 390 and 1100 again, in both engines and
every language, that the bars of each row start at one y with a long
name wrapped beside a short one, that the names sit above the bar, and
that a reset line starts 13px under its bar's top.

Run on mote at this head (on 6e331afb4):
- quota-window-rows: 11/11. At origin/main's assets 10/11, only the
  subgrid check red, so the bars and spacing are the same. Broken by
  hand (no min-height): 10 of 11 red, bars at 391 and 377.
- The 90 quota-, panel-quota-, usage-, balance-parts, plugin-plan,
  account-mask and i18n-keys files: 1146 pass, 43 fail. The red files
  are red alone on origin/main too, the same counts: quota-count-wrap
  2 (#3404), quota-refresh-order 9 (#3679), usage-agents-hide 22
  (#3414), usage-ledger 6 (#1876). usage-overview-fold is flaky on
  both: 2 and 3 red on main, 3 and 5 here (#3947).
- node --check app.js: ok. go test -run Budget|Asset|CSS ./internal/gui:
  ok; TestCoreScriptBudget held without a raise (the addition was
  compacted to fit, 1526556 bytes or under).
- After that compaction: quota-window-rows and account-mask 15/15; all
  quota-* files plus i18n-keys 163 pass, 11 fail, the same
  quota-count-wrap and quota-refresh-order reds as above.

Not tried: a real Safari 16 (no macOS 13 machine).
2026-10-28 13:05:14 +08:00