Repository navigation
The desktop app has the Mac app's Edit and Window menus and a Core Log, and greys out Chats items it can't do - #243
Merged
Merged
Conversation
…g, and greys out Chats items it can't do The Chats menu's actions now sit on the window's root while they can act, so GPUI greys an item (and its keys do nothing) when it can't: Search in Chat, Focus Composer and Close Chat need an open chat, Attach Files is off in a request or while editing, and the whole menu waits for a dialog or another screen. A focus anchor on the root keeps those actions reachable when no field has the keys. macOS gets Hush's About, Hide, Hide Others and Show All, an Edit menu over the focused text field, and a Window menu with Minimize, Zoom, Close Window and Core Log. The Core Log keeps the core's last 200 errors with their times, and Settings opens it on every platform.
…the sheet or Settings on top first
# Conflicts: # core/desktop/src/main.rs
…us fallback, Settings under the log, a restart keeping it; comments corrected
# Conflicts: # core/desktop/src/main.rs
… the core is open
Owner
Author
Review (pr-review-toolkit: code, tests, comments, types)There were no Critical findings. Each finding and what was done: Important
Suggestions and test gaps
Declined
Merged from main: #241 (the Core Log's times follow the 12/24-hour clock, as bubble times do), #242 (one Edit menu, carrying its note) and #240 (⌘W goes through its hook). |
This was referenced Nov 28, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Chats menu greys what it can't do. On macOS, GPUI enables a menu item only if its action is handled on the focused element's way; the Chats actions were app-wide handlers, so every item stayed enabled and silently did nothing. They now sit on the window's root (
navigate::chats_actions) while they can act, following the Mac app'sChatCommandsrules:can_search, which the shortcuts already waited for).The shortcuts work exactly when the item is enabled. To keep them reachable when no text field has the keys (at launch, after a chat closes), the root holds a zero-area focus anchor (the pattern the chat column already uses for selected text), and focus that is lost falls back to it (
on_focus_lost, with a redraw GPUI doesn't do itself).macOS menus (
main.rs), after SwiftUI's standard ones:OsAction), so they act on the focused field and grey without one. Copy is the exception: it stays on, because gpui-kit's root also copies selected message text. macOS adds Emoji & Symbols to this menu itself (The desktop app reacts with any emoji, and on macOS its Edit menu inserts emoji in the composer #242); there is one Edit menu.Close Window works as in the Mac app, where About, the Core Log and Settings are windows of their own:
running::closing, Closing the desktop app's window keeps it running, as the Mac app does #240): it hides while the core is open, and closes and quits otherwise.About: GPUI has no About panel, and the standard AppKit one would read "hush" with no version from this unbundled binary. So it's a small sheet: Hush, "Version 0.1.0 (core 0.1.0)".
Core Log (
core_log.rs), as the Mac'sCoreLogView:It's a sheet over the window, opened from Window ▸ Core Log and from a "Core Log…" button at the foot of Settings, since Windows and Linux have no menu bar.
Side effect fixed: an action that isn't available no longer swallows its keystroke, so ⌥↓ reached the stories viewer's ↓. That viewer's arrows now ignore modifiers (the existing stories test caught it).
Not done / limits
shortcut:a dialog over the chats doesn't hold the window against ⌘W the way a sheet does on the Mac.How it was tested
Test-first:
the_chats_menu_offers_only_what_can_actasks GPUI what a macOS menu asks (App::is_action_available). With the old app-wide handlers it failed at "while editing", because Attach Files was offered. It also covers:Also added:
the_core_log_keeps_the_cores_errors_and_gives_the_keys_back: core errors are logged; Edit's items follow the focused field; Settings and the chats wait for the sheet; Esc and Return close it; a notification's click closes it; over Settings, Esc and ⌘W close one layer at a time; ⌘W closes the window when no core is open;close_window_closes_as_the_close_button_does: with the core open, ⌘W keeps the window and app running. It fails if the hook is bypassed;Gate, from
core/:cargo fmt --check: passcargo clippy --all-targets -q -- -D warnings: passcargo clippy --all-targets --features hush-desktop/snapshot -q -- -D warnings: passcargo test --features hush-desktop/snapshot -q: pass (293 desktop, 537 core)The Swift leg (xcodebuild) was skipped because nothing in
app/changed.Snapshots, light and dark, looked at:
core-log,core-log-empty,about(new demo screens) andsettings(the new Core Log… button). The menu bar itself can't be captured headless; the availability tests stand in for it.Closes #229