Page MenuHomePhabricator

[web] Unify behaviour of chat composer with native
AbandonedPublic

Authored by kuba on Nov 2 2022, 10:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 11:48 AM
Unknown Object (File)
Sun, Nov 24, 11:47 AM
Unknown Object (File)
Sun, Nov 24, 11:47 AM
Unknown Object (File)
Sun, Nov 24, 11:47 AM
Unknown Object (File)
Sun, Nov 24, 11:47 AM
Unknown Object (File)
Sun, Nov 24, 11:47 AM
Unknown Object (File)
Sun, Nov 24, 11:47 AM
Unknown Object (File)
Sun, Nov 24, 11:46 AM
Subscribers

Details

Summary

Raised in D5463, the web app should behave as the native app:

  • when selecting someone in the chat composer who isn't a friend, and when nobody else is selected, the web app should exit search and create a 1-1 thread with this user
  • should display alert if you try to add a non-friend when you have already selected some users
  • should display alert on blocked users

Depends on D5463

Alerts (text is the same as in the native app):

image.png (576×708 px, 49 KB)

image.png (584×718 px, 50 KB)

Test Plan
  • select a friend, create chat
  • select a non-friend -> search should end and chat should be displayed without the search bar
  • select a friend, than a non-friend -> alert should be displayed
  • select a blocked user -> alert should be displayed

Diff Detail

Repository
rCOMM Comm
Branch
arcpatch-D5518
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

It was not a goal of this task, but the experience can be improved by adding an option to these modals to perform the actions instead of directing the user to the profile tab. @michal can you create a task for this?

web/chat/chat-thread-composer.react.js
32–34 ↗(On Diff #18026)

We have a type that can express this

151–154 ↗(On Diff #18026)

With current types this invariant might be ok, but I think it would be better to show an empty alert than to crash the app.

A better solution would be to change type definition of UserListItem so that either all or none of alertText and alertTitle are present.

This revision is now accepted and ready to land.Nov 7 2022, 3:15 AM

Changed type, changed the definition of the UserListItem.

michal requested review of this revision.Nov 7 2022, 4:07 AM
tomek requested changes to this revision.Nov 8 2022, 4:15 AM
tomek added inline comments.
web/chat/chat-thread-composer.react.js
151–154 ↗(On Diff #18026)

Sorry for the confusion, I should've made it clearer, but this change should be a separate diff, placed before this one in the stack.

This revision now requires changes to proceed.Nov 8 2022, 4:15 AM
This revision is now accepted and ready to land.Nov 10 2022, 7:46 AM
kuba added a reviewer: michal.

New version: https://phab.comm.dev/D8224 (to prevent rebase issues)