ac4af582301a4e8a29245dbba767eba31334ddf9
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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 |
||
|
|
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
|
||
|
|
a7a38193f5 |
gui, settings: colorblind mode for quota curves and chart series (#2073)
In Usage -> Allowances, the 5-hour and weekly quota curves and their
legend dots took --c1 and --c2, which are both shades of blue in light
(#4f46e5, #0ea5e9) and dark (#a5b4fc, #7dd3fc) themes, with identical
solid lines and 7px round dots and the 5-hour line dimmed to .45 over a
week (#2073, chenlz22550).
- settings.Colorblind ("colorblind" in settings.json), passed in GET
/boot.js when on and applied before first paint by theme.js and on
every state/settings read by applyPrefs as data-colorblind="1" on
:root.
- Settings -> General adds a Colorblind mode row (#colorblindRow,
#colorblindSegs) under Appearance, in en, zh, zh-TW, ja and de.
- Under :root[data-colorblind="1"], --c1...--c7 switch to an Okabe-Ito
qualitative palette in both light and dark themes so adjacent series
differ in hue and lightness across quota curves, tray sparklines, the
usage ledger and context charts.
- drawQuotaPlot and quotaCurve's drawLegend tag each series with
data-series on path.qc-line and .qc-key; in colorblind mode series 0
and series 1+ use distinct stroke-dasharray patterns and legend swatch
shapes (filled circle vs hollow square/diamond), and .qc-line.qc-short
keeps .85 opacity so short windows stay legible over a weekly span.
- docs/subsystems/gui-shell.md documents the boot and Settings contract.
Run (on origin/main
|
||
|
|
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 |
||
|
|
bd33e575f1 |
gui: let users choose installed interface and code fonts (#1007)
* gui: choose installed interface and code fonts and styles Discover installed styles through DirectWrite, CoreText and Fontconfig. Keep choices per computer, apply them before paint and notify both desktop webviews after saving; defaults retain platform and Omarchy fallbacks. Verified seven focused Go tests, including real Windows discovery (90 families, 276 styles), 14 font browser cases in Chromium/WebKit, 68 settings/zoom/Omarchy/web cases, go vet, Windows amd64/arm64 and Linux nogui builds. Against the original assets, the new UI test fails with Settings must offer an interface font picker (0 != 1). Full Windows suites have separately reproduced upstream failures; macOS/Linux native discovery is covered by the added CI step. * gui: retain bundled Mac fonts and variable style precision Only filter an undownloaded CoreText face when it is explicitly downloadable; bundled fonts are installed without being downloaded. Use resolved font names when descriptors omit them. Preserve fractional weights and nonnegative CSS widths for named variable styles. * gui: restore the authored font cascade when returning to defaults Apply family-only trait overrides only while a custom face is active. The browser regression catches code under a bold parent becoming 700 instead of its original 400. Keep the compatibility shim first, and apply boot fonts before visible content. * gui: keep font picker review separate from CI integration Leave the native test sources and manual verification command with the feature. Move the added workflow step to a follow-up so the font picker can take the normal review path requested on PR #1007. |
||
|
|
bf25a3ae80 |
omarchy: on Omarchy, magpie is drawn in Omarchy's own design language, follows its theme, drops its panel under the bar as Omarchy's own menus do, and can put its icon in Omarchy's bar (让整个UI/UX完全符合Omarchy的设计语言…单独对Omarchy做这个支持,现在的UI/UX当然要保留) — on Hyprland magpie looked like any other GTK app: its own light/dark palette, rounded shadowed popups, and a tray panel floated framed and dimmed in the middle of the screen, labelled with the program's name, never closing on a click elsewhere (focus follows the mouse there, so Wails turns off focus-lost hiding), and its tray icon was hidden in the bar's drawer. Now, only when Omarchy is detected (internal/omarchy: ~/.local/share/omarchy and its current theme), boot.js hands the page the current theme (colors.toml, the shell's theme TOML, Hyprland's border size, colour and rounding, Omarchy's font) as CSS variables before the first paint, and omarchy.css, all under html.omarchy, draws flat as Omarchy's shell does: the theme's background, no shadows or blur, corners as round as Hyprland's windows, popups and dialogs framed by the active border's colour, uppercase letter-spaced labels, rows and picks as a faint fill with the text in the accent. /api/omarchy is polled every 2.5s, so a theme picked in Omarchy's menu reaches the windows at once; Settings → Appearance shows the theme's name instead of Light/Dark/System. Under Hyprland the tray panel gets a title of its own ("magpie panel", set through GTK since Wails leaves frameless windows untitled), and each opening gives Hyprland a named Lua window rule placing it under the bar at the click, 6px in from the edges, pinned, opaque, borderless; its height is capped to the work area. While it is open a non-consuming left-click bind emits a custom event on Hyprland's socket2; a click outside the panel and below the bar closes it (the bar is left to its icons, so the icon toggles), and the bind is removed on close or, after Escape, on the next click. The tray item's SNI id is "magpie" instead of "Wails", so it can be pinned. Settings → Bar icon (状态栏图标), shown only in the app on Omarchy's Hyprland, puts an Omarchy bar-widget plugin (usemagpie.magpie, a bird glyph, in ~/.config/omarchy/plugins, then rescanPlugins and plugin enable) beside Omarchy's own icons: a click runs magpie panel, a right-click magpie app; Off disables and removes it; a widget pointing at a moved or older magpie is rewritten at start. magpie panel (new) opens the quick panel, starting magpie if needed, or toggles it in the running instance. Elsewhere nothing changes. Tested in a Hyper-V VM on the latest Omarchy (Hyprland 0.56, 2528×960 at scale 1.6): the look with tokyo-night; the panel at [1134,32] under the bar; clicks on the panel and the bar keep it open, a click on another window closes it, the icon toggles it, Escape closes it and the bind goes; Bar icon On adds the bird to the bar, its click opens the panel under it (also with magpie not running), a second click closes it, right-click opens the window, Off removes it; autostart becomes app-magpie@autostart through systemd's XDG generator; the launcher entry and icon are there. Go: internal/omarchy tests (theme parsing, panel placement on scaled and turned monitors, click-outside geometry, widget files quoted with the executable, KeepWidget rewriting only a stale one). A new internal/gui/tests/omarchy.test.cjs, Chromium and WebKit, en and zh: with no Omarchy theme the page has no omarchy class or theme style, the Appearance choices show, no Bar icon row, nothing asked of /api/omarchy; with one, the theme's background, square corners, its name, and Bar icon's On and Off each posted with nothing scrolled, hidden when the bar isn't there. old-webkit now lets omarchy.js load in the head beside boot.js (it does nothing off Omarchy). The full GUI suite, gofmt, go vet, go build (GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass. Not tried: other Hyprland setups than Omarchy's, a multi-monitor VM, and the GTK4 build in the VM (gtk3 was used).
|