diff --git a/CHANGELOG.md b/CHANGELOG.md index c5bc78d24d..2b74e71922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ - windows 64bit and 32bit protable and setup now have different filenames #4131 - scroll the selected account into view in the accounts sidebar #4137 - dev: clarify scrolling-related code #4121 -- improved performance a bit #4145, #4188 +- improved performance a bit #4145, #4188, #4206 - show contact / group name & avatar when pasting invite link in the search field #4151, #4178 - Update local help (2024-10-02) #4165 - trim whitepaces when reading from clipboard in qr code reader #4169 diff --git a/packages/frontend/src/components/attachment/mediaAttachment.tsx b/packages/frontend/src/components/attachment/mediaAttachment.tsx index 7ef1692cac..043cb6e817 100644 --- a/packages/frontend/src/components/attachment/mediaAttachment.tsx +++ b/packages/frontend/src/components/attachment/mediaAttachment.tsx @@ -73,7 +73,7 @@ const contextMenuFactory = ( }, { label: tx('show_in_chat'), - action: () => jumpToMessage(accountId, message.id), + action: () => jumpToMessage(accountId, message.id, message.chatId), }, { label: tx('info'), diff --git a/packages/frontend/src/components/composer/Composer.tsx b/packages/frontend/src/components/composer/Composer.tsx index f961ca31f0..9305c5bd61 100644 --- a/packages/frontend/src/components/composer/Composer.tsx +++ b/packages/frontend/src/components/composer/Composer.tsx @@ -605,7 +605,7 @@ export function useDraft( // TODO perf: jumpToMessage is not instant, but it should be // since the message is (almost?) always already rendered. - jumpToMessage(accountId, messageId, true) + jumpToMessage(accountId, messageId, chatId, true) } // TODO perf: I imagine this is pretty slow, given IPC and some chats // being quite large. Perhaps we could hook into the diff --git a/packages/frontend/src/components/composer/EmojiAndStickerPicker.tsx b/packages/frontend/src/components/composer/EmojiAndStickerPicker.tsx index 63d3072b79..304a730ec5 100644 --- a/packages/frontend/src/components/composer/EmojiAndStickerPicker.tsx +++ b/packages/frontend/src/components/composer/EmojiAndStickerPicker.tsx @@ -38,7 +38,7 @@ const DisplayedStickerPack = ({ const stickerPath = fileName.replace('file://', '') BackendRemote.rpc .sendSticker(accountId, chatId, stickerPath) - .then(id => jumpToMessage(accountId, id, false)) + .then(id => jumpToMessage(accountId, id, chatId, false)) setShowEmojiPicker(false) } diff --git a/packages/frontend/src/components/dialogs/ChatAuditLogDialog.tsx b/packages/frontend/src/components/dialogs/ChatAuditLogDialog.tsx index 3f217cf4b2..1b83c3dbf8 100644 --- a/packages/frontend/src/components/dialogs/ChatAuditLogDialog.tsx +++ b/packages/frontend/src/components/dialogs/ChatAuditLogDialog.tsx @@ -44,7 +44,9 @@ function buildContextMenu( label: tx('show_in_chat'), action: () => { closeDialogCallback() - setTimeout(() => jumpToMessage(accountId, message.id, true)) + setTimeout(() => + jumpToMessage(accountId, message.id, message.chatId, true) + ) }, }, // Show Webxdc in Chat @@ -53,7 +55,10 @@ function buildContextMenu( action: () => { if (message.parentId) { closeDialogCallback() - jumpToMessage(accountId, message.parentId, true) + // Currently the info message is always in the same chat + // as the message with `message.parentId`, + // but let's not pass `chatId` here, for future-proofing. + jumpToMessage(accountId, message.parentId, undefined, true) } }, }, diff --git a/packages/frontend/src/components/dialogs/ForwardMessage/index.tsx b/packages/frontend/src/components/dialogs/ForwardMessage/index.tsx index d1273051f9..70f3207281 100644 --- a/packages/frontend/src/components/dialogs/ForwardMessage/index.tsx +++ b/packages/frontend/src/components/dialogs/ForwardMessage/index.tsx @@ -65,7 +65,7 @@ export default function ForwardMessage(props: Props) { ) const lastMessage = messageIds[messageIds.length - 1] if (lastMessage) { - jumpToMessage(accountId, lastMessage) + jumpToMessage(accountId, lastMessage, chatId) } } else { selectChat(accountId, message.chatId) diff --git a/packages/frontend/src/components/dialogs/FullscreenMedia.tsx b/packages/frontend/src/components/dialogs/FullscreenMedia.tsx index 630dc57210..2920367df0 100644 --- a/packages/frontend/src/components/dialogs/FullscreenMedia.tsx +++ b/packages/frontend/src/components/dialogs/FullscreenMedia.tsx @@ -114,7 +114,7 @@ export default function FullscreenMedia(props: Props & DialogProps) { { label: tx('show_in_chat'), action: () => { - jumpToMessage(accountId, msg.id) + jumpToMessage(accountId, msg.id, msg.chatId) onClose() }, }, diff --git a/packages/frontend/src/components/message/Message.tsx b/packages/frontend/src/components/message/Message.tsx index 824c312f57..c1c2e1a268 100644 --- a/packages/frontend/src/components/message/Message.tsx +++ b/packages/frontend/src/components/message/Message.tsx @@ -449,7 +449,13 @@ export default function Message(props: { if (isInteractive) { onClick = async () => { if (isWebxdcInfo && message.parentId) { - jumpToMessage(accountId, message.parentId, true, message.id) + jumpToMessage( + accountId, + message.parentId, + undefined, + true, + message.id + ) } else if (isProtectionBrokenMsg) { const { name } = await BackendRemote.rpc.getBasicChatInfo( selectedAccountId(), @@ -738,7 +744,13 @@ export const Quote = ({ className='quote-background' onClick={() => { quote.kind === 'WithMessage' && - jumpToMessage(accountId, quote.messageId, true, msgParentId) + jumpToMessage( + accountId, + quote.messageId, + undefined, + true, + msgParentId + ) }} >