Skip to content

In the desktop app, a notification or tray click closes Group Info and gives the chat the keys, and a dialog or Settings keeps them - #248

Merged
pitis merged 4 commits into
mainfrom
fix/desktop-group-info-select
Nov 29, 2026
Merged

pitis merged 4 commits into
mainfrom
fix/desktop-group-info-select

Conversation

@pitis

@pitis pitis commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

What changed

select() (core/desktop/src/app/mod.rs) is where every way of opening a chat ends up: a notification's click, the tray, search, the list, a dialog's outcome. It now decides, in that one place, what each panel over the chats does, and who gets the keys.

  • A click for the chat already open changes nothing over the chats. Group Info and its sheets, a view-once look, the stories window, the safety number sheet, About and the Core Log all stay up and keep the keys. This is what the Mac app does: AppStore.select does nothing for the open chat. Before, the composer under them took the keys, so Esc no longer closed the panel and Return sent what was typed.
  • A click for another chat closes what's over the chats about the chat it leaves, and the keys go to the new chat's composer:
    • Group Info, with its Add Members and Edit Name and Description sheets (the issue). Changes on their way still land, as they do when Done closes it; a failure then shows above the chat list.
    • The safety number sheet, a view-once look and the stories window, as before. A look ends in switch(), which leaves the chat.
    • About and the Core Log. They now close as Done closes them, so their keys go back to what was under them.
  • The New Chat, New Group and Join dialogs, and Settings (with Back Up over it), stay in front with the keys, whichever chat is clicked. The chat opens underneath. What's typed in them isn't lost (a username, a group's name and the people ticked, a link, an unsaved profile, a passphrase), Esc still closes them, and Return can't send to the chat behind.
    • The dialogs match the Mac: its sidebar sheets stay up, with the keys, while the chat changes behind them.
    • Settings is a choice, not parity. On the Mac, Settings is a window of its own, and a tray click brings the main window in front of it. Here Settings is a panel in the same window, so the chat could only come forward by closing Settings. That would lose an unsaved profile, so Settings stays (the owner's call).
  • The rule: the composer gets the keys only when nothing is left over the chats (can_search()).
    • switch() no longer focuses the composer itself; only select() called it with a chat.
    • switch() still lets go of the keys when it closes the chat.
    • The stories window now closes in select(), not switch(). switch()'s other callers (Close Chat, Mark as Unread) can't run while that window is up.

Not changed:

  • Chat Colour and Wallpaper: a popover beside the composer, not a modal. It already closes when another chat opens.
  • The Delete/Block/Leave confirmations: system prompts that act on the chat they asked about.
  • The history transfer: it can't be closed. The Mac's overlay leaves its composer the same way.

Why

#234 fixed this for the safety number sheet, and #243 for About and the Core Log, each with its own line in select(). Group Info was missed. The cause was that select() handed the composer the keys whatever was over it. The owner decided what each panel does (2026-11-29): nothing changes for the chat open, as on the Mac. For another chat, what's about the chat goes, and the dialogs and Settings stay in front.

How it was tested

Each test failed before its change:

  • group::window_tests::a_notification_for_the_group_leaves_the_panel_and_one_for_another_chat_closes_it
    • The group open: the panel and its Add Members sheet stay, and Esc closes the sheet.
    • Another chat: both go and the composer has the keys.
  • view_once::window_tests::a_notification_for_its_chat_leaves_the_look_the_keys: the look stays and Esc closes it.
  • stories::window_tests::a_chat_opened_from_under_the_window_closes_it_but_the_one_open_doesnt
    • Another chat: the window closes and the composer has the keys.
    • The chat open: the window stays and Esc closes it.
  • safety::window_tests::a_notification_for_the_chat_open_leaves_the_sheet_and_one_for_another_closes_it
  • menus::window_tests::the_core_log_keeps_the_cores_errors_and_gives_the_keys_back: the Core Log stays for the chat open and keeps the keys; it goes for another.
  • navigate::window_tests::a_chat_opened_from_a_notification_under_a_dialog_or_settings_leaves_them_the_keys
    • Covers New Group, Settings, the Core Log over Settings, and Back Up over Settings, each for the chat open and for another.
    • In every case typed text stays out of the composer, and Esc closes what's on top, one layer at a time.
    • It also checks that a dialog's own chat (dialog_done with Outcome::Open) opens into its composer.

Gate, from core/, on the merged head after make update (it merged #249):

  • 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 314, sig-core 537)

What wasn't checked:

  • The Swift leg (xcodebuild) wasn't run: nothing under app/ or core/sig-core changes.
  • No snapshot: nothing is drawn differently (only what closes and who has the keys).
  • The live window wasn't run: the desktop app isn't linked on this Mac, so a real notification click wasn't tried.

Closes #237

…log or Settings the keys

select() now closes Group Info and its sheets, a view-once look and the
stories window for the chat already open as well as another, and gives the
composer the keys only when nothing is left over the chats: a New Chat, New
Group or Join dialog, or Settings, stays with the keys while the chat opens
under it.
… the dialog or Settings under it

select() closed the sheet without handing its keys back, so a dialog or
Settings left over the chat had none. It now closes it as Done does. The
window test covers it, Back Up over Settings, the chat open as well as
another, and a dialog's own chat opening into its composer.
@pitis

pitis commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Review (/pr-review-toolkit:review-pr: code, tests, comments) and what was done

Fixed in 6f9a94a:

  • Important, found by all three reviewers: About or the Core Log over Settings or a dialog left the panel with no keys. select() reset sheets without handing their keys back, so Settings or the dialog stayed open with nothing focused, and Esc did nothing. On Windows and Linux the Core Log opens from Settings, so this path is a normal one. Fix: select() now closes the sheet with hide_sheet, as Done does (made pub(super)). The window test gained the Core Log over Settings case, which failed before the fix.
  • Important (tests): the navigate test covered another chat only. It now runs for the chat open and for another, and covers Back Up over Settings (its passphrase keeps the keys; Esc twice closes both).
  • Important (tests): nothing guarded the new ordering in a dialog's outcome. switch() no longer focuses the composer, so dialog_done must clear the dialog before select. Fix: the test now checks that dialog_done(Outcome::Open) opens the chat into its composer.
  • Important (tests): the stories test didn't check the keys. It now asserts that the composer has focus after each click.
  • Important (comments): the doc on select promised the composer unconditionally. Reworded: "into its composer, unless a dialog or Settings stays over it", and it names the row click as another way to reopen the open chat.
  • Important (code review, Suggestion 3): the PR body called keeping Settings Mac parity. On the Mac a tray click brings the main window in front of Settings. The body now says keeping Settings is a choice (so an unsaved profile isn't lost), not parity.
  • Suggestions (comments), taken:
    • switch's doc says the keys stay where they are for id.
    • end_view_once's doc names the chat being opened again.
    • select's comment says "a view-once look shown".
    • The navigate test's comment says the typing doesn't reach the composer (Settings focuses its panel, not a field).

Declined:

  • Suggestion (comments): notifications.rs:348 "select leaves the others". It is still true: select switches, and so marks the chat seen, only for another chat. The comment is outside this change, so it stays.
  • Suggestion (comments): a view-once look still opening for the chat open shows after the click. The window is the few milliseconds a photo takes to decode, after the user clicked View themselves. The look then takes the keys as it would anyway, and Esc closes it. Not worth a branch.
  • Suggestion (tests): a video variant of the same-chat view-once test. select calls end_view_once, which already removes a video's copy, and the existing "handed" test covers that removal.
  • Suggestion (tests): assert that the setup opened in the group and stories loops. open_group_info and open_stories have no refusal path on these demo screens, so a check would add nothing.

Left for the owner (a product call, unchanged):

  • Code review, Suggestion 2: a click for the chat already open closes Group Info and a view-once look. The Mac's AppStore.select does nothing for the open chat (guard id != selectedId), so its sheet, any text typed in Edit Name and Description, the people ticked in Add Members, and the rest of a one-time look all stay. The issue's "Done when" asks for Group Info to close, the safety number sheet already closes for the same chat (The desktop app shows a contact's safety number to verify #234), and the clicked notification's message is then in view, so this PR closes them.
    • The other option: leave them up for the open chat. The keys would stay with them, and only another chat would close them.

Gate after the fixes, from core/, on the head after make update:

  • 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)

…over the chats, with the keys

As in the Mac app, whose select does nothing for the chat open: Group Info
and its sheets, a view-once look, the stories window, the safety number,
About and the Core Log stay up and keep the keys. Another chat still closes
the ones about the chat left, and the composer still takes the keys only
when nothing is over the chats.
@pitis

pitis commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner Author

Changed per the owner's decision (2026-11-29), in cb53541

What changed:

  • A click for the chat already open no longer closes anything over the chats. Group Info and its sheets, a view-once look, the stories window, the safety number sheet, About and the Core Log all stay up and keep the keys, as the Mac's AppStore.select does nothing for the open chat. The composer still doesn't take the keys from what's on top.
  • A click for another chat is unchanged: what's about the chat goes, and the composer gets the keys only when nothing is left over the chats.
  • The dialogs and Settings are unchanged: they stay in front with the keys.

Tests: I changed these first, and each failed on the previous head (6f9a94a):

  • the same-chat cases for Group Info, the view-once look and the stories window;
  • the safety number sheet and the Core Log (safety, menus).

The navigate test's Core Log over Settings row now presses Esc twice, since the Core Log stays for the chat open. That row passes on both heads; the menus test covers the change.

Gate on the merged head after make update (it merged #249): fmt, both clippy runs and cargo test --features hush-desktop/snapshot pass (desktop 314, sig-core 537). I updated the PR body to match.

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.

A notification click while the desktop app's Group Info is open sends the keys to the composer under it

1 participant