Commit Graph
2 Commits
Author SHA1 Message Date
yetone 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 d5cae267a, was cut short at 352 tests on the owner's
"ship": 6 reds (account-alias, account-models, codex-auto-review,
codex-credits, context-text) each pass alone, here and on main d5cae267a,
so they are timing under the full run's load and are to be filed. After
rebasing onto e4e22b23e: sidebar, side-toggle, session-identity,
filter-ime, library-instr-busy, usage-speed-count and view-scrollbar,
50/50 in chromium and webkit. go build ./... passes.
2026-10-12 00:41:34 +08:00
yetone 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.
2026-10-11 00:49:01 +08:00