ac4af582301a4e8a29245dbba767eba31334ddf9
8
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
80ae904c23 |
routing: routing groups get a page of their own, beside Routing
The owner asked for the groups to leave the Routing page (11-06): under the live stage and every request they were a long scroll down, and New group with them. The design was reviewed before this was built. - New page, Routing groups (#view-groups), drawn by the routing plugin's same script (routingPage), so the editor, its dirty/discard and every group action are unchanged. Toolbar: filter, "N groups · M on", Templates, Import, Select, and New group as the filled button. The list is right under it, and a Settings section under the list holds Found groups (with Exclude providers…) and Names in agents' lists. - No Export button: each group already has its own Copy to share. - Routing keeps the live stage and the requests. A request's group opens the groups page at its row. - The sidebar has a Routing groups tab right after Routing (from 1024 points). The header's row has no room for one: at 860px the extra tab pushed the logo out (brand.test). There the tab is hidden, Routing's tab is lit for both pages (markNav), and Routing's head has a "Routing groups ›" button, hidden beside the sidebar. - Every way in now goes to the groups page: the guide's Open routing groups, the panel's and the provider editor's Make a routing group (window/main?view=groups&newgroup=…). mainView still takes view=routing&newgroup from an older panel. - Words: "Routing groups", "Open routing groups", "Once saved, make a group of them in Routing groups.", and the editor's names note now says the setting is under the list, in zh, zh-TW, ja and de. "Open Routing" stays for the Agents page's button. - Docs: providers-accounts, gateway-routing, plugin-runtime, gui-shell and reference say "Routing groups page" where they mean the groups. - Core budget: the core's scripts are 1,533,774 of 1,533,802, paid for by three show()/setGatewayMode comments cut in app.js. No raise. Tests: routing-groups-page.test.cjs (new) covers the page in Chromium and WebKit, en/zh/zh-TW/ja/de, at 1280, 640 (window) and 420 (web): no groups on Routing, the tab or the head's button by width, the lit tab, toolbar order, New group primary and in sight, list then Settings, no sideways scroll, no native select, no left-border accent; a request's group to its row; quotas redrawn with an open editor left alone. The trace tests (routing-compact, -pause-folder, -rule-models, -folder) open Routing, then show the groups; routing-editor-foot and name-suffix-where-named scroll by wheel, as the scroll guard lets a reader; builtins expects the groups tab beside the sidebar only. Removed: routing-groups-jump (the head's "Routing groups ↓" that scrolled down to them, gone with them), routing-pointer-pin and routing-steady (the groups kept in place under requests streaming in above them: no request is above them now). Their guarantee that what redraws leaves an open editor and its typing alone is routing-groups-page's quotas case; Routing's own lists keep their keepInView. The groups page's jump: a request's group, or a pool's "Several keys" chip, opened the groups page and scrolled the row to the centre, and the next frame show()'s backAfterLoad put the page back where the reader last left it, then brought the focused segment in by "nearest": in WebKit the pool sat half under the window's foot (routing-mode-goes, 9 of its 10 WebKit cases). goRouting now jumps at once on a page it opens and marks it arrived(). The wheel in routing-many-keys turns over the keys: at the page's foot, now shorter, the mouse rested over the requests list (.rt-reqs, overscroll-behavior: contain), which took every wheel up, and the test stopped with 2 keys in sight. That is #4082's cause. routing-days-fit's fixture has 12 requests, a day that fills the window, since the day bar held needs room under it. Run on mote (macOS 27, load 25 to 65), Playwright 1.62.0: - Go: go vet, gofmt -l and go test ./... at the rebased head ( |
||
|
|
d1b0b34430 |
gui tests: sidebar's unroll is counted as its animations are made
"the list opens and folds as it plays" sampled getAnimations() once after the click to see the list's unroll still playing. Under a machine load of ~175 that one sample landed after the whole play was over: a finished animation is out of getAnimations(), so the test read "not animating" and went red once (8be402816's GUI run; it passed on rerun). The list unrolls for 460 ms and its rows come one after another for 636 ms in all - the round trip from the click through the element wait to that one sample is not bound to that window. The animations made are counted instead: Element.prototype.animate is wrapped ahead of the click, and the assert reads that the nav-sub's own unroll was among them. An animation made is a fact that stays put, so the sampling race is gone. The assert is not looser: an opening with no animation still fails it. Run (playwright 1.62.0, idle machine): - this file: 10 runs, 160/160 ok (Chromium and WebKit) - nav-sub-unroll, sidebar-glide and sidebar-tab-top together: 2 runs, 136/136 ok - a 700 ms wait put between the click and the old sample turned it red with the reported "the list unrolls" assertion; with this change the same wait passes, and cutting navSubEnter's animations off turns it red again Not tried: a machine at load ~175 (the load figure is the report's; the delay injection stands in for it). Siblings: provider-advanced-fold's boxMoves() reads getAnimations() once after its own click the same way; it has no observed red, so it stays as it is. Fixes #2950 Generated-by: GLM-5.3-Flash (ZCode) Review (at the pushed head, mote, playwright 1.62.0): agent-expand-steady, sidebar and lightweight together, Chromium and WebKit, 30/30 ok. navSubEnter animates the nav-sub box itself, so the wrapped animate sees it. The sibling named above is filed as #5417. |
||
|
|
ce8b67de37 |
gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called page.goto with no timeout of its own, so Playwright held the first load of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a busy box (a whole-suite run at load 130-160) that load took longer and goto timed out. The same pattern is in 988 GUI test files (1174 pages): every one of them now also sets setDefaultNavigationTimeout(60000) on the same page, right after its default, so goto, reload and waitForURL wait on the load itself with room, while clicks and waits keep their short bar. group-from-model-add's own 20s navigation bar is raised to the same minute. claude-switch-only also gives its first provider row (drawn from the page's first reads) a minute before clicking it. nav-timeout.test.cjs (no browser) reads every GUI test file and names each page given a default under a minute without a navigation timeout of at least a minute, so a new file can't bring the pattern back. What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from other sessions): - node --check on every file in internal/gui/tests: all parse. - nav-timeout.test.cjs against origin/main's test files: red (names the 1174 pages); against this tree: its only reds were my own probe copies of the old files, since removed. - By hand: claude-switch-only with app.js served 7s late (a busy box's first load), --test-name-pattern "1100 en": origin/main's file 4 of 4 red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green. - claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420: 32 of 32. group-from-model-add, usage-access-key-card and i18n-keys: green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red on a 5s waitForFunction at line 115 (a wait after load, not the navigation), at load ~230. Not tried: the whole GUI suite (about 1000 files; the change is one mechanical line per page), Windows or mote (mote's browsers, #4125). |
||
|
|
95a4180c0b |
gui tests: the sidebar lists expect Masking's tab, and Built-in wheels to rows it can reach (#3498)
|
||
|
|
6874095b15 |
gui: the sidebar's gateway line is drawn from boot.js, before the providers' read (#3429, chiperman)
After a refresh the sidebar's gateway line came in about 1.5s late: it
was drawn only by sideGwRead, which waits 1500ms before it reads
/api/providers. chiperman's commit (c1f457a1b) has boot.js carry where
this process's gateway listens, and app.js draw it at once. Ported with
changes:
- api.go puts sideGateway in boot.js only when this process serves the
gateway (served.Load() != nil), with the URL from gateway.URL(), the
one /api/providers reports, and marked boot. Another magpie serving
the port: nothing is sent, and the providers read decides as before.
- app.js starts sideGwAt from boot.js, so the first layoutNav draws it;
chiperman's separate renderSideGwBoot is folded into that. A value
from boot.js is read again at 1500ms like before, so /api/providers
has the last word: served is set before the listen succeeds, so a
listen that failed, or a gateway stopped since, shows "Gateway
stopped" then. Without the re-read the boot line could stay stale.
- app.js is 45 bytes under its budget, which is unchanged.
Not fixed here, and pre-existing on main: Settings' address Apply leaves
the line on the old port until a reload (#3531). Seen in real sandbox
apps on main (3483 -> 3486) and with this change (3481 -> 3485).
Tests: TestBootSaysWhereItsGatewayListens (gui) checks boot.js's
sideGateway for 127.0.0.1:3481 and for 0.0.0.0:3483 shown as 127.0.0.1,
and none when this process doesn't serve. sidebar.test.cjs gets the
line from boot.js before any providers read, and a new subtest: the
boot.js line for 3425 is read again and turns to "Gateway stopped" on
3490 once providers says so, with one read.
Run on origin/main
|
||
|
|
17a2b00efb |
gui: the sidebar's open page moves from row to row on a spring, as iOS's selection does
The owner asked for the sidebar's pages (Providers, Routing, Gateway…) to slide from one to the next like their sub-tabs do, "like iOS". The open page's row is now marked by one shape (.nav-top-hl) that navTopGo moves on a damped spring (NAV_SPRING: SwiftUI's response 0.42s, damping 0.84; navTopStep, four sub-steps a frame, dt capped): - it sets off as the row is pressed, and comes back if the press leaves the row or the page refuses to be left; - being physics, a press that changes its mind turns it with the speed it has, never a jump; - it follows its row while Usage's tab list folds above it and lands where the row ends up; - it is put in place, not sent, when the window opens on a kept page or the rows move under it at rest (ResizeObserver); away while Settings is open, it fades back in on its row; reduced motion jumps; the header's tabs keep their .thumb and draw none. The rows give up their own ground (open, hovered, pressed) to it. #nav is position: relative in the sidebar for it, so .seg's centring left/top are reset (without that the whole list sat 105px right). Tests: - sidebar-glide.test.cjs (new): Chromium + WebKit, en + zh, 1024 and 1440, plus 900 (header): at rest on its row and the list in the sidebar, no ground hovered, press sets off before release and comes back off the row, Providers→Usage→Agents by frames (≥3 moving frames, overshoot < 3px) landing on the row, Settings hides it and Routing brings it back, reduced motion jumps, no page errors. Broken by hand: without the left/top reset the list check goes red; before the "not seen yet" rule the boot slid from Agents (red). - sidebar.test.cjs: a pressed page row no longer darkens itself (the shape comes to it); Settings still must. - routing-idle-frame.test.cjs counted every self-asking rAF callback as Routing's loop, so navTopStep after the click read as 33 Routing frames. It now counts only callbacks no global holds (app.js's are globals; Routing's frame is in its plugin's scope). Broken by hand: Routing's loop made to always ask again → 4 red; green on main's assets and on this change. - TestCoreScriptBudget: app.js 1,343,324 / core 1,535,084 with no room added; the sidebar is the window's shell, not a page a plugin can take. Run: - Full GUI suite at 183fa169b (this change on |
||
|
|
92fbabb47e |
gui: the Providers page draws the last list at once and the fresh one behind it
#1519 (fatkun): the Providers page asked /api/providers each time it opened, and after a start that read takes seconds (every account's sign-in, every agent's model), so the page showed skeletons that long. Now, as the Agents page draws the last state: - the app reads /api/providers once in the background after the start (prefetchProviders), and the page's first opening uses that read, or waits on it, instead of asking again. The sidebar's gateway line reuses the same read (sideGwRead), so a start still makes one read. - the server keeps the list it last built in the cache folder (providers-state.json, 0600; lastproviders.go) without the gateway's recent calls and lanes or any provider's headers, proxy or extra body. /api/providers?last=1 serves it at once; the page draws it while the fresh read is out, and the fresh one replaces it. - a row clicked on a kept list waits for the fresh one rather than opening an editor that would be drawn again under the reader's hands. Tests: - TestLastKnownProviders (internal/gui): red when the stripping of Headers/Proxy was broken by hand ("the kept list holds hdr-secret-1519 / proxy-secret-1519"), green restored. - providers-last-known.test.cjs (new): the kept list drawn before the fresh read answers, then replaced; a row click waits. With kept.last = false by hand the row-click case was red in all 5 languages. - sidebar.test.cjs: the narrow case now guards one /api/providers read in total, still one after widening to 1200px (the sidebar reuses it). Red on the old assets (0 reads), green on the new, both engines. Run: go test -timeout 45m ./internal/gui ok github.com/yetone/magpie/internal/gui 528.667s gofmt -l internal/: nothing; go vet ./internal/gui, GOOS=linux and GOOS=windows go vet -tags nogui ./...: exit 0 GUI, chromium and webkit, every language, wide and narrow: providers-last-known 20/20, sidebar 8/8, provider-proxy 4/4, agents-last-known 3/3, last-page 1/1 in each engine. provider-advanced-fold: 1-3 of 25 red per run, the same on the old assets (#2552). Chromium full GUI suite (before the kept.last and sidebar-test edits), under load ~200: 5681 tests, 55 red in 23 files; each was rerun alone and either passed or was as red on the old assets. routing-model-rest runs, old vs new: old 4, 2, 7 red, new 3, 3 red; routing-request- metrics two runs: old 1, 0 red, new 0, 2 red, each red at 23-29s (load ~240; the same test red on old). Not verified: a real cold start on Windows; the webkit full suite (59 provider/sidebar/start files run: 516 tests, the reds there pass alone or are #1863). |
||
|
|
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 |