Commit Graph
2 Commits
Author SHA1 Message Date
yetone f5dd4d604e gui: the Linux app's sidebar button switches the layout at once, no view transition, which WebKitGTK with compositing off crashed in (depravity_wings on X)
Since 18e82adc6 (v0.1.1197) the sidebar button, Ctrl+Shift+S and dragging
the sidebar's edge past its narrowest trade the two layouts in a view
transition (navMorph). Under Wayland magpie turns WebKitGTK's compositing
off (webkit_linux.go), and WebKitGTK 2.52 then crashes in the transition:
SIGSEGV on the GTK main thread inside libwebkit2gtk-4.1, from a
JavaScriptCore run-loop timer. The reporter saw the window freeze.

The Linux app (body.linux) now has the new layout at once, the path reduced
motion already takes; magpie web in a Linux browser keeps the motion. Other
webviews get a guard: a transition still going after MORPH_MAX (1.5s, three
times its length) is skipped, so one that never ends can't leave the window
on the old layout's picture.

Run:
- Reproduced on the omarchy VM (Hyprland/Wayland, webkit2gtk-4.1 2.52.6),
  v0.1.1207 under a scratch HOME: the button crashed the app 4 of 4 clicks;
  with WEBKIT_DISABLE_COMPOSITING_MODE=0 it didn't.
- The fixed build there (same Linux path, compositing at magpie's default):
  8 button clicks, 4 Ctrl+Shift+S and an edge drag past its narrowest all
  switched the layout, checked by screenshot each step; no crash, no freeze.
- side-toggle.test.cjs: "Linux: at once, no transition" and "a transition
  that never ends is cut short", chromium and webkit; both go red with the
  change undone by hand. side-toggle, sidebar, side-width, header-centre
  pass in both engines (60 tests). go test -tags nogui ./internal/gui ok.
Not run: the 1.5s guard on a real webview that never ends a transition
(none found); it is tested with a stub.
2026-10-12 19:13:14 +08:00
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