Commit Graph
3 Commits
Author SHA1 Message Date
yetone a11a1f2f93 gui tests: session-terminal opens a 1000px-tall window — settings rows were added above the Session terminal row, so in 700px it sat at the foot of #view-settings; Playwright scrolled it in before each click, the scroll closed the menu the first click opened (a menu closes on a scroll), and the second click opened it again ("a second click closes it", Chromium) or found the row out of reach (WebKit). A real click on the open menu's button closes it. Passes in Chromium and WebKit, en and zh; failed on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone eddc298e92 gui: a gateway key's limit window and the session terminal are picked from the app's own menu too, so no native select is left (the owner, on the account picker: 这里为啥是原生的 selector 而不是我们抽象的 ComboBox?) — after the keep-signed-in account picker, two <select>s remained: the Window of a gateway key's limit editor (#585) and Settings → Session terminal. Each is now a sess-pick button showing what is picked, with a chevron, opening the app's menu (openProtoMenu) headed Limit window / Session terminal (限额周期 / 会话终端) with the current one ticked. The limit window's pick is staged in the editor as before (nothing sent until Save) and fills its column with the chevron at its end; the terminal's is drawn at once and saved as before. gateway-key-limit.test.cjs and session-terminal.test.cjs now check there is no native select, the menu's head and items, the button's value and text, a pick closing the menu (and leaving the limit editor open), a second click closing it, and picking through the menu, posting as before; they, keep-login, click-scroll and settings-sections pass in WebKit, en and zh. 2026-10-03 01:02:53 +08:00
Karenandyetone 2693cd8828 feat(gui): choose macOS session terminal (#241)
* feat(gui): choose macOS session terminal

* session terminal: build the darwin CLI without cgo, drop the dead macOS 11 path, and open Terminal when the .command default is not a terminal

- terminal_apps_darwin.go imports "C" but had no cgo tag, and terminal_apps_other.go was !darwin only, so `CGO_ENABLED=0 GOOS=darwin go build -tags nogui .` (make release-cli's darwin targets) failed with undefined discoverTerminals. The cgo file and its test are now darwin && cgo; the stub is !darwin || !cgo.
- magpie needs macOS 12 (LSMinimumSystemVersion, -mmacosx-version-min=12.0), so the macOS 11 branch (temp .command file, deprecated LSCopyApplicationURLsForURL, CFRelease) never ran; it is gone along with the CoreServices link.
- With no saved choice, a default .command handler that is not a listed terminal, or a failed lookup, now opens Terminal as before the PR instead of failing; Settings labels the system option "System default (Terminal)" then, and the unused "System default (unavailable)" string is dropped.
- session-terminal.test.cjs covers an editor as the default in Chromium and WebKit, en and zh, and is on the README's node --test line.

---------

Co-authored-by: yetone <yetoneful@gmail.com>
2026-09-30 02:36:12 +08:00