c9e8422fa8c2b8eb96dfb7ff0c91c2caef1306bd
285
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ead91a9a50 |
gui: a browser tab's title names this magpie: MAGPIE_NAME or Settings › Network and sharing › Advanced › Name (starballl on X)
starballl on X (tweet 2122376116220633444) runs several magpie web pages
and every tab is titled "magpie", so they can't be told apart. A magpie
now has a name, and a browser tab's title is "<name> · magpie" (plain
"magpie" with none).
- settings.Name, set in Settings › Network and sharing › Advanced › Name
(instancename.js, imported when Settings is drawn, so nothing is added
to app.js's core). Advanced is closed until a name is set.
- MAGPIE_NAME (Docker, magpie web) names it while the field is empty and
is the field's placeholder. It is read, never written, so a name typed
in Settings always wins and clearing the field goes back to it.
- One line, at most 60 characters (settings.CleanName).
- This computer's own (KeepOwn): sync and a restored backup never bring
another magpie's name. A Settings save that leaves `name` out keeps it
(settingsapi.Merge).
- boot.js titles a browser tab itself for the first paint, so app.js's
core gains only the line in applyPrefs, which sets the title again from
every settings read (TestCoreScriptBudget was 74 bytes over with a
title function in app.js). Only a browser page (web) is retitled: the
app's windows and tray keep "magpie".
- Docker docs (en, zh, ja) list MAGPIE_NAME; docs/reference.md and
docs/subsystems/gui-shell.md say how it works.
Tests:
- TestInstanceName (internal/gui): the variable alone names it at boot;
a saved name wins over it, trimmed; a save without `name` keeps it;
KeepOwn keeps it; cleared goes back to the variable; no name, none at
boot. Broken by hand, each red: KeepOwn without Name ("KeepOwn took
\"other\""), Merge without the keep ("a save without the name changed
it to \"\""), boot.js with s.Name in place of InstanceName ("named by
the variable alone: boot <nil>"), boot.js not setting the title ("a
browser tab's boot.js sets no title"). The app window's boot.js sets
none.
- TestSettingsSaveKeepsWhatItDoesNotSend now sets Name: the page's other
saves leave it out, and it is kept.
- instance-name.test.cjs: title from the first paint, the field under a
closed Advanced, save and clear retitle the tab, Advanced open after a
reload, 360px, the app's window keeps "magpie"; en, zh, zh-TW, ja, de,
Chromium and WebKit, 16/16. 14 of 16 red with applyPrefs not setting
the title.
Run, at this commit on
|
||
|
|
34606000da |
gui: the tray panel's Usage tab ends in a heatmap of recent weeks (eiyuuzaki2333 on X)
Asked for "a heatmap like GitHub's / Codex's, also in the tray". The window already has one (Usage › Requests, 53 weeks, #1369), so no second copy goes on the Overview, which counts gateway calls only while the heatmap counts session-file calls too. The tray panel had none. The panel's Usage tab now ends in a card of the recent weeks, one cell a day, Monday on top, as many weeks as the card fits (8 to 53: about 25 at the panel's 440, 17 at 320). It goes after the chart and ranking, so nothing above it moves. Its shades are the existing monochrome accent ramp (.l0 to .l4) and follow the tab's own Tokens / Cost / Requests switch, with no new read; a provider or computer picked above narrows it. A tooltip says the day and its tokens, requests and cost. Weeks with no call show no card. No animation. It reads the existing cached /api/usage/heatmap, at most once a minute and again when a pick changes; the tab's own 10 s reads don't wait for it, and no endpoint was added. The card, its reads and tooltip live in plugins/usage/page.js, which shares its grid (heatGridOf, taken out of drawLedHeat as it was) and tooltip (ledHeatTip, now told the metric and provider) with the Requests tab. app.js keeps one guarded call in renderPanelUse: the ledger read can come back before page.js has run, so page.js draws the tab again when it loads. Both script budgets hold it at this base with no raise. The card is .pu-heat, not .pu-card, so the chart's card stays the tab's one .pu-card. The panel's light pills are its card's white, so a quiet day there is a 7% shade of the text over the card. Run (rebased on origin/main |
||
|
|
187d067241 |
gui: a page's row in Sidebar pages is dragged by a finger too (chet030714 on X)
v0.1.4296's page order "根本拖不动" on a phone. Reproduced in Chromium with real touch input (CDP Input.dispatchTouchEvent, 390px, hasTouch, isMobile): the press on the grip went pointerdown, pointermove, lostpointercapture, and the drag ended before it began. A finger (and a pen, where the browser does so) is captured by what it pressed, here the grip span inside the row; dragRows then takes the capture on the row, the grip loses it, and its lostpointercapture bubbled to the row's listener in dragListen, which cancelled the drag. A mouse has no implicit capture, which is why the mouse test and the desktop app were fine (mouse drags passed in Chromium and WebKit, 1100px and 390px). dragListen now cancels only on the handle's own lostpointercapture. The fix is in the shared listener, so every dragRows/dragCards whose handle holds a child (the accounts' rows, a model's rows, plugin pages) gets it. On a coarse pointer the grip is 40px wide instead of 26, a finger's target. Alt+Up/Down is unchanged. No new motion: the rows' existing 0.16s strong ease-out shift (none under reduced motion) is what a finger drag shows. The listener's lines were written shorter so app.js stays under its budget (4 bytes of room left), no raise. Run: - nav-pages-order.test.cjs: a finger drag (CDP touch) and a pen drag (CDP pointerType pen) on the phone's menu, Chromium; WebKit checks the grip shows. 10/10 (Chromium, WebKit x en/zh/zh-TW/ja/de) on mica. Red on origin/main 269e54de5's app.js: "a finger dragged Masking up", chromium en and zh (2/2). The pen step passes on the old code too (Chromium's CDP pen isn't implicitly captured), so it guards nothing old, only the path. - The drag GUI files (account-arrange, agent-grip, codex-model-order, drag-rows-shift, gateway-key-arrange, group-arrange, group-member-drag, group-member-row-drag, panel-arrange, plugin-page-arrange, provider-order, routing-rule-drag, usage-arrange, usage-drag, tap-lost-click, tap-inverted, tap-click, search-order, nav-pages-order) on mica: 196 pass / 12 fail. The 12 are account-arrange (53 !== 52, #6010) and gateway-key-arrange 420px (#6268); both fail the same 12 at origin/main 269e54de5's assets. - go test ./internal/gui/ on mote: ok (TestCoreScriptBudget included). Not tried: a real phone (iOS Safari, Android Chrome); WebKit touch, which Playwright can't send; a real pen; the Wails windows. |
||
|
|
269e54de5f |
gui: an update restart nobody clicked comes back in the tray alone (eating_dream on X)
eating_dream on X (v0.1.4303, macOS, Restart automatically on, a check every half hour, prerelease channel): after each automatic update the main window came back over what they were doing. A restart by itself brought the window back when it was up (#2096), and minimised when it was (#3495). Now every restart nobody clicked comes back with the tray icon alone, on every system, the window closed even when it was up. That covers Settings' AutoRestart, `magpie update` from a terminal, a Remote magpie's ask, and another copy replacing this binary. The restart path is restartBySelf, which updates.autoRestart calls. It still takes no focus and the Mac's Dock icon joins without coming to the front (quiet_restart.go). A restart the user clicked (the pill, Settings, the tray) opens the window as it was. No new setting. restartInto loses its minimised parameter, and markQuietRestart writes the seconds alone. An older version restarting into this one still asks for its window and may write "<seconds> minimised", so the reading side (takeQuietRestart, quietMinimised, showMinimised) stays. host.mainUp had no caller left, so it moved into the Windows test that reads it. Tests: - New TestRestartBySelfComesBackToTheTray: by itself asks for no window, clicked asks for it. - TestRestartBySelfComesBackQuietly now checks restartBySelf's mark and reads an older version's minimised mark (markOldQuietRestart, which the Windows minimised and quiet tests use too). Run, at fd407bc99 + this change: - mote-run: - go test ./internal/gui -count=1 -timeout 45m: ok - go vet ./internal/gui, GOOS=windows go vet ./internal/gui, GOOS=linux go vet -tags nogui ./internal/gui: clean - gofmt -l: clean - Broken by hand: restartBySelf asking for the window (the old behaviour with it up) fails "windows asked for [true true], want [false true]". The old code read the window through a live Wails window, so the test can't run against it as it was. - win-run go test ./internal/gui -run 'Quiet|BySelf|Minimised|RestartBy': ok. TestRestartMinimisedComesBackMinimised and TestRestartBySelfAsksNoAttention skip over ssh (session 0). - wsl-run go test -tags nogui ./internal/gui -run 'Quiet|BySelf|Beside': ok Not tried: a real automatic restart of the app on any system, and the Windows desktop tests in the signed-in session. The first update into this version is still made by the old one, which brings the window back once. Docs: gui-shell.md, restart by itself. |
||
|
|
e0f9218f91 |
update: Restart to update goes into the newest version out, not an older download (char1es_lu on X)
char1es_lu on X: Restart to update put in a version downloaded a while ago, and right after the restart magpie offered an update again. Since |
||
|
|
b010fba05b |
gui: the pages go in the reader's own order, in the sidebar and a phone's tab bar (chet030714 on X)
Settings › General › Sidebar pages, where pages are hidden, now also puts them in order: a row is dragged by its grip (shown on hover, always on a touch screen), or moved with Alt+↑/↓. The order is kept for this browser in localStorage magpie.navOrder, beside magpie.navHidden. The sidebar and the header's tabs follow it at once, and a phone's tab bar (phonetabs.js) shows the first four with the rest under More. Providers is listed (it can be moved, never hidden). While the order isn't the home one the sidebar's group names (Work, Models, ...) are left out, since a reordered list breaks the groups; Default order (shown only then) removes the key and puts the pages and their names back. A page the kept order doesn't name (new in an update) goes after the page it follows at home. Plugin pages keep their place in their group. A reader who never reorders sees nothing change. navOrder and navArrange live in the new navorder.js, imported by navHides only once an order is kept (and by navpages.js with the menu), so what is left in app.js is that one line: +107 on both core budgets, explained there. old-webkit's list of on-demand scripts names navorder.js. Built on the unpushed WIP 10b9ee22c (page-order worktree), cherry-picked onto origin/main; the WIP test clicked the aria-disabled Providers row without force, and its reload checks now wait for the async import. Run: - nav-pages-order.test.cjs (new): Chromium and WebKit, en/zh/zh-TW/ja/de, 10/10 pass. Red on origin/main (no menu opens), 5/5 chromium. - The whole GUI suite (make test-ui) on mote at the first, inline version (navArrange ran on every start; the final version runs nothing new for a reader with no order), stopped after 4,171 ok / 171 not ok, none in a nav, sidebar or phone file. Five of the red files (agent-switch-accounts, gateway-key-arrange, first-untick, data-folder, api-key-theme) rerun on mica at this tree and at origin/main |
||
|
|
023a563735 |
install: the Windows install dialog says the download can be deleted
@jiangshangmuyun on X updated on Windows and found a new magpie while "the original is still there". That is by design since |
||
|
|
c6a67dd412 |
gui: the Windows main window is resized from its edges again (Puremilk_chun on X)
Since 0.1.4274 ( |
||
|
|
b34243823e |
routing: accounts' resets stay in their column, and resizing over many accounts is smooth (lexrus on X)
lexrus on X: on Routing's Accounts and keys, at some widths "resets in
3h" ran over the next column and the right column's words were cut, and
with many accounts dragging the window's edge was janky.
Overlap: the window parts' widths (--wk/--wv/--wr) were taken from the
widest window of the whole list, so one provider's long reset pushed
every row past its column. They are now per provider, and CSS caps each
part to its row.
Jank: the list was CSS columns, and the browser balanced every row again
on each layout. packActs (plugins/routing/client.js) places each
provider's box (and a long box's rows) itself under .rt-acts.packed with
--px/--py: down a column and on into the next, ends as level as a binary
search on the cap allows, a heading never last in a column. It runs on
the window's resize, on render, and a frame after a box's height changes.
Side mode (min1150, beside the requests) is unchanged: one scrolled
column, nothing placed. Measured on mote with a 100-row fixture, per
resize step: WebKit layout 26.6ms -> 5.9ms, frame p90 35 -> 18ms;
Chromium layout 8.24ms -> 2.86ms.
Test: routing-account-windows-fit.test.cjs, 4 and 20 Codex accounts, en
and zh, Chromium and WebKit, widths 420-1600: no window part runs past
or is cut, a provider's lines start together, the list isn't CSS
columns, boxes sit inside the list in column order without overlapping,
2+ columns at 700-1099. Broken by hand: the old assets are red on the
overlap; packing turned off is red ("the list isn't CSS columns").
gui-shell.md says how the columns are placed.
Run on mote at this change on origin/main
|
||
|
|
dd77094ca2 |
gui: on Windows the header is the window's title bar (258a14 on X)
With a wallpaper, Windows' main window had a white native title bar over
the page, cut off from it ("内容区域和标题栏有割裂感"). On Windows the main
window is now frameless (mainFrameless), as the Mac's header already is
the title bar: the page and its wallpaper run to the top edge. Wails v3's
frameless window keeps WS_OVERLAPPEDWINDOW, so the shadow, Windows 11's
rounded corners, snap (Win+arrows, drag to an edge) and Wails' resize
edges stay. The header draws minimise, maximise/restore and close at its
right (#wincap, wincap.js, imported in that window alone), Windows-sized
with Segoe Fluent Icons, in the theme's colour, Close red on hover
(.1s ease); the header's refresh and pin sit left of them and stay
no-drag. A double click on what drags the window maximises or restores
it. The app tells the page when the window is (un)maximised (captionJS),
which swaps the glyph and its tooltip and keeps Wails' resize edges off
while maximised so the corner pixel is Close's. The buttons stay over a
dialog's scrim (wincap.js undoes modalBackground's inert on them). The
Mac, Linux, the tray panel and the web page are unchanged.
TestCoreScriptBudget: +27 on both budgets for the one import line in
app.js, past the 29 bytes of room there were; the rest lives in
wincap.js and app.css.
Run (mote, at this tree on origin/main
|
||
|
|
261f482260 |
gui: Disconnect and quit puts the agents back for the next start, which connects them again (jtbbtnt54249 on X)
jtbbtnt54249, on LolingVerse's agy thread: "很多都这样,退出有时候又要重新开启".
Several agents' switches were off after quitting magpie and had to be
turned on again by hand.
Looked for a shared path that flips agents off. The row's switch is
Wired() alone, and nothing automatic disconnects an agent except a
removed plugin, the gateway pause (which reconnects on resume) and
Put agents back when quitting (which reconnects at start). The quit
question's Disconnect and quit, though, ran each row's Disconnect,
which leaves the disconnectedKey mark: every agent it listed stayed off
at every start after, and RewireOnStart skips a marked agent. Users
choose it so their agents work while magpie is closed, not to leave
magpie for good.
Now Disconnect and quit posts quit/disconnect (quitDisconnect), which
runs agent.RestoreOnQuit on the agents the question lists: their own
files back, no mark, recorded in quit.restored, so the next start's
RewireOnStart connects them again, the setting on or off. This covers
every agent the question lists: every detected agent wired to magpie,
built-in, plugin and WSL ones alike. A failure answers an error naming
the agent and magpie stays open. Its tooltip says magpie connects them
again when it opens (en, zh, zh-TW, ja, de).
Run at this tree (parent
|
||
|
|
139a6be2bb |
gui: a pin in the title bar keeps the main window on top (NovaStudiosss on X)
NovaStudiosss wanted to watch Usage and Routing while working in other apps. The main window's toolbar now has a pin between Refresh and Settings. A click keeps the window above other apps' windows (Wails SetAlwaysOnTop through POST /api/window/ontop?on=1|0) and saves it as settings.json's onTop, which this computer keeps for itself (KeepOwn, not synced). makeMain opens the window pinned on the next start, and boot.js shows the pin pressed before the first paint. There is no pin in the panel, in a browser's page (magpie web) or under Wayland, where always-on-top is ignored (GDK_BACKEND=x11 keeps it). A refused pin goes back up. Tooltips "Keep on top" and "Stop keeping on top" are in every language. A Settings save keeps onTop (settingsapi.Merge), which a test showed was lost before. Run (rebased on |
||
|
|
923cc8747f |
routing: filtering groups reuses indexed lookups and cards (liu-kan, #6744)
Ported from liu-kan's routing_mod_filter branch at 5aca86598 (#6744). Typing in the Routing groups filter re-ran every member's lookups as a linear .find over all models, deciders, drawers and accounts, and redrew the whole page each keystroke. Now a lazy index (Maps built first-match like .find, splitMember and memberInfo cached, search text cached per group and locale) is rebuilt whenever `groups` is reassigned (it never is mutated in place) and dropped 5 minutes after both Routing pages are hidden. The filter's input redraws only the group list from cached cards, falling back to a full draw when groups or the locale changed. No look, matching or saved config change; no new strings; app.js untouched (client.js is outside the core budget). Measured (mote, Playwright, 4000 models, 20 groups x 20 members, 16 keystrokes, ms per keystroke incl. layout): chromium: before mean 4767.6 / median 5086.3, after 0.37 / 0.2 webkit: before mean 4813 / median 5075, after 0.88 / 1 Run: - go test -count=1 ./internal/gui/ on |
||
|
|
b0d634b850 |
routing: Expand picks how far the stage opens, models or accounts (ipsikent on X)
ipsikent asked on X for a setting for how deep the Routing page opens:
often only which model a route uses matters, not which provider's account
it went to. Expand, at the end of the stage's top line, opens a menu
(openProtoMenu) with Automatic (as before: long lists folded, short ones
open), Models (two or more accounts or keys of one provider fold into the
row naming the model, and start folded) and Accounts (every fold starts
open). Models and Accounts open every group in the group. The pick is
kept in localStorage magpie.routingDepth; picking one forgets the stage's
remembered folds, so every row follows it at once, and a row clicked
after it is kept as before. Accounts and keys isn't changed. Display only:
the gateway's choice of seat is untouched.
It sits in the stage card's top line, not the page head: in the head it
pushed Hide accounts onto a second line at 420px in English. "Expand" is
in the core dictionary, since i18n-keys finds the word in plugged.go.
Run (mica, at this tree on
|
||
|
|
5bccfb4ef2 |
usage: a table's provider with several accounts is one folded row; an empty Account column is left out (#6740, jay68xu on X)
jay68xu on X: the Usage page gets hard to scan with many providers and accounts. This change covers the table view only, as the issue's comment asks. In the Allowances table (Usage > Overview, Table), a provider with several accounts is now one row. The row shows the chevron, the provider's icon and name, "N accounts" (a string every language already has), and each window column's mean share over the accounts. A failed read counts for nothing in the mean. The provider's accounts sit under it, folded until the row (or its button, with Enter or Space) is clicked. Each provider's open state is kept in localStorage magpie.quotaTableOpen, the way the cards' folds are kept. A provider with one account is one row, as before. Sorting orders accounts within a provider, then providers by their mean (window columns) or by their first row. The Account column is left out when no row names an account. Window columns and Other already appear only when some row has one. There is no motion: a toggle redraws the table, and the chevron turns. app.js is untouched (quotatable.js loads lazily), and there are no new strings. Run at this tree (base origin/main |
||
|
|
dd89f12556 |
gui: the no-activate hook's handle is swapped atomically, and the Windows exit doc says what the unhook leaves to endProcess (#6705)
On top of wizd's unhook (#6705, afe3b3ff7, kept as authored with its test): noActivateHook becomes an atomic.Uintptr that unhookNoActivate swaps to 0, so the three places that unhook (OnShutdown, the main-thread window's WM_DESTROY, Run's return) take it off once without a racy read-then-clear. Nothing hooks it again: hookNoActivate runs its SetWindowsHookEx under noActivateOnce, and noActivateHooked stays true after the unhook. 07dfd0bb8's endProcess (TerminateProcess on itself) and awaitExit are kept and the gui-shell doc says why: they still cover the other DLL detaches, an os.Exit while the app runs (Wails' fatal error, which this unhook doesn't reach), and an update from a version before the fix. Exit paths reviewed: Quit (tray, page) runs Wails' cleanup, whose shutdown tasks run on the main thread (InvokeSync), so OnShutdown unhooks on the hook's thread before Run returns into endProcess. A restart to update quits the same way. Wails' SingleInstance os.Exit in a second instance comes in application.New, before any window exists, so no hook is on. SIGINT/SIGTERM in the app go to Wails (ownSignals), so through OnShutdown. The handover's quitBy exitNow is Mac/Linux only. Run at this tree on base |
||
|
|
7ce93508f0 |
gui: unhook noActivateHook before process exit on Windows (#6705)
Two full-memory dumps on Windows 11 (magpie.DMP on v0.1.4196 and magpie2.dmp on v0.1.4185) show why ExitProcess throws in exitsyscall and wedges with one thread left (#5922, #6678, #6705): 1. hookNoActivate installs a thread-local WH_CBT hook (noActivateCBT, Go callback #93) on Wails' main thread and never unhooks it. 2. When the process exits through runtime.exit(0) -> ExitProcess (for example from Wails' SingleInstance handover os.Exit, Wails' fatal os.Exit, or before 07dfd0bb8's endProcess), runtime.exit(0) acquires runtime.finlock and enters ExitProcess via runtime.stdcall with g1.syscallsp set. 3. Inside ExitProcess -> RtlExitUserProcess -> LdrShutdownProcess -> RtlpFlsDataCleanup -> msctf!CicFlsCallback -> msctf!SYSTHREAD::DestroyThreadMessageWindow -> win32u!NtUserDestroyWindow, Windows dispatches HCBT_DESTROYWND (nCode=4) to noActivateCBT on the main thread. 4. noActivateCBT calls w32.CallNextHookEx, whose nested Go syscall clears g1.syscallsp = 0 on return. When cgocallbackg then calls runtime.exitsyscall, gp.syscallsp < sp triggers 'fatal error: exitsyscall: syscall frame is no longer valid'. 5. runtime.fatalthrow.func1 calls runtime.exit(2) on the same thread (m0), which attempts to lock runtime.finlock a second time and self-deadlocks forever while still holding Wails' single-instance mutex and WebView2 profile handles. Fix: unhook noActivateHook (w32.UnhookWindowsHookEx) when Wails' main-thread window receives WM_DESTROY in appWndProc, in OnShutdown, and when Run returns. TestUnhookNoActivatePreventsExitDeadlock reproduces the exact FLS window-destruction callback on ExitProcess's last thread: without unhookNoActivate the child process throws 'exitsyscall: syscall frame is no longer valid' and wedges with 1 thread left; with unhookNoActivate (or WM_DESTROY on the main-thread window) it exits 0 cleanly. Fixes #6705 |
||
|
|
028b07b4bd |
routing: a folded fold of accounts on one plan shows its bar in the app (Sdsi134a on X)
Sdsi134a on X: on the Routing stage, "Command Code Plan · 3 accounts" folded said only "3 available", with no quota, though the accounts are on one plan. foldQuota ( |
||
|
|
862660144e |
gui: a page's tabs in the sidebar fold from its own row, with a disclosure chevron (hkwok06 on X)
Opening Settings unrolled its tabs in the window's sidebar and nothing said they would fold again; only opening another page (the gateway) put them away. The open page's row now carries a quiet disclosure chevron, as a Mac sidebar's: turned to its list while the list shows (down for the pages above, up for Settings, whose list opens above its row), and clicking the row or the chevron again folds the list and unfolds it, the page staying open on its tab. A list folded stays folded, per page, until it is opened again (localStorage magpie.navFolded). The same holds for Usage, Library and Plugins. The chevron is muted, turns in 200ms on the strong ease-out, and doesn't move under prefers-reduced-motion. aria-expanded says the state; Enter on the focused row toggles it too. The chevron and the fold live in navicons.js (navFoldRows, navFold), imported with the first list; app.js keeps 123 bytes (navList shared with navMine, the two rows' clicks asking navFold first), with the budgets raised by that and the reason in core_budget_test.go. Run (mote): - nav-sub-fold.test.cjs (new), chromium + webkit, en zh zh-TW ja de: red on the old code (12 of 12, "Settings' row shows a disclosure chevron"), green 12 of 12 on this change. - After rebasing on origin/main |
||
|
|
1ac137e100 |
update: a version found is downloaded at once, not when Update is clicked
canlee886 on X (11-13, again 11-15): with downloads automatic, magpie
showed a new version and downloaded it only after a click on Update.
0.1.4051 made a click go into the copy downloaded and waiting, but the
clock's check (byClock) also kept that copy, so every version out after
it waited for the click: the pill said Update while the newest had never
been fetched. A failed download likewise waited, as a pill to click, for
the next 6-hour check, and a "found" version stayed found when downloads
were turned back on.
Every check that finds a newer version now downloads it with downloads
automatic: the clock's (5 s after start, then UpdateEvery), Check now,
the Version row's refresh and a page asking for notes in another
language (relang now starts the clock's check when the feed names a
newer version). A newer one replaces the one waiting. Only a restart's
check and the update dialog's (keep: recheck, freshen), a restart
waiting for the gateway to go idle (waiting) and downloads on a click
leave it, so a click on Update still restarts at once.
One download at a time stays (begin refuses a check meanwhile); such a
check now sets again (supersede), and the feed is asked again once the
download is in, so a newer version found then takes its place. The
minute loop fetches what was left (fetchDue): "found" once downloads are
automatic, and a failed download (error with retry) after 30 minutes.
docs/subsystems/gui-shell.md has the rule (When an update downloads).
Tests: TestUpdateClockLeavesWaitingDownload, which held the old rule, is
now TestUpdateClockFetchesNewerThanWaiting; new TestUpdateFetchDue,
TestUpdateCheckDuringDownloadTakesNewer (one download in flight at most)
and TestUpdateWaitingRestartKeepsItsDownload.
Broken by hand: putting u.byClock back in the keep-staged condition
turns TestUpdateClockFetchesNewerThanWaiting red (0.1.12 out, still
0.1.11, 1 download); supersede as a no-op turns
TestUpdateCheckDuringDownloadTakesNewer red (never took 0.1.12);
fetchDue false for found turns TestUpdateFetchDue red; dropping
u.waiting turns TestUpdateWaitingRestartKeepsItsDownload red (0.1.12, 2
downloads).
Run at this tree on
|
||
|
|
93762f968a |
usage: small, idle clients fold into one Other row
WJaunita45604 on X: test runs leave dozens of randomly named clients of
~10K tokens each in the Usage page's Agents list, and the page crawls.
renderUsage draws every Agents row again at each refresh whose summary
changed, at ~0.1ms of DOM and layout a row: with 400 clients a redraw
took 30-54ms in Chromium and 45-66ms in WebKit, with 2000 136-178ms and
224-246ms (probe at 1200px, Bun/SiYuan/translate-web and N clients).
A client not hidden folds when it is past the 5 with the most tokens,
under 1% of the period's tokens, and either made no call in the last 3
days (the agent group's new `last`) or is past the top 20; two or more
fold, or none do. No setting. Other sits at the list's foot with the
folded groups' sums (usageSum), so totals stay exact, and opens with a
click, Enter or Space; open, it draws the folded rows with their own
actions 100 at a time (Show {n} more). Closed they aren't drawn at all:
with 400 or 2000 clients a redraw now fits one frame (~13-20ms in both
engines), as with none.
Run at
|
||
|
|
07dfd0bb8f |
update: a magpie stuck in its exit on Windows no longer holds the restarted one (BESTLJP0412 on X)
BESTLJP0412 on X (Windows 11 26200, 0.1.4179 to 0.1.4193, WebView2 157):
after an update's restart the window stayed "Not Responding", and a
process with a single thread sat on port 3425 and the WebView2 profile.
A Go process has several threads while it runs; one left means it is in
ExitProcess (os.Exit on Windows), which ends every other thread and then
runs each loaded DLL's detach on the last one. A detach that waits for a
thread already ended (WebView2's, COM's) never returns, so the old magpie
never ends, its handles stay open, and the new one waited its 60s
(awaitGone), went on beside it, and hung on the held port and profile.
Both ends fixed:
- the old one: cli.Main ends through endProcess, on Windows
TerminateProcess on itself instead of ExitProcess. Everything magpie
writes is written by then; the kernel closes every handle and no
detach runs.
- the new one: awaitGone's wait for the old magpie (awaitExit) looks at
its thread count every 250ms; one thread for a second is a magpie stuck
in its exit, and it is ended (opened with PROCESS_TERMINATE). This is
what fixes the update from 0.1.4193 and older, which still exit through
ExitProcess.
docs/subsystems/gui-shell.md says how a Windows restart waits and ends.
Tests (Windows, real processes; the stuck detach is a fiber-local storage
callback set to kernel32's Sleep with INFINITE, which ExitProcess runs on
its last thread and TerminateProcess doesn't):
- cli TestEndProcessSkipsAStuckDetach: first checks the stand-in is real
(os.Exit there hangs with exactly 1 thread left), then that
endProcess(3) ends with code 3. Broken by hand (TerminateProcess taken
out): red, "endProcess hung in a DLL's detach, as os.Exit does".
- update TestAwaitGoneEndsAMagpieStuckInItsExit: a predecessor stuck that
way is ended in ~1.4s. Broken by hand (the thread check skipped): red,
"the start went on after 20.022s with the old magpie still stuck".
Run:
- win-run on xiaomi-gpu (Windows 11): go test ./internal/cli ok (179s);
./internal/update all ok but TestPackagedByDpkg, red the same on
origin/main
|
||
|
|
1edebf0500 | tray: a card with more than two windows shows them all, in columns of two (jen_celeus on X) | ||
|
|
221c91fae3 |
gui: the gateway card opens the chat page
The gateway card gets a "Chat page" button beside Restart gateway while the gateway runs. It opens <gateway>/deepseek-chat/ in the browser, or, in web mode, the public URL's chat page. Both buttons sit in one .gw-acts group, so a narrow card wraps them together, and Restart keeps its .gw-fix class (the takeover, pause and port-holder tests read the first .gw-fix). The label is translated in zh, zh-TW, ja and de. Run: gateway-chat-page.test.cjs in Chromium and WebKit, every language, at 1100 and 420 wide, on mica: ok. It is red without this change (no button). At |
||
|
|
47684ef176 |
usage: a table column is what its windows are of, not their names
normalcoder_ on X: in Usage > Overview's table, Antigravity's
"Gemini · 5 hours / 7 days" landed in the last ("Other") column, since
columns were keyed by window name. That holds for every provider whose
names don't match the column keys.
columnOf keys a pooled window to its pool's column (poolWord, "Claude &
GPT" under Claude) and names the window in the cell; any other window
goes by its span (spanOf: "Weekly", "7 days" and "7d" share a column,
headed by the name most rows use, a number on a tie); a window with no
span goes by its name.
Run (mote, chromium + webkit, en zh zh-TW ja de, 1100 and 420px):
usage-account-subcards.test.cjs 40/40 here, 40/40 red on origin/main
|
||
|
|
2a6ab83d8a |
usage: each account of a provider's card is a card of its own; the ⋯ keeps its room
normalcoder_ on X (v0.1.4079, Usage > Overview): accounts inside a provider
card were told apart by a hairline only, and the card's ⋯ was drawn over
the end of the head ("Show the other accounts in brief" was hidden).
- renderQuotas puts each account of a card with several into a
.subscription-acct box (a provider's keys, a balance a line, stay
lines); quotaCardMenu looks through the box for the account's head.
- The head keeps 18px for the ⋯ whether it shows or not; where nothing
hovers, the ⋯ is always shown.
- Core budgets +57 (app.js) / +81 (core): renderQuotas draws every card,
so there is no page to move it to.
Run (mote, both engines):
- usage-card-menu-room.test.cjs: 20/20 here; red 20/20 on origin/main
|
||
|
|
cfd70c60c2 |
update: the old pill quiet ran through 0.1.4181, not 0.1.4179
Comments and docs only: v0.1.4180 and v0.1.4181 were tagged before
|
||
|
|
3f09b9ffc6 |
update: the header's Update pill shows a waiting update at once; only its x holds it, for 3 days (visamzh, normalcoder_ on X)
visamzh (0.1.4174, 0.1.4176 downloaded, Update button and Automatic updates on) and normalcoder_ (0.1.4079) saw no Update pill for about two days. Cause: |
||
|
|
90efddabae |
gui: providers can be picked and removed together (eiyuuzaki2333 on X)
Many API providers added meant removing them one at a time. Select, by
the Providers search box (shown with two or more), puts a box on every
row as Routing's groups and Library's lists have it: a click on a row
picks it rather than open its editor, Shift picks the rows shown
between, and the bar's box picks every row shown. Remove asks once, in
the app's own dialog, with the count and every name, then posts
POST /api/providers/delete {ids}. That runs provider.Delete for each
id, as the editor's Remove does, inside one agent.Reseat, so agents
move once, to where they end up. One it can't remove comes back in
`unremoved` with why, stays picked and is named in the status; the call
is refused only when nothing was removed. Done or Escape ends picking.
The rows, bar and removal are in pvpick.js, imported when Select is
first clicked. The core grows 270 bytes (pvSel, the button's click and
two lines in renderProviders), and coreScriptBudget is raised by that
with the reason. "{name} wasn't removed: {error}" moves from Library's
words into core i18n.js, since core code says it now.
Run (rebased on origin/main
|
||
|
|
1ab2c39843 |
tray: the menu bar and panel leave out what Usage's Overview hides (onkashiko on X)
onkashiko on X: a quota hidden in the main window still showed from the menu bar. |
||
|
|
61e2035d39 |
gui: a Windows start no one can answer is never asked where to install, so the gateway comes up (v0.1.4160-4166 release check)
Every magpie-releases build from v0.1.4160 to v0.1.4169 failed windows-check (amd64 and arm64) at "Launch magpie": the exe logged "magpie 0.1.4166 started (app, ...)" and the gateway never answered, so none of those versions has assets. Cause: |
||
|
|
ee6352b638 |
gui: black's dark page is #000000, and a dark colour darkens the page in its hue (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS on X (tweet 2121543612278472704), on the dark theme: 「现在的纯黑……感觉色对不上」 beside Chrome's black, and the darkest navy of the system's picker 「感觉是有浅灰存在,所以导致深变浅」. Their screenshots: black's page (2,1,7), Chrome's (0,0,0); navy #191047's page (24,23,29), card (31,30,36), the grey of Graphite's. Why (appearance.go ground()): - the dark grounds went down by the same amount on every channel, so app.css's cool grey cast stayed: black's page was #000003, its card #08080c, a blue-black next to Chrome's #000000; - how dark a pick is was its mean channel against the page's. #191047's mean (37) is above the page's (27), so a deep navy counted as light and only got a breath of hue (0.08): the same grey page as Graphite. What changes: - darkness(): a pick's OKLab lightness under 0.4 (Graphite #52525b is 0.44, every preset 0.51 or more) is how far the dark grounds go toward black; 1 for black. #191047 is 0.23, so 0.43. - as a ground goes down it loses the grey's cool cast by as much, and takes more of the pick's hue (0.08 + 0.25 x darkness). Black's page is #000000 with neutral steps above it (card #090909); navy's page is a near-black navy. - Graphite, the presets, colours lighter than 0.4 and the light theme are unchanged; lifted() (where the ink starts) is unchanged. Measured (Settings > General zh, dark, 1200px; screenshot pixels, the same in Chromium and WebKit), before -> after: - black: page #000003 -> #000000, card #08080c -> #090909 - #191047: page #191821 -> #0c0b17, card #22212a -> #151420 - #130830: page #17161e -> #0b0813, card #201f27 -> #14111c - Default, Graphite (#1a1a1e / #232327), teal, #7f1d1d: unchanged Tests: - TestDarkPickDarkensPage: black's grounds are neutral greys; three dark blues draw a darker, blue page with text >= 7:1 and the accent >= 4.4:1; Graphite and the presets have darkness 0. - TestBlackIsBlack: black's page is #000000 exactly. - appearance-look: black's dark page is rgb(0, 0, 0); #191047 draws a dark navy page with Settings' list on its card (dark), and keeps the light page's lightness (light). Fixture gains #191047. Run on mote (load ~22-35 over its 18 cores; mica's disk is full, 116MB free), at this change on origin/main |
||
|
|
14807bcf20 |
update: a Windows download kept outside Downloads asks to install too
@XBJNTMs2mDbsvPH on X: on Windows magpie ran from wherever the
downloaded exe was and updated itself in place there, so deleting the
download deleted magpie, and opening copies of different versions left
several Magpie entries in the Start menu.
Cause: update.Settle installed the exe into %LOCALAPPDATA%\Programs\magpie
only when it ran from the known Downloads or Desktop folder or a temp
folder. A browser set to save elsewhere (D:\下载), or a download moved
into a folder of the user's own, never counted, so that copy stayed the
app, updated in place, and each copy opened was an app of its own to
Windows (its own path: taskbar, Start's lists, Open at login,
Magpie.lnk repointed at whichever ran last).
Now an exe still named as the site's download
(magpie-windows-amd64.exe, "… (1).exe", arm64; downloadName) counts as a
download wherever it is, but only through the existing install dialog,
never unasked (no dialog, no install). Installed, it opens the installed
copy as a download in Downloads does, and a newer one replaces it.
Cancel on such a copy is kept in HKCU\Software\magpie NotInstalled (the
exe's path): it runs where it is from then on, is not asked again and
never forwards; another copy is still asked. Cancel in Downloads is not
recorded, as before. forwards() (no magpie.com beside a forwarding
copy) follows the same rule. Uninstall's ForgetInstallDir takes the new
value out with InstallLocation. A renamed copy (D:\Tools\magpie.exe)
is left alone as before. No new UI: the dialog is the one from
|
||
|
|
7ea1e6a4b3 |
usage: the tray panel and the TUI leave out what the Usage page hides
onkashiko on X: a provider whose allowance card was hidden in the main
window (Usage > Overview, "Hide from Overview") still showed in the menu
bar's panel. The panel's Allowances tab had only its own Arrange list
(panelUsageHidden) and read the full cards.
Now the panel leaves out a card whose cardHideKey is in usageCardsHidden
and the rows in usageWindowsHidden (withoutHiddenRows), as Overview does;
a menu bar cell's card still shows (panelPeek). A subscription whose
every card the page hides counts in the foot's "{n} hidden" and shows as
hidden in Arrange; Show there
also drops its keys from usageCardsHidden, since the panel follows the
page. All of it is panelPageCut in the Usage plugin's page.js, which every
window loads, so the core scripts get no bigger (TestCoreScriptBudget
unchanged). Hiding from the panel alone still leaves the page as it is. The
panel reads settings again each time it is shown (loadBack), so a hide or
unhide in the main window reaches it with no restart.
Siblings: magpie tui's Usage page leaves out the same cards and rows
(usageShown, read at every quota read). The menu bar's cells and tooltip
show only the cards picked in Settings, so they keep a hidden card as
before; routing, caps and counting are unchanged.
Run:
- panel-page-hidden.test.cjs (new): chromium + webkit, en/zh/zh-TW/ja/de,
10/10 green; red on the old app.js/panelarrange.js (cards still drawn).
- TestUsagePageLeavesOutWhatTheAppHides (new): green; red on the old
pages.go (balance, account and row still listed).
- GUI: the 128 files that read the panel, Usage or tray code, chromium +
webkit, every language, on mote: 17 files red, rerun alone at
concurrency 1 here 123/449 red and at origin/main
|
||
|
|
90ad90646a |
gui: black draws a black dark theme, not Graphite's grey (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS, on v0.1.4124 (tweet 2121468612238266666), with three dark-theme screenshots of Settings > General, one each with Default, Graphite and a custom black picked: 「这三个颜色……都显示是一样的」, 「尤其是黑色始终一直是灰色」. Their screenshots show the same page in all three: ground (25,25,27), card (32,32,34). Why: - v0.1.4124 tints the grounds with the pick's hue only (base + k*(c - mean(c))), lightness kept. Black and Graphite have no hue, so they changed nothing. Default draws no look at all (magpie's own). - accentOn lifts a dark pick toward white only until it reads at 4.5:1, so black's dark ink came out #8a8a8a, next to Graphite's #89898f. What changes (appearance.go): - ground(): on the dark theme, a pick darker than the theme's background darkens every dark ground by as much (depth()). Black draws a black page (#000003), with cards, pills, lines, menus and the tray panel the same steps above it as in app.css (card #08080c, line #18181e). Graphite, and any colour as light as the ground, draw as before. - lifted(): black's ink starts most of the way to white, so it is a light mono ink (#e0e0e0, dark text on its buttons), not Graphite's grey. On the light theme black is #000000, as before. The sibling, white on the light theme, now gets a dark ink instead of a mid grey. - The light theme's grounds keep their lightness: a white pick would melt its white cards into the page. - app.css: a swatch's edge and the chosen ring take a little of the text's ink, so the black swatch stays seen on the black page it draws. - Default stays magpie's own look (grey grounds, indigo accent) for every user. Not changed here. Tests: - TestBlackIsBlack: black's dark page is black and each ground keeps its step; Graphite moves nothing; black's ink is light in dark (>= 1.8:1 from Graphite's) and #000000 in light; white's light ink is dark; text reads >= 7:1 on black's grounds. - appearance-look.test.cjs: "Default, Graphite and black are three looks", light and dark, both engines: three different --accent values; Graphite keeps the grey page; in dark, black's page is black, Settings' list sits on black's card a step above it, its ink is light; in light, black is #000000 ink. - TestLookFixture's fixture gains #000000 and #52525b. Run on mote (mote was unreachable for ~20 minutes; the red check ran on mica), at this commit rebased on origin/main |
||
|
|
27c998aba0 |
usage: the tray panel's and Requests' costs follow each provider's currency
onkashiko on X: with Currency set to By provider, the menu bar panel still showed every cost in one currency; providers and models were not each in their own. drawLedColumns and drawLedRank (shared by the tray panel and the window's Requests tab) formatted every value with no provider, so fmtCost fell back to the Totals in currency. - usageapi.Ledger echoes the provider a page is filtered to (`provider`, omitempty). - app.js: ledProv(l, split, id) names the provider of a value: the ledger's filter, the row's provider (provider split), the provider part of a modelAt id, or for a model split the provider(s) that served it when they all share a currency. ledFormat/ledFormatLong take it, so the rank's values and sub-lines, the tooltip's rows and the axis (when one provider is picked) are in that provider's currency. Sums (the panel total, the tooltip total, a model served in two currencies) stay in the Totals in currency. - page.js: the Requests head and the cost head use the filter's provider; the heatmap tip too. Other fmtCost calls are sums or sessions with no provider and are unchanged. - core script budget +491 (1,269,040 -> 1,269,531): drawLedColumns and drawLedRank are drawn by the panel, so there is no lazy page to move this to; packed to the shortest form. - docs/subsystems/gui-shell.md says how By provider reaches the panel. Run: - At 065fb6a8b (rebased on |
||
|
|
74c94b5db0 |
gui: a picked accent tints the theme's grounds (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS asked, on 0.1.4112 and again on 0.1.4116 ("依然没变,是不是
出bug了"), for the dark theme to follow the colour they picked. v0.1.4114
(
|
||
|
|
ed63a5be5e |
gui: a picked accent colours what is chosen (CHENGJIAHEGOXIS on X)
「选中任意强调色没反应」: picking an accent in Settings › General seemed
to do nothing. The token did apply. With the real server, in Chromium
and WebKit, under light, dark and system, with and without a background
image, --accent was set by lookCSS and kept. Neither the theme nor the
wallpaper overrode it. But nothing on Settings, the sidebar, the header
tabs or the panel's tabs used --accent: every chosen option is graphite,
var(--fg), by design. So the colour only showed in a few buttons
elsewhere.
The fix is a --mark token, the ink of what is chosen.
- It is var(--fg) by default, so magpie's own look is unchanged, like a
Mac's Graphite.
- accentVars sets it once the user picks an accent. It is moved toward
black (light) or white (dark) until it reads at 4.5:1 on the surfaces a
chosen option sits on: --pill-hover #e9e9ee, and the dark switch thumb
#4c4c52.
- It is used by .seg/.opt/.ptabs/.warm-tabs/.am-seg/.klf-tab/.day-chip/
.apptab .on, the header nav's chosen tab, the side-nav's open-page icon
and Settings icon, and Library's switches and radios. Each is the same
"chosen" role, so all of them follow the accent, not just one.
Tests:
- appearance_test.go's TestAccentReadable checks --mark's contrast on
each surface, in both themes.
- appearance-look.test.cjs adds 8 tests, in Chromium and WebKit, light
and dark:
- Settings' theme and bird options and the side-nav icon at 1200 with a
wallpaper set: graphite by default, the mark for #0d9488 and #db2777,
and back to graphite on Default.
- The header tabs at 900 and the panel's tabs at 380.
Run:
- gofmt clean. go vet ok on darwin, GOOS=linux -tags nogui and
GOOS=windows (at 75bdc85fe, the same change on an older main).
- At 6f5549b1f (this change on
|
||
|
|
817d35ffa9 |
usage: a window's whole follows the tokens pick's With cache (Anotiaww on X)
@Anotiaww asked (X 2121248031983194214) that the account cards' "Whole ≈ N tokens" on Usage → Overview follow the page's tokens pick. With cache, it now adds the window's routed cache read and written, scaled by the same share used as the input and output; the line reads "Whole ≈ N tokens with cache" and its tooltip says cache is included. Without cache nothing changes. Changing the pick redraws the cards. The tray panel shows no holds line, so it has nothing to follow. holdsLine and holdsUnknownLine move from app.js into the Usage plugin's page.js, beside usageWithCache, so the core script budget stays as it is (it had 14 bytes left). quotaWindows still calls them as globals. New words are said in zh, zh-TW, ja and de. Run (mica, both engines, every language): - quota-holds, i18n-keys, i18n-en-no-cjk: 16/16 ok. The new quota-holds test (pick With cache at 360 and 1000px, reload keeps it, pick back) went red in both engines with the cache left out and the old words, and again with no redraw on pick. - 185 GUI files that reach Usage or quotas, plus mobile-web, idle-ticks, old-webkit and every i18n file, concurrency 3. Reds: account-eye, account-mask, account-refresh-holds, claude-quota-onboarding, codex-auto-reset (de), key-balance-card (de), menu-scroll, mobile-web, old-webkit, quota-count-wrap. The same files are red at the base |
||
|
|
5211fd3ba2 |
usage: a currency "By provider" shows each provider's costs in what it sells in
onkashiko on X: DeepSeek, Kimi (China), Zhipu and other domestic vendors
price in yuan, the rest in dollars, and one currency for every cost made
the Usage page read wrong for half of them.
Settings > Usage > Currency gains a third choice, By provider. With it,
a figure of one provider's calls (a model's, an account's, a key's row,
a request, a routing try, a quota card's whole) shows in the currency
that provider sells in, and every sum across providers (the total,
agents, sessions, charts, the tray, Bark's daily, the day page) in the
currency a "Totals in" row picks, a row shown only while By provider is
chosen. GUI, TUI and CLI agree. Costs stay stored in dollars; only the
display converts, at the live rate (internal/fx).
Which providers sell in yuan (provider.PricesInYuan): a .cn host; a
preset at its own site that is a yuan preset (deepseek, zhipu,
volcengine, tencent-cloud, bailian, siliconflow…), ends in -cn, or is in
its China region; a plugin id ending in -cn; a provider of one's own
with a yuan models.dev catalog served at that catalog's site. A relay
made from DeepSeek's preset, Z.ai, Kimi's and MiniMax's international
endpoints stay in dollars: they share a catalog with their Chinese
twins, so the catalog alone can't tell.
Known limit: models.dev has only dollar prices (converted from the
vendors' yuan at ~6.7-7.0), so a yuan figure is that dollar price at
today's rate and can differ a few percent from the vendor's own list.
A second ask from onkashiko: set the currency of the menu bar and of
the totals apart, sums converted by themselves.
So Settings > Usage also gains an Advanced fold (closed by default, open while
set) with one row, Menu bar currency: Same as totals (the default), $ or
¥ (settings.TrayCurrency, TrayCostIn). It sets the menu bar's totals
cards and the tray tooltip's cost; the Usage page, the panel, the TUI,
the CLI and Bark's daily message stay in the totals' currency
(totalsCurrency). Like the other menu bar settings it stays on this
computer (KeepOwn). Every sum is still made in dollars and converted
once, at the live rate, so a mixed-currency total is never added up
from yuan and dollars.
Settings' currency rows (Currency, Totals in, Menu bar currency and the
rate in the tooltip) moved out of app.js into currencyprefs.js, imported
when Settings draws its usage prefs, and costInYuan is packed: the core
is 3 bytes under coreScriptBudget, with no raise.
Run:
- go test -count=1 at this tree on mote: internal/settings,
settingsapi, tui, cli, catalog, provider, fx and gui all ok
(TestCoreScriptBudget included). The full go test ./... and the whole
GUI suite are queued behind other sessions' suites on suite.lock
(mote and mica, load 35 and 60) and had not started at push.
- GUI files at this tree (mica): currency-provider, currency, i18n-keys,
i18n-en-no-cjk, tray-cost, tray-totals, every settings-*, old-webkit:
362 pass, 28 red. Every red is red the same at origin/main
|
||
|
|
a65dade2e3 |
gui: an accent colour of your own and a picture behind the pages (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS asked for colours beyond the three themes and for a local picture. Settings › General gains two rows under Appearance: - Accent color: magpie's own, six quiet presets (Blue, Teal, Green, Orange, Pink, Graphite) and a swatch that opens the system's colour picker. Saved as settings.accent (#rrggbb only, checked in saveOwn; `magpie settings set accent "#0d9488"` works through settingsapi.Keys). The server draws it (appearance.go accentVars): darkened on the light theme and lightened on the dark one until it reads as text at 4.5:1 on the background and cards, with white or near-black text on it, whichever reads better. Never under Omarchy, whose theme is the look. - Background image: Choose… takes a PNG, JPEG, GIF or WebP of 16 MB at most, sent as base64 JSON to POST /api/appearance/wallpaper, saved as `wallpaper` in magpie's folder (edit.WriteAtomic); settings.Wallpaper is its stamp. A thumbnail, Change and Remove show; Remove deletes the file. It is drawn behind the window's pages (never the tray panel) under a veil of the theme's background at 84%, so text reads as on the plain page; the cards stay opaque, and body's colour stays the theme's, which Windows' title bar tint reads. boot.js puts the look's stylesheet in before the first paint and says which look it drew (bootPrefs.look); applyPrefs asks /api/appearance/css only when the settings' look differs. The rows, with the Colorblind, Reduce motion and Loading bird rows, are drawn by appearance.js, imported when Settings draws, so the core scripts stay under their budgets with no raise (app.js 2,393 under, the core 503 under). A save of Settings that doesn't send accent keeps it (Merge guard), and the wallpaper stamp is kept by every Settings save. fonts.test.cjs: the two new rows push the font row to the foot of its 560×620 window, where Playwright's click scrolled it in by a pixel and the test read that as the page moving; the reader now scrolls it in first with the wheel. settings_keep_test sets Wallpaper; the three /api/appearance routes are named in the CLI parity test's notYet. Run (mote, at this change on origin/main 406ad72f1; after the rebase on |
||
|
|
ac1702c330 |
library: the first part of a skill group opens below its heading, not over it (jinpwng on X)
jinpwng on X (macOS, Chinese UI): in Library > Skills, opening the first group made the page jump, and what was clicked went off the screen; the others opened downwards. The group was the first part of a big group (a repository split by folder, drawn in the group's windowed list). A click on a part's heading draws it anew, and the first part's only neighbour above it is the list's zero-height pad, which the click's hold passes over. So the page held the next part's heading, the rows opened pushed it down, and the view scrolled by the whole part: the clicked heading went from 152 to -920. A part's heading is now data-unrolls, so the hold keeps its list, whose top doesn't move. Top-level groups, projects and the Instructions agents already held still; the new test guards them too. library-group-steady.test.cjs opens and folds, at the top and scrolled: the Skills groups and the big group's parts (first and second, and the first with the second open), the projects in Skills, MCP and Subagents (first and third), and two Instructions agents. Each heading must stay within 1.5px of where it was clicked. Clicks and scrolls go through page.mouse, since Playwright's own scroll before a click reads as the reader's. Run (mica, mica-run), at base |
||
|
|
870a9e0fe1 |
gui: the Windows tray panel stays where it opened, no jump left (jiangshangmuyun on X)
On Windows the panel opened flush against the right edge and, a moment later, moved a fair way left. The tray placed it as it opened (ToggleWindow -> PositionWindow), and every refit after that placed it by the icon again: fitPanel, each glidePanel step (stepGlide in glide_other.go) and zoomWindows all called tray.PositionWindow. Wails centres the panel on the icon only when Shell_NotifyIconGetRect's rect is inside the taskbar, and flush right otherwise. An icon clicked in Windows 11's overflow flyout isn't in the taskbar as the panel opens, so it went flush right; the page's first fit, once the flyout had closed, read the flyout's arrow and centred the panel over that. Now every refit of the open panel goes through sizeOpenPanel. On Windows it keeps the place the tray gave it as it opened: the centre and the edge by the taskbar held, kept inside the work area (panelRefit, one SetBounds). The Mac and Linux keep SetSize then PositionWindow, as before, in the same order. Run: - gofmt -l; go vet ./internal/gui ./internal/agent on darwin, linux (-tags nogui) and windows, on mote. - go test -count=1 ./internal/gui ./internal/agent on mote: ok (145s, 250s). - win-run on xiaomi-gpu: TestPanel*, TestOpenPanel*: ok. Broken by hand (win-run, ../tray-jump-scratch/break.log): - panelRefit holding the top edge in place of the taskbar's: TestPanelRefitKeepsItsPlace red in 4 cases. - sizeOpenPanel taking the old path on Windows too, and app.go at its base (PositionWindow in fitPanel and zoomWindows): TestOpenPanelRefitsInPlaceOnWindows red each time. Not tried: the real tray click on xiaomi-gpu. Nobody is signed in there (query user: no users, LogonUI up, no explorer), so no tray exists to click and the panel's moves couldn't be watched; the cause above is read from Wails beta.24's systemtray_windows.go positionWindow. No GUI (Playwright) file reaches this: the change is in Go, not the page. |
||
|
|
8097860ab1 |
gui: put back what 76ceff87c took out of main by mistake
|
||
|
|
76ceff87c9 |
usage: a number of hours the reader sets, beside the calendar (eachg0 on X)
The range menu behind Custom has a top row, "[N] hours back". Enter asks the Usage page for the rolling window last:Nh (1 to 720), which the backend already answers for every view (totals, chart, models, accounts, Requests); the chip reads "Last 30 hours". The pick and N are kept on this device (magpie.usagePeriod, magpie.usageHours). 24 stays the preset's chip, and an empty page, the credit days and the menu-bar way in know the new period. zh, zh-TW, ja, de strings added. Run (mote, at the rebased head): usage-hours, usage-24h, i18n-keys in chromium and webkit, en and zh. Broken by hand: keptPeriod limited to the presets turned usage-hours red (expected last:30h, got today). Not tried: the whole GUI suite (queued on mote's suite.lock behind other sessions, still running), narrow widths by hand, the tray panel (it has no 24h chip and is unchanged). |
||
|
|
7c37424fcf |
gui: the Linux app draws without backdrop blur, which WebKitGTK repaints on the CPU each frame (Lsheng2012 on X)
Lsheng2012 (CachyOS, KDE, i7-12700H, RTX 3070 Ti Laptop) found the UI laggy. webkit_linux.go turns accelerated compositing off under Wayland and without a GPU, and there every backdrop-filter is software-painted for its whole box each frame. body.linux now drops it on .modal, .pop, the panel's profile chips, Settings' sticky head and the confirm ::backdrop. Layout unchanged. Measured (WebKitGTK 2.52.6, Xvfb on magpie-desktop, 240 rAF scroll frames of 600 rows, 1100x760): no blur 16.2ms, sticky head blur 16.2ms, full-window modal blur(8px) 25.0ms with compositing off (16.4ms with it on). Run: linux-no-backdrop-blur.test.cjs in chromium and webkit on mote (green; red with the rule removed by hand), go test ./internal/gui asset tests. Not tried: NVIDIA, Wayland/KDE, the omarchy VM, a full suite. The sticky head cost nothing in the probe, so the modal is the measured gain; if the reporter is still laggy the cause is elsewhere (CPU painting at HiDPI), and we ask for their session type, driver and version. |
||
|
|
6edf7a69e5 |
usage: hide and show single quota rows of an Overview card (wangshaowei39 on X)
Antigravity's card lists Claude & GPT, Gemini and more. A row group can now be
hidden from Usage > Overview the way a card can: right-click or long-press a
row, or use the card's "..." menu, and choose "Hide <group> from Overview". The
"Hidden" line under the cards lists hidden cards and rows with an Unhide button
and Show all. The last group of a card cannot be hidden (use the card's own
hide). Persisted as settings usageWindowsHidden ("<card>|<group>"), changed
through /api/usage/arrange { windowsHidden } and kept by the Settings save.
Table view and tray panel are untouched.
Run (on mote):
- go test: TestUsageArrange*, TestUsageArrangeWindowsHidden (new), TestSettingsSave*,
settings_keep guard, TestCoreScriptBudget, ./internal/settings, ./internal/settingsapi;
gofmt clean; go vet darwin, linux nogui, windows.
- GUI, chromium and webkit: usage-rows-hide (new, 5 languages x 1200/560/390;
32/32), usage-card-more 32/32, usage-arrange, usage-all-accounts 24/24,
i18n-keys 4/4.
- usage-cards-hide and usage-hidden-way-back: "de 560" red (no sideways scroll
635 vs 560); the same red on a clean origin/main
|
||
|
|
36eebea136 |
update: the header's Update pill waits until it is news (certhon520, jkd6688, Yuyuaneth, milianxinqi on X)
A release comes every few minutes, so a downloaded update was always
waiting and the pill (window and tray panel) never went out. /api/update
now says "quiet" while this version has been behind for less than 3 days
(update.Quiet, the Stable channel's soak; counted from the first newer
version seen, kept in update-behind.json for the version running), and the
pill stays away. An urgent release ("**Urgent release:**" in the latest's
notes or any release between, fetched once per check) lights it at once and
a dismissal does not hide it. The x dismissal now also starts the quiet over,
so the pill is not back with the next release. Settings > Version, the tray's
Restart to update, quit and Restart automatically are unchanged. Plugins'
dot is for plugins that do not update by themselves; left alone.
Run (mote): go test ./internal/update (ok), go test -run Update|Asset|Budget|Script ./internal/gui (ok),
gofmt, go vet darwin / linux nogui / windows clean, update-quiet.test.cjs 21/21 in chromium and
webkit across en, zh, zh-TW, ja, de, panel and window. Broken by hand: dropping
!u.quiet in app.js (11 red), forcing Quiet=false in jsonIn (TestUpdateQuietUntilBehindAWhile red).
Not tried: a real 3-day wait, and the urgent range lookup against the live site.
|
||
|
|
c14fa0ce93 |
Bring back 919780414 and 88d2962e0, which 698ed4adb undid
|
||
|
|
698ed4adb5 |
gateway: a busy port names the program holding it, and Tailscale's serve gets its fix (pluoki on X)
The Gateway page, `magpie serve` and the app log said only "port N is held by another program". pluoki's was `tailscale serve` on the same port number. proc.PortHolder reads the holder (lsof on the Mac, /proc on Linux, Get-NetTCPConnection on Windows). Tailscale's daemon is root's and often unreadable, so `tailscale serve status --json` is the fallback for the port. gateway.NoteHeld / PortHeld.Sentence say who holds it, and for Tailscale give `tailscale serve --https=<other> http://127.0.0.1:<port>`. Shown in the `magpie serve` standby line and bind error, the app log, `gatewayHeld` in /api/state (Gateway page) and Start's "taken" answer, in en, zh, zh-TW, ja, de. A holder that can't be read says nothing; the old wording stands. Nothing is killed or touched. Run: gofmt clean; go vet darwin, linux nogui, windows (mica); go test ./internal/proc ok; targeted holder/gateway tests on macOS (mica), Windows (win-run) and Linux (wsl-run); parser tests with real lsof output; GUI gateway-port-holder, gateway-takeover, gateway-older, gateway-skew, gateway-port, i18n-keys, i18n-en-no-cjk in chromium and webkit. Real run on WSL: a holder named tailscaled on the LAN address with magpie on 0.0.0.0 gives the Tailscale sentence at the bind error; a Python holder on loopback gives "held by python3.12 (pid N)". Broken by hand: each fix reverted in turn, its test went red. gateway-card.test.cjs is red on origin/main too (#6029). internal/gateway, gui and cli package runs were still going at push; the full suite follows the tag. Not tried: a real `tailscale serve` (changes live config), a real Windows holder end to end, the bind-error path on macOS (a wildcard bind coexists with a specific one there). |