From d90bef8ee51a641d26a669391ee60c6f5d143da8 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Thu, 27 Feb 2025 11:51:02 +0700 Subject: [PATCH 1/5] fix: search page cannot be dismissed by swiping to the right --- src/CONST.ts | 6 ++++++ src/components/AttachmentModal.tsx | 1 + src/components/Search/SearchRouter/SearchRouterModal.tsx | 1 + 3 files changed, 8 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index 29223e598d8cc..035d6c28649ad 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -763,6 +763,12 @@ const CONST = { GB: 'GB', IT: 'IT', }, + SWIPE_DIRECTION: { + DOWN: 'down', + LEFT: 'left', + RIGHT: 'right', + UP: 'up', + }, DESKTOP_DEEPLINK_APP_STATE: { CHECKING: 'checking', INSTALLED: 'installed', diff --git a/src/components/AttachmentModal.tsx b/src/components/AttachmentModal.tsx index e8da2b56cab93..c16361e7e9ae3 100644 --- a/src/components/AttachmentModal.tsx +++ b/src/components/AttachmentModal.tsx @@ -514,6 +514,7 @@ function AttachmentModal({ } }} propagateSwipe + swipeDirection={CONST.SWIPE_DIRECTION.RIGHT} initialFocus={() => { if (!submitRef.current) { return false; diff --git a/src/components/Search/SearchRouter/SearchRouterModal.tsx b/src/components/Search/SearchRouter/SearchRouterModal.tsx index fa8165fec596d..09adddcaa4bde 100644 --- a/src/components/Search/SearchRouter/SearchRouterModal.tsx +++ b/src/components/Search/SearchRouter/SearchRouterModal.tsx @@ -30,6 +30,7 @@ function SearchRouterModal() { popoverAnchorPosition={{right: 6, top: 6}} fullscreen propagateSwipe + swipeDirection={CONST.SWIPE_DIRECTION.RIGHT} shouldHandleNavigationBack={isMobileChrome()} onClose={closeSearchRouter} onModalHide={() => setShouldHideInputCaret(isMobileWebSafari)} From 854ad3ab65e103daccc5ba5e8c73d41626b161b6 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 3 Mar 2025 14:17:46 +0700 Subject: [PATCH 2/5] fix bug center search --- src/CONST.ts | 8 -------- src/components/AttachmentModal.tsx | 2 +- src/components/Search/SearchRouter/SearchRouterModal.tsx | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index f6b3293e00867..035d6c28649ad 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -3446,11 +3446,6 @@ const CONST = { UNAPPROVE: 'unapprove', DEBUG: 'debug', GO_TO_WORKSPACE: 'goToWorkspace', - TRACK: { - SUBMIT: 'submit', - CATEGORIZE: 'categorize', - SHARE: 'share', - }, }, EDIT_REQUEST_FIELD: { AMOUNT: 'amount', @@ -6681,7 +6676,6 @@ const CONST = { HYBRID_APP: { REORDERING_REACT_NATIVE_ACTIVITY_TO_FRONT: 'reorderingReactNativeActivityToFront', - SINGLE_NEW_DOT_ENTRY: 'singleNewDotEntry', }, MIGRATED_USER_WELCOME_MODAL: 'migratedUserWelcomeModal', @@ -6697,8 +6691,6 @@ const CONST = { LHN_WORKSPACE_CHAT_TOOLTIP: 'workspaceChatLHNTooltip', GLOBAL_CREATE_TOOLTIP: 'globalCreateTooltip', SCAN_TEST_TOOLTIP: 'scanTestTooltip', - SCAN_TEST_TOOLTIP_MANAGER: 'scanTestTooltipManager', - SCAN_TEST_CONFIRMATION: 'scanTestConfirmation', }, SMART_BANNER_HEIGHT: 152, diff --git a/src/components/AttachmentModal.tsx b/src/components/AttachmentModal.tsx index c16361e7e9ae3..40f2cc4cf6f05 100644 --- a/src/components/AttachmentModal.tsx +++ b/src/components/AttachmentModal.tsx @@ -514,7 +514,7 @@ function AttachmentModal({ } }} propagateSwipe - swipeDirection={CONST.SWIPE_DIRECTION.RIGHT} + swipeDirection={shouldUseNarrowLayout ? CONST.SWIPE_DIRECTION.RIGHT : undefined} initialFocus={() => { if (!submitRef.current) { return false; diff --git a/src/components/Search/SearchRouter/SearchRouterModal.tsx b/src/components/Search/SearchRouter/SearchRouterModal.tsx index 09adddcaa4bde..bb65689f700a6 100644 --- a/src/components/Search/SearchRouter/SearchRouterModal.tsx +++ b/src/components/Search/SearchRouter/SearchRouterModal.tsx @@ -30,7 +30,7 @@ function SearchRouterModal() { popoverAnchorPosition={{right: 6, top: 6}} fullscreen propagateSwipe - swipeDirection={CONST.SWIPE_DIRECTION.RIGHT} + swipeDirection={shouldUseNarrowLayout ? CONST.SWIPE_DIRECTION.RIGHT : undefined} shouldHandleNavigationBack={isMobileChrome()} onClose={closeSearchRouter} onModalHide={() => setShouldHideInputCaret(isMobileWebSafari)} From 678c32e4402f001c5198d28d88c280a4d8b59e97 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 3 Mar 2025 14:36:25 +0700 Subject: [PATCH 3/5] fix remove useFocusEffect --- .../workspace/companyCards/WorkspaceCompanyCardsPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx index 53e325bfb6a87..883bcfb11df53 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx @@ -67,7 +67,9 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) { const {isOffline} = useNetwork({onReconnect: fetchCompanyCards}); const isLoading = !isOffline && (!cardFeeds || (!!cardFeeds.isLoading && isEmptyObject(cardsList))); - useFocusEffect(fetchCompanyCards); + useEffect(() => { + fetchCompanyCards(); + }, [fetchCompanyCards]); useEffect(() => { if (isLoading || !selectedFeed || isPending) { From 4934ccc65a8cd73fc257e16979514ed2c9cebadf Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 3 Mar 2025 14:37:02 +0700 Subject: [PATCH 4/5] fix lint --- .../workspace/companyCards/WorkspaceCompanyCardsPage.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx index 883bcfb11df53..53e325bfb6a87 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx @@ -67,9 +67,7 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) { const {isOffline} = useNetwork({onReconnect: fetchCompanyCards}); const isLoading = !isOffline && (!cardFeeds || (!!cardFeeds.isLoading && isEmptyObject(cardsList))); - useEffect(() => { - fetchCompanyCards(); - }, [fetchCompanyCards]); + useFocusEffect(fetchCompanyCards); useEffect(() => { if (isLoading || !selectedFeed || isPending) { From 9b006e4a0a76d5d3a78844183d27c7da8f88526e Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 3 Mar 2025 17:13:56 +0700 Subject: [PATCH 5/5] fix lint --- src/CONST.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index 035d6c28649ad..f6b3293e00867 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -3446,6 +3446,11 @@ const CONST = { UNAPPROVE: 'unapprove', DEBUG: 'debug', GO_TO_WORKSPACE: 'goToWorkspace', + TRACK: { + SUBMIT: 'submit', + CATEGORIZE: 'categorize', + SHARE: 'share', + }, }, EDIT_REQUEST_FIELD: { AMOUNT: 'amount', @@ -6676,6 +6681,7 @@ const CONST = { HYBRID_APP: { REORDERING_REACT_NATIVE_ACTIVITY_TO_FRONT: 'reorderingReactNativeActivityToFront', + SINGLE_NEW_DOT_ENTRY: 'singleNewDotEntry', }, MIGRATED_USER_WELCOME_MODAL: 'migratedUserWelcomeModal', @@ -6691,6 +6697,8 @@ const CONST = { LHN_WORKSPACE_CHAT_TOOLTIP: 'workspaceChatLHNTooltip', GLOBAL_CREATE_TOOLTIP: 'globalCreateTooltip', SCAN_TEST_TOOLTIP: 'scanTestTooltip', + SCAN_TEST_TOOLTIP_MANAGER: 'scanTestTooltipManager', + SCAN_TEST_CONFIRMATION: 'scanTestConfirmation', }, SMART_BANNER_HEIGHT: 152,