Skip to content

local echo (7/7): Support simplified version of local echo #1453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

PIG208
Copy link
Member

@PIG208 PIG208 commented Apr 1, 2025

screenshots
message sent got message event
sending-success-before sending-success-after
message failed to send message content tapped recipient headers
send-failed sent-failed-interacted recipient-headers

(This branch can be used to preview the full implementation)

Fixes #1441

@PIG208 PIG208 changed the title Support simplified version a local echo (n/n) Support simplified version of local echo (n/n) Apr 1, 2025
@PIG208 PIG208 changed the title Support simplified version of local echo (n/n) locale echo (n/n): Support simplified version of local echo Apr 1, 2025
@PIG208 PIG208 changed the title locale echo (n/n): Support simplified version of local echo local echo (n/n): Support simplified version of local echo Apr 2, 2025
@PIG208 PIG208 force-pushed the pr-echo branch 16 times, most recently from 988c615 to f297a65 Compare April 15, 2025 01:45
@PIG208 PIG208 marked this pull request as ready for review April 15, 2025 01:49
@PIG208 PIG208 force-pushed the pr-echo branch 5 times, most recently from aa81e2f to 28d545f Compare April 17, 2025 18:49
@PIG208 PIG208 changed the title local echo (n/n): Support simplified version of local echo local echo (6/6): Support simplified version of local echo Apr 17, 2025
@PIG208 PIG208 changed the title local echo (6/6): Support simplified version of local echo local echo (7/7): Support simplified version of local echo Apr 17, 2025
@PIG208 PIG208 force-pushed the pr-echo branch 4 times, most recently from 0cfc1d3 to bd7ed4c Compare April 24, 2025 18:53
@PIG208 PIG208 force-pushed the pr-echo branch 3 times, most recently from 4dbbbfd to 9ab3f5f Compare April 28, 2025 22:29
@PIG208 PIG208 force-pushed the pr-echo branch 4 times, most recently from cd699e1 to 0a12c33 Compare May 13, 2025 21:25
@gnprice
Copy link
Member

gnprice commented May 16, 2025

I've been running on my phone a build with this PR in it for the past few days (as described at #mobile-team > beta release management @ 💬). It works! Glad to see this feature nearing completion.

One observation: the loading indicator is pretty conspicuous, and feels too conspicuous in the normal case where the message promptly succeeds.

  • One factor is that it causes the message to be taller, so that it and all the messages above it end up shifting down slightly after the send completes. I think this is why the design in Figma calls for the indicator to encroach on the padding instead: Edit-message (8/n): Implement edit-message! #1498 (comment)

    Unlike for the editing case, though, this might be easy to fix because OutboxMessageWithPossibleSender is already a separate widget. If so, let's fix it.

  • Even after fixing that shift, it might be helpful to de-emphasize the indicator by having it only appear after some time has elapsed, like 500ms or 1s.

PIG208 added 9 commits May 16, 2025 18:15
While we do create outbox messages, there are in no way user-visible
changes since the outbox messages don't end up in message list views.
We create skeletons for helpers needed from message list view, but don't
implement them yet, to make the diff smaller.

For testing, similar to TypingNotifier.debugEnable, we add
MessageStoreImpl.debugOutboxEnable for tests that do not intend to
cover outbox messages.

Some of the delays to fake responses added in tests are not necessary
because the future of sendMessage is not completed immediately, but we
still add them to keep the tests realistic.
This 11px whitespace can be traced back to 311d4d5 in 2022, and is not
present in the Figma design. It was there to match the web design while
prototyping the app.
Also removed a stale comment that refers to resolved issues
(zulip#173 and zulip#175).

We will reuse this helper when processing items for outbox messages.
This adds some overhead in magnitude of O(1) (where the constant is
the number of outbox messages in a view, expected to be small) on
message event handling.

We add outboxMessages as a list independent from messages on
_MessageSequence.  Because outbox messages are not rendered
(the raw content is shown as plain text), we leave the 1-1
relationship between `messages` and `contents` unchanged.

When computing `items`, we now start to look at `outboxMessages` as
well, with the guarantee that the items related to outbox messages
always come after those for other messages.  Look for places that call
`_processOutboxMessage(int index)` for references, and the changes to
`checkInvariants` on how this affects the message list invariants.

`addOutboxMessage` is similar to `handleMessage`.  However, outbox
messages do not rely on the fetched state, i.e. they can be
synchronously updated when the message list view was first
initialized.

This implements minimal support to display outbox message message item
widgets in the message list, without indicators for theirs states.
Retrieving content from failed sent requests and the full UI are
implemented in a later commit.
@PIG208
Copy link
Member Author

PIG208 commented May 16, 2025

Thanks! Updated this to use 500ms, and rearranged the paddings to avoid displacement.

@alya
Copy link
Collaborator

alya commented May 17, 2025

The error text reads a bit funny to me. I think "Message not sent." would be better for the first part.

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.

Simplified local echo, with retry
3 participants