-
-
Notifications
You must be signed in to change notification settings - Fork 209
Merge three dot menues #5776
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
base: main
Are you sure you want to change the base?
Merge three dot menues #5776
Conversation
may not even be useful for groups anymore with key contacts? there are no opportunisitc groups anymore, are there? |
"encryption info" is mostly useful for one-to-ones, that is even mentioned in advanced faq. "group encryption info" is more a debug thing, it does not make sense to upgrade that to three-dot-menu, it would better be placed in group profile as well - but as we do not have the three-dot-menu there atm, let's leave that in the chatlist context menu for now (we anyway stay with two menus) or remove it (if we only have one menu) there is the idea to have a "three dot menu" also in group profiles
let's go for but i'd call the color
|
|
for the "more options" - that can also be flattened, there will stay only "clear chat" after #5773 this also looks better as the "red options" are at the end then ("Clear" and "Delete") |
29caf37 to
348fbfa
Compare
WofWca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some issues (not all are critical), but overall I think this is probably a good change, removes duplicate logic.
| $themeDarkOrLight: light !default; | ||
| $colorPrimary: #42a5f5 !default; | ||
| $colorDanger: #f96856 !default; | ||
| $colorDanger: #ff0c16 !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contrast in fact is not satisfactory on either of the themes (dark or light), especially with the "hover highlight".
To fix that we should use different colors for dark and light theme, as @nicodh said.
This also goes for $btnDangerBackground BTW.
Maybe this is for another MR though.
| .filter({ hasText: userA.name }) | ||
| .first() | ||
| await expect(chatListItem).toBeVisible() | ||
| // check for context menu items |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // check for context menu items | |
| // check for context menu items |
It's somewhat of a separate test, so let's separate it with a new line at least.
| .getByTestId(`account-item-${userB.id}`) | ||
| .locator('.styles_module_accountBadgeIcon') | ||
| await expect(badgeNumber).toHaveText('1') | ||
| // check for context menu items |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // check for context menu items | |
| // check for context menu items |
| await chatListItem.click({ | ||
| button: 'right', | ||
| }) | ||
| await expect(page.getByRole('menu').getByRole('menuitem')).toHaveText([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding tests for the "three-dot menu" as well while we're at it?
(BTW note that there is another place which explicitly tests context menu:)
deltachat-desktop/packages/e2e-tests/tests/chat-list-multiselect.spec.ts
Lines 193 to 210 in 17ba3b0
| test.describe('context menu', () => { | |
| test('opens', async () => { | |
| await getChat(7).click() | |
| await expectSelectedChats([7]) | |
| await getChat(5).click({ | |
| modifiers: ['ControlOrMeta'], | |
| }) | |
| await expectSelectedChats([7, 5]) | |
| await getChat(5).click({ | |
| button: 'right', | |
| }) | |
| await expect(page.getByRole('menu').getByRole('menuitem')).toHaveText([ | |
| 'Pin Chat', | |
| 'Mute Notifications', | |
| 'Archive Chat', | |
| 'Delete Chat', | |
| ]) |
| action: onClearChat, | ||
| danger: true, | ||
| }, | ||
| !isMainView && encryptionInfoItem, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| label: tx('menu_delete_chat'), | ||
| action: onDeleteChats, | ||
| danger: true, | ||
| }, | ||
| isMainView && { | ||
| label: tx('clear_chat'), | ||
| action: onClearChat, | ||
| danger: true, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | |
| label: tx('menu_delete_chat'), | |
| action: onDeleteChats, | |
| danger: true, | |
| }, | |
| isMainView && { | |
| label: tx('clear_chat'), | |
| action: onClearChat, | |
| danger: true, | |
| }, | |
| isMainView && { | |
| label: tx('clear_chat'), | |
| action: onClearChat, | |
| danger: true, | |
| }, | |
| { | |
| label: tx('menu_delete_chat'), | |
| action: onDeleteChats, | |
| danger: true, | |
| }, |
Let's swap the two. Makes sense, and is in line with Android and Telegram.
| action: () => onLeaveGroupOrChannel(singleChat), | ||
| danger: true, | ||
| }, | ||
| ephemeralMessagesMenuItem, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving this to just below "mute chat"?
| 'Pin Chat', | ||
| 'Mute Notifications', | ||
| 'Archive Chat', | ||
| 'View Profile', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 'View Profile', | |
| 'Edit Group', |
menu_edit_group string is unused in this version of the MR. I think we shouldn't change this to "View Profile".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was explicitly requested by @r10s
| !isGroup && | ||
| !singleChat.isDeviceTalk && { | ||
| label: tx('menu_view_profile'), | ||
| action: onViewProfile, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also shown for channels, and the button just opens the first recipient's profile.
I think it's best to avoid using isGroup with !, and it's best to use chatType directly.
Edit: OK, never mind, this bug is also present on main.
| const activeChat = { | ||
| ...chat, | ||
| kind: 'ChatListItem', | ||
| } as unknown as T.ChatListItemFetchResult & { kind: 'ChatListItem' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it hard to avoid a type cast here?
|
I applied some of the suggestions concerning the order of items. And introduced a new (reduced) chat list type which the full chat is converted to. |


resolves #5325, #5769
TBD:
Current state:
Main difference between both menues: chatlist has "pin", main chat has "search" and "more options"
Note: I will rename the file and the class ChatListContextMenu => ChatContextMenu but after being approved for better reviewing