Skip to content

The desktop app shows when someone is typing and tells others when you are - #208

Merged
pitis merged 4 commits into
mainfrom
feat/desktop-typing
Nov 14, 2026
Merged

pitis merged 4 commits into
mainfrom
feat/desktop-typing

Conversation

@pitis

@pitis pitis commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

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").

  • Showing (app/typing.rs): CoreEvent::Typing is 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:
    • the open chat's timeline ends with an incoming bubble of three dots pulsing left to right (still under Reduce Motion), with the typer's picture in a group; it rides on the last row, which is remeasured when it comes or goes;
    • the toolbar subtitle says "typing…", ahead of Offline/Connecting…, "Disappearing messages: …" and @username (ConversationChrome.subtitle's order);
    • the chat's row says "typing…" in italics, ahead of everything else and without a tick (ChatList.line).
  • Sending: every change of the composer by hand tells the core set_typing(chat, true) while there is something to send, and false once 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, in set_typed; so does deleting the open chat. The core does the rest per its set_typing contract: 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.
  • A typing snapshot 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 in compose.rs::set_typed, the row field, chat-row line and the toolbar subtitle (now a function, view::subtitle, so its order is tested) in view.rs, the demo screen in main.rs.

Why

Parity with the Mac app (desktop parity epic).

How it was tested

  • Unit tests (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.
  • The toolbar subtitle's order: typing, Offline, Disappearing messages, @username.
  • Window tests over GPUI's test executor (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).
  • Gate: make format; make lint; cd core && cargo test -q; cd core && cargo test -q --features hush-desktop/snapshot; clippy with the feature (in make lint): all pass.
  • Snapshots (--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.
  • Swift leg not run: nothing it builds changed (no core/sig-core or app/ change).
  • Only macOS was built and run; nothing here is platform-specific.

Decisions for the owner

  • The Mac app doesn't send typing. It shows others' typing, but nothing in app/Hush calls setTyping (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's set_typing contract (each hand edit; stop on send, clear, leaving the chat; the core's 10 s idle). The Mac may want the same (separate issue).
  • Their message ends their typing (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).
  • Others' typing shows whatever our typing-indicators setting says (the core checks it only for sending; the Mac is the same). Signal hides others' typing when yours is off: a core change if wanted.
  • Editing a message counts as typing (any hand change in the composer does); starting or ending an edit sends a stop first.
  • Typing in groups doesn't arrive yet: the core drops incoming group typing (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).
  • A chat with no message loaded shows no bubble (it rides on the last row; shortcut: comment in typing_bubble). The toolbar and chat row still say "typing…".

Closes #147

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.
@pitis

pitis commented Nov 14, 2026

Copy link
Copy Markdown
Owner Author

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

No Critical findings. Fixed in be2b67b; main (#206, #207 notifications) merged in 1488fcd, conflict in mod.rs resolved keeping both (NewMessage notifies in the first match and ends the sender's typing in the second). Gate re-run after the merge: make lint, cd core && cargo test -q --features hush-desktop/snapshot (198 desktop + 537 core passed); snapshots re-rendered and looked at.

Important, fixed

  • errors: "typing…" stayed up to 15 s after the typer's message came, if their app sends no stop. → CoreEvent::NewMessage now ends that sender's typing (as Signal's own apps do on receipt). Tested; the test failed before the fix. The Mac app has the same gap (see Decisions).
  • comments: the chat row's tick comment was stale (the tick also hides while someone types). → reworded.
  • tests: the toolbar subtitle's order was untested. → the subtitle is now a function (view::subtitle) with a test: typing > Offline > Disappearing messages > @username > nothing.
  • tests: the bubble's place on the last row was untested. → row is reachable from the module's tests; the test checks the last row carries the bubble and the one before doesn't.
  • tests: nothing checked the window repaints when typing times out. → the test observes the app and asserts it was notified; it failed with the repaint removed.

Suggestions taken

  • Deleting the open chat now stops our typing there (one line in delete_chat; tested, failed before).
  • The 1:1 bubble (no picture) is asserted; the typing map is asserted empty once nobody types.
  • Comment wording (TIMEOUT's why, typers, expire, composer_typed, stop_typing, told, set_typed), and a note that the core doesn't pass group typing on yet.

Declined, with reason

  • types: a guard stopping a previous ours before setting a new one, #[must_use] on set: every way the selection changes goes through set_typed or now delete_chat, both of which stop; one caller of set. Not worth the lines.
  • tests: a helper for the chat-row line, and pinning TIMEOUT to 15 s: the row is a two-arm choice, checked in the snapshot; the constant cites the Mac's typingTimeout.
  • code: a row of its own for the bubble (screen readers would announce it apart from the last message): kept as the shortcut: already in typing_bubble.
  • code/errors: hiding others' typing when our typing-indicators setting is off, a debug log when the core drops our typing for an unknown setting: core behaviour shared with the Mac; listed for the owner.

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 shows and sends typing indicators

1 participant