Skip to content

Conversation

@nicodh
Copy link
Member

@nicodh nicodh commented Nov 27, 2025

resolves #5325, #5769

TBD:

  1. should we show the Encryption info item in chat list at all?
  2. the generic "dangerColor" seems a bit inappropriate (too pale) - do we need 2 different colors for danger & error?
  3. I moved profile to "more options" in 3dot menu since there is the direct link to the chat header which is much more convenient

Current state:
Main difference between both menues: chatlist has "pin", main chat has "search" and "more options"

context menu:            three-dot-menu menu:


                         search in chat
                         mute notifications
                         --------
pin chat                     
mute notifications       archive chat
archive chat             disappearing messages
--------                 --------
profile
clone chat **
--------                 
block contact *          block contact *
leave group **           leave group/channel
                         clear chat
delete chat              delete chat
encryption info          more options:
                                 profile
                                 clear chat
                                 encryption info
                                 chat audit log



*one-to-one only
**groups only
image

Note: I will rename the file and the class ChatListContextMenu => ChatContextMenu but after being approved for better reviewing

@Simon-Laux
Copy link
Member

  1. should we show the Encryption info item in chat list at all?

may not even be useful for groups anymore with key contacts? there are no opportunisitc groups anymore, are there?
And for contacts you can already/still access it from the profile view.

@r10s
Copy link
Member

r10s commented Dec 1, 2025

  1. should we show the Encryption info item in chat list at all?

"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

  1. the generic "dangerColor" seems a bit inappropriate (too pale) - do we need 2 different colors for danger & error?

let's go for #ff0c16 for "red danger or error text", this is what we're using on android as well. it works nicely on light and dark mode

but i'd call the color dangerTextColor - it must not be used for red background and white text (as eg. in the buttons)

Screenshot 2025-12-01 at 18 36 29

@r10s
Copy link
Member

r10s commented Dec 1, 2025

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

@nicodh nicodh force-pushed the merge-three-dot-menues branch from 29caf37 to 348fbfa Compare December 5, 2025 08:52
@nicodh nicodh marked this pull request as ready for review December 5, 2025 09:00
Copy link
Member

@WofWca WofWca left a 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;
Copy link
Member

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

Image

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// 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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// check for context menu items
// check for context menu items

await chatListItem.click({
button: 'right',
})
await expect(page.getByRole('menu').getByRole('menuitem')).toHaveText([
Copy link
Member

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:)

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,
Copy link
Member

@WofWca WofWca Dec 5, 2025

Choose a reason for hiding this comment

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

TBH this looks really odd after the "danger" buttons:

Image

Maybe move it up? Right along "view profile / group".

Comment on lines 433 to 442
{
label: tx('menu_delete_chat'),
action: onDeleteChats,
danger: true,
},
isMainView && {
label: tx('clear_chat'),
action: onClearChat,
danger: true,
},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
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,
Copy link
Member

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',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'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".

Copy link
Member Author

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

Comment on lines 208 to 212
!isGroup &&
!singleChat.isDeviceTalk && {
label: tx('menu_view_profile'),
action: onViewProfile,
},
Copy link
Member

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' }
Copy link
Member

@WofWca WofWca Dec 5, 2025

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?

@nicodh
Copy link
Member Author

nicodh commented Dec 6, 2025

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.

@nicodh nicodh requested review from WofWca and removed request for r10s December 6, 2025 12:06
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.

How is "Three dot menu" different from "Chat list item context menu"?

5 participants