a3cd1338454e65bcfe86bf641389871cdba00cac
50
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f36e744c30 |
gui: Settings › General says each setting's name alone where it says enough, and Language is one menu (1ooogle on X)
1ooogle's mockup on X redrew Settings › General the way macOS System
Settings reads it. The owner approved, and this follows it.
Rows that now show only their name:
- Appearance, Text size, Interface and Code font, the tray click,
Provider in model names, the Codex titles, auto-review and memories
model rows, Open at login and Show in Dock.
- A font row's line shows only while its fonts are loading or have
failed.
- The text size keys (⌘0 / Ctrl+0) move into the choices' tooltip.
Rows that keep one short line, because the name alone doesn't explain
the setting or what it costs:
- Codex subagents, Long conversations, Lightweight mode, Prevent sleep
and Session terminal.
Renames:
- "Tray icon" becomes "Click the tray icon to", with the choices "Open
the quick panel" and "Open the main window" (点击托盘图标: 打开快捷面板 /
打开主窗口).
- "Keep awake while agents work" becomes "Prevent sleep" (防止休眠: 在
magpie 运行任务时,让电脑保持唤醒状态).
- "Dock" becomes "Show in Dock" (显示程序坞).
Language is one button showing the language picked (renderLangPick).
It opens in the app's own menu (openProtoMenu, styled like Session
terminal's sess-pick), not a native <select> and not six segments.
Every language gets the same text: en, zh, zh-TW, ja and de. The 25
strings no longer used are removed from all four translations.
Tests:
- New: settings-general.test.cjs. In Chromium and WebKit, en, zh,
zh-TW, ja and de, at 1000 and 440 px, on a Mac, it checks that:
- the rows that should show only their name have no line;
- the kept lines are one line each, and none is cut short at 1000px;
- Language is a button showing the language, and its menu lists all
six;
- a pick saves lang and redraws the page in that language, with the
button staying under the pointer;
- nothing has a left stripe and nothing scrolls sideways.
I broke it by hand twice and saw it fail both times: once by giving
the Dock row a line back, once by making the pick save nothing.
- Updated to the new text and controls: codex-titles,
codex-auto-review, codex-memories-settings, model-suffix-own,
plain-names, lightweight, keep-awake, text-size, gateway-mode,
omarchy, settings-search, gui-zh-tw (Language's button and menu fit
at 1000/440px), header-relang (picks through the menu) and
readable-focus (the first shown line).
- German's long-conversations line was shortened to fit on one line at
1000px.
What was run:
- go test -tags nogui ./internal/gui passes; gofmt -l is clean; go vet
passes on darwin, linux and windows.
- The whole GUI suite (601 files, --test-concurrency=4): 6584 passed,
33 failed. Every failing file was then run alone:
- mobile-web fails on purpose. It compares desktop screenshots with
origin/main, and only the Settings page differs.
- routing-group-fold, text-size, routing-sessions and pick-skills
are #1672; searcher-pick is #1745. Each also fails alone on
origin/main
|
||
|
|
61a0a69b5c |
gui: Routing, Usage and Sessions keep to the width the other pages do on a large screen, centred (面条 on Discord)
What changed: the window's page-width rule (#860), padding each view to max(16px, calc(50% - 600px)), now names #view-routing, #view-usage and to edge while Agents, Providers, Library, Gateway, Plugins and Settings sat in a 1200px column in the middle. A narrow window keeps the 16px gutter it had. Routing's two columns, the Usage cards' packing and the requests ledger lay out by the room they get (byWidth, packUsage), so they follow the narrower box: at 1920 Routing still gets its two columns (min1150) and the ledger fits 1200 without a sideways scroll. sess-agent-strip.test.cjs asserted that eleven long agent names fit a 1600px window's Usage page in one row. With the page kept to 1200px they were 8px too wide in WebKit zh (its scroll bar takes width), which is the strip's designed overflow; the first two names are shortened so the "fits" case is still one that fits, and the narrow case still overflows. One word off the first name left it 0.34px of room (1159.66 in 1160), which went red once in WebKit en under load; two names shorter leave 135px, and it passed 3 runs in a row in each engine. sessions-toolbar.test.cjs asserted that ten agents' tabs fit an 1800px window; in a 1200px page they need 1115px of 912, so the page shows the compact agent menu (its designed overflow). The fixture now has eight agents (829px), so the wide case still tests tabs that fit. Run: - new page-width.test.cjs: every view's content width 1150..1200 and centred at en 1920, zh 2560, zh-TW 1920, ja 2560, de 1920; 16px at en 900; every view's left edge and padding equal Agents'; chromium and webkit, 14/14. Without the CSS change it fails ("sessions: 1676 wide at 1920"). - before/after screenshots of Routing, Usage cards, the ledger, Sessions and Providers at 1920, 2560, 1100 and 800 (chromium). - GUI regression set, both engines: click-scroll, editor-short-window, ledger-*, panel-usage, quota-*, routing-*, usage-*, sessions-*, sess-agent-strip and sessions-toolbar (after the fixture changes). routing-group-fold (webkit en/ja/de) and routing-sessions (webkit en) fail the same with origin/main 17c12621b's own assets, run alone: already filed as #1612 and #1672. usage-ledger's webkit "dark, and narrow" failed once in the full run; it fails the same with 48e59c5b8's assets (the view left scrolled 32px after the resize, the tab under the header), noted on #1671. - Go: gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., the builds: clean. go test -tags nogui ./... at load ~25-60 (other sessions' runs): every package passed but internal/agent and internal/gateway, which hit the 30m timeout; run again alone, agent passed and gateway's only red was TestOTelWaterfallIncludesUnbilledFallback, filed as #1794 (passes alone, -count=3). Not verified: real WebView2 or WebKitGTK windows; layouts were checked in Playwright's chromium and webkit only. |
||
|
|
66ec713af7 |
gui: a short window's sidebar has no scroll bar beside its pages, a thin one shows over them while they scroll and fades, as on a Mac (xybio and MOMO on Discord)
In a window shorter than the sidebar's pages, .side-scroll (scrollbar-width: thin) and .side-foot kept a native bar and its gutter at rest on Windows and Linux. On Windows this was MOMO's report (v0.1.1207, WebView2): a classic, always-visible bar with arrows between the sidebar's items and the page, because Chromium drops every ::-webkit-scrollbar rule on a box with scrollbar-width set and draws the system bar. Both boxes now hide their native bars (scrollbar-width: none and ::-webkit-scrollbar display:none, which Chromium/WebView2, WebKit and WebKitGTK each honour), and app.js sideBars lays a thin overlay bar inside, shown on scroll, faded ~900ms after, kept while hovered or dragged, the thumb draggable with pointer capture, a click off it pages the box, hidden when the box fits. ResizeObserver/MutationObserver keep it placed as the nav's sub-tabs open and fold. gui-shell.md describes it. Run: new sidebar-overlay-scrollbar.test.cjs (chromium with native bars on, webkit; en, zh, zh-TW, ja, de at 1100x320 and a tall window) 14/14; it fails without the change (no bar shown while scrolling, 5/5 languages both engines). Its drag step first measured the thumb before the scroll event had moved it, pressed the bar below the thumb and paged the box (3 of 6 webkit runs red, "162 of 191"); it now waits for that scroll, and 8 webkit and 5 chromium runs in a row pass. sidebar, side-width, side-toggle, strip-scrollbar, view-scrollbar, view-scrollbar-drag, click-scroll all pass in both engines. Screenshots at rest and mid-scroll in both engines checked by eye. Windows: on the Windows 11 box, headless Edge 155 (WebView2's engine) rendered a sidebar box with origin/main's app.css and with this one. Old: 10px gutter and the classic bar with arrows, as in MOMO's screenshot. New: 0px gutter and no bar, with an unstyled overflow box beside it still drawing its 10px bar, so system bars were on. Not tried: the overlay bar's JS inside a real WebView2 or WebKitGTK window (it ran in Playwright's Chromium and WebKit only). |
||
|
|
0db8112afe |
omarchy: on Hyprland the tray panel opens under the click on a monitor that isn't at 0,0, not off the screen (#1785)
PanelAt answered where the panel goes in coordinates across the whole
layout (the cursor's, from hyprctl cursorpos), and PlacePanel handed them
to Hyprland's move rule. Hyprland counts a move from the corner of the
window's monitor (CDefaultFloatingAlgorithm::newTarget in 0.56.2:
COMPUTED + MONITOR_POS), so the monitor's place was added twice. The
reporter's click on the right of two 1920-wide monitors asked for
3238,40 and got 5158,40, off every screen. The monitor at 0,0 hid it,
and the only setup tried before (
|
||
|
|
ff49ca72fe |
gui: Windows without the WebView2 runtime says so in a message box and offers the download page, instead of a double-click doing nothing (#1806)
magpie's windows are WebView2, which Windows 10 doesn't always have. Without it Wails handed the failure to ErrorHandler and exited, and the desktop build (-H windowsgui) has no console for the log line to land in: ufec's double-click came up to nothing at all. ufec found the cause, that Wails' own Env.Info().PlatformInfo["WebView2"] answers "" then, and that a box can't come from ErrorHandler (it runs on the thread Wails makes its windows on); this takes both from their branch. Run asks webView2Check right after application.New, before any window. Missing, it logs it and shows MessageBoxW (Yes/No, error icon, topmost) in the reader's language (trayLang): the runtime is missing, Microsoft's page https://developer.microsoft.com/microsoft-edge/webview2/, that "magpie web" and "magpie tui" work without it, and whether to open the page now; Yes opens it (ShellExecute), and Run ends. A key Wails doesn't set is read as present: refusing to start a magpie that would have worked is worse than the silent exit. The tray isn't kept: its panel is a WebView2 window too. Run: TestWebView2Missing and TestWebView2Notice (all OSes); TestWebView2MissingFromWails on the Windows box (10.0.0.132, Windows with WebView2 installed): a child process with Wails pointed at a folder that isn't a runtime reads missing, the machine's own runtime reads present. TestWebView2Missing goes red with webView2Missing made to answer false. On the box, a throwaway -H windowsgui test binary calling webView2Check with that bogus runtime path, run in the desktop session: the box came up titled "magpie 需要 WebView2" with the Chinese text, the page and 是/否 buttons (read back from the dialog's controls), the log line was written, pressing 是 opened the page in Edge and the check answered false. go test -tags nogui ./internal/gui in a sandbox HOME; gofmt -l clean; go vet ./... on darwin, GOOS=linux -tags nogui and GOOS=windows; windows and linux builds. Not tried: a machine that really lacks the runtime (the box has it; the missing case is Wails' lookup failing on a path that isn't a runtime, the same failure), nor a real magpie.exe start through Run. |
||
|
|
897f6d32f1 |
gui: on Linux the tray panel is a solid window with an opaque page, as the main window is, so scrolling it leaves no ghost of the old position (#1803)
MizuIro-H (Bazzite / Fedora 44, KDE Plasma 6, Wayland) saw the panel's Allowances tab leave a fainter copy of what it showed at the old scroll position, on Wayland and under GDK_BACKEND=x11, with WEBKIT_DISABLE_COMPOSITING_MODE=1 (which magpie already sets under Wayland, so that try changed nothing), at scale 1, and without KWin's corner effect. The main window, with the same page, never did. The panel was the one window with per-pixel alpha: Wails' BackgroundTypeTranslucent on Linux makes it an app-paintable GTK window on the screen's RGBA visual under a 0-alpha webview, and body.panel painted --bg at 93% over it. Paint not cleared before a scroll repaint shows through 93%, which is the fainter copy. The main window is a plain solid window painting --bg whole. On Linux only, panelOptions now makes the panel BackgroundTypeSolid, and body.linux.panel paints --panel-tint as --bg (no alpha). The Mac (tinted by tintPanel) and Windows keep the translucent panel. The corners are square on Linux now (the body's paint fills the canvas). Run: gofmt -l internal/gui (clean); go vet darwin ./internal/gui, GOOS=linux -tags nogui ./..., GOOS=windows ./... (clean); go test ./internal/gui under a sandbox HOME (ok); node --test internal/gui/tests/panel-*.test.cjs, chromium and webkit (74 pass), the new panel-linux-opaque test across en/zh/zh-TW/ja/de and light/dark. Broken by hand: TestPanelSolidOnLinux fails without the panelOptions change, and panel-linux-opaque fails without the CSS rule (the Linux body read color(srgb ... / 0.93)). Not tried on the reporter's setup. A repro of the panel's window (GTK3 + WebKit2 4.1, RGBA visual, 0-alpha webview, 93% page) under Xvfb with picom, on Ubuntu and on Fedora 44 (WebKitGTK 2.54), scrolled by JS and by a real X wheel, with compositing mode on and off, showed no ghost either way: software rendering there doesn't reproduce it, so whether the opaque panel ends it rests on the reporter's KDE/GPU machine. No real Linux magpie build was run. |
||
|
|
3e88fc09dc |
agent, gateway: Claude Code on a model Anthropic doesn't review gets auto mode's server review turned off, so it no longer says magpie isn't eligible (1EFLOPS on X)
1EFLOPS runs Claude Code through magpie on Codex's gpt-6.1-sol. In auto mode, Claude Code 2.1.296 says "this session isn't eligible because your requests go through 127.0.0.1:3425 ... ask your gateway to implement https://code.claude.com/docs/en/auto-mode-classifier-billing". What the page asks of a gateway: pass the anthropic-beta header (dangerous-tool-use-2026-09-03), the request's `safeguards` field, and `safeguard_results` in the reply through unchanged, and leave tool-use ids alone. The results are verdicts from Anthropic's own safety classifier. For a gateway that can't provide them, the page's remedy is CLAUDE_CODE_AUTO_MODE_SERVER=0. Pro, Max and Team plans never see the notice. In the bundle, Claude Code falls back on server_unsupported, server_unavailable_disabled or server_no_result, and the notice shows whenever there's no real verdict. Only that variable removes it. Per route: - Claude subscription bridge, Anthropic API key, relays in front of Anthropic, Bedrock and Vertex: already pass the beta, `safeguards` and `safeguard_results` through ( |
||
|
|
23e764d0e0 |
cli: magpie's commands move from the root into internal/cli; the root keeps only main.go
The root held 89 .go files (30 commands, 59 tests). They move as they are to internal/cli (package cli), with git mv so history follows them. The only code change is main() becoming cli.Main(version): the root's new main.go keeps `var version` in package main, so -ldflags "-X main.version=…" in the Makefile, the Dockerfile and magpie-releases, and every workflow, work unchanged. go-winres's rsrc_windows_*.syso still land next to package main in the root. Tests that read testdata by a root-relative path now go up one level (../plugin/testdata/fake, ../sessions/testdata). Five subsystem doc links point at internal/cli/. Run: - go build ./..., gofmt -l, go vet on darwin, linux and windows (nogui) - builds with tags production, dev, "production nogui"; windows -H windowsgui; linux CGO_ENABLED=0 - make release-cli TARGETS="darwin/arm64 linux/amd64 windows/amd64 android/arm64" VERSION=9.9.9-tidy: all four built, binary prints "magpie 9.9.9-tidy" - docker build --build-arg VERSION=7.7.7-tidy: container prints "magpie 7.7.7-tidy" - go test ./internal/cli (default and nogui): 152 tests, the same count as the root on main - go test ./...: all packages pass (agent, gateway, library, provider timed out at 10m under other sessions' load and passed rerun alone with -timeout 40m; none of them changed) - the built binary in a sandbox HOME: version, help, ls, providers, claude, and an unknown command's error |
||
|
|
f5dd4d604e |
gui: the Linux app's sidebar button switches the layout at once, no view transition, which WebKitGTK with compositing off crashed in (depravity_wings on X)
Since
|
||
|
|
e21ea07e47 |
gui: a client in the Usage page's Agents list can be hidden from it, and shown again from the line under it (ikunbots on X)
ikunbots asked to hide curl, Go-http-client, python-httpx and other clients
from the Agents list beside the agents they actually use.
What changed:
- Each Agents row has a "…" button that shows on hover (always on touch) and
opens the app's row menu (openRowMenu) with "Hide from this list".
Right-clicking the row opens the same menu. No native select.
- The hidden ids are saved by client id in settings.UsageAgentsHidden,
trimmed and deduped. They go through POST /api/usage/arrange
(agentsHidden), which changes only that field, and the Settings save
carries the field over.
- Hiding is display only. The ledger keeps the calls, and the totals, the
chart and every share still count them.
- When anything is hidden, a quiet "3 hidden" / "已隐藏 3 个" line sits under
the list. It opens the hidden rows, dimmed, each with "Unhide" / "取消隐藏".
No click scrolls the page: the scroll guard holds the clicked line in place.
- Where a pointer hovers, the "…" takes no room. Its margins give back its
width and gap, so a row at rest is laid out as on main (mobile-web's
desktop comparison is the same). It shows over the end of the share bar.
On phones (body.web) it has its own grid column.
- Translated into zh, zh-TW, ja and de. docs/subsystems/gui-shell.md
describes it.
What was run, in a worktree off origin/main:
- gofmt -l: clean.
- go build ./... and go vet ./...: pass.
- GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./...: pass.
- HOME=<scratch> go test -tags nogui ./...: 49 packages ok. Includes the new
TestUsageArrangeAgentsHidden, which covers saving, surviving a settings
save, narrowing and emptying.
- New usage-agents-hide.test.cjs: 32/32 in Chromium and WebKit. It covers
en, zh, zh-TW, ja and de at 1200, 560 and 390 (web). It hides by "…" and
by right-click, checks the POST body, unchanged totals and an unmoved
page, then unhides, reloads and checks the hidden rows persist.
- All 48 usage, panel-arrange and click-scroll GUI files: 503/503.
old-webkit and mobile-web: pass.
- Full GUI suite (6489 tests, concurrency 5): the reds outside this change
fail the same when run alone on origin/main
|
||
|
|
3deb85685f |
gui: Usage's subscription cards in one row are as tall as each other, so their bottoms line up (ikunbots on X)
ikunbots ("magpie 的这个卡片可以对齐吗") and duanjl_china ("有的长有的短"):
Claude Code, Codex and Antigravity sat side by side in one row on the
Usage page, each as tall as what it held, so their bottoms were ragged.
What changed
- packUsage (app.js) still packs the cards into columns as #860 made it
(a short card stacks beside a tall one, never stretched to a row's
height). After placing them, the last card in each column gets a
min-height that takes it down to where the tallest column ends.
- Cards side by side in one row (one card per column) are as tall as
the tallest, bottoms on one line, content at each card's top.
- A stack stays a stack: the upper cards are as tall as themselves and
only the last one reaches down to end with the tall card beside it,
which is what #860 asked for (堆叠和 Codex 对齐).
- One column: each card is as tall as itself, nothing to line up.
- The min-heights are cleared before every measuring, so a re-pack
(resize, a fold opened, cards changed) measures each card as tall as
itself. A min-height rather than a stretch keeps a card that outgrows
it growing, so the ResizeObserver still re-packs.
- docs/subsystems/gui-shell.md says so.
Tests
- usage-pack.test.cjs:
- New: ikunbots' three cards (Claude Code 2 windows, Codex, Antigravity
6 families; content heights 107/169/217px) at 1400 and 1018px are one
row with bottoms within 0.5px; at 480px one column, each card as tall
as itself; widened again, one row lined up again.
- The reporter's #860 stack at 897/1018/1400px still stacks:
Antigravity as tall as itself, DeepSeek under it with the 7px gap,
ending where Codex does.
- sound(): a card is as tall as itself unless it is last in its column,
which ends with the tallest; no card is shorter than its content.
- The fold case: opening Codex's brief account grows what the card
holds; the card already reaching down to the stack's end stays that
tall rather than growing (was "the card grew").
- Broken by hand: no min-height applied -> "1400px: the cards' bottoms
line up" red in all 8 (chromium/webkit x en/zh/ja/de); min-height not
cleared before measuring -> "narrow: antigravity is as tall as itself"
red. Restored: 8/8 pass.
Run
- usage-pack.test.cjs in Chromium and WebKit, en/zh/ja/de: 8/8 pass.
- Every GUI test file touching the Usage page (75 files, those naming
#subscriptionUsage/.subscription-card/view=usage, plus click-scroll),
both engines, concurrency 6: 917/918 pass. panel-usage webkit en failed
once under that load ("asked: period=today&limit=1", a 2.4s poll in its
Requests-window step this change doesn't reach), passes 3/3 alone;
added to #1544 with its cause.
- Screenshots before/after with fixture data looked at: ragged row
before, one line after; 897px stack unchanged but for DeepSeek/Codex
ending together.
- No Go change; gofmt/vet/build not run. Full GUI suite not run.
|
||
|
|
f131117976 |
gui: on niri the tray panel opens under the bar beside the clicked icon, not in the middle of the screen (#1670, Kenoia)
A Wayland window can't place itself. Under niri the panel opened where niri floats a new window, the middle of the output. Hyprland already had an adapter (omarchy/hypr.go); niri now has one too. niri (checked in niri v26.04's source, niri-ipc/src/lib.rs and src/ipc/server.rs) can't add window rules at runtime and doesn't report the pointer over IPC. So omarchy.NiriPanel watches niri's event stream ($NIRI_SOCKET, one line of JSON per message) and moves each window of magpie's pid titled "magpie panel" once as it opens: MoveWindowToFloating if it was tiled, then MoveFloatingWindow with SetFixed x/y, which count from the working area's top-left (below the bar). It goes 6 px under the bar, centred on the x that the tray host passed to the SNI Activate(x, y), kept inside the output. Wails' Linux tray keeps that x in private fields (lastClickX/lastClickY), read the same way trayProps already reads props; TestTrayClickIsWails reads Wails' source to fail if they move. Noctalia passes bar-surface-local coordinates, so the x is taken across the focused output. With no click (`magpie panel`), or with one off the output, it goes to the top right. Wails' HideOnFocusLost closes it when another window takes the focus. What was run: - go test -race ./internal/omarchy/, go test ./internal/gui/ (sandbox HOME, pinned GOMODCACHE/GOCACHE). The IPC fixtures are built from niri-ipc 26.4.0's Window/Output/Event/Reply types, quoted in the test. - Broke it by hand: dropping the placed-once map fails TestWatchWindows (placed [7 7 9 9 9]); dropping the right-edge clamp fails TestPanelSpot. - gofmt -l; go vet (darwin), GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...; linux nogui and windows builds. - A nested niri 26.04 (winit backend on Xvfb, scale 1.5, Fedora 43 container, magpie built with -tags gtk3), with SNI Activate sent via dbus-send. Activate(300, 14) put the panel at [58, 6] (300 - 484/2). A second Activate closed it. `magpie panel` reopened it at the top right (853 - 484 - 6 = 363). Activate(800, 14) clamped it to 363. `magpie gui` taking the focus closed it. Not tried: a real niri desktop, Noctalia or another real tray host (Waybar, ironbar), more than one monitor, a bar at the bottom or the side (not accounted for), focus-follows-mouse. The panel still opens in the middle and slides up; how visible that is on real hardware wasn't seen. Not from this change: omarchy's TestCurrent fails with -count=2 on main (it passes with -count=1). |
||
|
|
a0c4dba97d |
gui: the tray icon closes an open panel on the Mac under a window over the whole screen too, not only when the panel can be seen (#1661)
TestTrayCellClickReleasedPanel went red with "initial quota click did not open the panel". The cause: Wails' WebviewWindow.IsVisible on the Mac is the window's occlusion state, not [NSWindow isVisible]. This Mac runs UURemoteServer, whose privacy curtain is an opaque window over the whole screen at layer 2147483631, above every app's. Under it, every window is "occluded", so the panel the click had just opened read as closed. The same check is a product bug too. togglePanelNow went through Wails' SystemTray.ToggleWindow, which chooses hide or show by IsVisible. Under such a cover, a click on the tray icon showed the already open panel again and never closed it. With only the test's check changed, the test failed on "second quota click did not close the panel". Fix: on the Mac, togglePanelNow decides by windowOpen (shown and not miniaturised, the check #1381 brought in for lightweight mode). It hides the panel, or places it and shows it, itself. fitPanel, zoomWindows and trayCellClick use windowOpen in place of IsVisible as well. Linux and Windows still go through ToggleWindow, unchanged. The Hyprland branch's IsVisible checks are left alone, since they are Wayland only. Both AppKit tests (TestTrayCellClickReleasedPanel, TestPanelCloseHidesIt) now read the panel's state through windowOpen. gui-shell.md item 5 says so. Run, on darwin/arm64: - Under an injected cover (scratchpad cover.swift: opaque, max level, sharingType none, the whole screen): - origin/main: TestTrayCellClickReleasedPanel 0/8, and TestPanelCloseHidesIt 0/4 ("timed out waiting until the panel shows"). - Test-only change: 0/8 ("second quota click did not close the panel"). - This commit: TestTrayCellClickReleasedPanel 25/25, and TestPanelCloseHidesIt 20/20. - Under UU's own curtain: - origin/main: 30/30 red. - This commit: 10/10 green. - Before the curtain was up, origin/main passed 75/75. Under an activator load, it was 5/40 red. - go test ./internal/gui (GUI build) passes. go test -tags nogui ./internal/gui passes. gofmt is clean. - go vet with -tags nogui passes for linux and windows; go vet passes on darwin. Not tried: clicking the real status item by hand under a remote session. The test drives trayCellClick and togglePanel's path through the host. |
||
|
|
751ebe8f5a |
gui: magpie leads Command-Tab's order after opening its window on a busy Mac too, not only when the main thread keeps up (#1651)
TestDockJoinLeadsCommandTab failed under a full local go test ./...: the test app was LaunchServices' front app, yet last in Command-Tab's order (lsappinfo visibleProcessList), kitty first. Cause: setDock decided whether to activate magpie again by way of the Dock (#1381's fix) from [NSApp isActive]. The Mac makes an activated app the front app at once, but NSApp says it is active only once its main thread has taken the activation in. On a loaded machine the join came first, isActive read NO, dockStep chose a plain activate (a no-op for the front app), and magpie stayed last. A temporary print in setDock showed active=false in every failing run (3 of 5 at load ~120) and true in the passing ones. The same can happen to a user when the panel's focus and Open come close together on a busy Mac. Fix: joining the Dock to the front always goes by way of the Dock (activateAgain), whatever NSApp says. When magpie truly isn't active (the tray's Open), the Dock's turn in front changes nothing: magpie is activated after it either way. dockStep loses its active argument and appActive is gone. docs/subsystems/gui-shell.md item 7 says so. The test now activates magpie, waits for LaunchServices to call it the front app, and joins, all in one turn of the main thread, so the join always comes before NSApp knows: the busy-machine order, made certain. Run: - New test on the old dockStep: 5 of 5 red (magpie not first, kitty first). With the fix: 25 of 25 green at load ~120-135. - The old test (no injected order) with the fix: 10 of 10 green at load ~180; before the fix 3 of 5 red at load ~120. - TestDockStep (table without active). go test ./internal/gui (GUI build, darwin) 5 runs green. One run before them failed and its output wasn't kept, so which test failed is unknown. After rebasing onto |
||
|
|
18e82adc62 |
gui: the window's pages down a sidebar in groups, the open page's tabs under it, and a button to have the header's tabs instead
From 1024 points wide (SIDE_AT) the window lays its pages down the left as a Mac app's sidebar: Work (Agents, Sessions, Library), Models (Providers, Routing, Gateway), Insights (Usage), Extend (Plugins), with Settings and the gateway's address at the foot. The open page's own tabs (Usage, Library, Plugins, Settings) are listed under it, opening and folding on an iOS-like spring, and the page's strip is hidden. The header becomes a breadcrumb, and pages whose head held only tools have them in the title bar. Graphite: the open page is in the text's ink, not purple. A pressed row darkens and never shrinks. The selection under the tabs sets off as the row is pressed, on a 0.3s curve (it felt behind the finger), and is the list's only shape: a sub-row hovered or pressed has no ground of its own, which showed a block under the finger before the selection slid there. The page's tab is clicked at once, so what is typed next goes to it. The title bar's button (or ⌃⌘S, Ctrl+Shift+S), there at every width, picks the sidebar or the header's tabs. The choice is kept in localStorage magpie.navLayout (side or top) at every width, so it is laid out from the first frame; picked in a narrow window the sidebar is 184 points under 860. The two trade places in a view transition: the sidebar slides, each tab flies to its place, and the page slides as one. Without view transitions or under reduced motion, the change is at once. With nothing picked, narrower than 1024 the page beside a sidebar would be narrower than Usage's requests table needs, so the header's tabs come back. A resize drops what a click held (heldWidth). Usage's KPI strip goes two to a line by the room the page gives it (a container query), and Japanese counts wrap there. Tests whose window is 1024+ were updated for the sidebar, and docs/subsystems/gui-shell.md says how it works. Run: sidebar.test.cjs and side-toggle.test.cjs 16/16 in chromium and webkit, in en, zh, zh-TW, ja and de. Each was broken by hand (press shrink, address cut, press glide, sub-row ground, view transition, kept choice) and went red. Every page at 560 points with the sidebar picked, zh and de, both engines: nothing scrolls sideways. session-identity's ledger row sits under the footer beside the sidebar; WebKit's click doesn't scroll to it, so the test wheels it up first. Animation frames were checked from a recorded video. The 105 affected GUI files in both engines; their reds were rerun alone and fixed (filter-ime: the sub-row's click now at once; session-identity, above) or fail the same on main (tray-logos). The full GUI suite in chromium, on the rebase onto |
||
|
|
96de5cac29 |
gui: Providers has a search box, and a provider's right-click moves it to the top or the bottom (#1614, ququdu)
ququdu has many providers and kept scrolling to find one, and moving one
far up the list meant a long drag. The Providers page had neither a search
nor a quick move; its rows moved only by dragging the logo or Alt+↑/↓ one
step at a time.
- A search box over the list, at its right edge as Settings' is (full width
in a narrow window). The words typed keep the rows, on and off, whose
text or data say them all: name, id, preset, addresses, every model's id
and name, the account's user and plan and each login's, account names
and key names. The Turned off fold stays open while searching; nothing
found says so; Escape or clearing the box shows every row and the fold
as it was (findProviders).
- A row that is on has a right-click menu, as an agent row has: Move to
top, Move up, Move down, Move to bottom (openProviderMenu), with their
keys. Alt+Shift+↑/↓ on the logo go to the top or the bottom.
- While searching, a row still moves, among the rows shown: Alt+↑/↓ and a
drop put it where the shown row it passes was, and the hidden rows keep
their order (stepProvider, shownToOn). Move to top and Move to bottom go
to the ends of the whole list. Every move saves the whole order through
/api/providers/arrange as before.
- After a save, the keyboard stays on the handle it is on, also when it
was another row's taken up while the save was out (it was lost before).
- The logo's tooltip says right-click moves it to the top or the bottom.
- Drag already scrolls the page near its edges (dragRows); unchanged.
Strings in zh, zh-TW, ja and de. docs/subsystems/gui-shell.md says how it
works.
Run:
- provider-find.test.cjs (new), en, zh, zh-TW, ja, de at 420x560, Chromium
and WebKit: matches by name, model id, account user, key name and two
words; the off row found with its fold open; nothing-found text; Alt+↑ and
a drag while filtered, with the posted order checked; Escape; the menu's
four items, which are off at each end; Alt+Shift+↑/↓; nothing scrolled,
nothing but the order posted, no overflow. Fails on the old assets ("no
search box on the Providers page"), and goes red with each of five breaks
by hand: steps over the full list while filtered, no right-click menu,
drop index taken as a full-list index, no Alt+Shift, the off fold
honoured while searching.
- provider-order.test.cjs updated for the tooltip.
- Every GUI test that opens the Providers page (150 files): WebKit 754/754;
Chromium 748/752 under load ~100, the 4 in azure-endpoint and
routing-save (30s waits on the add sheet and routing) pass alone in both
engines, with provider-search, provider-order and settings-search
(31/31). gui-zh-tw, gui-ja, gui-de pass in both.
- go test -tags nogui ./internal/gui/... (sandbox HOME), go vet darwin,
GOOS=linux and GOOS=windows -tags nogui.
- Screenshots looked at: zh narrow with a search, zh wide with the menu.
|
||
|
|
917a365778 |
gui: opening the Usage page or the tray panel's Allowances reads the allowances now, once in 30s (#1588, qq666666qq)
On Windows the tray panel's Allowances tab, and the window brought back
on Usage, showed the reading magpie kept until "Read the allowances
again now" was pressed: picking the panel's tab and the panel shown
again only loaded usage/quotas without ?asked=1, which hands back the
backend's cache, and so did the window coming back to the front on
the Usage page.
Opening the allowances is now asking to see them (quotasOpened), as
Refresh now is and as #1518 counts the Usage page opened:
- the window: Usage from the nav (as before), the Overview tab picked,
and the window back to the front on the Overview;
- the tray panel: the Allowances tab picked, the panel brought up on it
(focus / visibility), and a menu bar cell clicked (panelQuotaFocus).
A panel page loaded while it is put away (hidden or without focus)
doesn't ask, so a panel prepared at login sends nothing with allowance
reads at "When I ask".
An asked read makes the backend read every account again (AskUsage
clears the caches; only Claude has its own 30s floor), so an opening
within 30s of the last asked read (QUOTAS_OPEN_GAP) sends an ordinary
read instead: switching tabs and back, focus and visibilitychange both
firing, focus-follows-mouse don't reach the vendors again. Reads stay
one at a time: an opening during an ordinary read goes after it
(loadQuotas, unchanged). Refresh now still asks every time; the timed
refresh is unchanged and never asks.
Written against main from qq666666qq's fork patch
(qq666666qq/magpie#1), which asked on every tab click and every return
without a gap; this keeps their entries and adds the gap, the Overview
tab, and the hidden-panel guard.
Run: new allowance-open-read.test.cjs (Chromium and WebKit, en and zh,
panel at 360px): passes; red on the old app.js (the panel's Allowances
never asks; the window re-asks on every nav click), red with
QUOTAS_OPEN_GAP = 0, and red with the window-return line removed. The
GUI tests touching the allowances (every test naming usage/quotas, the
Usage view or the panel's Allowances tab) in both engines, and
go test -tags nogui ./internal/gui. No Go changes. Not tried in the
native Windows tray.
Of the GUI run (3164 tests, load ~120-230), the 8 failures passed when
their files were run again, except library-mcp-tool-switch in WebKit,
which fails the same with main's app.js (
|
||
|
|
15872d977a |
gui: with the window open, magpie leads Command-Tab's order, so one Command-Tab away and one back returns to it (#1381, ttmouse)
ttmouse on v0.1.1168: open magpie's window, Command-Tab to another app, Command-Tab back, and magpie is last in the switcher. Cause: magpie is out of the Dock (Accessory) until the window opens. With Settings > Dock set to "while the window is open" (or a full-screen window), the quick panel's focus activates magpie while it is still Accessory, and it joins the Dock (Regular) after that. An app activated before it joins stays last in LaunchServices' front-to-back order (lsappinfo visibleProcessList), which Command-Tab follows, though it is frontmost. Wails' Focus only calls activateIgnoringOtherApps when the app isn't active, and calling it again while active is a no-op. setDock also ran async (dispatch_async), so openMain's Show/Focus could come before the policy change. Fix: - setDock runs on the main thread at once (InvokeSync), so openMain joins before it shows the window. - A pure dockStep(regular, on, active, front) decides the move. Joining while already active activates the Dock and then magpie again (activateAgain), which puts magpie first in the order. Joining while not active just activates it; leaving never re-activates. - The full-screen join does the same once the window is in full screen (DidEnterFullScreen) if magpie was active when it joined. - Dock "off" (the default) is unchanged: magpie stays out of the Dock and out of Command-Tab, by design. The tray panel's behaviour is unchanged. - docs/subsystems/gui-shell.md: Runtime path item 7 for the Dock setting. Run: - TestDockStep (table, pure). TestDockJoinLeadsCommandTab (darwin GUI build): a real Accessory Wails app activated, then setDock(true, true) + window Show/Focus, asserts it is first in lsappinfo's order. Red with `again` forced false (front was the test, kitty first in the order), green with the fix. - go test ./internal/gui (GUI build, darwin) passes; full go test -tags nogui ./... passes; gofmt -l clean; go vet ./internal/gui (darwin) and GOOS=linux / GOOS=windows go vet -tags nogui clean. - Real build on this Mac, sandbox HOME, own bundle id, port 3481, DockWindow on: launched with the quick panel, window opened through the Mac's reopen, then two osascript Command-Tabs. Old build: magpie front but 11th of 11 in the order (the report). New build: magpie 1st; after Command-Tab, the other app 1st and magpie 2nd; Command-Tab again brings magpie back. Dock "always": magpie 1st, round trip works. Dock "off": stays UIElement, not in the order. Not tried: the full-screen path in the real build, a human Command-Tab (only osascript keystrokes), real accounts (not involved). |
||
|
|
1c0eab7c84 |
gui, gateway: every search API takes a base URL of the user's own, under its key in Settings (#1580, xzhlksh)
The reporter has endpoints that answer as Tavily, Exa and others do, at
addresses that aren't the vendors', and Settings only took a key. The
saved SearchAPI already had a url, and the CLI's url= set it, but the
Settings row showed the field only for SearXNG and sent "" for the rest.
- Settings › Models › Web search: the add row has a base URL field on a
line of its own under the key, for every API, with the vendor's own
address as its placeholder (searchVendorJSON.base). Picking an API
already added fills in its saved URL, so Add with a new key alone keeps
it; Add with no key typed changes only the URL, the key kept (the key
placeholder says so). Strings in zh, zh-TW, ja, de.
- provider: check() also refuses a URL with a ?query or #fragment, since
the vendor's path goes after it.
- gateway: the key goes only to the URL set. Go drops Authorization on a
redirect to another host but keeps Brave's X-Subscription-Token and
Exa's x-api-key, so a search API's redirect to another host is not
followed; the error names where it was sent. The request still goes
through the gateway's client and so magpie's proxy settings.
- CLI: `magpie search add <api> <key>` keeps the url set before; `url=`
with nothing after it puts the vendor's own back (was: a new key alone
dropped the url).
- docs/subsystems/gateway-routing.md: "A search API's base URL";
gui-shell.md: the field.
- search-api.test.cjs: Settings is drawn twice (/api/state, then
/api/settings), so scrolling to the add row can hit a detached node
(WebKit, 1 in ~6 runs here); it retries the scroll.
magpie ships and lists no third-party search endpoint; the URL is only
the user's.
Tests (sandbox HOME, pinned caches):
- TestSearchAPIAtItsOwnBaseURL: an httptest fake at <fake>/relay/<vendor>/
gets tavily POST /relay/tavily/search with Bearer, exa POST
/relay/exa/search with x-api-key, brave GET
/relay/brave/res/v1/web/search with X-Subscription-Token, firecrawl
POST /relay/firecrawl/v2/search with Bearer. Passes on the old gateway
too: the backend already honoured a url.
- TestSearchKeyStaysAtItsBaseURL: with search_api.go put back, FAIL
"a key reached another host: exa-secret / brave-secret".
- TestSearchCLI: with search_cli.go put back, FAIL "a new key took the
base URL away"; with provider/search_api.go put back, FAIL
"url=https://x.example.com/?k=1 taken".
- TestSearchAPIBaseURLFromSettings: POST /api/settings/search-api saves,
keeps the key, refuses ftp/no-scheme/query URLs, lists vendor bases.
- search-api.test.cjs in Chromium and WebKit, en and zh, 980px and
420px: 8/8; with the old app.js, FAIL "Tavily takes a base URL"
(false !== true). WebKit 980px 10 runs in a row green after the retry.
search-first, search-mcp, searcher-pick, i18n-keys, gui-ja, gui-de,
gui-zh-tw, click-scroll with it: 45/45 in each engine.
- Screenshots at 980/420 in both engines checked by eye.
- go test -tags nogui -timeout 40m ./... on
|
||
|
|
afe0c59d2d |
gui: on a Mac window a popover that opens upward stops under the traffic lights, not over them (#1573, lyston11)
In a short Mac window, Pick (an agent's model list), the field picker (#pop) and every app menu (placeMenu) were held only 8px from the top when they opened upward or were held to the window's top, so they covered the traffic lights and header.top, which the system draws them over. popTop(pad) is now the highest a popover's top edge may go: 8px under header.top's measured bottom on a Mac window (so it follows --zoom), and 8px from the top everywhere else, as before. openAgentModels, placePop and placeMenu use it in place of pad for the top. placePop also holds #pop's max-height to the room between that edge and the foot when its CSS max-height doesn't fit, so a picker held to the top scrolls inside itself instead of running off the bottom (it already did run off before this change in a very short window; moving the edge down would have made that worse). Nothing else clamps a popover to the top: the remaining getBoundingClientRect placements (profiles in the panel, the heat-map tip, the rail tip) are kept inside their own card or panel. Run: - new internal/gui/tests/popover-mac-chrome.test.cjs: Chromium and WebKit, en and zh, MacIntel and Win32, 480px wide: 8/8 pass, 4 runs in a row. On the old app.js it fails (model list top 8 < 58 on Mac, the picker off the bottom on Windows). Breaking each placer by hand turns it red on its own: model list top 8, picker top 8, menu top 17. - related GUI tests, Chromium and WebKit, all pass: click-scroll, agent-models, agent-models-picker, -all-hidden, -loading, -only-picked, -redraw, agent-model-groups, menu-scroll, proto-menu-overflow, codex-app-menu-cap, desktop-model-menu, editor-short-window, removed-groups-menu-scroll, agent-start-pick, agent-leave-magpie, claude-picker-fold, header-zoom-fit, header-centre, text-size. - HOME=<scratch> go test -tags nogui ./internal/gui: ok. - GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui: ok. |
||
|
|
9bb68615b0 |
gui: a scroll not the reader's made just before a click is put back, not kept as where the reader was (#1554)
skill-install-agents-all.test.cjs was red on main in Chromium at 420px (en, ja, de): the install picker's All chip, clicked, left the Library view 5px down. Cause: the browser tells the page of a scroll at the next frame. The test clicks while the Library view is still sliding in (view-in, translateY 5px), and Playwright's click scrolls the chip into view first; with the view 5px taller than it is high at 420px, that scroll takes the view to its 5px foot. The click came in before that scroll's event, so the click guard took its snapshot (held.chain, held.top) at 5px and every hold() after kept it there, the scroll event included. A real click can do the same: WebKit scrolls a field focused on the press, or code scrolls just before the click, and the scroll was adopted as the reader's. Fix (app.js, the click guard): before taking a click's snapshot, a view not scrolled by the reader (no purposeUntil window, no scrollbar drag) is put back where the reader left it (backToReader), as the scroll listener would have done a frame later. A click in quick turn after another still holds that one first, as before. The guard is shared by every view, so every picker and button is covered; the library picker needs no change of its own (the MCP editor's picker is in #modal, outside any view). Tests: - click-scroll.test.cjs: new "a scroll the page hears of after the click is still put back" (scrollTop += 40 and a click in one task). Red on the old app.js in Chromium and WebKit (expected 2020, actual 2060), green with the fix. - sessions-manage-paging.test.cjs scrolled with Playwright's scrollIntoViewIfNeeded and clicked Show more before the next frame, so it passed in Chromium only through this bug (the guard puts that scroll back a frame later; it was red in WebKit on main). It now scrolls with the reader's wheel; green in both engines. - docs/subsystems/gui-shell.md says a click is taken where the reader left the view. Run: skill-install-agents-all.test.cjs red before (en/ja/de 420px, "view:5,0"), green after in Chromium and WebKit, every language; click-scroll.test.cjs green in both engines; 306 GUI test files that assert on scrolling or touch the library/skills/MCP, then the other 253, both engines. Failures seen there were rerun alone: purpose-filter (WebKit, 1px, #1291) and search-api (WebKit zh, #1442) fail the same on the old app.js; the rest pass alone. No Go changed. |
||
|
|
3144868538 |
gui, gateway: the Providers and Gateway pages no longer download every recent call's bodies; an opened call reads its own (#1521, xiaohei-info)
GET /api/providers carried up to 40 recent gateway calls with their request and response previews (up to 256 KB each) in gateway.calls, and every provider write returned the same state. The Providers page never shows them; only an opened row on Gateway does. With 40 calls of ~300 KB each, /api/providers was 21,019,635 bytes on origin/main. Taken from xiaohei-info's patch (bb26b802, attached to #1521 as external PRs are closed): providersState drops the bodies from the calls it sends; GET /api/gateway/call returns one call's previews and truncation flags with Cache-Control: no-store, 404 once it has left the ring; the page fetches on open, dedupes a pending read, keeps loaded bodies across refreshes, drops them with their call, shows "Fetching…" and a "Try again" on a failed read; the strings in zh, zh-TW, ja and de; the Go and Playwright tests; the gui-shell note. Changed from the patch: a call is asked for by a number the gateway gives it in the ring (Call.ID, Server.RecentCall), not by time, agent and model, which two calls of one agent to one model can share. The page keys a row by that id too (callRow), so two such calls no longer open, or show the bodies of, each other. The tests ask with ids, and the Playwright fixture gives two calls the same time, agent and model. The route is on the same mux as the rest of the API, so magpie web's key guard covers it, and the gateway's own port doesn't serve it. The bodies are the ones the ring kept, masked as before (redacted runs before capture). Nothing else reads gateway.calls' bodies: Routing reads /api/gateway/trace, and the tray, TUI, CLI and /api/state don't read the ring. Run: - Real use: magpie web built from origin/main and from this commit, sandbox HOME, a local upstream answering 300 KB, 40 calls of 300 KB. /api/providers 21,019,635 bytes before, 45,525 after (calls: 14,503 bytes). Opening a row in Chromium and WebKit fetched /api/gateway/call once (524,412 bytes) and showed both bodies with their "first 256 KB" marks. Without the key: 401, also for a rebound Host; on the gateway port: 404; an evicted id: 404. - TestRecentCallBodiesOnDemand fails with the bodies left in providersState ("providers must keep call metadata without sending bodies"), and with RecentCall ignoring the id ("the second call's detail isn't its own"). - recent-call-bodies.test.cjs fails on main's app.js, and with callRow keyed by time|agent|model again. - GUI: gateway-fold, json-tree, phone-rows, recent-calls-more, request-archive, recent-call-bodies, sse-body: 24/24 in Chromium and 24/24 in WebKit (en, zh, zh-TW, ja, de). - gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui on internal/gui and internal/gateway. - Full GUI suite: 5225 tests, 71 failures under load ~200, none in a gateway or recent-call file. The 20 files with failures, rerun on this commit and on origin/main: 54 and 58 fail; what fails on one only (Sessions checkbox colour, Sessions paging scroll, account dragging, ZCode block) moves between runs on both. - go test -tags nogui ./...: every package ok on the rebased head. Co-authored-by: xiaohei-info <14011749+xiaohei-info@users.noreply.github.com> |
||
|
|
6f0301f3c3 |
gui: magpie web gzips its page and JSON, and keeps each versioned script for good (akic404 on Discord)
akic404 runs `magpie web` on a public server over a ~3 Mbps link, and
the page took very long to load. Measured in a sandbox (`magpie web` on
127.0.0.1:3461/3463, sandbox HOME): every load sent the page's ~4.1 MB
of scripts and styles as they are (i18n.js 1.8 MB, app.js 1.1 MB,
app.css 282 KB, routing.js 279 KB, library.js 211 KB) with no
compression, whatever the browser's Accept-Encoding, and the API's JSON
the same way: a day of the Routing page's history
(/api/gateway/history, a real 267-request day copied in) was 1.23 MB,
and the routing trace's JSON grows with every account a request could
go to. Nothing is embedded, vendored or source-mapped in routing.js;
the bytes were the uncompressed transfer.
- webHandler wraps `magpie web`'s guarded handler in gzhttp
(klauspost/compress, already a dependency): text, scripts, CSS, JSON
and SVG are gzipped for a client that takes gzip, with Vary:
Accept-Encoding; PNG/WebP/ICO/JPEG go as they are. A gzipped
response's ETag ends -gzip, and If-None-Match with it is mapped back
so a revalidation is still a 304. A 32-byte content-keyed jitter keeps
the compressed size from being exact (BREACH), since the page carries
keys. The desktop windows read the page in-process through Wails'
asset server, with no network, so they stay uncompressed.
- revalidated: a script or stylesheet asked for under its current
content hash (?v=…, as versionedPage names it) is sent with
Cache-Control: max-age=31536000, immutable; any other hash, no hash,
and the page itself stay no-cache + ETag. Applies to both paths.
Numbers (curl, page + its 21 scripts/styles + /api/state):
before: 4,142,180 bytes, with or without Accept-Encoding: gzip
after: 1,258,298 bytes with gzip (i18n.js 565 KB, app.js 361 KB,
routing.js 89 KB), 4,142,180 without
/api/gateway/history?day=: 1,233,600 -> 72,538 bytes
Real browser (Playwright, ?view=routing, 6s, response body bytes):
Chromium first load 4,340,720 -> 1,362,922; reload 75,336 -> 10,597
WebKit first load 4,340,672 -> 1,362,843; reload 115,667 -> 34,006
both engines: Routing view shown, no page errors or console errors.
Tests: TestWebCompresses and TestVersionedFilesKept (web_compress_test.go).
Broken by hand, each goes red: webHandler without webCompressed
(Content-Encoding "" for app.js, routing.js, /, /api/state, SVG); no
immutable branch ("/app.js?v=…: Cache-Control no-cache"); no
If-None-Match mapping ("asked again with its gzipped ETag: 200, want
304"); compressing every type ("a PNG: Content-Encoding gzip"); no
ETag suffix ("gzipped keeps the ETag of other bytes").
Run: go test -tags nogui ./internal/gui (ok); full go test -tags nogui
-timeout 40m ./... under a sandbox HOME (all ok); gofmt -l clean; go vet
./internal/gui on darwin, GOOS=linux -tags nogui, GOOS=windows with and
without nogui. GUI: routing-*.test.cjs, panel-routing, web-page,
mobile-web, phone-web, gateway-mode in Chromium and WebKit; results
after rebase are in the report (mobile-web was red on the old base
before
|
||
|
|
a98ab77fde |
gui, gateway: a context window's part, cell or item clicked opens the text the request sent there (masaka)
masaka on Discord asked to see the whole context behind the context window
card: click the agent's prompt, or any other part, and read it.
What changed:
- gateway: the trace keeps the last 10 request bodies in memory only
(promptBodies; at most 32 MiB each and 64 MiB together, oldest dropped
first), masked as the vendor got them. For a model the user let have
the request unmasked, the masked copy is kept all the same. Never
written to disk, never in telemetry. Route.Prompt and the routing
history keep names and sizes only, as before.
- gateway: Server.PromptText re-reads a part's items and their text from
that body (prompt_text.go). promptBuilder gains a keep mode that records
each item's pieces: system text, tool definitions laid out as JSON, each
turn's user/thinking/assistant/call pieces, tool results, and images
or sealed reasoning named with their size. Sizes are unchanged.
- gui: GET /api/context/text?id=&kind=[&item=] (no-store; 404 "not kept"
when the body is gone or another process serves the gateway).
- gui: in the card, a legend part, a waffle cell or a content row
(click, Enter or Space) opens a wide modal: one item alone with "All of
{part}", or the part's list 100 rows at a time, each item's text
fetched when it is opened and shown 20000 characters at a time, with
copy buttons. Strings in zh, zh-TW, ja and de.
- docs: gateway-routing and gui-shell subsystem pages; the site's start
page (en, zh, ja) says the text is kept for the last 10 requests in
memory and sent nowhere. The README Privacy is unchanged, since nothing
more is sent.
What was run:
- go test -tags nogui ./... (temp HOME). internal/gateway hit the 10m
default under the full parallel run, in TestRequestTailAfterOldLimit,
which takes 57s alone on the base commit too; the package run alone
with -timeout 30m: ok (700s, the machine shared with other runs). Every other package: ok.
- New tests TestPromptTextIsWhatWasSent, ...KeepsOnlyTheLastBodies,
...ChatPieces, TestContextTextAPI. Broken by hand: keeping the unmasked
body fails (the key shows), and dropping keepBody fails ("not kept").
- gofmt -l; go vet, GOOS=linux and GOOS=windows go vet on internal/gateway
and internal/gui.
- GUI: tests/context-text.test.cjs in Chromium and WebKit, en/zh/zh-TW/
ja/de, at 1100 and 420px: legend, row, cell and keyboard open the text,
long text grows on demand, the page never scrolls, and a gone body is
named. It fails with the click wiring removed. Under a load average of
~140 one case failed once: the test read the list while the dialog
still said "Reading…". Reproduced with a 400ms reply, fixed by waiting
for the list; the mock now always answers after 200ms. A second case
("a click doesn't move the page", 662 vs 605 on the contents row) came
from taking the page's top while a wheel scroll was still easing: the
test now wheels to the row like the other cases, and wheelTo waits for
three equal looks. Four full runs at load ~150 then passed (80 cases). context-window,
i18n-keys, held-animations and the modal tests (dialog-backdrop-drag,
editor-short-window, readable-focus, ux-safety, whats-new, add-sheet,
api-key-theme) pass in both engines.
- Real use: a sandbox magpie (own HOME, ports 3486/3487, the Codex login)
served a real `claude -p` (Claude Code) request on codex/gpt-6-luna
that read a file. In its web UI, Usage > Context: each of System
prompt, Tools, Memory, Files and Conversation, a waffle cell and a
contents row opened the request's real text (Claude Code's system
prompt, 21 tool definitions, the CLAUDE.md reminder, main.go's Read
result, the turn with its thinking and call). No page errors.
|
||
|
|
472b36cec5 |
gui: the Usage page's short cards stack beside a tall one, packed into columns in the user's order (#860, huoranxuanyuan)
huoranxuanyuan's screenshots (1569px window at 175%, about 897px CSS):
a tall Codex card shared a grid row with Antigravity and a DeepSeek
balance, and both short cards stretched to Codex's height, mostly empty.
They asked for Antigravity and DeepSeek to stack beside Codex.
What changed
- packUsage (app.js) packs #subscriptionUsage into columns on 1px grid
rows. Each card takes the leftmost column that ends highest and is as
tall as itself; the cards' 7px gap stays.
- The DOM order is unchanged and is still settings.usageOrder, so
dragging, Alt+arrows and screen readers work as before.
- Column count: the most 260px columns that fit, or one fewer when
that leaves much less empty room (<0.6x) for a page at most 1.3x
taller. It is chosen again only when the cards change or the width
fits another number of columns. A card that grows or shrinks (a fold,
"Every model") is only re-packed, so the card clicked stays where it
was, even when the view's scrollbar appears and takes 10px of width.
Keying the choice on the pixel width moved a card turned to every
model in WebKit, which quota-families caught.
- A ResizeObserver on the list and each card re-packs on the next
frame. A hidden view falls back to the plain grid.
- fitQuotas is split into fitQuota(g), so heights are measured with each
meter box laid out for the width being tried.
- The tray panel's Allowances list is a single column with no row
stretching, so it needs no change.
- docs/subsystems/gui-shell.md describes the packing.
Tests
- New usage-pack.test.cjs, with fixtures of the reporter's cards:
- Codex with a 7-day window, credit resets and a curve; Antigravity by
family; a DeepSeek balance with its trend.
- At 897, 1018 and 1400px: Antigravity beside Codex at its top,
DeepSeek under it with the 7px gap, order kept, no overlap, no card
taller than its content.
- Equal cards: one row in order at 1300px, one column at 480px.
- Opening a brief Codex account grows that card in place, with no
scroll.
- Runs in Chromium and WebKit, in en/zh/ja/de. It goes red when
packUsage returns early (checked by hand).
- usage-accounts-fold: "Show fewer" now holds the card's head where it
was, as usage-keys-fold already does for keys. Its old assertions
expected the page to shrink to its end, which packing no longer does.
- usage-fold: scrolls to each fold button before clicking it, since
Codex is now packed under ZCode, past the 300px-tall window.
Run
- usage-*.test.cjs, quota-families and click-scroll in both engines:
all pass except usage-heatmap, which fails the same way alone on
origin/main
|
||
|
|
0a11b18301 |
gui: the tray panel's Allowances tab lists a balance where the Usage page's order puts it, not after every plan (#1510, JokerQyou)
The panel sorted its subscriptions by settings.UsageOrder like the Usage page, then pulled every balance-only card (DeepSeek and the like) into one "Balances" group appended after all the plan groups. With the reporter's order Codex, DeepSeek, Copilot the panel showed Codex, Copilot, then DeepSeek, while the Usage page and the panel's own Arrange list showed the set order. renderPanelQuota now builds its sections in order: a vendor's accounts at its first card, and a run of balances where it falls. Balances next to each other still share one Balances grid (panelBalances, the old block moved into a function unchanged). The TUI lists in magpie's own order and never read usageOrder; it is unchanged. The menu bar cells keep their own picked order (TrayUsages). Run: - panel-balance-order.test.cjs (new): the reporter's quotas and order (Gemini CLI, Kimi hidden), and a balance first plus two balances side by side; checks the panel's groups in order, the Usage page's order, a Balances group holds only balances, nothing runs off at 380px. Red on the old app.js (Codex, Copilot, DeepSeek), 16/16 green now in Chromium and WebKit, en/zh/ja/de. No new strings. - every panel-*, quota-*, tray-*, usage-*, account-arrange and routing-quota GUI test, both engines. - HOME=<tmp> go test -tags nogui ./... - screenshot of the reporter's case in zh at 440px: Codex, 余额 DeepSeek, Copilot. |
||
|
|
3d7acfb40f |
routing: the mode chip leads to where the routing is set, and a lone key names none
xczzhh on X: "这个路由策略能自己选吗,我的一直是smart,也改不了好像". The Routing page's hub chip and the Accounts and keys heading said Smart for every provider, even one with a single key on, where there is nothing to route, and nothing on the page said where it changes. Now, where routing can be changed (a group, or a provider listed in /api/groups' pools: two or more accounts or keys on), the chip and the heading are .rt-go controls (goTo/goRouting): a click or Enter brings the group's card or the provider's row under Several accounts or keys into view via scrollOnPurpose, marks it (rt-found, off under reduced motion) and focuses its routing picker. A provider with one on names no routing, and the mode paragraph says to turn on a second in the provider's editor (LONE, in zh, zh-TW, ja and de). The header is drawn again when the groups arrive (headOf). routing-weight-chip's fixture now lists its two-key relay in pools, as /api/groups does. Run: routing-mode-goes.test.cjs 40/40 (chromium+webkit, en/zh/zh-TW/ja/de, 1100px and 420px); all 20 chromium cases fail on the old routing.js. All routing-*, quota-pool*, rate-limited-sink, panel-routing, click-scroll, view-scrollbar-drag and i18n-keys tests pass (group-fold, keys-fold, flood and context-fold failed only under a 6-way parallel full run and pass alone, as on main). go test -tags nogui ./internal/gui ok. |
||
|
|
9ca4b9ec28 |
gateway: provider search can be Off in Settings, so a model's web search goes to the Search APIs alone (#1483, NorethSea)
Settings › Search gets an Off choice beside Automatic and the providers. With it, no provider is asked to search for another model (no ChatGPT or Claude account's allowance spent, no Kimi Code search service, no Google sign-in's separate search), and the saved Search APIs are asked in their order; one failing never falls back to a provider. With Off and no ready Search API, magpie offers no search tool of its own. A provider's native search on the client's own protocol is unchanged. NorethSea's change (from their fork, feature/search-provider-off, 68fe54ff), cherry-picked onto main. On review one sibling was missing: ownSearcher and webSearchOf (what this magpie's model list tells another magpie about searching) still treated a Kimi Code plan or Google sign-in as searching for its models with Off. Both now go through searchesOwn, the one check canSearchFor uses, so with Off a remote magpie is told there is no search instead of adding a tool that has nothing behind it. Run: go test -tags nogui ./internal/gateway ./internal/gui ./internal/settings (sandbox HOME); TestSearchProviderOffTellsRemoteMagpie goes red with webSearchOf's old check put back; searcher-pick, gui-ja, gui-de, gui-zh-tw .test.cjs pass in Chromium and WebKit. Co-authored-by: NorethSea <963979204@qq.com> |
||
|
|
7f66a0cce2 |
gui: on Linux the quick panel is dragged by its header, as the window is (#1430, olivezane)
On KDE Wayland the panel can't be put by the tray icon (a Wayland window
can't place itself, so KWin places it), and since ownFrame took KWin's
title bar off it (#1283) it had no handle at all: only Meta+drag moved
it. The panel's header set --wails-draggable: no-drag on every platform
(
|
||
|
|
884dbdb201 |
gui: on KDE a right-click on the tray icon opens its menu and leaves the quick panel shut (#1430, olivezane)
Wails (v3 beta.24, systemtray_linux.go) calls the tray's click handler
both for the icon's click (Activate) and from the dbusmenu "opened" event,
when the tray host opens the icon's menu. KDE Plasma opens the menu on a
right-click, so the right-click also opened the quick panel, which took
the focus, and on Wayland the menu shut at once (it stayed under
GDK_BACKEND=x11, as the reporter saw). On Linux the click handler now
ignores a call whose callers include Wails' (*linuxSystemTray).Event
(menuOpening, trayclick.go); a left-click (Activate) opens the panel as
before. Wails has no public hook for the menu opening.
Run: TestTrayMenuOpeningIsNoClick fails with openedBy broken ("a click
from the menu's opened event was counted a click") and passes;
TestTrayMenuOpenFrameIsWails reads the Wails module's source and fails if
Event stops calling the click handler on "opened" or is renamed.
go test -tags nogui ./internal/gui/ under a temp HOME passes; gofmt -l
clean; go vet (darwin, with the GUI) and GOOS=linux/windows go vet -tags
nogui ./internal/gui/ pass; GOOS=linux go build -tags nogui passes.
Not tried on a real KDE Plasma 6 Wayland session: no KDE machine here.
|
||
|
|
9e665491ec |
context: Tuned for you — each agent's settings worked out from the user's own calls, for the fewest tokens, put in on a click and undone on another
The Context tab now replays the period's calls of each agent against the
settings that decide what they cost, and shows, per agent and per model,
the value that would have used the fewest tokens for how this user works:
Claude Code's auto-compact window per model (modelSettings.<model>.
autoCompactWindow), its main and subagent prompt cache lifetimes
(promptCacheTtl, subagentPromptCacheTtl: 5m or 1h), and Codex's
model_auto_compact_token_limit. Each row says where the value comes from
now (the agent's default, the user's own setting, one magpie set, or a
variable that comes first and locks it), why (how fast conversations grow,
what a compaction leaves, how long the user pauses), the cost curve, and
the saving. Nothing is written until "Use …" is clicked; what was there is
stashed and Undo puts it back, unless the user changed it since. A window
the user set past the model's own is shown capped, as Claude Code caps it
(min(setting, model window)), so no saving is claimed that wouldn't happen.
Advice under a 3% saving is "already the leanest".
On the owner's 7 days (88K Claude Code calls, 956 Codex): opus keeps 200K
(their 500K is capped to it), fable 5.1 200K → 160K saves 5% (2.56M
tokens), both cache lifetimes and Codex's 272K are already the leanest.
Run: go vet ./... and go test ./... pass (internal/tune, internal/agent
TestTune*: user-set values kept, env locks, undo after a user edit, TOML
key order). context-tune.test.cjs passes in Chromium and WebKit, en/zh/
zh-TW/ja/de, at 360 and 1100px (22); context-window, context-scroll-end
pass. Full GUI suite: library-servers-bulk and market-have failed once
under load and pass alone; market-have fails on origin/main
|
||
|
|
c9b8263378 |
sessions, gateway: Sessions lists gateway sessions, and can keep their text on this computer when turned on (#1355, mu-zi-lee)
What changed: the Sessions page lists sessions seen only through the gateway (from the usage ledger, read-only, a native session of the same id wins), and shows in gateway mode. A Sessions switch, off by default and confirmed before it turns on, records each gateway exchange's text under the config dir (scrubbed, at most 7 days and 256 MiB, cleaned hourly). Settings sync and restore can't turn it on; POST /api/sessions/recording turns it on or off and can clear what was kept. Why: users of magpie as a gateway (gateway mode, LAN clients) had no way to see their conversations; the owner chose this design on the PR. Squashed from PR head 6a343ba1 onto origin/main. Conflicts: gui-shell.md (kept main's placeMenu text, took the PR's Sessions in gateway mode) and settings_keep_test.go (main's fields plus GatewayConversations). Run: go build ./..., go vet on gateway, gui, sessions, settings, usage; go test -race -timeout 900s on those five packages: all ok. |
||
|
|
b4bdd59f72 |
gui: a long app menu stays in the window and scrolls inside itself, so the last removed group can be brought back (#1437, Hipple)
With 28 found groups removed, Routing's "28 found groups removed" menu ran
off the bottom of a ~717px WebView2 window and couldn't be scrolled.
openRowMenu had no height cap (max-height: none, and .pop clips with
overflow: hidden), it only flipped up when the whole menu fit above, and any
scroll, even one inside the menu, closed it.
What changed:
- placeMenu (app.js) places every app menu: under its anchor, over it when
the window runs out below, and one that fits neither way takes the larger
room with its height held to it. openProtoMenu's placement moved into it
unchanged; openRowMenu (agent rows, model chips, Routing's removed groups
and its other row menus) and openSessCombo (the Sessions/Usage filters,
which could run off the bottom the same way) now use it too.
- .row-menu scrolls inside itself (overflow-y: auto, overscroll-behavior:
contain), and openRowMenu closes only on a scroll outside the menu, as
openProtoMenu and openSessCombo already did.
- docs/subsystems/gui-shell.md names placeMenu.
Verified:
- New removed-groups-menu-scroll.test.cjs: 30 removed groups, 1100x700 and
560x700, en and zh, Chromium and WebKit, 8/8 pass. It wheels the page to
the line, clicks it where it is, checks the menu is inside the window and
scrolls, wheels the menu until the last entry shows inside it, clicks it
(posts groups/show auto-gone-30), and checks the page never scrolled and
has no sideways scroll.
- Broken by hand three ways, each red in every case: the old app.js/app.css
("the menu stays in the window": bottom 1494 of 700), the old
scroll-closes-menu handler ("scrolling the menu doesn't close it"), and no
overflow-y on .row-menu ("the last entry is scrolled into view inside the
menu").
- The 63 GUI test files that open app menus or guard click-scroll, both
engines: 595 pass, 1 fail: search-api.test.cjs webkit zh, at page load
(the row is redrawn between waitFor and scrollIntoViewIfNeeded) before any
menu opens; it passes 5/5 alone. Not run: the rest of the GUI suite, and
gui-zh-tw/ja/de (no new strings).
- gofmt (no Go changed), go vet ./internal/gui (darwin, GOOS=windows),
GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui, and
go test -tags nogui ./... under a sandbox HOME: all pass.
- Not tried in a real Windows WebView2 window.
|
||
|
|
3cd0b5f78d |
gui: lightweight mode no longer lets go of a main window that is open under another app's, so Command-Tab back to magpie finds it there (#1381, ttmouse)
Cause: lightweight mode (#580) let go of the main window once two of its 30 s looks found it "not shown", and it asked Wails' IsVisible, which on the Mac is the window's occlusion state. A window the user had Command-Tabbed away from, covered by the other app's window, counted as closed: 30-60 s later its webview was dropped and the window closed, and Command-Tab back to magpie found a blank shell or no window at all. Hidden with magpie (Command-H) it went the same way, since hiding orders every window out. Change: windowUp says whether a window is up as the user sees it: ordered in on any Space, covered or not, minimised, or open as magpie was hidden (watchHide records those on NSApplicationWillHideNotification). Only a window magpie closed itself is down. lighten (through lightShown) and mainShown use it, so the Dock-while-open setting and a restart to update also keep a covered window as open. Elsewhere windowUp is IsVisible as before (visible there covers covered and minimised). Run: - Reproduced with a sandbox build of origin/main (own HOME and CFFIXED_USER_HOME, port 3481, dock+lightweight on): with the open window covered by a full-screen window of a helper process for 70 s the log said "the main window's webview let go" and the window was a blank white shell. With this change, the same run let go only the closed panel and the window kept its page (screenshot of the window). - Activation itself was checked by handing activation from the helper to magpie (NSRunningApplication activateFromApplication): with the window there it came forward. A real Command-Tab keystroke was not sent. - New TestCoveredWindowStaysUp (AppKit, own process): open, covered by another window (until IsVisible says false), hidden with the app, minimised -> up; closed by magpie, also with the app hidden -> down. With windowUp put back to IsVisible it fails: "open: the window counts as up=false, want true"; without the hidden clause: "hidden with magpie: the window counts as up=false, want true". Passes -count=10. - gofmt -l; go vet ./internal/gui; GOOS=linux go vet -tags nogui and GOOS=windows go vet (with and without nogui) ./internal/gui; go build, GOOS=linux go build -tags nogui, GOOS=windows go build; go test ./internal/gui and go test -tags nogui ./internal/gui under a temp HOME: ok. |
||
|
|
2018882e47 |
davsync, gui: a server file that isn't a backup is said as what it is, and can be replaced by this computer's setup (JasonLeeForOnly on Discord)
JasonLeeForOnly's WebDAV sync failed with only "not a magpie backup" for
several versions, and nothing on the page got past it. A WebDAV GET of the
backup can come back as a body that isn't the file in several ways; each is
now reproduced with an httptest server that answers the way the real one
does:
Unpacked (WebDAV and S3): gzip with or without Content-Encoding (a proxy
that drops the header), x-gzip, zstd with or without the header, deflate
(zlib or raw), and a header that says gzip over a plain body. Bodies are
told by magic number; a backup is JSON, so either magic is never the file.
Brotli (br) can't be unpacked and is said as itself, with what to turn off.
Said, with no upload offered: an HTML page answered with 200 (Nextcloud
login after a redirect, Cloudflare Access, an AList/OpenList web app, an
rclone directory listing, a captive portal), with its <title> and the
host/path a redirect ended at (query, fragment and user dropped), and
where the WebDAV address is for 坚果云 and Nextcloud; an XML answer, by its
root element.
Said, with Upload as the way out: an empty (0-byte) file, a backup cut
short or damaged (the automatic rebuild is unchanged and still goes first
when its rules allow), another app's file ("format": "…"), other JSON,
and any other file by its content type. Messages carry the size, kind and a
page title only, never the file's contents.
backup.Open now tells ErrNotBackup (doesn't begin like a backup) from
ErrCorrupt (begins like one, cut short). The status carries the kind as
serverFile; Settings › Sync and backup says it in the reader's language,
wraps it whole, and shows "Upload this computer's setup" only when the file
may be replaced. davsync.Upload (POST /api/davsync/upload, `magpie webdav
upload`, `magpie s3 upload`) asks first in the GUI, re-reads the file,
refuses a backup this computer opens, one sealed with another passphrase,
a newer magpie's, a page and an XML answer, keeps the server's copy in the
sync folder (0600, newest 5) and writes nothing if that fails, then writes
with If-Match on the version read. New strings in en, zh, zh-TW, ja, de.
Verified: internal/davsync/not_backup_test.go (TestReadCompressedBackup,
TestReadBrotliSaid, TestServerAnswerSaid, TestCutBackupSaidAndUploaded,
TestS3ReadCompressedObject; Upload-only parts stripped to compile) fails
on
|
||
|
|
55544f09f6 |
routing, gui: a provider's accounts and a group in the group fold on the Routing page, long ones folded at first, what the reader picks kept (Aiirobyte on Discord)
Aiirobyte: a routing group of many accounts took so much of the page that editing the groups below it was a long scroll. The stage folded only runs of three or more API keys (#1319). Now: - Three or more accounts of one provider side by side for one model fold into one row the way keys do: the count, the lit one and what it does, how many are available and resting. A request to a folded account flies to the fold. - A group in the group's heading folds from a click, Enter or Space (it is a button now, with a chevron). Folded, it says "{n} on" and what its seats do together; requests under it fly to the heading and a failure tags it. - Accounts and keys sums a provider's accounts up in one row too. - Keys start folded as before. Accounts and group headings start open under six, folded from six. What the reader opens is kept in magpie.routingKeysOpen as before, what they fold in the new magpie.routingFolded, so both directions survive a reload. - Redraws go through steady(), so a click keeps the page where it is. - Strings in en, zh, zh-TW, ja, de. Display only: the gateway's order and choice don't change. routing-account-order now opens the relay's key fold by :not(.open), since the account folds there start open. Run: new internal/gui/tests/routing-group-fold.test.cjs (defaults, click and Enter in place with the page not moving, kept across reloads both ways, a live request to a folded group heading with its tag, Accounts and keys folds, 420px fit) in Chromium and WebKit, en/zh/zh-TW/ja/de, 40/40. On origin/main's assets it fails (no account fold, heading not foldable). All routing-* tests, panel-routing, click-scroll, gui-ja, gui-de, gui-zh-tw and i18n-keys: 255/255 in Chromium and 255/255 in WebKit. Not tried in the real window with a live gateway. |
||
|
|
8db24fd62f |
gui: Routing folds three or more of a provider's keys for one model into one row that shows the count and their state, and opens in place to each key (#1319, tkhs101)
53 agnes-3.0-flash keys were 53 near-identical stage rows and 53 rows under Accounts and keys. Now three or more keys of one provider standing together for one model (same fixed effort, fallback and group-in-group heading) fold into one stage row: "Agnes 53 keys agnes-3.0-flash", then the lit key and what it does, "51 available · 2 resting". A request on a folded key flies to the fold; a key failing and the next answering show there (its 429 tag too). A click, Enter or Space opens it in place: each key keeps its own row, state and wire, drawn from the fold. Accounts and keys folds the provider's keys into one row with their summed tally and models, and opens the same way. Open folds are kept per reader in localStorage magpie.routingKeysOpen. Two keys stay two rows; one key is as before. Display only: the gateway's order and choice don't change. New strings in zh, zh-TW, ja and de. docs/subsystems/gui-shell.md says how. routing-account-order's relay has three keys, so it now opens their fold to read their order. Run: routing-keys-fold.test.cjs (32: folded, open/persist/Enter, live updates folded and open, Accounts and keys, 440px; Chromium and WebKit; en, zh, ja, de) — fails on main (no fold). All routing-*.test.cjs, panel-routing, click-scroll, fold-show-grip, gui-ja, gui-de, gui-zh-tw, i18n-keys: 409 pass. Every other test that opens Routing (29 files, 152 tests) passes but purpose-filter's WebKit "returning focus does not scroll the page", which fails the same alone on origin/main (off by 1px). go vet -tags nogui ./internal/gui (darwin, GOOS=linux, GOOS=windows). |
||
|
|
d226f87e4c |
gui: on KDE Plasma's Wayland session the quick panel has no KWin title bar or frame, as the main window has none (#1283)
GTK 3, which the Linux builds link, announces server-side decorations over org_kde_kwin_server_decoration for every window that isn't client-decorated, an undecorated (frameless) one too (gtkwindow.c realize: announce_ssd), and KWin then draws its title bar on it. The main window escapes it through plainTitlebar's hidden titlebar widget. The panel now announces client-side decorations after each realize (ownFrame: gdk_wayland_window_announce_csd), at start and when lightweight mode makes it again. GTK 4 already asks for none, X11 and compositors without the protocol never see it. Run: on real KWin 6.3.6 Wayland (kwin_wayland --virtual with Breeze, Debian trixie arm64 container, -tags gtk3 test binary): WAYLAND_DEBUG shows request_mode(1) and KWin answers mode(1); a KWin script reads the panel's frame 440x520 = its client 440x520. With ownFrame skipped: request_mode(2), frame 442x557 over client 440x520 (KWin's title bar and borders, the reporter's picture). go vet -tags gtk3 ./internal/gui ok there; macOS go vet/go build ok; GOOS=linux/windows go vet -tags nogui ./internal/gui ok. Not tried: the reporter's Manjaro Plasma session, a GTK 4 build, GNOME/Hyprland (no KDE protocol there, so unchanged). |
||
|
|
23cd1bb609 |
gui: closing the quick panel from its title bar (or Alt+F4, a window manager's close key) hides it as Escape does, so the tray icon opens it again; it was closed for good and the icon did nothing until a restart (#1283, KDE Wayland)
The system's close reaches Wails as WindowClosing, which destroyed the panel while h.panel and the tray still held it. makePanel now hooks WindowClosing: the panel cancels and hides; one lightweight mode let go (h.panel no longer it) still closes. Run: TestPanelCloseHidesIt (AppKit, new) passes; with the hook's check forced to let the close through it fails "panel close: the panel closed for good; the tray icon can't open it again". On real KWin 6.3.6 Wayland (kwin_wayland --virtual, Debian trixie container, GTK 3 build) a KWin script closeWindow() on the panel (what its title bar X does): with the hook alive=true and a second Show is visible; without it alive=false and Show shows nothing. go test ./internal/gui ok (darwin, GUI tag); go vet, go build ok; GOOS=linux/windows go vet -tags nogui ./internal/gui ok, GOOS=windows go vet ./internal/gui ok. go test -tags nogui ./...: all ok but internal/agent (11m timeout) and internal/plugin TestHostRunsAsMagpieBun under load average ~110; neither imports internal/gui, and TestHostRunsAsMagpieBun passes alone. Not tried: the reporter's own Manjaro Plasma session; Windows' Alt+F4 on the box. |
||
|
|
f00ed2901c |
routing: filter by several purposes with checkboxes (#1247)
* routing: filter by several purposes with checkboxes Ticking a purpose immediately shows the union of the selected purposes while keeping the menu open. All purposes, Clear filter and removing the last selection restore every purpose. Counts, the story and history follow the same list. Live menus ignore renderer-induced scrolling while deliberate outside scrolling still dismisses them. Update the GUI shell reference and browser coverage for multi-purpose counts, keyboard toggling, history, aliases and narrow windows in five languages. Verified 115 isolated Playwright checks in Chromium and WebKit, JavaScript syntax and git diff --check. The new checkbox case fails against the old assets with 0 checkbox choices instead of 5; restoring the old menu scroll handler separately detaches the menu during selection in WebKit. * routing: All purposes returns keyboard focus to its button Address the keyboard-focus regression reported in PR #1247. Choosing All purposes closes its menu and focuses the purpose button without scrolling. Unticking the last purpose keeps the live menu and its checkbox focused. The expanded checkbox test fails without the focus restoration in Chromium and WebKit: All purposes returns keyboard focus to the purpose button (false !== true). With the fix, 162 isolated Playwright checks pass across both engines, including five locales, narrow widths, purpose state, history, request/session grouping, Usage and scroll/menu regressions. JavaScript syntax and git diff --check pass. The full GUI/Go suites and the packaged desktop app were not run. |
||
|
|
586f2bce8f |
context: magpie inspects the context window of every request, session and agent
The gateway reads each request's prompt into its parts (system prompt, tools and MCP servers, memory, files, tool results, chat), measured against the model's window and calibrated to the tokens the vendor counted. Routing shows a request's window as a card: a 400-cell grid by part, a hover naming what is largest in a cell, and the contents by part. The Usage page's Context tab scores each agent out of 100 (cache reuse, how lean it starts, how fast it grows, how reliably it answers), tags it (lean, cache-friendly, mcp-heavy, compacts, near-full…), and draws each session's growth with its latest request's card. Older Safari (15) gets media-query and solid-colour fallbacks for the card's container queries and color-mix. |
||
|
|
aff4f9f22c |
gui, tray, alerts, settings: magpie speaks Traditional Chinese (繁體中文) with Taiwan wording, picked on its own for a zh-TW, zh-HK or zh-Hant system
Settings → Language offers 繁體中文 beside 简体中文. On System, a browser or OS locale of zh-TW, zh-HK, zh-MO or zh-Hant (zh_TW.UTF-8 too) shows zh-TW; zh-CN, zh-SG and zh-Hans-HK keep Simplified. The tray menu and quota alerts follow the same choice. Release notes fall back to Simplified. The zh-TW strings are generated from the zh strings with opencc (cn→twp), then corrected to Taiwan wording: 設定, 檔案, 帳號, 伺服器, 預設, 閘道, 連接埠, 參數, 選單, 透過, 取得, 用戶端, 存取, 終端機, 「」 quotes. A quota window is 時段 and a context window stays 上下文視窗. Number units use 萬/億, and #unitsRow is shown for zh-TW. Verified: - New gui-zh-tw.test.cjs, in Chromium and WebKit: - key parity, placeholders and tags against zh; - no Simplified characters; - the Taiwan words; - locale detection for each system tag; - <html lang>, nav labels, fmtN units, the picker; - Settings Language at 1000px and 440px. With the sysLocale zh-TW line removed, it fails. On the base assets, all 3 fail. - gui-ja, gui-de and i18n-keys pass. - go vet, and go test -tags nogui for ./internal/gui and ./internal/settings, pass. That includes the new zh-TW cases in TestTrayLang / TestTrayLabels / quota_alert_test, which fail without the zh-TW branches. |
||
|
|
89b3a20f5d |
gui tests: a test run leaves no gui.test folder in the real ~/Library/WebKit or ~/Library/Caches (waitingsnow) (#1047)
TestTrayCellClickReleasedPanel shows its panel in the test binary run
again as a child. The package's TestMain gives the tests testenv's HOME,
but WebKit takes the home from the account's record, so every run wrote
the child's WebKit data to ~/Library/WebKit/gui.test and its caches to
~/Library/Caches/gui.test in the real home.
The child now starts through runAppKit (appkit_darwin_test.go). It sets
CFFIXED_USER_HOME, which CoreFoundation reads before the account's
record, to a temporary folder, so WebKit's data and caches go there. It
runs the binary under a name of its own, through a hard link: WebKit
names its folders after the process, whose name comes from the file, not
argv[0]. The test fails when a folder of that name is left in the real
~/Library/WebKit or ~/Library/Caches. The empty folders WebKit makes
under the name in the account's temporary folder (NSTemporaryDirectory,
which TMPDIR doesn't move) are removed. Wails v3 beta.24 offers no
non-persistent WKWebsiteDataStore: its windowNew makes a plain
WKWebViewConfiguration, which uses WebKit's default store.
CFFIXED_USER_HOME doesn't move the account's settings: cfprefsd still
serves the global domain and com.apple.universalaccess, where dark mode
and Increase Contrast are kept. A probe window read the same appearance,
Increase Contrast, Reduce Transparency, layout direction, languages and
non-default values (AppleShowScrollBars, AppleReduceDesktopTinting, the
zoom factor) with and without it, on macOS 26.7.1. Nothing is written
to the temporary home after the child exits.
Without CFFIXED_USER_HOME the test fails:
trayusage_panel_darwin_test.go:20: the windows' process left /Users/wei/Library/WebKit/gui.test-1791307161567260000 in the account's real home
trayusage_panel_darwin_test.go:20: the windows' process left /Users/wei/Library/Caches/gui.test-1791307161567260000 in the account's real home
--- FAIL: TestTrayCellClickReleasedPanel (0.45s)
With it, it passes, and nothing new appears in the real ~/Library or in
the temporary folder.
PR #1042's TestMainWindowCorners and TestMainWindowRightToLeft, moved
onto runAppKit at its head f89991b1, pass and print the same with and
without CFFIXED_USER_HOME: corners 16.00pt (plain 16.00, toolbar
26.00), lights [[26 26] [49 26] [72 26]], title bar 66pt, a sheet 66pt
below the top, right to left lights [[874 26] [851 26] [828 26]].
Without it, both fail the same way.
go vet ./..., go build ./..., GOOS=linux go build -tags nogui ./...,
GOOS=windows go build ./..., go test -tags nogui ./..., go test
-count=1 ./internal/gui/... and gofmt -l pass under a temp HOME with
Go's caches pinned. docs/subsystems/gui-shell.md says it. Tests only.
|
||
|
|
29f4909262 |
fonts: list upright styles before slanted faces at the same weight (#1030)
Follow up on the Menlo style ordering noted in PR #1007. Compare normal, italic and oblique explicitly after weight, retaining the existing width and name tie-breakers. The Menlo regression fails before the change with Italic, Regular, Bold Italic, Bold, and passes with Regular, Italic, Bold, Bold Italic. Group/tie-break tests, fresh Windows native discovery, focused nogui GUI/font tests, go vet and Windows/Linux nogui builds pass. |
||
|
|
bd33e575f1 |
gui: let users choose installed interface and code fonts (#1007)
* gui: choose installed interface and code fonts and styles Discover installed styles through DirectWrite, CoreText and Fontconfig. Keep choices per computer, apply them before paint and notify both desktop webviews after saving; defaults retain platform and Omarchy fallbacks. Verified seven focused Go tests, including real Windows discovery (90 families, 276 styles), 14 font browser cases in Chromium/WebKit, 68 settings/zoom/Omarchy/web cases, go vet, Windows amd64/arm64 and Linux nogui builds. Against the original assets, the new UI test fails with Settings must offer an interface font picker (0 != 1). Full Windows suites have separately reproduced upstream failures; macOS/Linux native discovery is covered by the added CI step. * gui: retain bundled Mac fonts and variable style precision Only filter an undownloaded CoreText face when it is explicitly downloadable; bundled fonts are installed without being downloaded. Use resolved font names when descriptors omit them. Preserve fractional weights and nonnegative CSS widths for named variable styles. * gui: restore the authored font cascade when returning to defaults Apply family-only trait overrides only while a custom face is active. The browser regression catches code under a bold parent becoming 700 instead of its original 400. Keep the compatibility shim first, and apply boot fonts before visible content. * gui: keep font picker review separate from CI integration Leave the native test sources and manual verification command with the feature. Move the added workflow step to a follow-up so the font picker can take the normal review path requested on PR #1007. |
||
|
|
490d2ea362 | gui: the tray panel's Allowances tab hides subscriptions and moves them, from an Arrange at its foot (H20 on Discord: "菜单栏的详情页能不能选择某些不显示,有点额度并不想看到或者可以调整顺序,目前的还不行") — the panel's tab already followed the Usage page's order (usageOrder, byUsageOrder), but it could be set only by dragging a card's logo on the window's Usage page, which nothing in the panel said, and there was no way to leave a subscription out of the panel at all. The tab's foot now has Arrange, and "{n} hidden" beside it when some are: Arrange lists a row a subscription (balances too) in the shared order, its logo the handle (a drag, or Alt+arrows; the grip by it on hover only, as on the Usage page) and a Hide/Show pill, under a note that hiding is the panel's only and the order is the Usage page's too; Done draws the cards again. What's hidden is kept in magpie's settings (settings.PanelUsageHidden, panelUsageHidden), not the browser: routing, caps, the Usage page and the menu bar's cells still have it, and a menu bar cell for a hidden subscription still opens its card (panelPeek) until the panel is put away or the tab left. POST /api/usage/arrange takes order and panelHidden and changes only the one it is sent (both were whole-order before; an order alone still works), and the Settings save keeps panelUsageHidden as it does usageOrder. Saves draw at once and are put back with the error if they fail; no click moves the page (the view's scroll is kept across the redraw); no native select, no left-border stripe. Which allowances the menu bar shows beside its icon stays Settings' pick (trayUsages). New t() strings have zh, ja and de. TestUsageArrangePanelHidden (each field set and cleared on its own, a Settings save between) passes -race -count=20, TestSettingsSaveKeepsWhatItDoesNotSend's fixture names the field. panel-arrange.test.cjs (440px: the hidden card left out and counted, Arrange keeping the reader's scroll, the rows and note, the hover-only grip, no stripe, no sideways overflow, Show/Hide posting panelHidden without a scroll and a failed save put back, Alt+arrow and a drag posting the order, Done's cards in it, a menu bar cell opening a hidden card until the panel hides, the Usage page keeping the hidden card) passes on Chromium and WebKit in en, zh, ja and de; click-scroll, gui-ja, gui-de, i18n-keys, panel-fold, panel-usage, quota-*, routing-quota-left, tray-cell-click, tray-inuse, tray-logos, tray-usages, usage-accounts(-fold), usage-arrange, usage-fold, usage-quota-head, usage-card-refresh, usage-stale-answer, usage-remote-cards, api-key-usage, claude-usage-asked and usage-checkin pass on both. go test -tags nogui ./internal/... under a temp HOME, go vet, gofmt -l, linux (nogui) and windows builds pass. Not tried in the real tray panel on a Mac. docs/reference.md and docs/subsystems/gui-shell.md say it. | ||
|
|
f109b270c0 |
gui: the main window opens as it was last left — maximised again if it was, at its last size otherwise (#995)
On a MacBook the window had last been zoomed. magpie skipped a maximised window when it saved the size, so it reopened at an older, nearly full size: 1712×1083 at (8,34) on a 1728×1084 work area, neither full nor the size it was given nor the default. settings.WindowMaximised (this computer's own, KeepOwn) now records whether the window was maximised when it settled; Window stays the size it restores to (settle). A window not shown yet, let go, full screen or minimised, or on Linux hidden, records nothing. Reopened maximised: on the Mac and Windows placeMain maximises the made window just before its first Show (on Windows once its page has come); Wails' StartState is undone by the Mac's centring and shows a Windows window before its page. The least size Maximise drops is put back. On Linux makeMain sets StartState, since GTK can't be asked about a window not mapped yet. A size kept on a larger screen: Windows fits the window to the work area and centres it, title bar in reach, and keeps the larger size for the larger screen (fitted); the Mac fits and zooms it itself, and magpie doesn't zoom it again, so it can still be restored. TestSettle fails with upstream's rule (5 of 9 cases); TestOpenSize, TestFitRoom, TestWindowMaximisedKeptAndOwn; the Mac's real build under a sandbox HOME, 11 cases. |
||
|
|
db55bc8b7a |
gui: reject unknown Codex auto-review models from known providers (#938) (#943)
Resolve deliberately accepts arbitrary model names under an existing provider. The auto-review setting consequently accepted fake/missing and fake/, replacing a valid reviewer with one that fails when Codex requests approval. Validate against the served catalog at the settings endpoint. Keep model and group choices, unlisted providers, whitespace trimming and clearing. Rejected values leave the saved reviewer and model-list tag unchanged. TestCodexAutoReviewSetting fails against the upstream API with fake/missing and fake/ returning 200, and passes with the fix. Focused auto-review tests, go vet ./..., the Windows build and Linux nogui build pass. The full Windows suite has failures also reproduced with upstream production code; details are recorded in the PR. |
||
|
|
2cc663d0a2 |
gui: protect unsaved edits and confirm destructive actions (#820)
* gui: edited forms ask before they are discarded, removals ask before they take effect, and the header keeps its first layout — Cancel, Escape, the backdrop and a page change could throw away a provider's draft, and several account, key, plugin and library removals took effect at once. Modified provider, settings, library and routing forms now ask before discarding; unmodified forms still close without asking, and refresh or closing the browser tab uses its leave confirmation. Removal and discard confirmations are in-app dialogs over the intact editor, centered, with Cancel focused first, Tab kept inside, Escape canceling and focus returned afterwards; destructive buttons have readable foregrounds in light and dark themes. Text and connection settings have Save/Cancel rather than saving on blur; simple switches still save at once. Editors associate labels and help with fields, make the background inert while open and keep focus through redraws; navigation keeps browser back/forward history and its current-page state, errors remain until dismissed or replaced, and focus and validation can scroll into view. Mobile settings tabs have larger targets, fields use 16px text and page zoom stays available. layout.js applies mode and platform before the header paints, theme.js applies the saved text size before styles, and mode-specific window controls stay hidden while app.js downloads. zh/ja/de strings added. routing-shape's global .rt-day selector selected the hidden By session button on WebKit; its history click now stays in .rt-days. ux-safety covers unchanged and modified closes, canceled and confirmed removals, Escape, backdrop, modal focus, light/dark centering and button contrast, explicit saves, browser history and sync-form discard. Rebased onto upstream/main |
||
|
|
a5df344e43 |
docs: code-standards gets the acceptance criteria a change must show before merge or release and the PR review patterns, and docs/subsystems covers gateway routing, agent wiring, providers and accounts, the library and the GUI shell (Junjie Zhou on Discord)
code-standards.md: a failing test before the change (a real FAIL, not a compile error), tests under a temp HOME with GOPATH/GOMODCACHE/GOCACHE pinned and never a live agent config, vet/build (linux nogui, windows)/test with pipefail, GUI tests in Chromium and WebKit with gui-ja/gui-de, real-account checks in a sandbox, the UI rules; a PR merges only after it is run merged onto main and with --match-head-commit; a release counts only with the tag on main, 16 assets and Latest. The review section is distilled from recent PR reviews (#706–#931). New references, each following the README's format and linking real source: gateway-routing.md (plan/planGroup, rests, sink, affinity, attempt/translate), agent-wiring.md (Agent fields, ConnectHow, applied.json drift, stash, DisconnectPreview, Reseat/Rewire, WSL twins and ListsFor), providers-accounts.md (providers.json, keys, Accounts, token refresh, logins, groups, Quotas), library.md (change/sync, instructions, MCP formats, skills link/copy, backups, RTK), gui-shell.md (Run, startBackend, Handler/held/revalidated, magpie web, gateway mode, nogui). Every link and backticked identifier was checked against the tree at origin/main. Docs only. |