Files
magpie/internal/gui/assets/omarchy.css
T
yetone 17a2b00efb gui: the sidebar's open page moves from row to row on a spring, as iOS's selection does
The owner asked for the sidebar's pages (Providers, Routing, Gateway…)
to slide from one to the next like their sub-tabs do, "like iOS".

The open page's row is now marked by one shape (.nav-top-hl) that
navTopGo moves on a damped spring (NAV_SPRING: SwiftUI's response
0.42s, damping 0.84; navTopStep, four sub-steps a frame, dt capped):
- it sets off as the row is pressed, and comes back if the press
  leaves the row or the page refuses to be left;
- being physics, a press that changes its mind turns it with the speed
  it has, never a jump;
- it follows its row while Usage's tab list folds above it and lands
  where the row ends up;
- it is put in place, not sent, when the window opens on a kept page or
  the rows move under it at rest (ResizeObserver); away while Settings
  is open, it fades back in on its row; reduced motion jumps; the
  header's tabs keep their .thumb and draw none.
The rows give up their own ground (open, hovered, pressed) to it.
#nav is position: relative in the sidebar for it, so .seg's centring
left/top are reset (without that the whole list sat 105px right).

Tests:
- sidebar-glide.test.cjs (new): Chromium + WebKit, en + zh, 1024 and
  1440, plus 900 (header): at rest on its row and the list in the
  sidebar, no ground hovered, press sets off before release and comes
  back off the row, Providers→Usage→Agents by frames (≥3 moving
  frames, overshoot < 3px) landing on the row, Settings hides it and
  Routing brings it back, reduced motion jumps, no page errors.
  Broken by hand: without the left/top reset the list check goes red;
  before the "not seen yet" rule the boot slid from Agents (red).
- sidebar.test.cjs: a pressed page row no longer darkens itself (the
  shape comes to it); Settings still must.
- routing-idle-frame.test.cjs counted every self-asking rAF callback as
  Routing's loop, so navTopStep after the click read as 33 Routing
  frames. It now counts only callbacks no global holds (app.js's are
  globals; Routing's frame is in its plugin's scope). Broken by hand:
  Routing's loop made to always ask again → 4 red; green on main's
  assets and on this change.
- TestCoreScriptBudget: app.js 1,343,324 / core 1,535,084 with no room
  added; the sidebar is the window's shell, not a page a plugin can take.

Run:
- Full GUI suite at 183fa169b (this change on 3b10a403d), alone on the
  machine but at load ~216: 11942 pass, 104 fail. The 25 red files
  rerun at load ~10 on this change and on 3b10a403d: the same reds on
  both except routing-idle-frame (fixed above); plugin-card-update,
  segment-press-dialog and sidebar-overlay-scrollbar pass alone here
  (segment-press-dialog red alone on main: #3416). Reds on main, filed:
  #3402 #3403 #3404 #3405 #3406 #3407 #3408 #3409 #3410 #3411 #3412
  #3413 #3414 #3415; already filed: #3350 #3099 #3096 #3094 #3091
  #3104 #3001. codex-predictions and codex-auto-reset were red only at
  load ~216 and passed in both reruns.
- At the pushed head (rebased on f3eb92924): sidebar, sidebar-glide,
  nav-sub-unroll, side-toggle, side-width, header-relang,
  sidebar-tab-top, settings-tabs-stick, omarchy,
  sidebar-overlay-scrollbar, click-scroll, routing-idle-frame,
  plugin-card-update, segment-press-dialog, i18n-keys: 230/230;
  go test -tags nogui -run 'TestCoreScriptBudget|I18n|Docs'
  ./internal/gui: ok; gofmt -l clean.

Not tried: the real Linux app (WebKitGTK); this uses only rAF and
transforms, no view transition. Not run: the full Go suite (only
internal/gui's budget/docs tests; no Go code changed).
2026-10-24 02:21:45 +08:00

73 lines
5.1 KiB
CSS

/* Omarchy: magpie drawn in Omarchy's own design language, only on Omarchy.
omarchy.js puts the class on <html> and the theme's colours, font, border
and rounding (from ~/.local/state/omarchy/current/theme and Hyprland) in
the variables; everything here is scoped under html.omarchy, so no other
system sees any of it. Omarchy's shell draws flat: no shadows, no blur, no
rounding (Hyprland's decoration:rounding, 0 by default), popups framed by
the window border's colour, uppercase letter-spaced labels, and a row
picked out by a faint fill with its text in the accent. */
/* what only Omarchy shows, and what it hides: the Appearance setting follows
Omarchy's theme instead of offering light and dark */
.om-only { display: none !important; }
html.omarchy .om-hide { display: none !important; }
html.omarchy .om-only { display: revert !important; }
html.omarchy .om-theme-name { color: var(--accent); font-size: 12px; white-space: nowrap; }
html.omarchy, html.omarchy body { font-family: var(--ui-font, var(--font)); font-size: var(--om-size); }
html:where([data-fonts]).omarchy, html:where([data-fonts]).omarchy body { font-style: var(--ui-style, inherit); font-weight: var(--ui-weight, inherit); font-stretch: var(--ui-stretch, 100%); }
html.omarchy body { -webkit-font-smoothing: antialiased; }
/* square, or rounded as far as Hyprland rounds its windows; what spins or
draws a dial stays round, as does a slider.s knob; a status dot goes square, like Omarchy.s workspace marks */
html.omarchy *, html.omarchy *::before, html.omarchy *::after { border-radius: var(--om-radius) !important; }
html.omarchy :is(.pq-dial, .pq-dial b, .sk-ring, .si-spin, .mk-spin, .signing .spinner, .eslide .knob, .effort-ticks i),
html.omarchy input[type="range"]::-webkit-slider-thumb { border-radius: 50% !important; }
/* no shadows or frosted glass: surfaces are the theme's background */
html.omarchy * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.omarchy :is(.pop, .modal .dialog, .status.lift, body.panel .profiles.open, .list, body.panel .list, .seg > .thumb) { box-shadow: none; }
html.omarchy body.panel { background: var(--bg); border: var(--om-border) solid var(--om-edge); }
/* popups, menus and dialogs: framed by the window border's colour */
html.omarchy :is(.pop, body.panel .profiles.open, .status.lift) { background: var(--pop-bg); border: var(--om-border) solid var(--om-edge) !important; }
html.omarchy .modal { background: color-mix(in srgb, var(--bg) 55%, transparent); }
html.omarchy .modal .dialog { background: var(--bg); border: var(--om-border) solid var(--om-edge); }
/* labels as Omarchy's shell sets its headings: uppercase, spaced out */
html.omarchy :is(.label, .pop li.group, .kpi span, .editor .ehead + * .k) { letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
html.omarchy .brand { letter-spacing: 0; font-weight: 700; }
/* the tabs: no track, the chosen one a faint square with its text in the accent */
html.omarchy .seg { background: transparent; }
html.omarchy .seg > .thumb { background: var(--om-sel); }
html.omarchy :is(.seg button.on, .ptabs button.on, .opt.on) { color: var(--accent); }
html.omarchy :is(.segs, .ptabs) { background: transparent; }
html.omarchy :is(.segs, .ptabs) > .thumb { background: var(--om-sel); box-shadow: inset 0 0 0 1px var(--om-sel-line); }
/* lists: a hairline frame, rows picked out by a faint fill */
html.omarchy .list { border: 1px solid var(--line); background: transparent; }
html.omarchy .row:hover { background: var(--om-hover); }
/* controls: Omarchy's buttons are a faint fill under a thin edge */
html.omarchy .field, html.omarchy body.panel .field, html.omarchy body.panel .field:hover { background: var(--om-hover); box-shadow: inset 0 0 0 1px var(--om-hover-line); }
html.omarchy .field:hover { background: var(--om-sel); }
html.omarchy .field.open, html.omarchy body.panel .field.open { box-shadow: inset 0 0 0 1px var(--accent); }
html.omarchy .icon:hover { background: var(--om-sel); color: var(--accent); }
html.omarchy .text.primary { background: var(--accent); color: var(--accent-fg); }
/* a menu's row under the cursor or keys: the fill and the accent, like Walker's */
html.omarchy :is(.pop li.sel, .pop li:hover:not(.group), .row-menu .rm-item:not(:disabled):is(:hover, :focus)) { background: var(--om-sel); color: var(--accent); }
html.omarchy :is(.pop li.sel, .pop li:hover) :is(.v, .n) { color: inherit; }
/* Linux's close button: square like the rest */
html.omarchy .icon.winclose { background: transparent; }
html.omarchy .icon.winclose:hover { background: var(--red-soft); color: var(--red); }
html.omarchy ::selection { background: var(--om-sel); color: var(--accent); }
html.omarchy body.side-nav :is(#nav button[data-view], #prefs).on { background: var(--om-sel); box-shadow: inset 0 0 0 1px var(--om-sel-line); color: var(--accent); }
html.omarchy .nav-hl { background: var(--om-sel); }
html.omarchy body.side-nav #nav > .nav-top-hl { background: var(--om-sel); box-shadow: inset 0 0 0 1px var(--om-sel-line); }
html.omarchy body.side-nav #nav.hl-on button[data-view].on { background: transparent; box-shadow: none; }
html.omarchy .nav-s.cur { color: var(--accent); }