Repository navigation
The desktop app pins, archives, mutes, blocks, deletes and exports chats, and answers requests - #200
Merged
Merged
Conversation
…ats, and answers requests A chat row's right-click menu has the Mac app's chat actions: pin (four at most), mute for a while or for good, mark read or unread, export, archive, block (asking first). The bar in place of the composer answers a message request, an invitation or our join request, or unblocks; the destructive answers ask first. Archived chats get their own list behind an "Archived Chats" row. sig-core re-exports GroupChange: change_group was public but its argument couldn't be named.
…ports open without logging - The request bar's buttons all wait while an answer is with the server: a Delete during a Cancel Request or Decline deleted the chat twice and said it failed. - An archive that empties closes, as on the Mac. The empty pane checks every chat, archived ones too. - The exported folder opens through the app's own opener: GPUI's reveal said nothing on failure and logged the path (the chat's name) on Windows. A non-local folder is said. - Only Accept, Unblock and Join look like the default (a join request's bar has none). A failed Unblock says so. - The change line holds a plain task. Comments fixed where wrong or stale. - Window tests run against a real, unlinked core, so going ahead (or not) shows; the test core is never dropped, as a database closing at exit crashed the test binary.
Owner
Author
Review (
|
Owner
Author
|
Updated with main (#199, desktop drafts) through |
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
A chat row's right-click menu (
core/desktop/src/app/chats.rs, drawn inchats/view.rs), as the Mac app'sSidebarView.chatMenu, in its order:export_chatinto a new folder there, then the new folder opens in the file manager (through the app's own opener: a failure is said, and nothing is logged). The exported files get the same "from elsewhere" mark that opened files get (Gatekeeper's quarantine on macOS, the Mark of the Web on Windows), as the Mac app does (Files.quarantineFiles).AppStore.change). A failure shows in the error banner ("Couldn't pin the chat: …").The request bar replaces the "answer on your phone"
shortcut:. It stands in place of the composer, with the Mac'sRequestBartext and buttons; Accept, Unblock and Join look like the default (a join request's bar has none):change_groupAcceptInvitation / DeclineInvitation; declining also deletes the chat)Block, Delete, Decline and Cancel Request ask first, with the Mac's questions ("this Mac" becomes "this computer"). While a Join, Decline or Cancel Request is with the server, all the bar's buttons wait (a Delete meanwhile would delete the chat twice). Return doesn't press the default button as on the Mac (
shortcut:).Archived chats: archived chats used to be hidden. An "Archived Chats" row with its count now sits under the inbox (when any chat is archived and nothing is being searched). It opens the archive: an "Archived" list, with a back button in New Chat's place. An archive that empties closes, as on the Mac. The arrows and ⌘1–9 move through what is listed. A search still covers every chat, and the archive comes back when the search ends. Archived chats' pictures and group authors' names now load too.
Smaller changes
sig-core: re-exportsGroupChange(pub use groups::{GroupChange, GroupPreview}).change_groupwas public but its argument's type couldn't be named outside the crate. The Swift bindings don't change.cancellingflag is renamedanswering; it now covers invitations too.files::mark_from_elsewhereis nowpub(super)so the export can use it.chat-menu(Ana's row right-clicked),request(a message request open),archive.As on the Mac, an accepted chat has no Delete; Delete is in the request bar only (the issue's list puts Delete in the row menu, but the Mac's row menu doesn't have one).
Why
Closes #143. Part of the desktop parity epic.
How it was tested
make format;make lint(rustfmt check,cargo clippy --all-targets -- -D warnings, swift-format lint);cargo clippy -p hush-desktop --all-targets --features snapshot -- -D warnings.cd core && cargo test -q: desktop 114, sig-core 537 (3 ignored), all pass.cargo test -p hush-desktop --features snapshot: 154 pass, including the new window tests.make core,make project, then the unsignedxcodebuild … test CODE_SIGNING_ALLOWED=NO CODE_SIGN_IDENTITY="". All pass but two, which fail again when re-run alone and don't touch the core:LegacyTests.testSettingsAreAdoptedWithoutOverwritingNewOnes(UserDefaults.persistentDomain(forName:)returns[:], not nil, after the domain is removed, on this macOS) andMessageRowTests.testRightClickOnTextClickedIntoShowsTheMessageMenu(noNSTextFieldfound on screen). The regenerated Swift bindings match the main checkout's, except forlistGroupfrom a newer main commit: the re-export doesn't change them.listedwith the archivewith_corenow never drops its core: a database still closing as the test binary exited crashed it (SIGSEGV aftertest result: ok, 3 of 12 runs of the core-backed tests; 0 of 12 with the fix).chat-menu,requestandarchive, checked against the Mac'schatMenu,RequestBarandarchiveRow. Also thechatscreen (with the new Archived Chats row).Not tested: the live window and a linked phone. With no core in the demo and tests, the core calls themselves (pin, mute, block, export, join…) aren't run from the desktop. They are the Mac app's calls, covered by sig-core's tests. Also not tested: the native folder picker and the file manager reveal, and the Mute submenu (it opens on hover, which the snapshot doesn't do).