Repository navigation
gui: make the Routing context lazy and align wide cards - #1354
Conversation
1567381 to
1e32de9
Compare
1e32de9 to
c212c56
Compare
|
Sorry this took so long to get a review. Thank you for the careful write-up and the before/after evidence. Reviewed at head It no longer merges. Since your base The The product call. The owner has delegated these decisions, so here it is:
The simplest way forward would be two PRs, each rebased on current main:
I'll review both with the Routing GUI tests in Chromium and WebKit, in every language, at narrow widths. |
Rebuild the context and wide-layout change on main e1b70c1 following the Oct 13 review. Keep the complete request story, original heading, visible stage caption and main's unchanged line/logo retention. Use one context header, construct its body only while open, migrate the existing fold choice and retain live card updates and the text viewer. Align the stage/story and overview/contents splits within the page's existing width cap. Keep the narrow stage sizing and prevent flex shrink from moving the header when context contents appear. Three-platform vet and builds and the sandboxed nogui suite passed. Base assets fail the new context test because a closed card constructs the detail grid (1 instead of 0). Focused disclosure checks passed; the complete GUI suite is still running and is tracked in the PR body.
b60224b to
d6d5738
Compare
Open the lazy context explicitly for its retained-animation check and wait for page entrance animations as well as cells. Reach the group Cancel button and history day with user wheel input rather than relying on forbidden click scrolling. Until the baseline contains the new Routing wrapper, keep its intentional desktop layout out of the unchanged-page pixel comparison; the focused layout matrix covers it and mobile fit still checks Routing. Validation: group-fold and held-animations passed all 8 cases; phone-rows passed all 10 cases across five languages and both engines; mobile-web passed all 30 cases. git diff --check and JavaScript syntax passed. The complete GUI suite is still being recorded on unchanged d6d5738 assets. Library switch failures are independently reproduced on e1b70c1 assets and tracked by upstream yetone#1609; they are not claimed as passing.
The visible full request story can leave a historical request below a narrow window. Reach the day and request row with wheel input before selecting them, while retaining the app scroll guard and all cancellation and failure-colour assertions. Validation: all 37 checks in routing-agent-gone and routing-agent-hue-not-red pass across both engines, four/five languages and 420/1100px widths. The whole GUI run had exposed the two WebKit German 420px click-scroll failures. git diff --check and JavaScript syntax passed.
Keep the last available live prompt separately from the render key. Opening or closing the unified header can redraw that carried context while a new request has no prompt yet; clearing a render key for a disclosure no longer removes the entire card. Explicitly picked requests still start fresh, and unavailable or completed requests clear the carried data. Validation: before the fix, the new pending-prompt disclosure regression fails because the carried context becomes invisible. After the fix, all 134 context disclosure, saved-choice, Usage-link, live patch, every-frame and provider-logo checks pass in Chromium and WebKit across five languages and desktop/phone widths. Native macOS, Linux nogui and Windows builds, syntax and git diff --check pass. The complete GUI run is recorded separately with unresolved existing failures linked in the PR description.
|
Ran before merging, at head 735c08e merged onto main c8c3ce9:
Nits for a follow-up, not blocking:
|
v0.1.1233 shipped community PR #1354 (dae2618), which put "How the last request was routed" in a right column beside the stage on wide windows, split the context card into overview/contents columns, and replaced the context card's own head with one lazily built disclosure header. Two users on Discord asked for the old page back: wongxy ("这是哪个人才要改成这样的,丑死了", "UI方面的需求响应要克制一点", with a screenshot of the new page) and molvqingtai ("v0.1.1231 没有这个问题"). The owner delegated the call: Routing goes back to v0.1.1231's look. Only the lazy construction of the context body was a candidate to keep, as it is invisible. It doesn't separate cleanly: it is built on the new unified header (ctxSummary in the closed state, ctx-body/ctx-overview in the open one), which is itself the visible change. So this reverts dae2618 whole: assets, its doc section, its README entry, the new routing-context-layout test, and the test edits that existed only for the new layout (wheel-scrolling to rows the right column pushed down, mobile-web's skip of Routing in the pixel comparison). No later commit on main is a follow-up of it. Later commits touching the same files are kept: 20350da's subagent reason in routing.js and README entry, a7a3819/5fc2f87d1's gui-shell.md lines, 00afcf9's README entry. routing.css and context.js are now byte-identical to v0.1.1231; routing.js differs only by later features (#1068 folders, subagent reasons). Run (worktree on origin/main 3ec45e7 + this revert): - Routing page screenshots against v0.1.1231's assets with one counted request (the .rt card): Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 420 wide, plus 1440/1800 in en/zh: 0 pixels differ in all 28. origin/main differs in all of them (the folded header, the columns). - node --test routing-*, panel-routing*, group-fold, held-animations, phone-rows, context-*: 1025 of 1034 pass. The 9 reds are routing-keys-fold's "a request that comes flies to the fold" (WebKit, and Chromium de) and routing-model-rest's "Try now" reach. Both files run alone fail the same way on origin/main bda2719 (12 fails there, 11 here, different cases of model-rest each run), at load average ~350 from other sessions; filed as #1612 and #2115. - mobile-web (pixel baseline) with BASE_REF=dae2618ad^: every phone case and Routing's desktop compare pass; the 8 reds are all Settings, changed since by #2073's colorblind switch, not by this. - gofmt -l, go vet (darwin, linux nogui, windows) and go test -tags nogui ./internal/gui pass. Not tried: the native Wails window; the complete GUI suite.
|
Thank you for this PR, and for the careful work behind it: rebuilding it on main after review, the five-language and two-engine checks, and the detailed notes in each commit. After it shipped in v0.1.1233, users on Discord asked for the previous Routing page back. They found the new wide layout (the routing story in a right column, the split context card, the folded context header) harder to read than before, and one noted that v0.1.1231 didn't look this way. We've decided to keep the page as it was, so bfef5d5 reverts this change and Routing is back to v0.1.1231's layout from the next release. We looked at keeping just the lazy construction of the context body, since users can't see it, but it's built on the new unified header, so it couldn't be separated cleanly. The whole commit was reverted, along with the test changes that existed only for the new layout. This is about how the page looks, not the quality of the code. Thanks again for contributing. |
…0.1.1244) New lessons: an origin exemption judges every Origin a browser can send (#2242, #2256; seen 2x with the 10-10 rebinding case); a file another process rewrites may be half-written; a pinned hash or new download source is checked against the vendor and trusted as far as who can write it; a fixed date in a test is checked against every clock the code reads (3c4b4dc -> 21aa402); a new field on a polled endpoint is costed at the poll rate; a full run gives slow packages -timeout 45m; a community layout PR is not merged on review alone (#1354). Evidence added: five fixed-wait CI reds under the timing habit, unfiled reds and a cancelled run that tested nothing, a second oversized squash subject (seen 2x), "see the push" as a run record and plugins#56 under the moved standards. ggbdpq's Watched row notes 94e3b3f and the red-before/green-after fixes since. Every cited sha was checked with git log; claims were checked against their commit bodies. Ran: go test -tags nogui -count=1 -run TestLoopGuardLeavesOrdinaryRepliesAlone ./internal/gateway (reads LESSONS.md): ok. Docs only, no code.
…at the page's foot into view (shihh on Discord) The routing groups sit below the stage, the story and every request; with many models (shihh on Discord) they are a long scroll down. The Routing page's head now has Routing groups (#rtGoGroups) beside New group: a down arrow, its name, and a tooltip saying where they are. Its click goes through scrollOnPurpose, brings .rt-gsec to the top of the view and moves the focus into it. The page's layout is unchanged (no #1354-style move): the groups stay last in #rtMore. fitGo gives the button only the head's spare room (the .grow spacer): named, its arrow alone (still named to a screen reader), or left out, so nothing else in the head moves or wraps. Strings in zh, zh-TW, ja and de. app.js untouched (plugin files only). Test: routing-groups-jump.test.cjs, Chromium and WebKit x en/zh/zh-TW/ja/de x 1000px web, 480px web, 640px window: 30/30. It is red on main's assets (no button), red with the scrollOnPurpose check removed (the app's guard pulls the view back), red without the focus move, and red with fitGo removed (de at 480px web: Hide accounts moves). Run at this change on 50f52b5 (de28176, rebased under it, touches only internal/gateway): - go test -tags nogui -timeout 45m ./...: 69 packages ok, no FAIL - gofmt -l: clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows: ok - TestCoreScriptBudget and the other budget tests: ok - GUI files the change can reach (routing*, group*, i18n-keys, click-scroll, title-bar-tools; 125 files, both engines): 1495/1495 Not run: the whole GUI suite. Another session's full GUI run held the machine for 2h45m+, and this touches only the routing plugin's files. Not changed: on a phone the web head already shrinks to its 40px min-height on main, so wrapped buttons slide under the first card (Hide accounts at 360px in German). Where the head has no spare room, the button is left out rather than wrapped.
Routing's expanded context window can consume the space needed for the request list. This change uses a single context header that builds the grid and content rows only when opened, and aligns the stage/story and overview/contents columns within the page's existing width cap.
Following the Oct 13 review, this PR now contains only the context header and wide-card layout, rebuilt on main e1b70c1. The request story remains fully visible, with “How the last request was routed”, the visible stage caption and main's unchanged
replaceKeeping/keepIconsline and provider-logo retention. The optional story toggle, open by default, is isolated in Nxir/magpie#3, based on the same upstream revision. GitHub rejected creation of its upstream PR with an account-permission error, so its reviewable diff is currently in the fork.Closed context shows used/window tokens, fill, cache and the thin occupancy bar. Opening uses the same header and removes duplicate summary counts; closing releases the body. An absent
magpie.routingContextsetting reads the originalmagpie.ctxShutchoice. Usage's Context link temporarily opens one request without replacing that preference. Live context nodes, cache states and the context text viewer are retained.At 1100px card width, the stage and visible caption sit beside the request story. Context stays below both and splits overview/contents from 800px. Both pairs share the same split; content filters stay on one scrollable line, grid rows have a fixed height, and long content lists scroll inside the card. The page retains main's 1200px cap, so the upper split uses 1100px rather than the earlier unreachable 1280px threshold. Smaller cards retain the original narrow-stage layout. Disclosure clicks do not shrink the page heading or move the context header.
See GUI app shell and the GUI test README for the contract and tests.
Validation at 735c08e:
closed context does not build the detail grid(actual 1, expected 0). Syntax andgit diff --checkpass. Fixtures use synthetic accounts/APIs; no live gateway or user configuration is touched. Native Windows/Linux GUI behavior was not manually exercised.Unresolved whole-run failures are recorded rather than retried into a passing total:
The automated preview below is maintained by CI and may describe the preceding revision until the latest run replaces it.
🎬 界面预览
CI 用这个 PR 的代码构建并真实运行 magpie(沙盒环境,配置了真实的 DeepSeek key),按改动自动操作、截图和录屏 ·
735c08e· 运行记录改动(按代码):路由页的上下文窗口改成一条可点击的标题行,放在舞台与请求故事的下方:收起时只显示已用/窗口 token、占比、缓存与占用条,点开才构建详情网格和内容列表,不再有第二个标题;卡片宽到 800px 及以上时详情内的概览与内容并排成两栏。
Note
沙盒里看不到:沙盒窗口是 1280×800,路由卡片宽度不足 1100px,看不到宽卡片断点下「舞台与请求故事并排、两处列分隔线对齐」的布局;旧的 magpie.ctxShut 折叠偏好迁移、以及从用量页「上下文」入口临时展开某个请求而不改动已保存偏好的行为,也因沙盒里没有相应状态/操作路径而不在本片里展示。
路由页的上下文窗口头
路由页打开时的样子
页面下方收起的上下文窗口头:用量、占比与占用条
点击之后的上下文窗口
再次点击之后的上下文窗口