Skip to content

Commit

Permalink
Fabri QA for frames & deeplinks (#1098)
Browse files Browse the repository at this point in the history
* Fabri QA for frames & deeplinks

* also allow ' & " at beginning

* comments
  • Loading branch information
nmalzieu authored Oct 25, 2024
1 parent 9839dcf commit 393cff8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useGroupName } from "@hooks/useGroupName";
import { translate } from "@i18n";
import { useGroupQuery } from "@queries/useGroupQuery";
import { textPrimaryColor } from "@styles/colors";
import { isGroupTopic } from "@utils/groupUtils/groupId";
import { useCallback, useMemo } from "react";
import {
Keyboard,
Expand All @@ -25,6 +26,7 @@ type Props = {
};

export function GroupChatPlaceholder({ messagesCount }: Props) {
const topic = useConversationContext("topic");
const conversation = useConversationContext("conversation");
const onReadyToFocus = useConversationContext("onReadyToFocus");

Expand Down Expand Up @@ -74,9 +76,13 @@ export function GroupChatPlaceholder({ messagesCount }: Props) {
<View onLayout={onLayout} style={styles.chatPlaceholder}>
{!conversation && (
<View>
<ActivityIndicator style={styles.activitySpinner} />
{!topic && <ActivityIndicator style={{ marginBottom: 20 }} />}
<Text style={styles.chatPlaceholderText}>
{translate("opening_conversation")}
{topic
? isGroupTopic(topic)
? translate("group_not_found")
: translate("conversation_not_found")
: translate("opening_conversation")}
</Text>
</View>
)}
Expand Down
5 changes: 4 additions & 1 deletion screens/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ const Conversation = ({
}
} else if (
route.params?.mainConversationWithPeer &&
!openedMainConvo.current
!openedMainConvo.current &&
!conversationTopicRef.current
) {
openedMainConvo.current = true;
openMainConversationWithPeer(
Expand Down Expand Up @@ -286,6 +287,7 @@ const Conversation = ({

const conversationContextValue = useMemo(
() => ({
topic: conversationTopic,
conversation,
messageToPrefill,
inputRef: textInputRef,
Expand All @@ -300,6 +302,7 @@ const Conversation = ({
tagsFetchedOnceForMessage,
}),
[
conversationTopic,
conversation,
messageToPrefill,
textInputRef,
Expand Down
4 changes: 2 additions & 2 deletions utils/regex.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const BOUNDARY_START_LOOKBEHIND = /(\s|\()/.source; // Either a space or a (
const BOUNDARY_START_LOOKBEHIND = /(\s|\(|"|')/.source; // Either a space or a (, or a " or a '
const BOUNDARY_START = new RegExp(`(?<=${BOUNDARY_START_LOOKBEHIND})|^`).source; // It must be start of the line or be preceded by lookbehind
const BOUNDARY_END_LOOKAHEAD = /(\s|\)|$|\.|!|\?|\r\n|\r|\n)/.source; // Either a space, the end of the text, or a ), a ., a !, a ?, a line break
const BOUNDARY_END_LOOKAHEAD = /(\s|\)|$|\.|!|\?|\r\n|\r|\n|"|')/.source; // Either a space, the end of the text, or a ), a ., a !, a ?, a line break, or a " or a '
const BOUNDARY_END = new RegExp(`(?=${BOUNDARY_END_LOOKAHEAD})`).source;
const WORD_CONTENT = /[^()/\s]/.source; // Not a space, not a ( or ), not a /

Expand Down

0 comments on commit 393cff8

Please sign in to comment.