Commit Graph
11 Commits
Author SHA1 Message Date
yetone 2ff85f8a2b gui: a page's bar room comes out of its right padding, so both sides match
v0.1.1904 had every page keep its scrollbar's room, so nothing moves
when a page grows past the window. The owner asked whether the clear
bar now makes the sides uneven: it did, by the bar's width (8px on the
Mac, 10px on Windows and Linux), and the centred pages sat 4px to the
left.

layout.js measures the bar of a .view into --bar (again on resize, so
a text-size zoom is followed), and app.css takes it from each page's
right padding: the panel's 12px, the window's 16px, the centred pages'
max(16px, 50% - 600px) and the phone web's safe-area right. The heads
and strips that reach over the padding (Library's and Settings' sticky
heads, Providers' after-list fade, the masking record's bar) reach that
much less on the right, or they would run the page sideways. A plugin's
page, whose frame scrolls itself, shows a bar only when it needs one.

layout.js's measuring adds 254 bytes to the core's scripts; the budget is
raised by exactly that, with no room added.

page-width-steady.test.cjs now checks every page's left gap against its
right gap with the bar (chromium and webkit, the Mac's 8px bar and the
10px one, 1100 and 1600 wide) and that no page scrolls sideways; that
check found Providers' after-list fade running 4px past the page. With
v0.1.1904's CSS it is red ("agents: 16px on the left, 24px on the
right (bar 8px)", 26px with the 10px bar, 94/102 centred). page-width's
"centred" check compared paddings only, and now counts the bar too.

Run on mote at this head (f70cb6825's tree, on origin/main 174250b27):
page-width-steady, page-width, inner-scroll-contain, settings-tabs-stick,
library-all, agent-layout, i18n-keys, text-size, view-scrollbar: 168 of
168 pass; go test ./internal/gui -run Budget ok. Before the last rebase,
209 GUI files that reach pages, heads, panels, providers, masking,
library, settings and the gateway (3087 tests) had 29 reds; the same
files on origin/main d4f1d6480 had the same ones, apart from flakes:
gateway-key-limit and gateway-key-cycle (#4072, from f835bd713),
gateway-older (waits for #gateway .dot, which f835bd713 replaced; filed
with #4072's fix next), menu-input-scroll (#3402), header-centre webkit
(a ResizeObserver loop message, red on main too), account-mask chromium
zh, and gateway-caller-keys / gateway-key-models reading the page right
after a resize to 560 (#3523, #3797).
Not tried: the real Windows and Linux apps.
2026-10-28 22:44:22 +08:00
yetone a41d0d5098 redact: the demo's notebook has a square icon and its entries under the header
The owner's screenshot of the masking demo's "小鹊的小本本" box: the
notebook icon was stretched tall, and the two entries overlapped the
subtitle and each other.

- The icon carried the class "acc", which app.css already styles as an
  accounts row (flex, min-height 38px, padding), so the 22px tile came
  out 38px tall. It is xq-acc now; none of the demo's other short class
  names (on, done, hot, ok, hl, far) has an app.css rule of its own.
- The entries were placed at fixed tops (40 and 81) under a header that
  is ~41px tall in CJK fonts. They are a flowing list now, after the
  header: each entry is its placeholder pill over its value, 5px apart,
  and a highlighted entry gets a soft background instead of colliding.
  The flyers already land on the values' measured positions, so the
  animation follows.
- German's title "Notizbuch der kleinen Elster" wrapped to two lines
  in the 220px box and pushed the last entry 14px out of it (the
  existing no-clip check caught it). It is "Notizbuch der Elster".

Test: masking-demo's layout test checks every box icon is 22×22 and
that each notebook entry starts at least 4px below what is above it.

Run at this tree (a463b3ede + this change), on mote:
- masking-demo + masking-records, both engines: 110 of 110.
- gui-de, gui-ja, gui-zh-tw, i18n-keys, mask-actions, mask-emails,
  masking-demo, masking-records, redact-kinds, redact-rule-edit,
  redact-rule-row, redact-shape, redact-words-any-case,
  redact-words-whole: chromium 259 of 259; webkit 135 of 136. The red
  was mask-emails' page.goto at its 5s default on the Routing page,
  at load ~80; alone it passes 3 of 3 here and 2 of 2 on origin/main
  a463b3ede. Filed as #3995 (the class of #3525).
- Screenshots of the notebook at the demo's end in zh dark, en light,
  de light and ja dark, both engines: square icon, entries under the
  header, nothing clipped.

Rebased onto 58fb3a778 (it adds a Windows modal-backdrop rule to app.css),
then run again at the pushed tree: masking-demo, masking-records,
i18n-keys and gui-de, both engines: 117 of 117. 60520ddb3 (moejs's module path, no GUI
file) landed after; the push is rebased onto it.

Broken by hand: the old demo.js and redact.css with the new test are
red in every language (icon 22×38, gaps false); with only the class
renamed, the old fixed-top entries are still red (gaps false, false).

Not tried: the real desktop app; the change is CSS and DOM order in a
page the GUI suite loads as the app does.
2026-10-28 14:39:34 +08:00
yetone f13aafa87e redact: the masking demo card keeps 14px from the card above it
The page has no gap of its own; the request list keeps its distance from
the card with margin-top: 14px. The demo card, put between them in
cad7bbbdb, had none, so it sat flush under the card above. It gets the
same 14px, and masking-demo checks the room above and below it is 14
and 14.

Run at this head (origin/main cad7bbbdb + this change), on mote:
- node --test masking-demo, masking-records: 108 pass, 0 fail
  (Chromium and WebKit, five languages, 1100 and 640px).
- Broken by hand: without the margin, the new check is red (0 for 14,
  WebKit en 1100px).
2026-10-28 06:56:38 +08:00
yetone cad7bbbdb7 redact: Insights › Masking shows how masking works, with Little Magpie, folded until opened
A card under "What the vendor didn't see" and above the request list
plays a 27s demo: Little Magpie takes one request (a GitHub sign-in with
a password and an email), tears the real values out into her notebook,
pastes placeholders in, sends it, and swaps them back on your computer
when the tool call comes home.

- Folded by default. The video (xq_light/xq_dark.webm, 1.7MB/1.5MB) and
  the stage are built only on the first open, so a folded card fetches
  nothing but its 0:27 thumbnail.
- It plays only while open, on screen, in a visible window and not
  covered by a single record's sheet; it plays once and rests on the
  last step. Under reduced motion it shows the last step, still.
- The stage (request, notebook, browser, provider) is drawn in the page
  and translated in every language (41 keys, zh, zh-TW, ja, de); only
  Little Magpie herself is video. Light and dark takes match the card's
  colour exactly, and the take follows the theme as it changes, still
  playing (a new source starts paused, so it is woken where T is).
- The request and provider boxes keep room for taller fonts: WebKitGTK's
  Noto ran the provider's note 16px past its box. The stage is 1000x420.
- T, the frame clock, is the authority; a video that drifts (a seek
  it couldn't make) is sent back to T, never the other way.

Run at this head (origin/main 4842f69be + this change), on mote (macOS 27):
- node --test masking-demo, masking-records, i18n-keys: 111 pass, 1
  fail. The red is i18n-keys "a plugin's words are its own" on
  plugins/library "Runs as", red on main since 7f827b3b0 (#3897).
- masking-demo: Chromium and WebKit x en/zh/zh-TW/ja/de x 1100/640:
  folded fetches no webm, opening fetches one, the stage fits, no
  English left, nothing wider than the window, every box's text inside
  it (4px to spare in request and provider); plays, stops when folded
  or covered, rests at the end, restarts; dark take on the card colour;
  a theme changed mid-play goes on playing in the new take.
- go test ./internal/gui/: only TestMainWindowCorners/macOS_26_SDK red,
  the same on main (#3949); TestCoreScriptBudget ok.
- gofmt clean (no Go changed); go vet, GOOS=linux go vet -tags nogui,
  GOOS=windows go vet ./internal/gui/ clean.

Broken by hand:
- T following vid.currentTime (the first take): "plays while open" red
  in Chromium (the step 7 seek never stuck); green after.
- pickVid without wake(): the theme test red in both engines (0/2).
- The provider box at 350px: the no-clip check red ("prov -26px").

Whole GUI suite (*.test.cjs, mote, before the rebase, at dc1cfe015 +
this change): 75 files pass, 33 fail; origin/main 9e6347608 alone: 73
pass, 35 fail. Every file red with this change is red on main too:
account-mask (#3951), gateway-caller-keys (#3797), gateway-key-models
(#2648), header-centre (#3479), icon-tile (#3858), library-row-remove
(#3099), menu-input-scroll (#3402), mobile-web (#3952), old-webkit
(#3403), phone-web (#3876), quota-count-wrap (#3404),
quota-refresh-order (#3679).

Real use, magpie web from this tree:
- Windows 11 (xiaomi-gpu), Edge 156 headless = WebView2's engine:
  folded fetches no webm, VP9 "probably"; rAF 60fps, video 30fps, T
  never steps back; the step 7 seek holds; the theme switch keeps
  playing; rests at 27.5s; no page errors; every box fits in all five
  languages (8px or more to spare).
- Linux (WSL2 magpie-desktop, WebKitGTK 2.52.6 under Xvfb, compositing
  off as under Wayland): plays with T on the video's time, seeks, rests
  at the end, no errors. It found the two fixes above: the theme switch
  left the new take paused, and the provider's note ran 16px past its
  box in English and Japanese (and the request box 6px in ja and de). After: 10px or more to
  spare in all five languages.

Not tried: the packaged Linux and Windows apps themselves (magpie web
in their engines stood in); a real request through masking (the demo
is drawn, not live).
2026-10-28 06:43:31 +08:00
yetone 29f1a5a717 redact: a request's steps are joined number to number, not by a dash before each
The owner's screenshot of a masked request showed a short dash left of
steps 2 to 5. The connector (li + li::before) was 10px wide at left
-10px, so it covered only the grid gap, and read as a stray dash beside
each number. It now runs from the number before to this one, 6px clear
of each (columns are equal, 10px apart, numbers 20px).

masking-records' request test measures each line's ends against the two
numbers: 6px from each.

Run: masking-records.test.cjs whole (both engines, every language, 1100
and 640px), 82 of 82 ok. At 640px (container under 760px) the lines stay
hidden, as before.
2026-10-26 22:50:37 +08:00
yetone 4b3bdbe28c masking: the flow's dots, scan and Live dot stop moving once played (#3185)
The Masking page never came to rest. Each dot in its agents-to-providers
flow was an SVG animateMotion with repeatCount "indefinite", the scan
mark on the middle line ran forever, and the Live dot pulsed forever.
The SMIL dots alone made Chromium lay the page out ~700 times a second
(6,965 layouts and 2,282 style recalcs in 10s, read with CDP
Performance.getMetrics). Removing just those 22 elements took it to 0.

Now each dot goes round twice when the flow is drawn, and the scan mark
plays twice. The flow is drawn again only when the numbers change. The
Live dot pulses once each time the list is drawn again, which happens on
each 15s read. Reduced motion is unchanged: still no motion at all.

Measured on a sandbox `magpie app` (origin/main, sandbox HOME, real
deepseek provider, the real masking log copied in: 19,657 values over
577 requests). The Masking page was loaded in Playwright 1.62.0, and only
that browser's own processes were sampled with proc_pid_rusage, 20s per
sample:
- WebKit, before: 180 wakeups/s, 2.8% CPU, 56 mW.
  After: 37/s and 9.7 mW while the motion plays out (8-28s), then
  10.8/s, 0.1% CPU, 1.4 mW.
- Chromium, before: 96-98/s, 17% CPU, 537-543 mW.
  After: 40/s, 2.0% CPU, 57 mW while the motion plays out, then
  18.5/s, 0.5% CPU, 10 mW.
- The other pages at rest: 12-30/s and 1.6-7.7 mW in WebKit.

Test: masking-records' new "the masking page's motion ends" (chromium
and webkit, 1100px and 640px). It moves the SVG clock on an hour and
asks Chromium whether any dot is still in an interval. In both engines
it checks that no SMIL element is set to repeat for good and that no
CSS animation has an infinite end. All 4 cases are red on the old
page.js/redact.css and green on the new ones.

Run at this tree:
- masking-records, held-animations and i18n-keys: 68/68.
- account-mask-sessions, account-mask, mask-actions, mask-emails,
  provider-unmasked and redact-*: 172/172.
- go test -timeout 45m ./internal/gui: ok.
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui: ok.
- gofmt: clean.

Other states measured, with no change made:
- Go main process at rest with the window open: 25/s, 7 mW.
- Streaming 3 deepseek-flash replies (2,450 SSE events in 20s):
  275/s, 3.5% CPU, 107 mW, about 2 wakeups per event.

Not tried: the window hidden and the tray panel open; the
WKWebView in the real app window on Masking (measured in Playwright's
WebKit instead); the full GUI suite.
2026-10-25 20:33:33 +08:00
yetone dc6f3d496c masking: the flow's logos sit on one disc each, before the name on both sides
Insights › Masking's flow card showed each agent's and provider's logo
bare in a 16px box. A logo's own drawing fills that box or not (Pi's
edge to edge, Codex's a small tile, Alma's a picture), so three logos
of one box read as three sizes (the owner's screenshot). And an
agent's logo came after its right-aligned name, so the logos and the
names on that side lined up with nothing.

- Every logo sits 14px on a 24px disc (card fill, hairline ring), the
  disc the app's agent stacks use.
- Both sides read logo, then name over count, left-aligned. The
  agents' nodes are one block against the lines (a grid track as wide
  as the widest), so their logos make one column and their names one
  edge, as the providers' do.

Run (rebased on origin/main of 19:00, 10-25):
- masking-records.test.cjs: 52/52, Chromium and WebKit, 5 languages,
  1100px and 640px. Its flow check now asserts logo before name on
  both sides, a 24px round disc for every logo, and one column of
  logos and one edge of names per side.
- Screenshots with the owner's case (Pi, Codex, Alma → OpenRouter,
  Codex, OpenCode Zen), dark, 1x and 2x, looked at.

Broken by hand: the agent's logo back after its name turns
masking-records red ("the logo before the name").

Not tried: the light theme by eye (the disc is drawn from theme
tokens), the real app on WebKitGTK or Windows. Budgets untouched:
plugins/redact isn't in the core.
2026-10-25 19:14:47 +08:00
yetone 9277c25673 masking: under the number, the flow's middle takes the card's width, and sits further from the chart
The owner's screenshot of Insights › 脱敏 with the band stacked: the
animation stayed narrow, as each of the flow's three columns kept a
third of the card, and it sat 16px under the chart.

Under 780px the names now take what they need (fit-content, up to 150px,
120px under 640px) and the middle the rest; the gap is 28px. Measured in
Chromium, the middle's width before → after: 760px window 386 → 452,
640px 189 → 365, 560px 162 → 285, 480px 135 → 205. 820px and up (the
flow beside the number) is unchanged.

Run: screenshots at 760, 640 and 560 in Chromium and WebKit, before and
after; GUI masking-records 52/52, privacy-usage-stats 4/4, mask-actions
20/20, i18n-keys 4/4, click-scroll 22/22; privacy-model 23/24 in that
run, beside a Go test run, and 24/24 three times alone after it (the
failing test's name wasn't kept); go test -tags nogui -run Budget
./internal/gui ok.
Not tried: the whole GUI suite; the real Linux app (WebKitGTK).
2026-10-25 17:05:38 +08:00
yetone dbbe979914 masking: the flow goes under the number before its middle bunches up (window ~760px)
ZeRo Xu on X (10-25) showed the Masking card in a narrow window: the
flow beside the number had its middle squeezed to a sliver, the lines
bunched up and "OpenCode Zen" was cut to "OpenCod…".

The band put the flow beside the number down to a 640px container. Measured
with the reporter's data (Codex 19.6K; openai 14.1K, Codex 3.7K, OpenCode
Zen 1.9K) the flow's middle is 410px at a 1068px container, 162 at 820,
110 at 760 and 80 (its floor) at 700, where the names are cut. Now the
flow goes under the number from a 780px container, as it already did
under 640, so it has the card's whole width; the 640px rules (narrow
side columns and the rest) are unchanged.

Run at this head: GUI masking-records, privacy-usage-stats, privacy-model,
mask-actions, i18n-keys, click-scroll (both engines, all pass); go test
-run Budget ./internal/gui ok. Screenshots at 1280, 1000, 900, 820, 780,
760, 700 and 560 in Chromium and WebKit, before and after.

Not tried: the real Linux (WebKitGTK) and Windows apps; CSS only, no
motion or new API.
2026-10-25 04:18:58 +08:00
yetone d3fb381afe gui: Masking's bird sits in the middle of its ring; agents and providers show their logos
The flow's rule for its hairline layer, `.mo-mid svg { position:
absolute; inset: 0 }`, also matched the bird's svg inside .msk-hub, so
the 20px bird was pinned to the 30px ring's top-left corner (5px left
and 5px up). The rule is now `.mo-mid > svg`, and the hub's flex
centring places the bird.

Each agent and provider in the flow has its logo, from the same icon()
and maskWho icon the request rows already use: an agent's after its
name, a provider's before it, both on the side where the lines are. An
"N more" row keeps an empty slot so the names line up.

The test fixture's agent icons were "claude" and "codex", which aren't
icon files. They are now claudecode-color and codex-color, as the real
agents have.

Run at 71fd92ddf + this:
- masking-records.test.cjs + i18n-keys.test.cjs: 36/36 (Chromium and
  WebKit, every language, 1100 and 640px)
- go test ./internal/gui -run Budget: ok
- measured: the bird's svg went from the ring's corner (779,160.5) to
  (784,165.5), centred in the 30px ring

Broken by hand: the old redact.css fails "the bird in the middle of its
ring"; the old page.js fails the logo check.

Not tried: the real Linux (WebKitGTK) and Windows apps, and the whole
GUI suite. The change is confined to the masking plugin's files, and no
other page uses mo-/msk- classes.
2026-10-25 00:46:57 +08:00
yetone e698a688fd gui: Insights › Masking shows each request as sent, what was masked and how
What masking did moves out of Settings › Privacy into a page of its own
under Insights (plugins/redact: client.js, page.js, redact.css, i18n.js).
Privacy keeps how it is found and what to mask, with a "What was masked"
row that opens the page.

- The top card is Privacy's card, made shorter: the flow animation
  (agents → this computer → providers) with magpie's bird on the centre
  line and "magpie masks it on this computer" under it, so a screenshot
  says who masked it; the count and a 7-day bar. Nothing the list repeats.
- The list: one row per masked request, narrowed by kind, by who found it
  (rules or the local model), by agent or provider, or to held-back
  requests; or by value, each with how often it was put back.
- A request: the message as it went to the vendor beside the original,
  each mask marked, unchanged parts folded; picking a value lights every
  place it was masked; a held-back request offers "Mask it instead".
- Gateway's masked badge and ?view=masking&key=N (trace.go's mainView)
  open one request.
- Classes are msk-: library.css owns mk- (a first cut stacked the flow).
- Budgets lowered to the core's size after the move.
- Not shown: rule names and the local model's confidence; the records
  don't keep them.

Run on f5b1d36ff (rebased since onto 344d11484, which only raised the
budgets and changed a dialog's centring and two unrelated files):
- masking-records.test.cjs: 32/32, Chromium and WebKit, 5 languages,
  1100px and 640px (card, list, filters, detail, put back, held back,
  Gateway badge, deep link, Settings row, no scroll on click), with
  key-import and i18n-keys: 48/48.
- go test ./internal/maskrec ./internal/redact ./plugins/redact
  ./internal/gui ./internal/provider: ok. TestCoreScriptBudget and
  TestMainView ok; gofmt -l clean.
- Before the rebase, on 628e18987: go test ./... -timeout 45m, every
  package ok; GOOS=linux go vet -tags nogui ./... and GOOS=windows go
  vet ./... clean.
- Budgets lowered to the sizes at the pushed head (app.js 1,317,486,
  core 1,524,789), ~26KB under what f35c721c4 raised them to after
  ce5b23cdb's add-key spinner put the core over.

Broken by hand: the bird's href (#bird → #nobird) turns masking-records
red.

Not run at this head when pushed: internal/gateway, which main's newer
commits touched (run right after; the result goes on the release).
Not tried: the whole GUI suite (hours long, and another session's runs
held the machine), the real Linux (WebKitGTK) and Windows apps.
2026-10-24 19:45:03 +08:00