Repository navigation
The desktop app pages back through older messages and moves between chats from the keyboard - #189
Merged
Merged
Conversation
…hats from the keyboard Scrolling up near the oldest loaded message loads the page before it, with a spinner at the top; rows are built only for the messages on screen, and only the rows that came or went are replaced, so the reader stays on their message. A message that comes in while scrolled up shows the New messages pill (ours scrolls to it). The Chats menu and its shortcuts follow the Mac app: Find Chat, previous and next chat, unread ones, Jump to Chat 1-9, Focus Composer and Close Chat; the arrows in the search field move through the chats listed.
# Conflicts: # core/desktop/src/main.rs
With the review's fixes: a message's details are read only when its row comes in or it changes; rows that go take their files, pictures, link previews and reactions with them; no page is asked for while a load is on its way; the New messages pill sits bottom right, as on the Mac, and the always-on jump button goes; the attach shortcut uses the shared shortcut helper.
…while a load runs
Owner
Author
|
Review findings and fixes (after merging main with #188, link previews):
Checks run:
|
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
Paging back (
core/desktop/src/app/paging.rs, on #182's loaddepth)depth += PAGE), with a small spinner over its top while they load (the Mac app'sProgressViewat the top ofTimelineList). A load that returns fewer than asked for means the whole chat is in, so nothing more is asked. There is no cap: a chat's whole history can be scrolled.changed_rowsinapp/mod.rs) now gives one splice per run of rows that came or went, instead of one splice from the first change to the last. Before, a new message while scrolled up (the newest 100 load, so the oldest drops off and the new one comes in) replaced every row, and GPUI moved the reader to the top.back_to_newestdrops the older pages again, as it does after a jump.Timeline.onNewLastMessage). The always-on "Jump to latest" button is gone (the Mac has none).MessageChanged,AttachmentChanged), not for every loaded message on each load. Rows that go take their files, decoded pictures, recordings' lengths, link previews and their pictures, and reactions with them.Hush::row, read from the app inside the list's row renderer), not for every loaded message on every redraw. Measured with a window test, debug build, minimum of 5 frames: 100 loaded messages 15.0 ms vs 5,000 loaded 49.3 ms before; 13.5 ms vs 13.4 ms after.Keyboard (
core/desktop/src/app/navigate.rs), the Mac app's Chats menu (HushApp.swiftChatCommands,ChatList.neighbor). ⌘ on macOS, Ctrl on Windows and Linux; ⌥ is Alt:SidebarView.moveInSearch); The desktop app searches messages, everywhere or in one chat, and opens a found message in its chat #182 left this to this issue.Inputcontext so they win there.selectnow goes throughswitch(Option<String>), so Close Chat takes the same path as opening a chat (draft kept, tray and files cleared, loads dropped). The desktop app searches messages, everywhere or in one chat, and opens a found message in its chat #182's global-action helper is shared (navigate::on) and the search shortcuts use it too.Why
Closes #142. Part of #157.
How it was tested
cargo fmt --check;cargo clippy -p hush-desktop --all-targets -- -D warnings, and the same with--features snapshot;cargo test -p hush-desktop(93 passed) andcargo test -p hush-desktop --features snapshot(118 passed, including The desktop app searches messages, everywhere or in one chat, and opens a found message in its chat #182's and The desktop app shows formatted text and writes it, with mentions #186's window tests).neighbor(the Mac'sChatListTestscases) and the row diff. A property-style test checks that the splices turn the old list into the new one.historyscreen (chat scrolled back, spinner, pill), light and dark. I checked it and the existingchat,filesandsearch-in-chatscreens.Not tested: the live window and a linked phone (not linked here by design). That leaves real-database load times for deep pages unchecked; each page re-reads the chat's newest messages down to the oldest loaded, as #182's jump does. Linux's Alt+Shift binding precedence is from GPUI's keymap rules, not run on Linux. The native macOS menu (its submenu and key equivalents) doesn't render offscreen.
make checkneeds the signing certificate this Mac doesn't have.