From 9363ff6f481fa905faccad1951ea6d6705c1efae Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Mon, 21 Apr 2025 19:00:38 +0300 Subject: [PATCH 001/152] rm double close (#8246) --- src/components/verification/VerifierDialog.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/verification/VerifierDialog.tsx b/src/components/verification/VerifierDialog.tsx index bfe49ec19..afaac60d6 100644 --- a/src/components/verification/VerifierDialog.tsx +++ b/src/components/verification/VerifierDialog.tsx @@ -146,8 +146,6 @@ function Inner({ - - ) } -- 2.51.2 From b800334ebc97fa2ef15f8e0f2f8d81f61626b0fa Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 21 Apr 2025 11:28:35 -0500 Subject: [PATCH 002/152] Center handle in verifier dialog (#8247) * Center handle in verifier dialog * do the same for the other dialog --------- Co-authored-by: Samuel Newman --- src/components/verification/VerificationsDialog.tsx | 3 +-- src/components/verification/VerifierDialog.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/verification/VerificationsDialog.tsx b/src/components/verification/VerificationsDialog.tsx index d61823968..76fbcc355 100644 --- a/src/components/verification/VerificationsDialog.tsx +++ b/src/components/verification/VerificationsDialog.tsx @@ -35,6 +35,7 @@ export function VerificationsDialog({ }) { return ( + - - {label} diff --git a/src/components/verification/VerifierDialog.tsx b/src/components/verification/VerifierDialog.tsx index afaac60d6..23cc4724d 100644 --- a/src/components/verification/VerifierDialog.tsx +++ b/src/components/verification/VerifierDialog.tsx @@ -30,6 +30,7 @@ export function VerifierDialog({ }) { return ( + - - Date: Mon, 21 Apr 2025 19:53:01 +0300 Subject: [PATCH 003/152] rm other close (#8250) --- src/components/verification/VerificationsDialog.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/verification/VerificationsDialog.tsx b/src/components/verification/VerificationsDialog.tsx index 76fbcc355..42e7369ee 100644 --- a/src/components/verification/VerificationsDialog.tsx +++ b/src/components/verification/VerificationsDialog.tsx @@ -41,7 +41,6 @@ export function VerificationsDialog({ profile={profile} verificationState={verificationState} /> - ) } -- 2.51.2 From 0278c7a0b4827dc6f49a622233737b61c28bb27f Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 21 Apr 2025 12:07:55 -0500 Subject: [PATCH 004/152] Make notifications clickable (#8251) --- src/state/queries/notifications/types.ts | 8 +++++--- src/view/com/notifications/NotificationFeedItem.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/state/queries/notifications/types.ts b/src/state/queries/notifications/types.ts index c96374eb8..b3a972394 100644 --- a/src/state/queries/notifications/types.ts +++ b/src/state/queries/notifications/types.ts @@ -1,7 +1,7 @@ import { - AppBskyFeedDefs, - AppBskyGraphDefs, - AppBskyNotificationListNotifications, + type AppBskyFeedDefs, + type AppBskyGraphDefs, + type AppBskyNotificationListNotifications, } from '@atproto/api' export type NotificationType = @@ -44,6 +44,8 @@ type OtherNotificationType = | 'quote' | 'follow' | 'feedgen-like' + | 'verified' + | 'unverified' | 'unknown' type FeedNotificationBase = { diff --git a/src/view/com/notifications/NotificationFeedItem.tsx b/src/view/com/notifications/NotificationFeedItem.tsx index 1de0b67b3..a30aba7d8 100644 --- a/src/view/com/notifications/NotificationFeedItem.tsx +++ b/src/view/com/notifications/NotificationFeedItem.tsx @@ -102,7 +102,11 @@ let NotificationFeedItem = ({ const urip = new AtUri(item.subjectUri) return `/profile/${urip.host}/post/${urip.rkey}` } - } else if (item.type === 'follow') { + } else if ( + item.type === 'follow' || + item.type === 'verified' || + item.type === 'unverified' + ) { return makeProfileLink(item.notification.author) } else if (item.type === 'reply') { const urip = new AtUri(item.notification.uri) @@ -390,7 +394,6 @@ let NotificationFeedItem = ({ ) - // @ts-ignore TODO } else if (item.type === 'verified') { a11yLabel = hasMultipleAuthors ? _( @@ -416,7 +419,6 @@ let NotificationFeedItem = ({ {firstAuthorLink} verified you ) icon = - // @ts-ignore TODO } else if (item.type === 'unverified') { a11yLabel = hasMultipleAuthors ? _( -- 2.51.2 From d5dc065a839f1498c6096e6e1ac6badb4059e775 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 21 Apr 2025 12:08:05 -0500 Subject: [PATCH 005/152] Make whole verifier clickable, no nested interactives (#8249) --- src/components/ProfileCard.tsx | 16 ++++++++++++-- .../verification/VerificationsDialog.tsx | 22 +++++++++++++------ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index c97911a3f..aa5830eb9 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -16,7 +16,7 @@ import {useProfileShadow} from '#/state/cache/profile-shadow' import {useProfileFollowMutationQueue} from '#/state/queries/profile' import {useSession} from '#/state/session' import * as Toast from '#/view/com/util/Toast' -import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' +import {PreviewableUserAvatar, UserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, useTheme} from '#/alf' import { Button, @@ -130,17 +130,29 @@ export function Link({ export function Avatar({ profile, moderationOpts, + onPress, + disabledPreview, }: { profile: bsky.profile.AnyProfileView moderationOpts: ModerationOpts + onPress?: () => void + disabledPreview?: boolean }) { const moderation = moderateProfile(profile, moderationOpts) - return ( + return disabledPreview ? ( + + ) : ( ) } diff --git a/src/components/verification/VerificationsDialog.tsx b/src/components/verification/VerificationsDialog.tsx index 42e7369ee..554149d9e 100644 --- a/src/components/verification/VerificationsDialog.tsx +++ b/src/components/verification/VerificationsDialog.tsx @@ -211,14 +211,22 @@ function VerifierCard({ ) : profile && moderationOpts ? ( <> - - + style={[a.flex_row, a.align_center, a.gap_sm, a.flex_1]} + onPress={() => { + outerDialogControl.close() + }}> + + + {canAdminister && ( ) } - -const styles = StyleSheet.create({ - selectedProfilesContainer: { - marginTop: 10, - paddingHorizontal: 12, - height: 80, - }, - selectedProfilesContainerMobile: { - height: 100, - }, - profileItem: { - alignItems: 'center', - marginRight: 15, - width: 78, - }, - profileItemMobile: { - width: 70, - }, - profileName: { - width: 78, - marginTop: 6, - }, - profileRemoveBtn: { - position: 'absolute', - top: 0, - right: 5, - backgroundColor: 'white', - borderRadius: 10, - width: 18, - height: 18, - alignItems: 'center', - justifyContent: 'center', - }, -}) -- 2.51.2 From 6e80b340c825900524bfe981ba29cfd0c6cf5934 Mon Sep 17 00:00:00 2001 From: pfrazee <1270099+pfrazee@users.noreply.github.com> Date: Tue, 22 Apr 2025 02:37:34 +0000 Subject: [PATCH 015/152] Nightly source-language update --- src/locale/locales/en/messages.po | 216 +++++++++++++++--------------- 1 file changed, 106 insertions(+), 110 deletions(-) diff --git a/src/locale/locales/en/messages.po b/src/locale/locales/en/messages.po index c97c39b92..17ce91b1b 100644 --- a/src/locale/locales/en/messages.po +++ b/src/locale/locales/en/messages.po @@ -201,123 +201,123 @@ msgstr "" msgid "{estimatedTimeMins, plural, one {minute} other {minutes}}" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:324 +#: src/view/com/notifications/NotificationFeedItem.tsx:328 msgid "{firstAuthorLink} and <0>{additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} followed you" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:350 +#: src/view/com/notifications/NotificationFeedItem.tsx:354 msgid "{firstAuthorLink} and <0>{additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} liked your custom feed" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:243 +#: src/view/com/notifications/NotificationFeedItem.tsx:247 msgid "{firstAuthorLink} and <0>{additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} liked your post" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:430 +#: src/view/com/notifications/NotificationFeedItem.tsx:432 msgid "{firstAuthorLink} and <0>{additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} removed their verifications from your account" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:267 +#: src/view/com/notifications/NotificationFeedItem.tsx:271 msgid "{firstAuthorLink} and <0>{additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} reposted your post" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:374 +#: src/view/com/notifications/NotificationFeedItem.tsx:378 msgid "{firstAuthorLink} and <0>{additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} signed up with your starter pack" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:404 +#: src/view/com/notifications/NotificationFeedItem.tsx:407 msgid "{firstAuthorLink} and <0>{additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} verified you" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:336 +#: src/view/com/notifications/NotificationFeedItem.tsx:340 msgid "{firstAuthorLink} followed you" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:313 +#: src/view/com/notifications/NotificationFeedItem.tsx:317 msgid "{firstAuthorLink} followed you back" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:362 +#: src/view/com/notifications/NotificationFeedItem.tsx:366 msgid "{firstAuthorLink} liked your custom feed" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:255 +#: src/view/com/notifications/NotificationFeedItem.tsx:259 msgid "{firstAuthorLink} liked your post" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:442 +#: src/view/com/notifications/NotificationFeedItem.tsx:444 msgid "{firstAuthorLink} removed their verification from your account" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:279 +#: src/view/com/notifications/NotificationFeedItem.tsx:283 msgid "{firstAuthorLink} reposted your post" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:386 +#: src/view/com/notifications/NotificationFeedItem.tsx:390 msgid "{firstAuthorLink} signed up with your starter pack" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:416 +#: src/view/com/notifications/NotificationFeedItem.tsx:419 msgid "{firstAuthorLink} verified you" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:317 +#: src/view/com/notifications/NotificationFeedItem.tsx:321 msgid "{firstAuthorName} and {additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} followed you" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:343 +#: src/view/com/notifications/NotificationFeedItem.tsx:347 msgid "{firstAuthorName} and {additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} liked your custom feed" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:236 +#: src/view/com/notifications/NotificationFeedItem.tsx:240 msgid "{firstAuthorName} and {additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} liked your post" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:423 +#: src/view/com/notifications/NotificationFeedItem.tsx:425 msgid "{firstAuthorName} and {additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} removed their verifications from your account" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:260 +#: src/view/com/notifications/NotificationFeedItem.tsx:264 msgid "{firstAuthorName} and {additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} reposted your post" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:367 +#: src/view/com/notifications/NotificationFeedItem.tsx:371 msgid "{firstAuthorName} and {additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} signed up with your starter pack" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:397 +#: src/view/com/notifications/NotificationFeedItem.tsx:400 msgid "{firstAuthorName} and {additionalAuthorsCount, plural, one {{formattedAuthorsCount} other} other {{formattedAuthorsCount} others}} verified you" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:322 +#: src/view/com/notifications/NotificationFeedItem.tsx:326 msgid "{firstAuthorName} followed you" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:312 +#: src/view/com/notifications/NotificationFeedItem.tsx:316 msgid "{firstAuthorName} followed you back" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:348 +#: src/view/com/notifications/NotificationFeedItem.tsx:352 msgid "{firstAuthorName} liked your custom feed" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:241 +#: src/view/com/notifications/NotificationFeedItem.tsx:245 msgid "{firstAuthorName} liked your post" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:428 +#: src/view/com/notifications/NotificationFeedItem.tsx:430 msgid "{firstAuthorName} removed their verification from your account" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:265 +#: src/view/com/notifications/NotificationFeedItem.tsx:269 msgid "{firstAuthorName} reposted your post" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:372 +#: src/view/com/notifications/NotificationFeedItem.tsx:376 msgid "{firstAuthorName} signed up with your starter pack" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:402 +#: src/view/com/notifications/NotificationFeedItem.tsx:405 msgid "{firstAuthorName} verified you" msgstr "" @@ -512,11 +512,11 @@ msgstr "" msgid "Account Muted by List" msgstr "" -#: src/screens/Settings/Settings.tsx:472 +#: src/screens/Settings/Settings.tsx:480 msgid "Account options" msgstr "" -#: src/screens/Settings/Settings.tsx:508 +#: src/screens/Settings/Settings.tsx:516 msgid "Account removed from quick access" msgstr "" @@ -537,8 +537,8 @@ msgctxt "toast" msgid "Account unmuted" msgstr "" -#: src/components/verification/VerifierDialog.tsx:98 -msgid "Accounts with a scalloped blue check mark<0>{NON_BREAKING_SPACE}<1/>{NON_BREAKING_SPACE}can verify others. These trusted verifiers are selected by Bluesky." +#: src/components/verification/VerifierDialog.tsx:96 +msgid "Accounts with a scalloped blue check mark <0><1/> can verify others. These trusted verifiers are selected by Bluesky." msgstr "" #: src/components/dialogs/lists/ListAddRemoveUsersDialog.tsx:169 @@ -584,8 +584,8 @@ msgstr "" msgid "Add alt text (optional)" msgstr "" -#: src/screens/Settings/Settings.tsx:415 -#: src/screens/Settings/Settings.tsx:418 +#: src/screens/Settings/Settings.tsx:423 +#: src/screens/Settings/Settings.tsx:426 #: src/view/shell/desktop/LeftNav.tsx:281 #: src/view/shell/desktop/LeftNav.tsx:285 msgid "Add another account" @@ -851,7 +851,7 @@ msgid "An error occurred while uploading the video." msgstr "" #: src/components/dialogs/nuxs/InitialVerificationAnnouncement.tsx:84 -#: src/components/verification/VerifierDialog.tsx:88 +#: src/components/verification/VerifierDialog.tsx:86 msgid "An illustration showing that Bluesky selects trusted verifiers, and trusted verifiers in turn verify individual user accounts." msgstr "" @@ -870,8 +870,8 @@ msgstr "" #: src/components/hooks/useFollowMethods.ts:35 #: src/components/hooks/useFollowMethods.ts:50 -#: src/components/ProfileCard.tsx:367 -#: src/components/ProfileCard.tsx:388 +#: src/components/ProfileCard.tsx:379 +#: src/components/ProfileCard.tsx:400 #: src/view/com/profile/FollowButton.tsx:38 #: src/view/com/profile/FollowButton.tsx:48 msgid "An issue occurred, please try again." @@ -1395,7 +1395,7 @@ msgstr "" #: src/view/com/modals/ChangePassword.tsx:282 #: src/view/com/modals/CreateOrEditList.tsx:335 #: src/view/com/modals/CropImage.web.tsx:97 -#: src/view/com/modals/EditProfile.tsx:270 +#: src/view/com/modals/EditProfile.tsx:269 #: src/view/com/modals/InAppBrowserConsent.tsx:75 #: src/view/com/modals/InAppBrowserConsent.tsx:77 #: src/view/com/modals/LinkWarning.tsx:105 @@ -1423,7 +1423,7 @@ msgstr "" msgid "Cancel image crop" msgstr "" -#: src/view/com/modals/EditProfile.tsx:265 +#: src/view/com/modals/EditProfile.tsx:264 msgid "Cancel profile editing" msgstr "" @@ -1626,11 +1626,11 @@ msgstr "" msgid "Choose your username" msgstr "" -#: src/screens/Settings/Settings.tsx:393 +#: src/screens/Settings/Settings.tsx:401 msgid "Clear all storage data" msgstr "" -#: src/screens/Settings/Settings.tsx:395 +#: src/screens/Settings/Settings.tsx:403 msgid "Clear all storage data (restart after this)" msgstr "" @@ -1684,8 +1684,8 @@ msgstr "" #: src/components/ProgressGuide/FollowDialog.tsx:386 #: src/components/StarterPack/Wizard/WizardEditListDialog.tsx:117 #: src/components/StarterPack/Wizard/WizardEditListDialog.tsx:123 -#: src/components/verification/VerificationsDialog.tsx:146 -#: src/components/verification/VerifierDialog.tsx:144 +#: src/components/verification/VerificationsDialog.tsx:144 +#: src/components/verification/VerifierDialog.tsx:140 #: src/view/com/modals/ChangePassword.tsx:279 #: src/view/com/modals/ChangePassword.tsx:282 #: src/view/com/util/post-embeds/GifEmbed.tsx:197 @@ -1706,8 +1706,8 @@ msgid "Close bottom drawer" msgstr "" #: src/components/dialogs/GifSelect.tsx:275 -#: src/components/verification/VerificationsDialog.tsx:138 -#: src/components/verification/VerifierDialog.tsx:136 +#: src/components/verification/VerificationsDialog.tsx:136 +#: src/components/verification/VerifierDialog.tsx:132 msgid "Close dialog" msgstr "" @@ -1759,11 +1759,11 @@ msgstr "" msgid "Closes viewer for header image" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:479 +#: src/view/com/notifications/NotificationFeedItem.tsx:481 msgid "Collapse list of users" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:687 +#: src/view/com/notifications/NotificationFeedItem.tsx:689 msgid "Collapses list of users for a given notification" msgstr "" @@ -2210,7 +2210,7 @@ msgstr "" msgid "Deactivate account" msgstr "" -#: src/screens/Settings/Settings.tsx:374 +#: src/screens/Settings/Settings.tsx:382 msgid "Debug Moderation" msgstr "" @@ -2259,7 +2259,7 @@ msgstr "" msgid "Delete chat" msgstr "" -#: src/screens/Settings/Settings.tsx:381 +#: src/screens/Settings/Settings.tsx:389 msgid "Delete chat declaration record" msgstr "" @@ -2333,8 +2333,8 @@ msgstr "" #: src/screens/Profile/Header/EditProfileDialog.tsx:370 #: src/view/com/modals/CreateOrEditList.tsx:280 #: src/view/com/modals/CreateOrEditList.tsx:301 -#: src/view/com/modals/EditProfile.tsx:219 -#: src/view/com/modals/EditProfile.tsx:231 +#: src/view/com/modals/EditProfile.tsx:218 +#: src/view/com/modals/EditProfile.tsx:230 msgid "Description" msgstr "" @@ -2582,7 +2582,7 @@ msgstr "" msgid "e.g. alice.com" msgstr "" -#: src/view/com/modals/EditProfile.tsx:224 +#: src/view/com/modals/EditProfile.tsx:223 msgid "e.g. Artist, dog-lover, and avid reader." msgstr "" @@ -2702,7 +2702,7 @@ msgstr "" msgid "Edit your display name" msgstr "" -#: src/view/com/modals/EditProfile.tsx:232 +#: src/view/com/modals/EditProfile.tsx:231 msgid "Edit your profile description" msgstr "" @@ -2992,11 +2992,11 @@ msgstr "" msgid "Expand alt text" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:480 +#: src/view/com/notifications/NotificationFeedItem.tsx:482 msgid "Expand list of users" msgstr "" -#: src/view/com/composer/ComposerReplyTo.tsx:83 +#: src/view/com/composer/ComposerReplyTo.tsx:84 msgid "Expand or collapse the full post you are replying to" msgstr "" @@ -3340,7 +3340,7 @@ msgid "Flexible" msgstr "" #. User is not following this account, click to follow -#: src/components/ProfileCard.tsx:400 +#: src/components/ProfileCard.tsx:412 #: src/components/ProfileHoverCard/index.web.tsx:456 #: src/components/ProfileHoverCard/index.web.tsx:467 #: src/screens/Profile/Header/ProfileHeaderStandard.tsx:236 @@ -3422,7 +3422,7 @@ msgid "Followers you know" msgstr "" #. User is following this account, click to unfollow -#: src/components/ProfileCard.tsx:394 +#: src/components/ProfileCard.tsx:406 #: src/components/ProfileHoverCard/index.web.tsx:455 #: src/components/ProfileHoverCard/index.web.tsx:466 #: src/screens/Profile/Header/ProfileHeaderStandard.tsx:232 @@ -3433,7 +3433,7 @@ msgstr "" msgid "Following" msgstr "" -#: src/components/ProfileCard.tsx:357 +#: src/components/ProfileCard.tsx:369 #: src/screens/Profile/Header/ProfileHeaderStandard.tsx:101 msgid "Following {0}" msgstr "" @@ -3600,7 +3600,7 @@ msgstr "" msgid "Go Home" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:193 +#: src/view/com/notifications/NotificationFeedItem.tsx:197 msgid "Go to {firstAuthorName}'s profile" msgstr "" @@ -3715,7 +3715,7 @@ msgstr "" msgid "Hide" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:694 +#: src/view/com/notifications/NotificationFeedItem.tsx:696 msgctxt "action" msgid "Hide" msgstr "" @@ -3766,7 +3766,7 @@ msgstr "" msgid "Hide trending videos?" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:685 +#: src/view/com/notifications/NotificationFeedItem.tsx:687 msgid "Hide user list" msgstr "" @@ -4119,12 +4119,12 @@ msgstr "" msgid "learn more" msgstr "" -#: src/components/verification/VerificationsDialog.tsx:163 -#: src/components/verification/VerifierDialog.tsx:132 +#: src/components/verification/VerificationsDialog.tsx:161 +#: src/components/verification/VerifierDialog.tsx:128 #: src/screens/Moderation/VerificationSettings.tsx:47 #: src/screens/Profile/Header/EditProfileDialog.tsx:360 #: src/screens/Settings/components/ChangeHandleDialog.tsx:212 -#: src/view/com/modals/EditProfile.tsx:208 +#: src/view/com/modals/EditProfile.tsx:207 msgid "Learn more" msgstr "" @@ -4153,8 +4153,8 @@ msgstr "" msgid "Learn more about this warning" msgstr "" -#: src/components/verification/VerificationsDialog.tsx:152 -#: src/components/verification/VerifierDialog.tsx:121 +#: src/components/verification/VerificationsDialog.tsx:150 +#: src/components/verification/VerifierDialog.tsx:117 msgid "Learn more about verification on Bluesky" msgstr "" @@ -4372,7 +4372,7 @@ msgstr "" msgid "Load new posts" msgstr "" -#: src/view/com/composer/text-input/mobile/Autocomplete.tsx:94 +#: src/view/com/composer/text-input/mobile/Autocomplete.tsx:61 msgid "Loading..." msgstr "" @@ -4919,7 +4919,7 @@ msgstr "" msgid "No likes yet" msgstr "" -#: src/components/ProfileCard.tsx:379 +#: src/components/ProfileCard.tsx:391 #: src/screens/Profile/Header/ProfileHeaderStandard.tsx:122 msgid "No longer following {0}" msgstr "" @@ -4957,8 +4957,8 @@ msgstr "" msgid "No reposts yet" msgstr "" -#: src/view/com/composer/text-input/mobile/Autocomplete.tsx:94 -#: src/view/com/composer/text-input/web/Autocomplete.tsx:195 +#: src/view/com/composer/text-input/mobile/Autocomplete.tsx:61 +#: src/view/com/composer/text-input/web/Autocomplete.tsx:172 msgid "No result" msgstr "" @@ -5135,7 +5135,7 @@ msgstr "" msgid "on<0><1/><2><3/>" msgstr "" -#: src/screens/Settings/Settings.tsx:346 +#: src/screens/Settings/Settings.tsx:354 msgid "Onboarding reset" msgstr "" @@ -5232,7 +5232,7 @@ msgstr "" msgid "Open message options" msgstr "" -#: src/screens/Settings/Settings.tsx:372 +#: src/screens/Settings/Settings.tsx:380 msgid "Open moderation debug page" msgstr "" @@ -5252,12 +5252,12 @@ msgstr "" msgid "Open starter pack menu" msgstr "" -#: src/screens/Settings/Settings.tsx:365 -#: src/screens/Settings/Settings.tsx:379 +#: src/screens/Settings/Settings.tsx:373 +#: src/screens/Settings/Settings.tsx:387 msgid "Open storybook page" msgstr "" -#: src/screens/Settings/Settings.tsx:358 +#: src/screens/Settings/Settings.tsx:366 msgid "Open system log" msgstr "" @@ -5335,7 +5335,7 @@ msgstr "" msgid "Opens the linked website" msgstr "" -#: src/view/com/notifications/NotificationFeedItem.tsx:788 +#: src/view/com/notifications/NotificationFeedItem.tsx:790 #: src/view/com/util/UserAvatar.tsx:465 msgid "Opens this profile" msgstr "" @@ -5843,7 +5843,7 @@ msgid "Profile" msgstr "" #: src/screens/Profile/Header/EditProfileDialog.tsx:198 -#: src/view/com/modals/EditProfile.tsx:127 +#: src/view/com/modals/EditProfile.tsx:128 msgctxt "toast" msgid "Profile updated" msgstr "" @@ -6017,7 +6017,7 @@ msgstr "" #: src/components/FeedCard.tsx:343 #: src/components/StarterPack/Wizard/WizardListCard.tsx:102 #: src/components/StarterPack/Wizard/WizardListCard.tsx:109 -#: src/screens/Settings/Settings.tsx:510 +#: src/screens/Settings/Settings.tsx:518 #: src/view/com/feeds/FeedSourceCard.tsx:322 #: src/view/com/modals/UserAddRemoveLists.tsx:235 #: src/view/com/posts/PostFeedErrorMessage.tsx:213 @@ -6028,12 +6028,12 @@ msgstr "" msgid "Remove {displayName} from starter pack" msgstr "" -#: src/screens/Search/components/SearchHistory.tsx:97 +#: src/screens/Search/components/SearchHistory.tsx:94 msgid "Remove {historyItem}" msgstr "" -#: src/screens/Settings/Settings.tsx:489 -#: src/screens/Settings/Settings.tsx:492 +#: src/screens/Settings/Settings.tsx:497 +#: src/screens/Settings/Settings.tsx:500 msgid "Remove account" msgstr "" @@ -6074,7 +6074,7 @@ msgstr "" msgid "Remove from my feeds" msgstr "" -#: src/screens/Settings/Settings.tsx:502 +#: src/screens/Settings/Settings.tsx:510 msgid "Remove from quick access?" msgstr "" @@ -6096,7 +6096,7 @@ msgstr "" msgid "Remove mute word from your list" msgstr "" -#: src/screens/Search/components/SearchHistory.tsx:178 +#: src/screens/Search/components/SearchHistory.tsx:167 msgid "Remove profile" msgstr "" @@ -6122,7 +6122,7 @@ msgid "Remove user from list" msgstr "" #: src/components/verification/VerificationRemovePrompt.tsx:46 -#: src/components/verification/VerificationsDialog.tsx:227 +#: src/components/verification/VerificationsDialog.tsx:243 #: src/view/com/profile/ProfileMenu.tsx:298 #: src/view/com/profile/ProfileMenu.tsx:301 msgid "Remove verification" @@ -6163,10 +6163,6 @@ msgstr "" msgid "Removed verification" msgstr "" -#: src/screens/Search/components/SearchHistory.tsx:179 -msgid "Removes profile from search history" -msgstr "" - #: src/view/com/util/post-embeds/QuoteEmbed.tsx:291 msgid "Removes quoted post" msgstr "" @@ -6431,8 +6427,8 @@ msgstr "" msgid "Reset Code" msgstr "" -#: src/screens/Settings/Settings.tsx:386 -#: src/screens/Settings/Settings.tsx:388 +#: src/screens/Settings/Settings.tsx:394 +#: src/screens/Settings/Settings.tsx:396 msgid "Reset onboarding state" msgstr "" @@ -6509,7 +6505,7 @@ msgstr "" #: src/view/com/composer/photos/ImageAltTextDialog.tsx:153 #: src/view/com/composer/photos/ImageAltTextDialog.tsx:163 #: src/view/com/modals/CreateOrEditList.tsx:317 -#: src/view/com/modals/EditProfile.tsx:245 +#: src/view/com/modals/EditProfile.tsx:244 #: src/view/screens/SavedFeeds.tsx:109 msgid "Save" msgstr "" @@ -6529,7 +6525,7 @@ msgstr "" msgid "Save changes" msgstr "" -#: src/view/com/modals/EditProfile.tsx:253 +#: src/view/com/modals/EditProfile.tsx:252 msgid "Save Changes" msgstr "" @@ -6568,7 +6564,7 @@ msgstr "" msgid "Saved to your feeds" msgstr "" -#: src/view/com/modals/EditProfile.tsx:246 +#: src/view/com/modals/EditProfile.tsx:245 msgid "Saves any changes to your profile" msgstr "" @@ -6578,8 +6574,8 @@ msgstr "" #: src/components/dms/ChatEmptyPill.tsx:33 #: src/components/NewskieDialog.tsx:105 -#: src/view/com/notifications/NotificationFeedItem.tsx:633 -#: src/view/com/notifications/NotificationFeedItem.tsx:658 +#: src/view/com/notifications/NotificationFeedItem.tsx:635 +#: src/view/com/notifications/NotificationFeedItem.tsx:660 msgid "Say hello!" msgstr "" @@ -7206,7 +7202,7 @@ msgstr "" msgid "Software Dev" msgstr "" -#: src/components/verification/VerificationsDialog.tsx:122 +#: src/components/verification/VerificationsDialog.tsx:120 msgid "Some of your verifications are invalid." msgstr "" @@ -7358,12 +7354,12 @@ msgstr "" msgid "Step {0} of {1}" msgstr "" -#: src/screens/Settings/Settings.tsx:351 +#: src/screens/Settings/Settings.tsx:359 msgid "Storage cleared, you need to restart the app now." msgstr "" #: src/Navigation.tsx:275 -#: src/screens/Settings/Settings.tsx:367 +#: src/screens/Settings/Settings.tsx:375 msgid "Storybook" msgstr "" @@ -7447,7 +7443,7 @@ msgstr "" #: src/screens/Settings/Settings.tsx:110 #: src/screens/Settings/Settings.tsx:124 -#: src/screens/Settings/Settings.tsx:454 +#: src/screens/Settings/Settings.tsx:462 #: src/view/shell/desktop/LeftNav.tsx:243 msgid "Switch account" msgstr "" @@ -7474,7 +7470,7 @@ msgstr "" #: src/screens/Settings/AboutSettings.tsx:104 #: src/screens/Settings/AboutSettings.tsx:107 -#: src/screens/Settings/Settings.tsx:360 +#: src/screens/Settings/Settings.tsx:368 msgid "System log" msgstr "" @@ -7803,12 +7799,12 @@ msgstr "" msgid "This {screenDescription} has been flagged:" msgstr "" -#: src/components/verification/VerificationsDialog.tsx:89 +#: src/components/verification/VerificationsDialog.tsx:87 msgid "This account has a checkmark because it's been verified by trusted sources." msgstr "" -#: src/components/verification/VerificationsDialog.tsx:94 -msgid "This account has one or more verifications, but it is not currently verified." +#: src/components/verification/VerificationsDialog.tsx:92 +msgid "This account has one or more attempted verifications, but it is not currently verified." msgstr "" #: src/components/moderation/ScreenHider.tsx:106 @@ -8008,7 +8004,7 @@ msgstr "" msgid "This will delete \"{0}\" from your muted words. You can always add it back later." msgstr "" -#: src/screens/Settings/Settings.tsx:504 +#: src/screens/Settings/Settings.tsx:512 msgid "This will remove @{0} from the quick access list." msgstr "" @@ -8220,7 +8216,7 @@ msgstr "" msgid "Unfortunately, none of your subscribed labelers supports this report type." msgstr "" -#: src/components/verification/VerificationsDialog.tsx:204 +#: src/components/verification/VerificationsDialog.tsx:202 msgid "Unknown verifier" msgstr "" @@ -8531,7 +8527,7 @@ msgstr "" msgid "Verifications on Bluesky work differently than on other platforms. <0>Learn more here." msgstr "" -#: src/components/verification/VerificationsDialog.tsx:105 +#: src/components/verification/VerificationsDialog.tsx:103 msgid "Verified by:" msgstr "" @@ -8652,7 +8648,7 @@ msgstr "" #: src/screens/Profile/components/ProfileFeedHeader.tsx:446 #: src/screens/Search/components/SearchProfileCard.tsx:36 #: src/screens/VideoFeed/index.tsx:769 -#: src/view/com/notifications/NotificationFeedItem.tsx:487 +#: src/view/com/notifications/NotificationFeedItem.tsx:489 msgid "View {0}'s profile" msgstr "" @@ -9055,7 +9051,7 @@ msgid "You are verified" msgstr "" #: src/screens/Profile/Header/EditProfileDialog.tsx:356 -#: src/view/com/modals/EditProfile.tsx:204 +#: src/view/com/modals/EditProfile.tsx:203 msgid "You are verified. You will lose your verification status if you change your display name. <0>Learn more." msgstr "" -- 2.51.2 From a770f5635b549f2a87ffeaedd031dfe8e37b58c8 Mon Sep 17 00:00:00 2001 From: Mathieu Acthernoene Date: Tue, 22 Apr 2025 18:16:50 +0200 Subject: [PATCH 016/152] Edge to edge support (#7497) --- app.config.js | 10 ++-- package.json | 5 +- plugins/withAndroidDayNightThemePlugin.js | 27 +++++++++ ...dSplashScreenStatusBarTranslucentPlugin.js | 28 ---------- plugins/withAndroidStylesAccentColorPlugin.js | 2 +- src/App.native.tsx | 7 +-- src/App.web.tsx | 7 +-- src/alf/util/navigationBar.ts | 21 ------- src/alf/util/systemUI.ts | 14 +++++ src/components/ContextMenu/index.tsx | 2 +- src/components/Dialog/sheet-wrapper.ts | 23 +++++--- src/lib/hooks/useEnableKeyboardController.tsx | 5 +- src/screens/Login/index.tsx | 2 +- .../Messages/components/MessageInput.tsx | 5 +- src/screens/SignupQueued.tsx | 4 +- src/screens/Takendown.tsx | 4 +- src/screens/VideoFeed/index.tsx | 8 ++- src/state/shell/light-status-bar.tsx | 49 ++++------------ src/view/com/composer/Composer.tsx | 3 +- src/view/com/lightbox/ImageViewing/index.tsx | 56 +++++++------------ src/view/com/modals/CreateOrEditList.tsx | 4 +- src/view/shell/index.tsx | 25 ++++----- yarn.lock | 26 +++------ 23 files changed, 137 insertions(+), 200 deletions(-) create mode 100644 plugins/withAndroidDayNightThemePlugin.js delete mode 100644 plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js delete mode 100644 src/alf/util/navigationBar.ts create mode 100644 src/alf/util/systemUI.ts diff --git a/app.config.js b/app.config.js index 7b4937d3b..e197e6770 100644 --- a/app.config.js +++ b/app.config.js @@ -1,7 +1,5 @@ const pkg = require('./package.json') -const DARK_SPLASH_ANDROID_BACKGROUND = '#0f141b' - module.exports = function (config) { /** * App version number. Should be incremented as part of a release cycle. @@ -140,12 +138,10 @@ module.exports = function (config) { }, androidStatusBar: { barStyle: 'light-content', - backgroundColor: '#00000000', }, // Dark nav bar in light mode is better than light nav bar in dark mode androidNavigationBar: { barStyle: 'light-content', - backgroundColor: DARK_SPLASH_ANDROID_BACKGROUND, }, android: { icon: './assets/app-icons/android_icon_default_light.png', @@ -197,6 +193,10 @@ module.exports = function (config) { plugins: [ 'expo-video', 'expo-localization', + [ + 'react-native-edge-to-edge', + {android: {enforceNavigationBarContrast: false}}, + ], USE_SENTRY && [ '@sentry/react-native/expo', { @@ -240,7 +240,7 @@ module.exports = function (config) { './plugins/withAndroidManifestPlugin.js', './plugins/withAndroidManifestFCMIconPlugin.js', './plugins/withAndroidStylesAccentColorPlugin.js', - './plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js', + './plugins/withAndroidDayNightThemePlugin.js', './plugins/withAndroidNoJitpackPlugin.js', './plugins/withNoBundleCompression.js', './plugins/shareExtension/withShareExtensions.js', diff --git a/package.json b/package.json index 235b1a91b..8448fbd1e 100644 --- a/package.json +++ b/package.json @@ -141,12 +141,10 @@ "expo-linking": "~7.0.5", "expo-localization": "~16.0.1", "expo-media-library": "~17.0.6", - "expo-navigation-bar": "~4.0.9", "expo-notifications": "~0.29.14", "expo-screen-orientation": "~8.0.4", "expo-sharing": "~13.0.1", "expo-splash-screen": "~0.29.22", - "expo-status-bar": "~2.0.1", "expo-system-ui": "~4.0.9", "expo-task-manager": "~12.0.6", "expo-updates": "~0.27.4", @@ -178,12 +176,13 @@ "react-native-compressor": "1.10.3", "react-native-date-picker": "^5.0.7", "react-native-drawer-layout": "^4.1.1", + "react-native-edge-to-edge": "^1.6.0", "react-native-emoji-popup": "^0.1.2", "react-native-gesture-handler": "2.20.2", "react-native-get-random-values": "~1.11.0", "react-native-image-crop-picker": "^0.41.6", "react-native-ios-context-menu": "^1.15.3", - "react-native-keyboard-controller": "^1.14.5", + "react-native-keyboard-controller": "^1.17.1", "react-native-mmkv": "^2.12.2", "react-native-pager-view": "6.5.1", "react-native-picker-select": "^9.3.1", diff --git a/plugins/withAndroidDayNightThemePlugin.js b/plugins/withAndroidDayNightThemePlugin.js new file mode 100644 index 000000000..d9bc1b211 --- /dev/null +++ b/plugins/withAndroidDayNightThemePlugin.js @@ -0,0 +1,27 @@ +// Based on https://github.com/expo/expo/pull/33957 +// Could be removed once the app has been updated to Expo 53 +const {withAndroidStyles} = require('@expo/config-plugins') + +module.exports = function withAndroidDayNightThemePlugin(appConfig) { + const cleanupList = new Set([ + 'colorPrimary', + 'android:editTextBackground', + 'android:textColor', + 'android:editTextStyle', + ]) + + return withAndroidStyles(appConfig, config => { + config.modResults.resources.style = config.modResults.resources.style + ?.map(style => { + if (style.$.name === 'AppTheme' && style.item != null) { + style.item = style.item.filter(item => !cleanupList.has(item.$.name)) + } + return style + }) + .filter(style => { + return style.$.name !== 'ResetEditText' + }) + + return config + }) +} diff --git a/plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js b/plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js deleted file mode 100644 index 704ead054..000000000 --- a/plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js +++ /dev/null @@ -1,28 +0,0 @@ -const {withStringsXml, AndroidConfig} = require('@expo/config-plugins') - -module.exports = function withAndroidSplashScreenStatusBarTranslucentPlugin( - appConfig, -) { - return withStringsXml(appConfig, function (decoratedAppConfig) { - try { - decoratedAppConfig.modResults = AndroidConfig.Strings.setStringItem( - [ - { - _: 'true', - $: { - name: 'expo_splash_screen_status_bar_translucent', - translatable: 'false', - }, - }, - ], - decoratedAppConfig.modResults, - ) - } catch (e) { - console.error( - `withAndroidSplashScreenStatusBarTranslucentPlugin failed`, - e, - ) - } - return decoratedAppConfig - }) -} diff --git a/plugins/withAndroidStylesAccentColorPlugin.js b/plugins/withAndroidStylesAccentColorPlugin.js index c45553788..51dd44f35 100644 --- a/plugins/withAndroidStylesAccentColorPlugin.js +++ b/plugins/withAndroidStylesAccentColorPlugin.js @@ -12,7 +12,7 @@ module.exports = function withAndroidStylesAccentColorPlugin(appConfig) { decoratedAppConfig.modResults, { add: true, - parent: AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(), + parent: AndroidConfig.Styles.getAppThemeGroup(), name: 'colorAccent', value: '@color/colorPrimary', }, diff --git a/src/App.native.tsx b/src/App.native.tsx index ac985e560..5023c48bb 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -46,14 +46,13 @@ import {Provider as ModerationOptsProvider} from '#/state/preferences/moderation import {Provider as UnreadNotifsProvider} from '#/state/queries/notifications/unread' import { Provider as SessionProvider, - SessionAccount, + type SessionAccount, useSession, useSessionApi, } from '#/state/session' import {readLastActiveAccount} from '#/state/session/util' import {Provider as ShellStateProvider} from '#/state/shell' import {Provider as ComposerProvider} from '#/state/shell/composer' -import {Provider as LightStatusBarProvider} from '#/state/shell/light-status-bar' import {Provider as LoggedOutViewProvider} from '#/state/shell/logged-out' import {Provider as ProgressGuideProvider} from '#/state/shell/progress-guide' import {Provider as SelectedFeedProvider} from '#/state/shell/selected-feed' @@ -219,9 +218,7 @@ function App() { - - - + diff --git a/src/App.web.tsx b/src/App.web.tsx index af39bee47..bbe23e5a5 100644 --- a/src/App.web.tsx +++ b/src/App.web.tsx @@ -35,14 +35,13 @@ import {Provider as ModerationOptsProvider} from '#/state/preferences/moderation import {Provider as UnreadNotifsProvider} from '#/state/queries/notifications/unread' import { Provider as SessionProvider, - SessionAccount, + type SessionAccount, useSession, useSessionApi, } from '#/state/session' import {readLastActiveAccount} from '#/state/session/util' import {Provider as ShellStateProvider} from '#/state/shell' import {Provider as ComposerProvider} from '#/state/shell/composer' -import {Provider as LightStatusBarProvider} from '#/state/shell/light-status-bar' import {Provider as LoggedOutViewProvider} from '#/state/shell/logged-out' import {Provider as ProgressGuideProvider} from '#/state/shell/progress-guide' import {Provider as SelectedFeedProvider} from '#/state/shell/selected-feed' @@ -193,9 +192,7 @@ function App() { - - - + diff --git a/src/alf/util/navigationBar.ts b/src/alf/util/navigationBar.ts deleted file mode 100644 index cb315f70a..000000000 --- a/src/alf/util/navigationBar.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as NavigationBar from 'expo-navigation-bar' -import * as SystemUI from 'expo-system-ui' - -import {isAndroid} from '#/platform/detection' -import {Theme} from '../types' - -export function setNavigationBar(themeType: 'theme' | 'lightbox', t: Theme) { - if (isAndroid) { - if (themeType === 'theme') { - NavigationBar.setBackgroundColorAsync(t.atoms.bg.backgroundColor) - NavigationBar.setBorderColorAsync(t.atoms.bg.backgroundColor) - NavigationBar.setButtonStyleAsync(t.name !== 'light' ? 'light' : 'dark') - SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor) - } else { - NavigationBar.setBackgroundColorAsync('black') - NavigationBar.setBorderColorAsync('black') - NavigationBar.setButtonStyleAsync('light') - SystemUI.setBackgroundColorAsync('black') - } - } -} diff --git a/src/alf/util/systemUI.ts b/src/alf/util/systemUI.ts new file mode 100644 index 000000000..c973e10ea --- /dev/null +++ b/src/alf/util/systemUI.ts @@ -0,0 +1,14 @@ +import * as SystemUI from 'expo-system-ui' + +import {isAndroid} from '#/platform/detection' +import {Theme} from '../types' + +export function setSystemUITheme(themeType: 'theme' | 'lightbox', t: Theme) { + if (isAndroid) { + if (themeType === 'theme') { + SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor) + } else { + SystemUI.setBackgroundColorAsync('black') + } + } +} diff --git a/src/components/ContextMenu/index.tsx b/src/components/ContextMenu/index.tsx index aebed6419..4a0814dfe 100644 --- a/src/components/ContextMenu/index.tsx +++ b/src/components/ContextMenu/index.tsx @@ -556,7 +556,7 @@ export function Outer({ // pure vibes based const TOP_INSET = insets.top + 80 const BOTTOM_INSET_IOS = insets.bottom + 20 - const BOTTOM_INSET_ANDROID = 12 // TODO: revisit when edge-to-edge mode is enabled -sfn + const BOTTOM_INSET_ANDROID = insets.bottom + 12 const {height} = evt.nativeEvent.layout const topPosition = diff --git a/src/components/Dialog/sheet-wrapper.ts b/src/components/Dialog/sheet-wrapper.ts index 37c663383..b655dde00 100644 --- a/src/components/Dialog/sheet-wrapper.ts +++ b/src/components/Dialog/sheet-wrapper.ts @@ -1,20 +1,25 @@ import {useCallback} from 'react' +import {SystemBars} from 'react-native-edge-to-edge' -import {useDialogStateControlContext} from '#/state/dialogs' +import {isIOS} from '#/platform/detection' /** * If we're calling a system API like the image picker that opens a sheet * wrap it in this function to make sure the status bar is the correct color. */ export function useSheetWrapper() { - const {setFullyExpandedCount} = useDialogStateControlContext() - return useCallback( - async (promise: Promise): Promise => { - setFullyExpandedCount(c => c + 1) + return useCallback(async (promise: Promise): Promise => { + if (isIOS) { + const entry = SystemBars.pushStackEntry({ + style: { + statusBar: 'light', + }, + }) const res = await promise - setFullyExpandedCount(c => c - 1) + SystemBars.popStackEntry(entry) return res - }, - [setFullyExpandedCount], - ) + } else { + return await promise + } + }, []) } diff --git a/src/lib/hooks/useEnableKeyboardController.tsx b/src/lib/hooks/useEnableKeyboardController.tsx index 366791c0c..858f6943a 100644 --- a/src/lib/hooks/useEnableKeyboardController.tsx +++ b/src/lib/hooks/useEnableKeyboardController.tsx @@ -26,10 +26,7 @@ export function KeyboardControllerProvider({ children: React.ReactNode }) { return ( - + {children} diff --git a/src/screens/Login/index.tsx b/src/screens/Login/index.tsx index 8ed8d2da8..e4e2f43f0 100644 --- a/src/screens/Login/index.tsx +++ b/src/screens/Login/index.tsx @@ -8,7 +8,7 @@ import {DEFAULT_SERVICE} from '#/lib/constants' import {logEvent} from '#/lib/statsig/statsig' import {logger} from '#/logger' import {useServiceQuery} from '#/state/queries/service' -import {SessionAccount, useSession} from '#/state/session' +import {type SessionAccount, useSession} from '#/state/session' import {useLoggedOutView} from '#/state/shell/logged-out' import {LoggedOutLayout} from '#/view/com/util/layouts/LoggedOutLayout' import {ForgotPasswordForm} from '#/screens/Login/ForgotPasswordForm' diff --git a/src/screens/Messages/components/MessageInput.tsx b/src/screens/Messages/components/MessageInput.tsx index ac0f7969f..69cba07f7 100644 --- a/src/screens/Messages/components/MessageInput.tsx +++ b/src/screens/Messages/components/MessageInput.tsx @@ -24,9 +24,9 @@ import { useMessageDraft, useSaveMessageDraft, } from '#/state/messages/message-drafts' -import {EmojiPickerPosition} from '#/view/com/composer/text-input/web/EmojiPicker.web' +import {type EmojiPickerPosition} from '#/view/com/composer/text-input/web/EmojiPicker.web' import * as Toast from '#/view/com/util/Toast' -import {atoms as a, useTheme} from '#/alf' +import {android, atoms as a, useTheme} from '#/alf' import {useSharedInputStyles} from '#/components/forms/TextField' import {PaperPlane_Stroke2_Corner0_Rounded as PaperPlane} from '#/components/icons/PaperPlane' import {useExtractEmbedFromFacets} from './MessageInputEmbed' @@ -174,6 +174,7 @@ export function MessageInput({ a.text_md, a.px_sm, t.atoms.text, + android({paddingTop: 0}), {paddingBottom: isIOS ? 5 : 0}, animatedStyle, ]} diff --git a/src/screens/SignupQueued.tsx b/src/screens/SignupQueued.tsx index 823ed0784..6a2c5bbc7 100644 --- a/src/screens/SignupQueued.tsx +++ b/src/screens/SignupQueued.tsx @@ -1,7 +1,7 @@ import React from 'react' import {Modal, ScrollView, View} from 'react-native' +import {SystemBars} from 'react-native-edge-to-edge' import {useSafeAreaInsets} from 'react-native-safe-area-context' -import {StatusBar} from 'expo-status-bar' import {msg, plural, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -106,7 +106,7 @@ export function SignupQueued() { animationType={native('slide')} presentationStyle="formSheet" style={[web(a.util_screen_outer)]}> - {isIOS && } + {isIOS && } - {isIOS && } + {isIOS && } { setMinShellMode(true) - setNavigationBar('lightbox', t) + setSystemUITheme('lightbox', t) return () => { setMinShellMode(false) - setNavigationBar('theme', t) + setSystemUITheme('theme', t) } }, [setMinShellMode, t]), ) @@ -140,6 +141,7 @@ export function VideoFeed({}: NativeStackScreenProps< return ( + (false) -const SetLightStatusBarRefCountContext = createContext -> | null>(null) - -export function useLightStatusBar() { - return useContext(LightStatusBarRefCountContext) -} +import {useEffect} from 'react' +import {SystemBars} from 'react-native-edge-to-edge' export function useSetLightStatusBar(enabled: boolean) { - const setRefCount = useContext(SetLightStatusBarRefCountContext) useEffect(() => { - // noop on web -sfn - if (isWeb) return - - if (!setRefCount) { - if (__DEV__) - console.error( - 'useLightStatusBar was used without a SetLightStatusBarRefCountContext provider', - ) - return - } if (enabled) { - setRefCount(prev => prev + 1) - return () => setRefCount(prev => prev - 1) + const entry = SystemBars.pushStackEntry({ + style: { + statusBar: 'light', + }, + }) + return () => { + SystemBars.popStackEntry(entry) + } } - }, [enabled, setRefCount]) -} - -export function Provider({children}: React.PropsWithChildren<{}>) { - const [refCount, setRefCount] = useState(0) - - return ( - - 0}> - {children} - - - ) + }, [enabled]) } diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 4384783dc..aa27adb3d 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -1464,8 +1464,7 @@ function useKeyboardVerticalOffset() { // Android etc if (!isIOS) { - // if Android <35 or web, bottom is 0 anyway. if >=35, this is needed to account - // for the edge-to-edge nav bar + // need to account for the edge-to-edge nav bar return bottom * -1 } diff --git a/src/view/com/lightbox/ImageViewing/index.tsx b/src/view/com/lightbox/ImageViewing/index.tsx index 7018d753a..41a54eba6 100644 --- a/src/view/com/lightbox/ImageViewing/index.tsx +++ b/src/view/com/lightbox/ImageViewing/index.tsx @@ -9,22 +9,17 @@ // https://github.com/jobtoday/react-native-image-viewing import React, {useCallback, useEffect, useMemo, useState} from 'react' -import { - LayoutAnimation, - PixelRatio, - Platform, - StyleSheet, - View, -} from 'react-native' +import {LayoutAnimation, PixelRatio, StyleSheet, View} from 'react-native' +import {SystemBars} from 'react-native-edge-to-edge' import {Gesture} from 'react-native-gesture-handler' import PagerView from 'react-native-pager-view' import Animated, { - AnimatedRef, + type AnimatedRef, cancelAnimation, interpolate, measure, runOnJS, - SharedValue, + type SharedValue, useAnimatedReaction, useAnimatedRef, useAnimatedStyle, @@ -32,30 +27,28 @@ import Animated, { useSharedValue, withDecay, withSpring, - WithSpringConfig, + type WithSpringConfig, } from 'react-native-reanimated' import { - Edge, SafeAreaView, useSafeAreaFrame, useSafeAreaInsets, } from 'react-native-safe-area-context' import * as ScreenOrientation from 'expo-screen-orientation' -import {StatusBar} from 'expo-status-bar' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {Trans} from '@lingui/macro' -import {Dimensions} from '#/lib/media/types' +import {type Dimensions} from '#/lib/media/types' import {colors, s} from '#/lib/styles' import {isIOS} from '#/platform/detection' -import {Lightbox} from '#/state/lightbox' +import {type Lightbox} from '#/state/lightbox' import {Button} from '#/view/com/util/forms/Button' import {Text} from '#/view/com/util/text/Text' import {ScrollView} from '#/view/com/util/Views' -import {ios, useTheme} from '#/alf' -import {setNavigationBar} from '#/alf/util/navigationBar' +import {useTheme} from '#/alf' +import {setSystemUITheme} from '#/alf/util/systemUI' import {PlatformInfo} from '../../../../../modules/expo-bluesky-swiss-army' -import {ImageSource, Transform} from './@types' +import {type ImageSource, type Transform} from './@types' import ImageDefaultHeader from './components/ImageDefaultHeader' import ImageItem from './components/ImageItem/ImageItem' @@ -63,10 +56,6 @@ type Rect = {x: number; y: number; width: number; height: number} const PORTRAIT_UP = ScreenOrientation.OrientationLock.PORTRAIT_UP const PIXEL_RATIO = PixelRatio.get() -const EDGES = - Platform.OS === 'android' && Platform.Version < 35 - ? (['top', 'bottom', 'left', 'right'] satisfies Edge[]) - : ([] satisfies Edge[]) // iOS or Android 15+ bleeds into safe area const SLOW_SPRING: WithSpringConfig = { mass: isIOS ? 1.25 : 0.75, @@ -167,9 +156,8 @@ export default function ImageViewRoot({ return ( // Keep it always mounted to avoid flicker on the first frame. - @@ -197,7 +185,7 @@ export default function ImageViewRoot({ /> )} - + ) } @@ -325,25 +313,23 @@ function ImageView({ }, ) - // style nav bar on android + // style system ui on android const t = useTheme() useEffect(() => { - setNavigationBar('lightbox', t) + setSystemUITheme('lightbox', t) return () => { - setNavigationBar('theme', t) + setSystemUITheme('theme', t) } }, [t]) return ( -