Skip to content

The desktop composer takes ⌥↩ for a line, its search clears with ✕, its buttons have tooltips, and Settings opens from every screen - #249

Merged
pitis merged 2 commits into
mainfrom
feat/desktop-small-polish
Nov 29, 2026
Merged

pitis merged 2 commits into
mainfrom
feat/desktop-small-polish

Conversation

@pitis

@pitis pitis commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

What changed

Four small gaps between the desktop app and the Mac app:

  • ⌥↩ adds a line. Alt-Enter elsewhere. It works as ⇧↩ does, and with the mention picker open too, as on the Mac, where ⌥↩ is AppKit's insertNewlineIgnoringFieldEditor: and ComposerField lets it through. It is a composer-only action (compose::NewLine) that inserts a line. ↩ and ⌘↩ still send.
  • The search field has a clear ✕ while it has text, like the Mac's .searchable (gpui-component's own Input::cleanable). Clicking it does what emptying the field by hand does: the results go, the field keeps the keys, and a chat-scoped search ends once the field is left empty (Esc or blur), as on the Mac.
  • Tooltips as on the Mac: Send shows "Send (↩)", or "Save the edit (↩)" while editing ("Enter" in place of ↩ off macOS). Sticker pack tabs show the pack's title, and each sticker shows its emoji (none when it has no emoji, as the Mac's empty .help). Chat colour and wallpaper swatches show their names ("Chat colour 3").
  • Settings opens from every screen. The link, unlinked and "Hush couldn't start" screens get the chat list's gear in the window's top-right corner. Before, Windows and Linux had only Ctrl+, there. macOS also has the Hush menu.

Dropped

  • File pickers filtered by type (the restore picker only .hushbackup, the group picture picker only pictures). GPUI's PathPromptOptions has no type filter (files, directories, multiple, prompt only). Each picker now has a shortcut: comment. No dialog dependency was added. A wrong file is still refused after it is picked: the restore fails with the core's error, and a non-picture is refused with "That file isn't a picture Hush can read".

How it was tested

Test first. Each new window test failed before the change:

  • compose::window_tests::option_return_adds_a_line_as_shift_return_does: before, "ab\nc" (⌥↩ did nothing). After review, it also presses ⌥↩ with the picker open, which failed on the first version (the member was picked).
  • search::window_tests::the_fields_x_clears_it_as_emptying_it_by_hand_does: before, the query stayed "pot".
  • settings::window_tests::the_gear_opens_it_from_every_screen (chats, link, unlinked, failed): before, "the link screen has the gear" failed.

Tooltips have no window test. GPUI gives tests no way to read a tooltip that is showing. They were checked in a snapshot instead (below).

Gate (the Rust half of make check, from core/):

  • cargo fmt --check: pass
  • cargo clippy --all-targets -q -- -D warnings: pass
  • cargo clippy --all-targets --features hush-desktop/snapshot -q -- -D warnings: pass
  • cargo test --features hush-desktop/snapshot -q: pass (desktop 311, sig-core 537 + 4 ignored)

The Swift leg (xcodebuild) was skipped: nothing in app/ changed.

Snapshots looked at (--snapshot, light and dark): link and unlinked show the gear in the top-right corner, in light and dark. search shows the ✕ at the end of the field while "book" is typed. A local-only render hovered the controls and showed the tooltips "Send (↩)", "Chat colour 3", and a sticker's 😂. The renderer change for that was not committed.

Closes #232

…ts buttons have tooltips, and Settings opens from every screen

Alt-Enter adds a line as Shift-Enter does. The sidebar search uses
gpui-component's clear button, which empties the field as typing it
away does. Send, sticker packs and stickers, and the colour swatches
get the Mac app's tooltips. The link, unlinked and failed screens get
the chat list's Settings gear in the window's corner. GPUI's file
picker has no type filter: both pickers say so in a shortcut comment.
…he composer

Alt-Enter was the same action as Shift-Enter, so the mention picker took
it and one-line fields submitted on it. On the Mac it is AppKit's
insertNewlineIgnoringFieldEditor:, which the picker lets through. It is
now an action of its own that only the composer handles. A sticker pack
without a title gets no empty tooltip, and the review's comment wording
is applied.
@pitis

pitis commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Review (/pr-review-toolkit:review-pr: code, tests, comments)

The fixes are in e108d9d. After make update (already up to date with main), the gate passes on that head: cargo fmt --check, both cargo clippy --all-targets runs (plain and --features hush-desktop/snapshot, -D warnings), and cargo test --features hush-desktop/snapshot (desktop 311, sig-core 537 + 4 ignored).

Important (tests), fixed: ⌥↩ picked the @-mention while the picker was open.

  • On the Mac, ⌥↩ is AppKit's insertNewlineIgnoringFieldEditor: (~\r in StandardKeyBinding.dict). ComposerField intercepts only insertNewline:, so on the Mac ⌥↩ always adds a line.
  • The desktop's ⌥↩ was the same Enter { shift: true } action as ⇧↩. So the picker's Enter capture took it, and one-line fields submitted on it.
  • ⌥↩ is now an action of its own, compose::NewLine. Only the composer handles it, inserting "\n" as ⇧↩ does. Elsewhere it does nothing, as before this PR.
  • The test option_return_adds_a_line_as_shift_return_does now also presses ⌥↩ with the picker open (Demo::Compose). It failed before the fix (the member was picked) and passes after.

Suggestion (code, S1), covered by the fix above: ⌥↩ submitted one-line fields. It no longer does.

Suggestion (code, S2), fixed: a sticker pack with an empty title showed an empty tooltip. The tooltip is now skipped then, as the Mac's .help("") shows nothing.

Suggestions (comments), applied:

  • The two shortcut: comments now say "as in the Mac app's picker (BackupFile.type)" and "([.image])". "(the Mac app's)" was ambiguous.
  • The gear's doc now names the link, unlinked and failed screens, rather than "the screens without one".
  • The render comment no longer repeats that doc.
  • The ✕ test's comment explains its offset, and the click moved to the ✕'s centre (24pt).

Suggestions (tests), declined:

  • A key-driven test of ↩/⌘↩ sending: this PR doesn't touch the send path (mod.rs PressEnter { shift: false, .. }). ⌥↩ is now a different action that never reaches it, so the gap the reviewer described can't come from this change.
  • A tooltip test: GPUI gives tests no way to read a shown tooltip. A local render showed "Send (↩)", "Chat colour 3" and a sticker's emoji.

No Critical findings. Nothing needs a product decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The desktop app's composer takes ⌥↩ for a line, its search clears with ✕, its buttons have tooltips, and Settings opens from every screen

1 participant