Skip to content
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

Rework create/edit group/chat #957

Merged
merged 51 commits into from
Sep 10, 2019
Merged

Rework create/edit group/chat #957

merged 51 commits into from
Sep 10, 2019

Conversation

Jikstra
Copy link
Contributor

@Jikstra Jikstra commented Aug 27, 2019

Missing:

  • implement search
  • implement create group
    • adding/removing group members over dialog search
    • setting group name
    • setting group picture
    • unset group picture
    • showing qr code
    • adding group members over own dialog
    • add members to group
    • properly set groupImage
    • delete group on aborting/closing dialog
  • implement create verified group
  • implement add contact
  • fix slow rerendering if only one chat changes (implements partial update on proper DC_EVENT_CHAT_CHANGED event). This greatly improves the performance
  • fix multiple chatlistitems with same key
  • refactor EditGroup & GroupBase
  • separate group related stuff from create chat related stuff in CreateChat styles
  • fix QR code view
  • update chat view header after editing a group (to show updated group properties)
  • update deltachat-node

ToDo (probably not in this pr):

  • when people join over qr in group creation dialog, update member list
  • show toast/error when trying to create group or qr code without a groupname
  • fix grey border bug when scrolling all the way down

@@ -16,11 +17,11 @@ ipcRenderer.on('DD_EVENT_BLOCKED_CONTACTS_UPDATED', (evt, payload) => {
contactsStore.setState({ ...state, blockedContacts })
})

ipcRenderer.on('DD_EVENT_CONTACTS_UPDATED', (evt, payload) => {
ipcRenderer.on('DD_EVENT_CONTACTS_UPDATED', debounce((evt, payload) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: I should remove this again.

/>
</ArchivedChats>
)
} else {
return (
<ChatListItem
key={chatListItem.id}
chatListItem={chatListItem}
Copy link
Member

@nicodh nicodh Sep 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove key attribute here? It might be an performance issue when reordering the chat list or when inserting new items at the beginning if react has no key to "identify" the items. https://reactjs.org/docs/reconciliation.html#recursing-on-children
I know we have an issue with duplicate keys sometimes but that should not be solved by removing the key. Consider that the chat list might have hundreds of items...

Copy link
Contributor Author

@Jikstra Jikstra Sep 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wasn't on purpose. I actually added the correct ones to the map values (ContactRequestItemWrapper & ArchivedChats) which fixes the multiple error problem (we had the index of the element in the array + the chatId which in some cases where the same). So this problem is fixed with the last commit.

@Jikstra Jikstra changed the title [wip] Rework create chat Rework create chat Sep 5, 2019
Jikstra and others added 26 commits September 5, 2019 13:24
- Made create chat by contact into a wip dialog
- moved ContactList into helpers, added useContacts hook
- Enforce fallback avatars to be uppercase
- fix opening settings
- Move out DeltaDialog in own helper component
- Implement add contact pseudo element
- Fix some styling
- Implement getContacts2 dc method which allows us to not use a store
DD_EVENT_CHAT_MODIFIED to only swap out the one chat that has been
modified. Also refactors ChatListItem
@nicodh nicodh self-assigned this Sep 7, 2019
…-errors

Rework create chat avoid react errors
DC_FUNCTION_CALL => EVENT_DC_DISPATCH

EVENT_DC_CALL_METHOD_IGNORE_RETURN => EVENT_DC_DISPATCH

EVENT_DC_CALL_METHOD => EVENT_DC_DISPATCH_CB

DD_DC_CALL_METHOD_RETURN_<fn> => EVENT_DD_DISPATCH_RETURN_<fn>
@nicodh
Copy link
Member

nicodh commented Sep 8, 2019

@Jikstra I would prefer to have 2 columns for editing groups, was it an explicit UI decisison to have only one column in CreateChat view?
This is roughly how edit group looks like in the dialog implementation with 2 columns now:

Editgroup-Screenshot

@Jikstra
Copy link
Contributor Author

Jikstra commented Sep 8, 2019

@Jikstra I would prefer to have 2 columns for editing groups, was it an explicit UI decisison to have only one column in CreateChat view?
This is roughly how edit group looks like in the dialog implementation with 2 columns now:|

Puuh. Sorry but I don't like it. Before implementing this i would prefer only adding them over the "Add member" button. As usual, i'm very opinionated and picky about ui/ux decisions, so this maybe comes around a bit mean.
I don't like having two columns as it spreads too much stuff over the screen and the whole width is only used in the group dialog. For selecting a contact for a chat you can't use the whole width as you do in Add Group dialogs. Switching from New Chat to Create Group will result in doubling the width of the dialog which I want to prevent as it stops the flow of going through the dialog. The close button is suddenly at another position, the eyes have to focus at different positions to find what they are looking for. The whole idea of combining existing and potential members into one list was to replace the 2 column view with a one column view but keeping the benefits of adding group members in a fast way. Also when searching things will change in the left and the right path of the dialog instead of creating a new list. Besides that you also can't use the whole width useful in the upper part of the dialog. I would prefer to keep it like it currently is.

Ahh i'm sorry i'm very opinionated on those things. I think i'm a lot less opinionated on coding style and stuff than on this...

@nicodh
Copy link
Member

nicodh commented Sep 8, 2019

Well I didn't mean to change it in the CreateChat view but only in the edit group view. So no switching of width etc.
Usability wise I consider it a huge benefit to see members and non members side by side, that's why I would like to keep it in the edit group dialog...

@Jikstra
Copy link
Contributor Author

Jikstra commented Sep 8, 2019

Okay some points why I think it's not a good idea:

  1. I prefer in a ui/ux to reuse ideas/components as often as possible. In my opinion it's confusing if adding/removing members in the Create Group dialog is done differently than in the edit group dialog.
  2. We have no other place in the whole ui where we show Contacts or Chats (which are visually extremely similiar) in 2 columns/left&right to each other. Doing this in one place is confusing.
  3. Opening the Edit Group dialog and having members displayed that aren't in this group is confusing. This is already problematic in the one column approach of me, but a bit better as it happens on a search input and can easily get undone, plus the checkboxes (which all are visually aligned at the same position, as it's in the same colum) makes it more clear that there's something different between members which i can add and members that i can remove. This benefit you don't have if they are spread accross two columns.

In case we can figure out a good way of the 2 column approach, i'm fine with using this approach as the general "Add member" view. But I don't like doing it at one place different as at another place. But can you explain to me what makes the 2 column approach easier to use over the "one splitted list" approach?

@nicodh
Copy link
Member

nicodh commented Sep 8, 2019

Ok - although I still don't get why we should reduce the usable space to 25% of the available width and add extra clicks and forth and back switches and check boxes to the add/remove user process.
But I'm NOT very opinionated about UI stuff ;-)
So let's go for the one column. Maybe we can get other opinions in the UI sessions next days...

@Jikstra
Copy link
Contributor Author

Jikstra commented Sep 8, 2019

add extra clicks and forth and back switches and check boxes to the add/remove user process

Hmm good point! The most forth/back that we currently have is because we can't create a new (verified) group from the main menu. If we implement this, zack, one click less for creating a (verified) group. Adding/removing a member is currently possible with some keystrokes and one click which is quite less. Showing the qr code is also one click. Proof me wrong, but for me it doesn't feel like Creating a Chat/Group is a Point and Click Adventure (yet) :D

why we should reduce the usable space to 25% of the available width

We don't have more to show. We have 4 things: Group image, group name, qr code and group members. We could show the qr code, but the qr code changes whenever we change the groupname. Updating the qr code whenever we change the groupname makes the ui busy and distracts the user. Splitting the create group flow into two parts, first where we enter the groupname and the second where we add groupmembers/show the qr code would solve this, but comes with the cost that we need to throw away that group to change the name and we have one click more again. Yes we can show the member lists in two columns, but we can't use the other column in the upper part for anything else. Letting the groupname take the whole width looks weird and besides that we have nothing, as the group image is tightly coupled with the groupname.

Maybe we can get other opinions in the UI sessions next days...

👍

Another point which is important in my opinion is that we don't have a ui/ux guideline for the desktop client as there is for android (material) ios (that apple thing). Both platforms have a strict styling guide and many examples how to do things. We don't have that. It's not like there's one way on how to do it right with electron. Coming up with an own is not easy, needs a lot of thinking through and a good designer to have a consistent style guide. That's the reason why im copying so many things from android and the material design, because i think it works well on desktop too and because I think people are used to the android/smartphone flow. If we completely change how we interact with the desktop ui, we also need to come up with new components, buttons, maybe even colors. I don't know that shit, so i go the more safe path and try to stay as close with the android ui as possible, modifying things where it makes sense and using the telegram desktop ui as a good inspiration for a bridge between a desktop app and a mobile app. The downside is that it feels to much like an android app or whatever, but that's my bigger idea of how the desktop ui should look like. Changing this is possible, but than we need to change a lot. For ui consistence is key.

@nicodh nicodh removed their assignment Sep 10, 2019
@Jikstra Jikstra changed the title Rework create chat Rework create/edit group/chat Sep 10, 2019
@Jikstra
Copy link
Contributor Author

Jikstra commented Sep 10, 2019

Displaying qr code works as expected, you need to use the latest deltachat-node (from git). Will do a new release (hopefully today).

update chat view header after editing a group (to show updated group properties)

This problem is probably an old bug? Would be fine to do this in another pr.

@Jikstra Jikstra merged commit cc7914a into master Sep 10, 2019
@Jikstra Jikstra deleted the rework_create_chat branch September 10, 2019 12:15
@hpk42
Copy link
Contributor

hpk42 commented Sep 10, 2019 via email

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.

4 participants