Repository navigation
The desktop app shows when someone is typing and tells others when you are - #208
Merged
Merged
Conversation
Someone typing shows as a bubble of three pulsing dots at the end of the open chat's timeline (with their picture in a group), as "typing…" under the chat's name and in its chat-list row, until they stop or for 15 s. Our own typing is told to the core on every change of the composer by hand, and stopped when the text is sent, cleared, or replaced (another chat's draft, an edit); the core repeats and times it out.
…eted, per review A message from someone typing ends their typing (not every app sends a stop); deleting the open chat stops ours there. The toolbar subtitle is a function of its own, so its order is tested; the timeline's last row carries the bubble, and the window repaints when typing times out, both tested. Comments say what the code does.
# Conflicts: # core/desktop/src/app/mod.rs
Owner
Author
Review (
|
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
The desktop app (
core/desktop) shows when someone is typing and tells others when we are, as the Mac app's design has it (ConversationView.swift,ChatList.line,DESIGN.md"Typing bubble").app/typing.rs):CoreEvent::Typingis kept per chat and per typer, until a stop arrives, their message arrives (CoreEvent::NewMessage), or 15 s pass (AppStore.typingTimeout; a newer start restarts the wait). While someone types:ConversationChrome.subtitle's order);ChatList.line).set_typing(chat, true)while there is something to send, andfalseonce it's cleared. Text put in by the app (sent, another chat's draft on switching, an edit started or ended, a failed send's text back) stops it first, inset_typed; so does deleting the open chat. The core does the rest per itsset_typingcontract: it repeats Started every 10 s while typing goes on, stops by itself 10 s after the last keystroke, sends nothing in Note to Self, and only when the account's typing-indicators setting is on.typingsnapshot screen (Family with Bogdan typing, Ana typing in her chat).Hooks in shared files are small: one field, two event arms and two calls in
mod.rs, one call incompose.rs::set_typed, the row field, chat-row line and the toolbar subtitle (now a function,view::subtitle, so its order is tested) inview.rs, the demo screen inmain.rs.Why
Parity with the Mac app (desktop parity epic).
How it was tested
typing::tests): a start shows until a stop or its timeout; a newer start overtakes an older timeout; in a group one typer shows (first by ACI, as on the Mac) while any type.typing::window_tests), with the clock advanced, not slept: someone's typing shows and stops, and ends when their message comes; a person's bubble has no picture, the open group's last row (only) carries a bubble naming the typer; it disappears 15 s after the last start and not before, and the window repaints then. What the core is told: started on every keystroke, stopped when cleared by hand, nothing for whitespace only, stopped when an edit puts its text in, when switching chats, when sending (over a real, unlinked core) and when deleting the chat. The window tests failed before the hooks were wired (and the review's additions before their fixes).make format;make lint;cd core && cargo test -q;cd core && cargo test -q --features hush-desktop/snapshot; clippy with the feature (inmake lint): all pass.--snapshot, light and dark): the typing screen shows the bubble with Bogdan's picture after the last message, "typing…" under Family's name and in Family's and Ana's rows.core/sig-coreorapp/change).Decisions for the owner
app/HushcallssetTyping(only the test fake has it). The issue says the Mac "sends its own typing while you write"; the desktop sends it, following the core'sset_typingcontract (each hand edit; stop on send, clear, leaving the chat; the core's 10 s idle). The Mac may want the same (separate issue).CoreEvent::NewMessage), as Signal's own apps do on receipt; the Mac app keeps it up to 15 s. The Mac may want the same (or the core could emit the stop for both).projector::typing, "a group id we can't map to a conversation yet"), on the Mac too. The group bubble with the typer's picture is drawn (shown in the snapshot) but appears only once the core maps it. Sending in groups works (the core adds the group id).shortcut:comment intyping_bubble). The toolbar and chat row still say "typing…".Closes #147