From b244f91d869072286e3c86a7728b103f9c310cf3 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 24 Oct 2024 13:21:06 -0300 Subject: [PATCH 1/3] fix: draft message not being updated (#5927) --- .../components/ComposerInput.tsx | 4 +++- e2e/tests/room/02-room.spec.ts | 23 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/containers/MessageComposer/components/ComposerInput.tsx b/app/containers/MessageComposer/components/ComposerInput.tsx index 378b1729bc..d1a3db21e4 100644 --- a/app/containers/MessageComposer/components/ComposerInput.tsx +++ b/app/containers/MessageComposer/components/ComposerInput.tsx @@ -6,7 +6,7 @@ import { RouteProp, useFocusEffect, useRoute } from '@react-navigation/native'; import I18n from '../../../i18n'; import { IAutocompleteItemProps, IComposerInput, IComposerInputProps, IInputSelection, TSetInput } from '../interfaces'; -import { useAutocompleteParams, useFocused, useMessageComposerApi } from '../context'; +import { useAutocompleteParams, useFocused, useMessageComposerApi, useMicOrSend } from '../context'; import { fetchIsAllOrHere, getMentionRegexp } from '../helpers'; import { useSubscription, useAutoSaveDraft } from '../hooks'; import sharedStyles from '../../../views/Styles'; @@ -58,6 +58,8 @@ export const ComposerInput = memo( const usedCannedResponse = route.params?.usedCannedResponse; const prevAction = usePrevious(action); + // subscribe to changes on mic state to update draft after a message is sent + useMicOrSend(); const { saveMessageDraft } = useAutoSaveDraft(textRef.current); // Draft/Canned Responses diff --git a/e2e/tests/room/02-room.spec.ts b/e2e/tests/room/02-room.spec.ts index 7a38a3c960..20b6ddbec1 100644 --- a/e2e/tests/room/02-room.spec.ts +++ b/e2e/tests/room/02-room.spec.ts @@ -10,7 +10,8 @@ import { TTextMatcher, mockMessage, navigateToRoom, - navigateToRecentRoom + navigateToRecentRoom, + checkMessage } from '../../helpers/app'; import { createRandomRoom, createRandomUser, deleteCreatedUsers, ITestUser, sendMessage } from '../../helpers/data_setup'; import data from '../../data'; @@ -413,6 +414,26 @@ describe('Room screen', () => { await tapBack(); }); + it('should save draft, check it, send it and clear it', async () => { + await navigateToRoom(room); + const draftMessage = 'draft'; + await element(by.id('message-composer-input')).typeText(draftMessage); + await tapBack(); + await navigateToRecentRoom(room); + await sleep(500); // wait for animation + await expect(element(by.id('message-composer-input'))).toHaveText(draftMessage); + await waitFor(element(by.id('message-composer-send'))) + .toExist() + .withTimeout(5000); + await element(by.id('message-composer-send')).tap(); + await checkMessage(draftMessage); + await tapBack(); + await navigateToRecentRoom(room); + await sleep(500); // wait for animation + await expect(element(by.id('message-composer-input'))).toHaveText(''); + await tapBack(); + }); + it('should save message and quote draft correctly', async () => { const newUser = await createRandomUser(); const { name: draftRoom } = await createRandomRoom(newUser, 'c'); From 39f54a03ccec1f71034fc482f2c761d15e714440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Stasiak?= <91474186+OtavioStasiak@users.noreply.github.com> Date: Thu, 24 Oct 2024 19:39:48 -0300 Subject: [PATCH 2/3] fix: you are in preview mode german translation (#5907) --- app/i18n/locales/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/i18n/locales/de.json b/app/i18n/locales/de.json index e899495fe9..81d03d2d10 100644 --- a/app/i18n/locales/de.json +++ b/app/i18n/locales/de.json @@ -740,7 +740,7 @@ "you": "Sie", "You_are_converting_the_team": "Sie wandeln dieses Team in einen Room um", "You_are_deleting_the_team": "Sie sind dabei dieses Team zu löschen.", - "You_are_in_preview_mode": "Sie befinden dich im Vorschaumodus", + "You_are_in_preview_mode": "Sie befinden sich im Vorschaumodus", "You_are_leaving_the_team": "Sie verlassen das Team '{{team}}'", "You_can_search_using_RegExp_eg": "Sie können mit RegExp suchen. z.B. `/ ^ text $ / i`", "You_colon": "Sie: ", From 85f6099b91777fb89f6f230cd450466c0da94b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Stasiak?= <91474186+OtavioStasiak@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:35:40 -0300 Subject: [PATCH 3/3] regression: Big emoji cutted (#5905) Co-authored-by: Diego Mello --- app/containers/markdown/index.tsx | 5 ++++- app/containers/markdown/styles.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/containers/markdown/index.tsx b/app/containers/markdown/index.tsx index a2b663f415..6b33eb12a8 100644 --- a/app/containers/markdown/index.tsx +++ b/app/containers/markdown/index.tsx @@ -191,10 +191,13 @@ class Markdown extends PureComponent { }; renderParagraph = ({ children }: any) => { - const { numberOfLines, style = [], theme } = this.props; + const { numberOfLines, style = [], theme, msg } = this.props; if (!children || children.length === 0) { return null; } + if (msg && this.isMessageContainsOnlyEmoji) { + return {children}; + } return ( {children} diff --git a/app/containers/markdown/styles.ts b/app/containers/markdown/styles.ts index 232d60d7f1..c03fd66f76 100644 --- a/app/containers/markdown/styles.ts +++ b/app/containers/markdown/styles.ts @@ -46,6 +46,7 @@ export default StyleSheet.create({ ...sharedStyles.textRegular }, textBig: { + lineHeight: 43, fontSize: 30, ...sharedStyles.textRegular },