88b4c00ea11c8653cada22e11edf20ab1594de43
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0db8112afe |
omarchy: on Hyprland the tray panel opens under the click on a monitor that isn't at 0,0, not off the screen (#1785)
PanelAt answered where the panel goes in coordinates across the whole
layout (the cursor's, from hyprctl cursorpos), and PlacePanel handed them
to Hyprland's move rule. Hyprland counts a move from the corner of the
window's monitor (CDefaultFloatingAlgorithm::newTarget in 0.56.2:
COMPUTED + MONITOR_POS), so the monitor's place was added twice. The
reporter's click on the right of two 1920-wide monitors asked for
3238,40 and got 5158,40, off every screen. The monitor at 0,0 hid it,
and the only setup tried before (
|
||
|
|
336605dc96 |
omarchy tests: TestCurrent starts from no theme read, so a second run (-count=2) isn't handed the first run's cached font
Current keeps the last theme it read for a second, and the package state
outlived the test, so the second run's first read came back from the cache
with the font the first run ended on. Seen while working on #1670.
Ran: go test -count=2 -run 'TestCurrent$' ./internal/omarchy/ fails on
|
||
|
|
f131117976 |
gui: on niri the tray panel opens under the bar beside the clicked icon, not in the middle of the screen (#1670, Kenoia)
A Wayland window can't place itself. Under niri the panel opened where niri floats a new window, the middle of the output. Hyprland already had an adapter (omarchy/hypr.go); niri now has one too. niri (checked in niri v26.04's source, niri-ipc/src/lib.rs and src/ipc/server.rs) can't add window rules at runtime and doesn't report the pointer over IPC. So omarchy.NiriPanel watches niri's event stream ($NIRI_SOCKET, one line of JSON per message) and moves each window of magpie's pid titled "magpie panel" once as it opens: MoveWindowToFloating if it was tiled, then MoveFloatingWindow with SetFixed x/y, which count from the working area's top-left (below the bar). It goes 6 px under the bar, centred on the x that the tray host passed to the SNI Activate(x, y), kept inside the output. Wails' Linux tray keeps that x in private fields (lastClickX/lastClickY), read the same way trayProps already reads props; TestTrayClickIsWails reads Wails' source to fail if they move. Noctalia passes bar-surface-local coordinates, so the x is taken across the focused output. With no click (`magpie panel`), or with one off the output, it goes to the top right. Wails' HideOnFocusLost closes it when another window takes the focus. What was run: - go test -race ./internal/omarchy/, go test ./internal/gui/ (sandbox HOME, pinned GOMODCACHE/GOCACHE). The IPC fixtures are built from niri-ipc 26.4.0's Window/Output/Event/Reply types, quoted in the test. - Broke it by hand: dropping the placed-once map fails TestWatchWindows (placed [7 7 9 9 9]); dropping the right-edge clamp fails TestPanelSpot. - gofmt -l; go vet (darwin), GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...; linux nogui and windows builds. - A nested niri 26.04 (winit backend on Xvfb, scale 1.5, Fedora 43 container, magpie built with -tags gtk3), with SNI Activate sent via dbus-send. Activate(300, 14) put the panel at [58, 6] (300 - 484/2). A second Activate closed it. `magpie panel` reopened it at the top right (853 - 484 - 6 = 363). Activate(800, 14) clamped it to 363. `magpie gui` taking the focus closed it. Not tried: a real niri desktop, Noctalia or another real tray host (Waybar, ironbar), more than one monitor, a bar at the bottom or the side (not accounted for), focus-follows-mouse. The panel still opens in the middle and slides up; how visible that is on real hardware wasn't seen. Not from this change: omarchy's TestCurrent fails with -count=2 on main (it passes with -count=1). |
||
|
|
21702d01ff |
Add German translation; harden paths against unset env vars (#770)
* Add German translation and harden paths against unset env vars Add a German locale to the GUI, tray menu, usage alerts and website home page, and refuse to start when the home folder is unset or relative so nothing is written under the working folder; the pi plugin no longer adopts the user's PI_CODING_AGENT_DIR, and an inherited APPIMAGE no longer selects portable mode. Scripts refuse to run from the wrong folder or empty a shared out folder, and a new internal/testenv sandboxes every test package from the user's real files, which also fixes the Claude picker and Termux installer tests on Windows. * Makefile: know magpie's folder by its go.mod, so paths with spaces work The check compared $(CURDIR) with $(dir $(abspath …)), which make splits on spaces, so a checkout under 'My Projects' or 'John Doe' refused every target. It now reads go.mod relative to the working folder and wants magpie's module there: make -C and a symlinked Makefile work, make -f from another folder still stops before any recipe runs. * i18n: German for the strings main added since, with a parity test 75 strings main added (group order, patterns, slow-start wait, usage caps, RTK savings …) get their German, and two that main dropped go. gui-de.test.cjs checks, as gui-ja does, that de has every zh string with its placeholders and tags, and that the window reads in German when picked or on a German system. * appdir: ignore relative folder variables when reading, keep them for children CheckEnv no longer unsets anything. magpie reads the XDG folders, APPDATA/LOCALAPPDATA and every agent's folder variable through appdir.Getenv/LookupEnv, which pass over a relative value; the environment stays as it is, so the agents magpie starts get the variable as the user set it. That covers what proc.UserPath lends from the login shell too, which is set after main's check and reached the desktop app unchecked. On Windows a path rooted on the current drive (\Users\x, Git Bash's /c/x) counts as usable, and magpie version and help answer without a home, before run makes any folder. * Sandbox the tests main added since internal/wslrun gets testenv's TestMain, and four tests main added that set HOME alone set their home with testenv.SetHome, so on Windows they don't read the runner's profile through USERPROFILE. * agentenv: PI_CONFIG_DIR and OPENCODE_DB take relative names on purpose omp puts $PI_CONFIG_DIR under the home and OpenCode a relative $OPENCODE_DB in its data folder, so neither depends on the working folder: appdir no longer passes them over. * i18n: German for the Library's multi-select and System One's decision API The 19 strings main added since (#791's skill multi-select, the decision API snippets) get their German; the one main replaced (four APIs → five APIs) goes. * appdir: tidy the import into magpie's group; say what Go makes of /c/x The appdir import joins the group of magpie's own imports where a file has one. rooted's comment now says that Go takes a Git Bash path like /c/x as \c\x on the current drive, not C:\x. |
||
|
|
23c26c2dba | site, omarchy: the site in Omarchy's style follows a theme set in Omarchy without a reload (owner: 现在系统换完主题后网页需要手动刷新一下才能切换到对应主题) — a browser that hasn't let usemagpie.ai reach this computer (Chromium's local network access, which nothing on the page asked for) left the page on Omarchy's default for light or dark, chosen from prefers-color-scheme once at load, and a page that had been let through could lose magpie for 30 s when one answer was slow. Now: while not let through, the page repaints as prefers-color-scheme turns (omarchy-theme-set turns GNOME's color-scheme, so Chromium's), and a "Follow my Omarchy theme" / 跟随 Omarchy 主题 button beside the chip asks the browser in one click; a permission turned to granted (the prompt, site settings) starts following at once, denied stops it; once magpie has answered, one failed or slow answer (5 s, was 3 s) keeps the page following and it asks again in 3 s (two in a row mark it absent, still asked every 3 s), and two permissions turning together poll once. The gateway's /v1/magpie/omarchy no longer asks omarchy-font-current and hyprctl again on every theme change, only when the font's or Hyprland's own files change, since a theme set reloads Hyprland and hyprctl asked meanwhile can stall (2 s timeouts each); TestCurrent checks a theme switch keeps the font without asking and fonts.conf changing asks again (fails on the old code). Tried in the Omarchy VM's Chromium with the new omarchy.js/css: not let through, the page went tokyo-night ↔ catppuccin-latte with the desktop; the button raised Chromium's "Access other apps and services on this device" prompt and the page went live on vantablack once granted, no reload; with access allowed, catppuccin-latte, tokyo-night, rose-pine and vantablack came through within 1.5–3 s each, no failed request. go vet, builds (darwin, GOOS=linux -tags nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. The prompt's Allow itself wasn't pressed (granted through the profile and CDP instead). | ||
|
|
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).
|