Files
magpie/internal/gui/assets
yetone c2b8814e75 gui: the tray panel keeps the latest height it asked for, its fits sent one at a time (robot_yz on X)
robot_yz on X (11-05, v0.1.3005): the menu-bar panel had become short,
and the Allowances tab's one card, Zhipu GLM (max, rings 5h 7%, 7d 18%,
MCP 1%, a curve), was cut off by the foot.

Cause: Wails v3 serves each request from the page on a goroutine of its
own (application.go, `go a.handleWebViewRequest(request)`), so two
window/fit requests sent together reach fitPanel in either order. In a
real WKWebView under Wails on mote, 69 of 400 pairs of fetches sent
together reached the handler the wrong way round. When an older, smaller
height lands last, it stays: fit.last in app.js and the panel's own
panelHeight both take the newer height as done, so nothing asks again
until the content's height changes. Since 2ba044aa6 (v0.1.2913) every
Mac panel open runs load(true), and renderAgents and renderPanelQuota
each fit in the same task. A boot asks 122, 306, 566 and 291 within
about 120ms (setPanelTab, renderAgentsLoading, the routing panel, its
poll), which is likely why it showed after the update. fit(), panelFrame,
panelRoom and fitPanel haven't changed since 10-20/10-26, and go.mod's
Wails hasn't changed either.

Fix: fit() sends through fitSend. A fit asked while one is on its way
waits for it, and only the latest of those goes next, so the panel always
ends at the height asked last.

Test: panel-fit-order.test.cjs sets up panel mode with the reporter's
case: one Zhipu GLM allowance with its 5h, 7d and MCP windows and the 5h
curve, 15 agents, and the Allowances tab. The fake panel holds the first
fit until the page has drawn the card and stopped asking. The test
asserts that the panel ends at the last height asked, that the card's
bottom is inside the view, and that the tab doesn't overflow.
Chromium and WebKit, en, zh, zh-TW, ja and de.

Rebased on 4e85cac01 and run again on mote at this head: go test ./internal/gui -run Budget ok; panel-fit-order, account-models-available and i18n-keys, 94 pass, 0 fail (on ea3d1c62e: every panel-* file too, 300 pass).

First run on mote (mote-run), at base 0e55a7593:
- panel-fit-order.test.cjs: 10 of 10 pass.
- Every panel-*.test.cjs and quota-*.test.cjs file plus i18n-keys.test.cjs
  (47 files, --test-concurrency=2): 534 tests, 534 pass, 0 fail.
- go test -timeout 45m ./internal/gui: FAIL, one red,
  TestMainWindowCorners/macOS_26_SDK ("a toolbar doesn't change the
  corners in this design, yet the main window's was taken off"). The
  same test alone on origin/main 2260390a0 (fetched just before) fails
  the same way. It is #3949 (macOS 27 on mote), and this change touches
  no Go. Every other test in the package passed.

Broken by hand: the new test run against origin/main's assets
(git archive of internal/gui/assets) is 0 of 10, each one "the panel
ended at an older height than the page asked for last (asked 122 306
566 291, applied 306 566 291 122)". The panel was left at 220 and the
card was cut off.

Not tried: the real tray panel by hand on a Mac with this build. The
reporter's own overlapping fits weren't seen either; the reorder was
measured with Wails and WKWebView on mote, not on their machine.
2026-11-05 11:59:50 +08:00
..
omarchy: on Omarchy, magpie is drawn in Omarchy's own design language, follows its theme, drops its panel under the bar as Omarchy's own menus do, and can put its icon in Omarchy's bar (让整个UI/UX完全符合Omarchy的设计语言…单独对Omarchy做这个支持,现在的UI/UX当然要保留) — on Hyprland magpie looked like any other GTK app: its own light/dark palette, rounded shadowed popups, and a tray panel floated framed and dimmed in the middle of the screen, labelled with the program's name, never closing on a click elsewhere (focus follows the mouse there, so Wails turns off focus-lost hiding), and its tray icon was hidden in the bar's drawer. Now, only when Omarchy is detected (internal/omarchy: ~/.local/share/omarchy and its current theme), boot.js hands the page the current theme (colors.toml, the shell's theme TOML, Hyprland's border size, colour and rounding, Omarchy's font) as CSS variables before the first paint, and omarchy.css, all under html.omarchy, draws flat as Omarchy's shell does: the theme's background, no shadows or blur, corners as round as Hyprland's windows, popups and dialogs framed by the active border's colour, uppercase letter-spaced labels, rows and picks as a faint fill with the text in the accent. /api/omarchy is polled every 2.5s, so a theme picked in Omarchy's menu reaches the windows at once; Settings → Appearance shows the theme's name instead of Light/Dark/System. Under Hyprland the tray panel gets a title of its own ("magpie panel", set through GTK since Wails leaves frameless windows untitled), and each opening gives Hyprland a named Lua window rule placing it under the bar at the click, 6px in from the edges, pinned, opaque, borderless; its height is capped to the work area. While it is open a non-consuming left-click bind emits a custom event on Hyprland's socket2; a click outside the panel and below the bar closes it (the bar is left to its icons, so the icon toggles), and the bind is removed on close or, after Escape, on the next click. The tray item's SNI id is "magpie" instead of "Wails", so it can be pinned. Settings → Bar icon (状态栏图标), shown only in the app on Omarchy's Hyprland, puts an Omarchy bar-widget plugin (usemagpie.magpie, a bird glyph, in ~/.config/omarchy/plugins, then rescanPlugins and plugin enable) beside Omarchy's own icons: a click runs magpie panel, a right-click magpie app; Off disables and removes it; a widget pointing at a moved or older magpie is rewritten at start. magpie panel (new) opens the quick panel, starting magpie if needed, or toggles it in the running instance. Elsewhere nothing changes. Tested in a Hyper-V VM on the latest Omarchy (Hyprland 0.56, 2528×960 at scale 1.6): the look with tokyo-night; the panel at [1134,32] under the bar; clicks on the panel and the bar keep it open, a click on another window closes it, the icon toggles it, Escape closes it and the bind goes; Bar icon On adds the bird to the bar, its click opens the panel under it (also with magpie not running), a second click closes it, right-click opens the window, Off removes it; autostart becomes app-magpie@autostart through systemd's XDG generator; the launcher entry and icon are there. Go: internal/omarchy tests (theme parsing, panel placement on scaled and turned monitors, click-outside geometry, widget files quoted with the executable, KeepWidget rewriting only a stale one). A new internal/gui/tests/omarchy.test.cjs, Chromium and WebKit, en and zh: with no Omarchy theme the page has no omarchy class or theme style, the Appearance choices show, no Bar icon row, nothing asked of /api/omarchy; with one, the theme's background, square corners, its name, and Bar icon's On and Off each posted with nothing scrolled, hidden when the bar isn't there. old-webkit now lets omarchy.js load in the head beside boot.js (it does nothing off Omarchy). The full GUI suite, gofmt, go vet, go build (GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass. Not tried: other Hyprland setups than Omarchy's, a multi-monitor VM, and the GTK4 build in the VM (gtk3 was used).
2026-09-30 04:58:11 +08:00