ac4af582301a4e8a29245dbba767eba31334ddf9
25
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c6702f4626 |
routing: the context card's route icons sit level with their text
The owner: the icon and the text in the context window card's route
(agent icon, name, ›, lab icon, model id) didn't look level. Flex
centred each icon on the line box, but the letters sit lower in it, so
the lab icon was ~1-1.25px above its lowercase model id and the agent
icon ~0.5px above its name. The lab icon now moves down 1px, to the
id's x-height middle, and the agent icon .5px, between its name's
capitals and lowercase.
ctx-route-align.test.cjs measures the drawn ink at 4x (x-only and
H-only texts) in Chromium and WebKit, en and zh, and holds each icon
within .5px of its text's middle.
Run (mote): ctx-route-align, ctx-route, ctx-head-narrow, 108 of 108 ok.
Broken by hand: with the CSS reverted ctx-route-align is red 4 of 4
("the lab icon is centred on the model id's lowercase", WebKit en
labIc 10.125 vs modelX 11.375).
Not tried: the real Linux app (WebKitGTK) and Windows WebView2.
|
||
|
|
f418edffc3 |
sessions: a session's details show how full its context was, request by request
liang_yongxiang on Discord: Routing tells how full one request's context window was; does Sessions have the same, each turn's share? A session's details on the Sessions page (and in Usage's Sessions list, which draws the same details) get a Context line when the gateway sent calls of it (s.via): the Context tab's spark of its prompts, request by request against its window, and the fullest one's share beside it, toned as the tab tones it. A point's tip says "Request 2: 80K of 200K (40%)" (the tab's spark says it too now, where the window is known); a point clicked opens that request in Routing with its card. A session the gateway never saw asks nothing; one it kept no prompt of shows no line. The data is the routing history the Context tab already reads. A new GET /api/context/session?agent=&id=&from=&to= reads only the days from the session's first to its last (30 at most), through the tab's per-day cache (daysRecsLocked, split out of contextRecsLocked, so the tab's cached days are not evicted), and keeps that one session (contextOfRecsFor), with up to 1000 of its requests. The tab keeps the latest 80 sessions and would leave an older one out. Subagent and side calls are left out as the tab leaves them out; the same id under another agent is that agent's. The line's code is in plugins/usage/page.js (sessCtxLine). context.js only exports spark and health, and pays for its tip by cutting comments, so the core's scripts are 10 bytes under main's, no budget raise. Run at this head (rebased on |
||
|
|
784113472d |
gui: motion answers sooner: strong ease-out, folds and popovers under 300ms, no scale(0)
The owner asked for every animation to follow Emil Kowalski's "make your app feel faster" rules (x.com/emilkowalski/status/2118687605776597482): ease-out for anything the user starts, a strong curve over the stock one, and UI motion under ~300ms. Spinners, attention flashes, decorative loops and the chart intros are left as they were. - New token --ease-out: cubic-bezier(.23, 1, .32, 1); --morph-ease is now the strong ease-in-out (.77, 0, .175, 1). - Agents' fold, and the panel's edge that moves with it (UNROLL/ROLLUP): .62s/.42s -> .34s/.26s on --ease-out; its rows .56s with a 48ms stagger -> .32s with 24ms. - An agent row's details (ROW_OPEN/ROW_CLOSE, .ag-open, .ag-body): .48s/.40s -> .32s/.26s. The curve stays the gentle-start spring the comment chose so the panel's edge keeps up; only the time is shorter. - Hover reveal of a row's menu: up to .52s -> .28s. Chevrons .3-.5s -> .22-.32s. - Popovers: pop-in .42s -> .24s; pop-out was .22s on an ease-in curve, now .15s ease-out. - The new-dot started from scale(0); it starts at scale(.5), opacity 0. - Sheets, sidebar sub-lists, modals (.57s -> .44s open, .38s -> .30s close), Context tiles and fades, plugin cards: 460-620ms -> 240-400ms. - Theme crossfade .35s -> .25s; copied/new-account pops .36-.5s -> .26-.3s. Run on the Linux VM (magpie-desktop, WSL), both engines, every language: - Whole GUI suite at this change: 21559 pass, 431 fail of 21990. The run overlapped another session's suite (15-minute load 39). #5559 has 478 of 21666 red on this VM at main. - 17 files that touch the changed motion (model-chip-steady, page-width-steady, zero-priced-free, segs-press-redraw, rest-try-now, provider-fetch-again, codex-predictions, side-toggle, tray-cell-click, menu-input-scroll, agent-details-ready, agent-expand-steady, held-animations, group-morph, header-centre, inner-scroll-contain, recovered-file), concurrency 2, at the parent |
||
|
|
8ee85c59f3 |
context: a slim tile in the context map keeps its gap to the tile beside it
noahhrreion on Discord (11-06): in the context map the system prompt and tool tiles sat right against the large "N more" tile beside them, and sometimes ran over it. A tile is its rect less a 3px gap, but its 7px/9px padding stayed on when the tile was too slim for labels (.bare). A box can't be narrower than its padding, so a tile laid at 16px (TILE_SIDE) was drawn 18px wide and ran 2px into its neighbour. A bare tile now has no padding (its labels are hidden already), so every tile stays inside its rect and the 3px gap holds at every width. Nothing else in the layout changes. Test: context-map.test.cjs "slim tiles keep their gap at every width" lays a system prompt, tools and 110 turns (the reporter's shape) and checks every pair of tiles is at least 2.5px apart at 13 widths from 1100px to 360px, in Chromium and WebKit, in all five languages. Run on mote (mote-run): - context-map.test.cjs: 36 of 36 passed (Chromium + WebKit, en/zh/zh-TW/ ja/de, 1100 and 420px, the new test included). - Broken by hand: on the old context.css the new test fails in all 10 runs: '980px: "ctx-tile k-chat bare" and "ctx-tile k-chat" are -2.25px apart'. - Screenshots, dark theme, zh, 980px, the old CSS and the new one: the old one has the slim column touching "另外 98 项", as in the report. The new one has the 3px gap. - context-map-live, context-scroll-end, context-text, ctx-route, context-scripts, context-window, ctx-head-narrow, routing-ctx-fold, routing-ctx-still, routing-context-fold, routing-ctx-sessions, routing-live-patch, routing-return-cost: 319 of 320. The red was context-window "chromium en 420px: the Context tab": browserContext.newPage said the browser had closed (load ~150). It passed 3 of 3 alone. Filed as #5460. Not run: the whole GUI suite, and the native apps. CSS only, so no Go build or tests. Reported-by: noahhrreion |
||
|
|
e4bc3eeb6f |
gui: the context window card's head keeps its title, icons and model apart at every width
packinggoods on Discord, in #feedback: in a narrow window the Routing page's "Context window" head drew the provider's icon over the end of the title. The mono model id (remote-magpie/claude/cla...) and the Live pill sat beside it. The cause was .ctx-fold, the title's button when the card can fold. It had min-width:0, so it shrank under the route, and the title's nowrap text ran on under the icons. The title no longer shrinks (flex:none). The route and the state now go together in .ctx-end, and the head wraps. Where the title leaves them too little room they take a line of their own, ending at the right, and the model id is cut there with an ellipsis. A folded card stays one line. At 520px and below it drops the agent's name and the lab part of the route. At 420px and below it drops the route and the state's word, keeping the state dot and the bar. The fold button keeps an outer height of 20px (margin -1px), so opening the card doesn't move the page. New test, ctx-head-narrow.test.cjs. It uses the reporter's model, live and counted, with and without the agent, with and without a known window. It runs en, zh, zh-TW, ja and de, at 1100 down to 340px, open and folded, in Chromium and WebKit. It checks that the title's text is whole, that no drawn parts overlap (boxes clipped to their overflow ancestors), that an icon is never part-cut, and that nothing runs past the card. Run at this head (rebased on a fresh origin/main), on mote, both engines: ctx-head-narrow, ctx-route, context-window, routing-context-fold, routing-ctx-still, routing-ctx-fold, routing-live-patch and i18n-keys: 188 pass, 0 fail. The whole GUI suite is running on WSL (Linux, both engines) and had not reported when this was pushed. Mote was busy with three other sessions' full suites. The owner's rule is to ship a verified fix at once. Any red it finds that this change caused gets an issue. Broken by hand: ctx-head-narrow on the old context.css/js is 52 of 52 red (e.g. "open at 580px: the title is whole ... cut:true", "title and lab icon overlap"). Not tried: the real Wails app (WebKit on macOS, WebKitGTK on Linux, WebView2 on Windows). |
||
|
|
34f51bbbca |
context: the head's agent icon is 14px again, not the agent cards' 20px
The owner: Pi's icon in the context window's head was oversized. context.css had two unscoped `.ctx-who` rules. The later one, for the Context tab's agent cards (20px icon, 8px gap, display flex), overrode the head's 14px one by source order. The card rules are now scoped to `.ctx-who-box`, where both card renderers put their `.ctx-who`. Run on mote, both engines, every language: ctx-route (52), context-window (24), context-scripts (22), routing-ctx-fold (6), routing-context-fold (24), routing-live-patch (10), all pass. These are every GUI file that renders .ctx-who. Broken by hand: with the old context.css, ctx-route's new width check fails with "the agent icon is 14px wide (20)". Not run: the rest of the GUI suite. Nothing outside context.js uses .ctx-who. |
||
|
|
80af3b86a4 |
context: the card's head names the agent and the model's lab
The owner asked for the agent's name and the model's icon on the context window card, and picked design A from a mock-up: in the head, right of the title and before the state pill, [agent icon] Claude Code › [lab icon] anthropic/claude-sonnet-5-5 - context.js: the head's model is now a route (.ctx-route): the agent's icon and name (agentIcon, agentLabel, as the Usage page names it), a ›, then the model's lab icon before its id. labIcon picks the lab from the id after its provider prefix (Claude, OpenAI's gpt/o-series/codex, Gemma, Gemini, DeepSeek, Qwen, Kimi, GLM, Grok, MiniMax, Doubao, Mistral, Llama, MiMo, Step, Hunyuan); an id it doesn't know gets no icon, so a wrong logo never stands for a model. - context.css: the name in --fg-2 at 500, the › in --faint, the agent's icon 14px and the lab's 12px; the model id keeps its ellipsis. In a card 420px or narrower the agent's name and the › go and its icon stays; folded and that narrow, the model goes as it did before. - core_budget_test.go: lowered to 1,532,958, the core after this and the text viewer's move to ctxtext.js (the commit before), on origin/main |
||
|
|
5f17c5a38e |
gui: a request's tool results are orange in its context, not pink
The owner found the context map's colours a little off (10-25, the Routing card). Tool results, often the biggest tile, took the palette's pink, which at the map's 11% tint sinks to a maroon between violet, sky and slate. Of the drafts shown (current, results orange, equal lightness, stronger tint) the owner picked results orange. --k-results is #fdba74 in dark mode and #ea580c in light, deep enough there to stand apart from memory's amber (#f59e0b). Colorblind mode keeps its palette's --c5, as every other part does. Nothing else changes: the tint, edges, text mixes and the other parts' colours. Run (darwin): go test ./internal/gui ok; GUI in chromium and webkit: context-map 22/22, routing-context-fold 24/24, context-window 24/24. Not run: the whole GUI suite; no screenshot of light mode in the app. |
||
|
|
83234fe920 |
gateway, gui: the skills an agent lists are their own part, not memory
The owner (10-24, on the Routing context map's "技能 / 记忆 · 9.6K"):
为什么这里又叫技能,又叫记忆?Skill 跟 Memory 应该是不一样的东西. The
gateway put Codex's <skills_instructions> in the memory part beside the
instruction files and reminders, so the tile said Skills of Memory.
Claude Code's skill list wasn't seen at all: it sat in its environment
message, counted as the system prompt.
- gateway: PartSkills ("skills") comes after tools. Codex's
<skills_instructions> goes there. So does Claude Code's list, from
"The following skills are available for use with the Skill tool:" to
the next blank line, taken out of whatever text holds it: its own
prompt, a harness message or a reminder.
- Routes kept before this (routing history) are read with an item
tagged skills moved out of memory into the skills part, so old
requests read the same way. The text view re-reads the body and finds
them under skills too.
- Usage's context baseline counts skills, as it did inside memory.
memory-heavy is now instruction files and reminders alone.
- gui: the card has a Skills part (slate, --c7), with its note in en,
zh, zh-TW, ja and de. The text view's "no longer kept" line is one
helper instead of two copies of the sentence, which makes the room for
it under the core script budget, with no room added.
Run (darwin):
- go test ./internal/gateway -run 'Text|Prompt|Context|History|Skill|Route'
ok; go test ./internal/gui ok; go vet both, gofmt clean.
- New: TestPromptOfClaudeCodeSkills (on testdata/workdir's real Claude
Code 2.1.296 body: 1502 tokens of skills out of the 2130-token
environment item), TestSplitSkillsEnds, TestSkillsApartOfKeptPrompt.
Broken by hand (splitSkills and skillsApart made no-ops): all three
red.
- GUI, chromium and webkit: context-map 22/22 (new: the skills tile's
tip names Skills and not Memory in every language, and it isn't
memory's colour), context-window 24/24, context-text 20/20,
context-scroll-end 14/14, routing-context-fold 24/24,
routing-ctx-still 16/16, i18n-keys 4/4.
Not run: the whole GUI suite (load ~400 on the box); a live Codex or
Claude Code request through the real app.
Not changed: the "system prompt, tools and memory" wording of the
baseline's tags, which now count skills too.
|
||
|
|
7edf5b0a3d |
gui: the context window is a map of tiles by default, the block grid a switch away
After flohoeller's "Context map" on X. The Context window card (Usage ›
Context, and Routing's request card) drew its window as 400 cells. It now
draws it as a map:
- Each item is a tile sized by its tokens, inside its part's area
(squarified, parts in their usual order).
- The tile has a soft fill of its part's colour, its name, and
"tokens · part".
- The free space is a hatched tile that names its share.
- The used share is drawn on a gentle curve (share^0.35), so a window
8% full still has tiles to read. The free tile states the real share.
Small items:
- Items too small to read go in one "{n} more" tile.
- A part whose items would leave a strip thinner than 14px is one tile.
- No tile is laid under 700px².
Hover and click:
- A hovered tile tells its item, part, tokens and share (a part's tile
lists its largest five) and dims the others.
- A row or the legend lights its tiles.
- A clicked tile opens its text, as a cell does.
Motion:
- Tiles come in with a short stagger (opacity, scale .94, blur), over
560ms with the iOS ease.
- A live update keeps the same nodes and glides them to their new rects.
- Tiles that are gone fade out.
- With motion reduced, or on a still pane, nothing moves.
The block grid is kept. A small segmented switch at the end of the legend
(Context map / Block grid) picks the look for every card, remembered in
localStorage magpie.ctxLook. The card eases to the other look's height.
The new look is the default, and the old one stays one click away (UI
restraint, owner's ask).
The text view shows an image the request sent inline (the gateway's Src,
previous commit), where it said "An image: magpie doesn't show it here".
It fades in, and a click opens it larger with a FLIP scale. An image with
no Src, or one that fails to load, keeps the old note.
Words: "Context map" and "Block grid" in zh, zh-TW, ja and de.
The core budget goes to 1,549,478, the new size with no room added:
context.js is drawn by the Routing page as well as Usage, so it is the
core's own (+14.4KB).
Tests:
- Seven existing tests read the grid's cells. They now pin
magpie.ctxLook=grid.
- New context-map.test.cjs, in both engines, en/zh/zh-TW/ja/de, at
1100 and 420px:
- The map is the default, with a free tile.
- Every tile is inside the map, none overlap, and none is a sliver.
- Hover gives the tip and dims the others.
- A refresh keeps the nodes.
- A click opens the text.
- An inline image loads (naturalWidth 2) and opens larger. One without
Src is named.
- The switch to the grid survives a reload, and the map comes back.
- With motion reduced, nothing animates.
Run at this head (rebased on
|
||
|
|
5fc2f87d13 |
gui: in colorblind mode a quota legend key is its window's dash, the even paces are dotted, and the balance curve and the good grade keep their look (#2073)
A review of db25c4ee found that colorblind mode reached past the quota
curve and that its legend shapes matched nothing on the plot:
- The fallback rules `.qc-line:not([data-series="0"])...` and the
matching `.qc-key` rule also matched elements with no data-series, so
the balance curve's solid line became dashed like its fitted line, and
its legend dot became a ring in var(--c4) while the line was var(--c1).
- A filled circle, hollow square or diamond in the legend appeared
nowhere on the plot, so it didn't tell a reader which line was which.
Series 3 and up shared one dash and one shape.
- The 7-day line's 6 2.5 dash sat beside its own 3 3 dashed even pace in
the same colour, while the tooltip still said "Solid: what was left.
Dashed: an even pace".
- The Context tab's "good" grade took var(--c2), which the palette turns
amber, next to "fair" in --amber (dark #fbbf24 vs #f2b544).
- omarchy.css made the first legend dot round with colorblind mode off.
- The legend set its colour twice (--sw and background) and undid it
with !important.
Now, with colorblind mode on:
- drawQuotaPlot tags each window's path.qc-line and line.qc-even with
data-series (its index mod 7, the same slot as its colour), and the
quota legend tags its key. Seven dash patterns, one per slot, apply to
`:is(.qc-line, .qc-dash)[data-series=N]`, so a line and its key can't
drift apart. Nothing else sets data-series, so the balance curve is as
on main.
- Each quota legend key shows a 22px sample of its window's line
(svg.qc-sample > line.qc-dash) in place of the dot; with the mode off
the sample is hidden and the dot is as on main.
- The even paces are dotted (0 4, round caps), unlike every window's
dash; the curve's tooltip, set in box.draw, says "Each window's line
has the dash shown beside its name. Dotted: an even pace, ..." in en,
zh, zh-TW, ja and de.
- `.ctx-ring.good` / `.ctx-grade-word.good` take --c1, the palette's
blue.
- omarchy.css is back to main's; the legend's `--sw` and !important are
gone.
- The Settings note now says what the mode does ("Colorblind-safe chart
colors, and each allowance window's line in a dash of its own"), and
gui-shell.md says the note is the Off/On control's tooltip, as the
code has it.
Run on db25c4ee + this change (upstream/main
|
||
|
|
6e5f4fc97f |
gui: Tuned for you names its advice "Fewest tokens" and says a compaction window is a token estimate, not what the agent keeps (#1854)
cnlove7777777-art: the card called 230K -> 150K "best for you" on token savings alone, while compacting sooner may lose more of a long coding task. A retention benchmark isn't built now; the card says what it measures instead: - the advised value's label is "Fewest tokens", not "Best for you"; - a compaction row that advises a change adds "A token estimate only: it doesn't measure how well the agent keeps the task after a compaction. The lower the window, the more often it compacts." Not on a window already the leanest, nor on the cache lifetimes. - zh, zh-TW, ja, de translations; agent-wiring.md says the same. Run: context-tune.test.cjs (new assertions on label and caveat) passes in Chromium and WebKit, 360 and 1100 wide, en/zh/zh-TW/ja/de; on origin/main's assets it fails 11 of 12. context-*.test.cjs, gui-zh-tw, gui-ja, gui-de, compact-at, i18n-keys: 99 pass, 0 fail. Not tried in the real app window. |
||
|
|
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 |
||
|
|
a98ab77fde |
gui, gateway: a context window's part, cell or item clicked opens the text the request sent there (masaka)
masaka on Discord asked to see the whole context behind the context window
card: click the agent's prompt, or any other part, and read it.
What changed:
- gateway: the trace keeps the last 10 request bodies in memory only
(promptBodies; at most 32 MiB each and 64 MiB together, oldest dropped
first), masked as the vendor got them. For a model the user let have
the request unmasked, the masked copy is kept all the same. Never
written to disk, never in telemetry. Route.Prompt and the routing
history keep names and sizes only, as before.
- gateway: Server.PromptText re-reads a part's items and their text from
that body (prompt_text.go). promptBuilder gains a keep mode that records
each item's pieces: system text, tool definitions laid out as JSON, each
turn's user/thinking/assistant/call pieces, tool results, and images
or sealed reasoning named with their size. Sizes are unchanged.
- gui: GET /api/context/text?id=&kind=[&item=] (no-store; 404 "not kept"
when the body is gone or another process serves the gateway).
- gui: in the card, a legend part, a waffle cell or a content row
(click, Enter or Space) opens a wide modal: one item alone with "All of
{part}", or the part's list 100 rows at a time, each item's text
fetched when it is opened and shown 20000 characters at a time, with
copy buttons. Strings in zh, zh-TW, ja and de.
- docs: gateway-routing and gui-shell subsystem pages; the site's start
page (en, zh, ja) says the text is kept for the last 10 requests in
memory and sent nowhere. The README Privacy is unchanged, since nothing
more is sent.
What was run:
- go test -tags nogui ./... (temp HOME). internal/gateway hit the 10m
default under the full parallel run, in TestRequestTailAfterOldLimit,
which takes 57s alone on the base commit too; the package run alone
with -timeout 30m: ok (700s, the machine shared with other runs). Every other package: ok.
- New tests TestPromptTextIsWhatWasSent, ...KeepsOnlyTheLastBodies,
...ChatPieces, TestContextTextAPI. Broken by hand: keeping the unmasked
body fails (the key shows), and dropping keepBody fails ("not kept").
- gofmt -l; go vet, GOOS=linux and GOOS=windows go vet on internal/gateway
and internal/gui.
- GUI: tests/context-text.test.cjs in Chromium and WebKit, en/zh/zh-TW/
ja/de, at 1100 and 420px: legend, row, cell and keyboard open the text,
long text grows on demand, the page never scrolls, and a gone body is
named. It fails with the click wiring removed. Under a load average of
~140 one case failed once: the test read the list while the dialog
still said "Reading…". Reproduced with a 400ms reply, fixed by waiting
for the list; the mock now always answers after 200ms. A second case
("a click doesn't move the page", 662 vs 605 on the contents row) came
from taking the page's top while a wheel scroll was still easing: the
test now wheels to the row like the other cases, and wheelTo waits for
three equal looks. Four full runs at load ~150 then passed (80 cases). context-window,
i18n-keys, held-animations and the modal tests (dialog-backdrop-drag,
editor-short-window, readable-focus, ux-safety, whats-new, add-sheet,
api-key-theme) pass in both engines.
- Real use: a sandbox magpie (own HOME, ports 3486/3487, the Codex login)
served a real `claude -p` (Claude Code) request on codex/gpt-6-luna
that read a file. In its web UI, Usage > Context: each of System
prompt, Tools, Memory, Files and Conversation, a waffle cell and a
contents row opened the request's real text (Claude Code's system
prompt, 21 tool definitions, the CLAUDE.md reminder, main.go's Read
result, the turn with its thinking and call). No page errors.
|
||
|
|
05ed5e69ba |
context: Tuned for you's curves draw themselves once, not again each time the pane is redrawn
The Context tab redraws the whole pane whenever the advice answers, the routing history answers, the state changes or a setting is put in. Only loadContext marked the pane "still", and only when a new history replaced an old one, so on opening the tab every curve played its entrance two or more times (the owner saw them play "好多次"), and the history's cards replayed theirs when the advice came in after them. renderContext now remembers whether its last draw showed the history and the advice: what was on the pane already holds still (.still for the history, .tune-still for the advice), and only what is new plays. A range change clears both, so the new range's draw plays once. Run: - new test "the advice's curves play their entrance once" (chromium, webkit): red without the change (8 draws of 4 curves in both), green with it. - context-tune, context-window, context-scroll-end, group-context, routing-ctx-fold, routing-ctx-still: all pass in both engines. - routing-context-fold: 2 WebKit failures, the same on origin/main without this change (the sticky header covers the fold button), filed as #1529. |
||
|
|
ad136426d2 |
gui: the context window's 400 cells and other entrance animations let go of their layers once played (#1481, hoffman24)
hoffman24's macOS app had a WebKit WebContent process over 1GB, 866MB of
it IOSurface graphics buffers for ~1,600 compositing layers. One clear
cause is ours: entrance animations played with fill "both" stay in effect
for good once finished, and an element with a finished transform/opacity
animation held keeps its compositing layer. The context window card's
waffle is 400 cells, each with ctx-cell (opacity + scale) and fill both,
so every card on Routing kept 400 layers alive.
Every one of these keyframes only says where the element starts (from),
or ends where its own style already is, so "backwards" draws the same
before and during the animation and lets go after:
- context.css: ctx-cell (waffle cells), ctx-grow (cache bar), ctx-arc
(ring), ctx-draw (tune chart), ctx-pop (tune dots)
- library.css: lib-skel-in, .mk-card content-in (a market card's hover
lift now shows too: the held animation overrode its transform)
- routing.css: .masking .pii rtpii
Measured on Routing with one context card (origin/main assets vs these):
- document.getAnimations(): 412 -> 13 (WebKit), 412 -> 15 (Chromium)
- Chromium CDP LayerTree: 421 layers -> 21
held-animations.test.cjs opens Routing with three traced requests,
waits for the cells to finish and asserts no finished animation is held
and the card looks the same (every cell opacity 1, no transform, cache
bar grown). It fails on origin/main ('ctx-cell': 400 held) in all four
cases and passes here: Chromium and WebKit at 420 and 1100px.
Run: the GUI tests touching ctx-/mk-card/lib-skel/masking/Routing/
Library (116 files): Chromium 576/576, WebKit 574/576. The two are one
case of routing-pointer-pin.test.cjs, whose card moved 588.56 -> 590px
under the full run's load; alone and 4-up it passed 3/3 and 36/36 here,
and 12/12 on origin/main's assets 4-up. Filed with the purpose-filter
WebKit 1px drift.
|
||
|
|
27e69702e1 |
context: Tuned for you draws each setting's cost as a curve over the advice, its waste shaded, the window set now saying how much more
The small sparkline had no scale: it couldn't show how much a setting costs over the one advised. The curve is now the row's width and measured from the advice's own cost (tune takes the largest window within 1% of the cheapest, so the cheapest point is not the level): the area over the advice's dashed level is what the other settings spend past it, the window set now and the costliest say how much more (+%), and the advice is marked Leanest. The cache lifetimes get the same chart for their two choices, and it shows at a phone's width too. The section note sits closer to its heading and further from the cards. Run: context-tune.test.cjs in Chromium and WebKit, every language, phone and desk widths (22/22), with checks on the set window's +% and the advice's level; a shot of the owner's real 7-day /api/tune. |
||
|
|
9d92068204 |
context: a folded context window card has as much space under its head as over it
Folded, the card is its head alone, but kept the open card's 14px over and 12px under, so the head sat 2px high (the user's screenshot). The folded card's bottom padding is now 14px; the top is unchanged, so the title stays where it is when the card opens. routing-ctx-fold asserts the two gaps are equal (14,12 before the fix, both engines). Run: routing-ctx-fold, routing-context-fold, routing-ctx-still, group-context, context-window in chromium and webkit. |
||
|
|
9e665491ec |
context: Tuned for you — each agent's settings worked out from the user's own calls, for the fewest tokens, put in on a click and undone on another
The Context tab now replays the period's calls of each agent against the
settings that decide what they cost, and shows, per agent and per model,
the value that would have used the fewest tokens for how this user works:
Claude Code's auto-compact window per model (modelSettings.<model>.
autoCompactWindow), its main and subagent prompt cache lifetimes
(promptCacheTtl, subagentPromptCacheTtl: 5m or 1h), and Codex's
model_auto_compact_token_limit. Each row says where the value comes from
now (the agent's default, the user's own setting, one magpie set, or a
variable that comes first and locks it), why (how fast conversations grow,
what a compaction leaves, how long the user pauses), the cost curve, and
the saving. Nothing is written until "Use …" is clicked; what was there is
stashed and Undo puts it back, unless the user changed it since. A window
the user set past the model's own is shown capped, as Claude Code caps it
(min(setting, model window)), so no saving is claimed that wouldn't happen.
Advice under a 3% saving is "already the leanest".
On the owner's 7 days (88K Claude Code calls, 956 Codex): opus keeps 200K
(their 500K is capped to it), fable 5.1 200K → 160K saves 5% (2.56M
tokens), both cache lifetimes and Codex's 272K are already the leanest.
Run: go vet ./... and go test ./... pass (internal/tune, internal/agent
TestTune*: user-set values kept, env locks, undo after a user edit, TOML
key order). context-tune.test.cjs passes in Chromium and WebKit, en/zh/
zh-TW/ja/de, at 360 and 1100px (22); context-window, context-scroll-end
pass. Full GUI suite: library-servers-bulk and market-have failed once
under load and pass alone; market-have fails on origin/main
|
||
|
|
666c0fa4fd |
routing: the context window holds still while requests stream in, and the prompt-cache card shows the last request's hit, dimmed, or a dash with the reason instead of "——命中" and an empty bar (dumplings on Discord)
dumplings reported that on Routing, every new request made the context
window jitter and flash, and that the prompt-cache card read "——命中",
glued together, with an empty bar under it.
Causes, measured with a frame sampler while requests stream through
start/read/done:
- A live request's story is shorter than a finished one's. "Is
answering…" becomes "answered in 4.0 s…", which wraps onto two lines
at phone width. The log head also gains View usage and Replay once the
request is done. So the card under it moved up and back down on every
request: 45px at 420px wide, 6px at 900px.
- The state pill ("Live" or "Counted") changed width, which moved the
model name beside it by about 11px.
- While a request was under way the cache card dropped to "—" with a
0% bar, then came back. That was the flash.
- A flex item's leading space is dropped, so " hit" and " / 272K" were
glued to the figure before them.
Fix:
- routing.js holdStory keeps the log head and steps at the tallest
height seen while following live, at this width and language. A
picked request, a replay or a past day is drawn at its own height. A
ResizeObserver on the steps measures again as soon as the width
changes. Without it, a scrollbar appearing before the first request
left a stale height and a 6px shift (seen in WebKit under load).
- context.js stacks all three state words in one grid cell and shows
only the current one, so the pill keeps one width.
- While the next request is under way, the cache card keeps the last
request's figure, dimmed (.was), with "The last request's · this one
is on its way". When there is nothing to show, it gives a faint "—"
and the reason ("Read once the vendor answers" or "The vendor didn't
say"). The bar stays hidden but keeps its space. The remembered
figure resets when the agent or session changes.
- .ctx-big gets a gap. Width and opacity transitions are turned off
under reduced motion.
- The three new strings are added in zh, zh-TW, ja and de.
Verified:
- The new tests/routing-ctx-still.test.cjs streams two requests and
checks that the card, model, state, used, cache, figure, bar, grid,
legend and foot rects never move by more than 0.5px. It also checks
the figure-to-word gap and both empty states.
- It runs in Chromium and WebKit, at en 420/1100, zh 420/1100,
zh-TW 900, ja 900 and de 420. It narrows the viewport by 10px after
load.
- On the old assets it fails 16 of 16 (the card moves 6–52px). It also
fails with only the ResizeObserver removed.
- routing-live-patch now expects the held figure ("97%") on live steps
instead of "—".
- Under --test-concurrency=4 in both engines: 578/578 pass across
routing-*, context-*, click-scroll, group-context, panel-routing and
gui-de/ja/zh-tw.
- go test -tags nogui ./internal/gui passes.
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui are
clean.
|
||
|
|
c17cbfa161 |
routing, gui: the folded context window shows a thin bar of what fills it beside how full it is, one line high whatever a live request puts in it, and a request opened from the Usage page's Context tab shows its card unfolded, it alone (PILIPALA @NXirg2 on X, Jeremy.Zhou on Discord)
On af798bd1's fold: folded, the head carries a bar of the window's
parts (system, tools, memory, files, results, chat), morphed with the
head so a live request changes its widths only; the folded head is
pinned at the open head's 20px and doesn't wrap. "Latest request" and a
point of the session line on the Usage page's Context tab open the
request with { context: true }: its card shows unfolded for it, the
next request takes the reader's choice (magpie.ctxShut) again, which is
left as it was; folding that card by its title keeps it folded.
routing-context-fold (new): folded at 1920x1080, 1440x900 and 440x900
in en, zh and de, one line with the bar, the stage and (at 1440 and
wider) the request list in view, nothing running over; opening doesn't
move the page; the Usage page's request opens unfolded for itself only.
routing-live-patch's folded cases: the card, head and bar are the same
nodes across live requests and the card's height never changes. Both
fail on af798bd1's assets. No new strings.
|
||
|
|
03c8d21fde |
gui: opening the folded context window on Routing no longer scrolls the page 4px; the folded card keeps the open card's padding, so its title stays where it is and the browser's scroll anchoring has nothing to follow (af798bd1's fold)
The folded card had padding-block 10px against the open card's 14px, so
the title moved down 4px as the card opened and scroll anchoring moved
the page with it, at the top of the page too. A click never moves the
page. Folded, the card is 50px instead of 42px, still one line.
routing-ctx-fold now opens the card with the title in view and checks
that scrollTop is the same and the title moved at most 1px. On
af798bd1's assets it fails in Chromium and WebKit ("200 -> 204", "0 -> 4");
with this change it passes 3/3 in each.
|
||
|
|
af798bd1bf |
routing, gui: the context window's card folds to its head, with how full it is beside the title ("114K / 272K · 42%"), and stays folded for the next request and after the page comes back, so the request list under it has the room (0xBCD18E on X: 这个"上下文窗口"的板块非常占"上下"高度,还不能折叠,下面只能展示三行)
ctxCard takes opts.foldable (Routing passes it; the Usage page's cards don't): its title becomes a button with a chevron, aria-expanded, and a click toggles .shut on the card, which hides all but the head. The choice is kept in localStorage (magpie.ctxShut). The head is morphed in place, so the click reads the button from the event, and the card that is there keeps .shut across live patches; a new card takes it from the saved choice. Verified: routing-ctx-fold.test.cjs (new), at 420 and 1100 wide in Chromium and WebKit, 3/3 each: open, then folded to one line (<60px) with the figure, the list under it up by >200px, nothing runs over at 420px; another request picked is still folded; after a reload still folded; opened again, 400 cells and the same height as before. It fails on the old code (no .ctx-fold). routing-*, context-*, usage*, group-context, click-scroll, panel-routing, old-webkit, gui-ja/de/zh-tw: WebKit 371/371; Chromium 370/371 once at --test-concurrency=4, routing-blocked's "picking the request moved the page", which passes 3/3 alone and in two more routing-* runs at the same concurrency (196/196 each). Not filed as caused by this change; seen once under load. |
||
|
|
6485f5ecb5 |
gui: the Routing page, and Usage's Context tab with a session open, scroll to their end in WebKit: their narrow and wide layouts go by classes set from each box's width, not container queries (#1249)
In WebKit (the macOS app's WKWebView, and Playwright's WebKit) the Routing page stopped well short of its bottom (wizzy-yang on #1213). Each time the page was drawn again while it was scrolled near its end, WebKit cut its scrollTop back to a shorter range. The page has query containers in it (.rt, .rt-accts, .rt-more, .rt-col), and the cut happens during a redraw. Seen at 440x620: 575 of 585, and up to a whole screen short when a part was redrawn. Chromium is unaffected. With container-type set to normal on those boxes the page reaches its end, and the cut goes away. Replacing a container with its clone at the end reproduces it in WKWebView too. Each box's width now sets a class, the same way container queries would have chosen a layout: - routing.js sets the classes from a ResizeObserver: max560 on .rt and .rt-accts, max460 on .rt-accts, max520/min1150 on .rt-more, and max440/max760 on each .rt-col. - context.js does the same for each .ctx-card: max520 and max420. - A rule that names the box goes through :where(), so it keeps the specificity it had inside its query. - The class is set on the next frame, as quotaFit does: set in the observer's own call, it changes the box's height, and WebKit reports that as a ResizeObserver loop. - A redrawn ctx-card starts with the width the last card in its place had (routing or session). It doesn't lay out wide for a frame and then narrow, which would itself pull the page up. - The Safari 15 @supports fallbacks are dropped. They chose a layout by the window's width, and ResizeObserver covers that Safari. Sibling: Usage → Context, with a session open, has the same bug. Each timed read redraws the card, and WebKit pulled the page up by up to 946px at 420 wide (682px at 1100). It is fixed the same way. The other query containers were checked at their end with a synthetic redraw and were not affected: Library's .lib-row.with-agents and Agents' .row.agent .who. Sessions (.sess-pane) also jumps in WebKit as it refreshes, but it still does with its container removed, so the cause is something else. It is left alone here. Run: - routing-scroll-end.test.cjs (new): 440x620, 600x700, 900x500, 1200x600 and 1400x700, en and zh, Chromium and WebKit, with the trace redrawing the page. It also checks the stage, request and column layouts. On the old CSS all 10 WebKit cases fail (twice); with the fix it passes 22/22 (four runs). - context-scroll-end.test.cjs (new): 420, 700 and 1100 wide, en and zh, across a timed read. On the old CSS the WebKit cases fail ("958 of 1891"…); with the fix it passes 14/14. - Layout compared with the old CSS: every element's rect on the Routing page (group editor closed and open) and in the Context card. Widths 360–1700, en/zh/zh-TW/ja/de, Chromium and WebKit: 220 + 100 configurations, none differ, and there are no page errors. - The macOS WKWebView: a part redrawn at the end left the page 200–238px short before the fix and 0 after, at 440 and 1100. - gui-ja, gui-de, gui-zh-tw and i18n-keys pass. - Full GUI suite (concurrency 4): 3719/3733. - Pass alone: azure-endpoint, remote-magpie, signin-again and routing-sessions. - mobile-web compares with origin/main, which had moved on; against this commit's parent it passes. - panel-arrange fails the same way on the parent. - context-window's chromium 1100px hover flakes under load on the parent too: 5 of 16 parallel runs, against 1 of 16 here. - go test ./internal/gui; GOOS=linux and GOOS=windows go vet ./internal/gui. Not run: the reporter's own machine, or an old Safari 15 WebKit. |
||
|
|
586f2bce8f |
context: magpie inspects the context window of every request, session and agent
The gateway reads each request's prompt into its parts (system prompt, tools and MCP servers, memory, files, tool results, chat), measured against the model's window and calibrated to the tokens the vendor counted. Routing shows a request's window as a card: a 400-cell grid by part, a hover naming what is largest in a cell, and the contents by part. The Usage page's Context tab scores each agent out of 100 (cache reuse, how lean it starts, how fast it grows, how reliably it answers), tags it (lean, cache-friendly, mcp-heavy, compacts, near-full…), and draws each session's growth with its latest request's card. Older Safari (15) gets media-query and solid-colour fallbacks for the card's container queries and color-mix. |