From dd7c950cc645b633f8631c7e7894273742d26a19 Mon Sep 17 00:00:00 2001 From: pfrazee <1270099+pfrazee@users.noreply.github.com> Date: Thu, 6 Aug 2026 03:09:55 +0000 Subject: [PATCH 01/42] Nightly source-language update --- src/locale/locales/en/messages.po | 260 +++++++++++++++++------------- 1 file changed, 149 insertions(+), 111 deletions(-) diff --git a/src/locale/locales/en/messages.po b/src/locale/locales/en/messages.po index f82413f9f..661fd1948 100644 --- a/src/locale/locales/en/messages.po +++ b/src/locale/locales/en/messages.po @@ -679,6 +679,12 @@ msgstr "" msgid "{hours, plural, one {# hour} other {# hours}}" msgstr "" +#. Badge indicating post count in a thread, e.g., the 3rd post of 5 total is '3/5' +#: src/screens/PostThread/components/ThreadItemPostNumber.tsx:78 +msgctxt "post-number-in-thread" +msgid "{index}/{count}" +msgstr "{index}/{count}" + #. Displayed when the number of requests is greater than 20 #: src/screens/Messages/components/RequestStatus.tsx:69 msgid "{JOIN_REQUESTS_THRESHOLD}+ new join requests" @@ -843,21 +849,21 @@ msgstr "" #. Quote count display, the <0> tags enclose the number of quotes in bold (will never be 0) #. placeholder {0}: formatPostStatCount(post.quoteCount) #. placeholder {1}: post.quoteCount -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:469 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:481 msgid "<0>{0} {1, plural, one {quote} other {quotes}}" msgstr "" #. Repost count display, the <0> tags enclose the number of reposts in bold (will never be 0) #. placeholder {0}: formatPostStatCount(post.repostCount) #. placeholder {1}: post.repostCount -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:448 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:460 msgid "<0>{0} {1, plural, one {repost} other {reposts}}" msgstr "" #. Save count display, the <0> tags enclose the number of saves in bold (will never be 0) #. placeholder {0}: formatPostStatCount(post.bookmarkCount) #. placeholder {1}: post.bookmarkCount -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:488 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:500 msgid "<0>{0} {1, plural, one {save} other {saves}}" msgstr "" @@ -1190,11 +1196,11 @@ msgstr "" msgid "Add another account" msgstr "" -#: src/view/com/composer/Composer.tsx:1606 +#: src/view/com/composer/Composer.tsx:1635 msgid "Add another post" msgstr "" -#: src/view/com/composer/Composer.tsx:2272 +#: src/view/com/composer/Composer.tsx:2301 msgid "Add another post to thread" msgstr "" @@ -1233,7 +1239,7 @@ msgid "Add image" msgstr "" #. Accessibility label for button in composer to add images, a video, or a GIF to a post -#: src/view/com/composer/SelectMediaButton.tsx:511 +#: src/view/com/composer/SelectMediaButton.tsx:531 msgid "Add media to post" msgstr "" @@ -1576,7 +1582,7 @@ msgstr "" msgid "An error occurred" msgstr "" -#: src/view/com/composer/state/video.ts:447 +#: src/view/com/composer/state/video.ts:486 msgid "An error occurred while compressing the video." msgstr "" @@ -1602,7 +1608,7 @@ msgstr "" msgid "An error occurred while loading the video. Please try again later." msgstr "" -#: src/components/Post/Embed/VideoEmbed/index.web.tsx:308 +#: src/components/Post/Embed/VideoEmbed/index.web.tsx:321 msgid "An error occurred while loading the video. Please try again." msgstr "" @@ -1622,11 +1628,11 @@ msgstr "" msgid "An error occurred while trying to follow all" msgstr "" -#: src/view/com/composer/state/video.ts:499 +#: src/view/com/composer/state/video.ts:538 msgid "An error occurred while uploading the video. {message}" msgstr "" -#: src/view/com/composer/state/video.ts:491 +#: src/view/com/composer/state/video.ts:530 msgid "An error occurred while uploading the video. Please check your internet connection and try again." msgstr "" @@ -1863,12 +1869,12 @@ msgid "Apply Pull Request" msgstr "" #. placeholder {0}: niceDate(i18n, createdAt, 'medium') -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:611 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:623 msgid "Archived from {0}" msgstr "" -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:582 -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:620 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:594 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:632 msgid "Archived post" msgstr "" @@ -1934,7 +1940,7 @@ msgstr "" msgid "Are you sure you want to rescind your request to join {0}?" msgstr "Are you sure you want to rescind your request to join {0}?" -#: src/view/com/composer/Composer.tsx:1742 +#: src/view/com/composer/Composer.tsx:1771 msgid "Are you sure you'd like to discard this post?" msgstr "" @@ -2282,7 +2288,7 @@ msgstr "bloomscrolling booksky" msgid "Bluesky" msgstr "" -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:636 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:648 msgid "Bluesky cannot confirm the authenticity of the claimed date." msgstr "" @@ -2540,8 +2546,8 @@ msgstr "Camera access needed" #: src/screens/Settings/Settings.tsx:310 #: src/screens/Takendown.tsx:102 #: src/screens/Takendown.tsx:105 -#: src/view/com/composer/Composer.tsx:1820 -#: src/view/com/composer/Composer.tsx:1830 +#: src/view/com/composer/Composer.tsx:1849 +#: src/view/com/composer/Composer.tsx:1859 #: src/view/com/composer/photos/EditImageDialog.web.tsx:44 #: src/view/com/composer/photos/EditImageDialog.web.tsx:53 #: src/view/shell/desktop/LeftNav.tsx:228 @@ -3093,7 +3099,7 @@ msgstr "" msgid "Closes password update alert" msgstr "" -#: src/view/com/composer/Composer.tsx:1828 +#: src/view/com/composer/Composer.tsx:1857 msgid "Closes post composer and discards post draft" msgstr "" @@ -3147,7 +3153,7 @@ msgid "Compose new post" msgstr "" #. placeholder {0}: MAX_GRAPHEME_LENGTH || 0 -#: src/view/com/composer/Composer.tsx:1704 +#: src/view/com/composer/Composer.tsx:1733 msgid "Compose posts up to {0, plural, other {# characters}} in length" msgstr "" @@ -3155,11 +3161,11 @@ msgstr "" msgid "Compose reply" msgstr "" -#: src/view/com/composer/Composer.tsx:2676 +#: src/view/com/composer/Composer.tsx:2705 msgid "Compressing GIF..." msgstr "" -#: src/view/com/composer/Composer.tsx:2678 +#: src/view/com/composer/Composer.tsx:2707 msgid "Compressing video..." msgstr "" @@ -3886,7 +3892,7 @@ msgstr "" #: src/components/PostControls/PostMenu/PostMenuItems.tsx:796 #: src/components/PostControls/PostMenu/PostMenuItems.tsx:798 -#: src/view/com/composer/Composer.tsx:1716 +#: src/view/com/composer/Composer.tsx:1745 msgid "Delete post" msgstr "" @@ -4037,9 +4043,9 @@ msgstr "" #: src/components/dialogs/lists/CreateOrEditListDialog.tsx:101 #: src/screens/Profile/Header/EditProfileDialog.tsx:79 -#: src/view/com/composer/Composer.tsx:1496 -#: src/view/com/composer/Composer.tsx:1540 -#: src/view/com/composer/Composer.tsx:1749 +#: src/view/com/composer/Composer.tsx:1525 +#: src/view/com/composer/Composer.tsx:1569 +#: src/view/com/composer/Composer.tsx:1778 #: src/view/com/composer/drafts/DraftItem.tsx:242 #: src/view/com/composer/drafts/DraftsButton.tsx:131 msgid "Discard" @@ -4050,14 +4056,14 @@ msgstr "" msgid "Discard changes?" msgstr "" -#: src/view/com/composer/Composer.tsx:1494 +#: src/view/com/composer/Composer.tsx:1523 #: src/view/com/composer/drafts/DraftItem.tsx:239 #: src/view/com/composer/drafts/DraftsButton.tsx:98 msgid "Discard draft?" msgstr "" -#: src/view/com/composer/Composer.tsx:1511 -#: src/view/com/composer/Composer.tsx:1741 +#: src/view/com/composer/Composer.tsx:1540 +#: src/view/com/composer/Composer.tsx:1770 msgid "Discard post?" msgstr "" @@ -4095,7 +4101,7 @@ msgstr "" msgid "Dismiss banner" msgstr "" -#: src/view/com/composer/Composer.tsx:2597 +#: src/view/com/composer/Composer.tsx:2626 msgid "Dismiss error" msgstr "" @@ -4653,7 +4659,7 @@ msgstr "" msgid "Entertainment" msgstr "" -#: src/view/com/composer/Composer.tsx:2696 +#: src/view/com/composer/Composer.tsx:2725 #: src/view/com/util/error/ErrorScreen.tsx:40 msgid "Error" msgstr "" @@ -5096,7 +5102,7 @@ msgstr "Failed to rescind your request. Please try again." msgid "Failed to resolve location. Please try again." msgstr "" -#: src/view/com/composer/Composer.tsx:730 +#: src/view/com/composer/Composer.tsx:759 msgid "Failed to save draft" msgstr "" @@ -5783,7 +5789,7 @@ msgstr "" msgid "GIF" msgstr "" -#: src/view/com/composer/Composer.tsx:2701 +#: src/view/com/composer/Composer.tsx:2730 msgid "GIF uploaded" msgstr "" @@ -6282,7 +6288,7 @@ msgstr "" msgid "Hmmmm, we couldn't load that moderation service." msgstr "" -#: src/view/com/composer/state/video.ts:461 +#: src/view/com/composer/state/video.ts:500 msgid "Hold up! We’re gradually giving access to video, and you’re still waiting in line. Check back soon!" msgstr "" @@ -6761,7 +6767,7 @@ msgid "It's just you right now! Add more people to your starter pack by searchin msgstr "" #. placeholder {0}: videoState.jobId -#: src/view/com/composer/Composer.tsx:2616 +#: src/view/com/composer/Composer.tsx:2645 msgid "Job ID: {0}" msgstr "" @@ -6801,8 +6807,8 @@ msgstr "" msgid "Journalism" msgstr "" -#: src/view/com/composer/Composer.tsx:1544 -#: src/view/com/composer/Composer.tsx:1554 +#: src/view/com/composer/Composer.tsx:1573 +#: src/view/com/composer/Composer.tsx:1583 #: src/view/com/composer/drafts/DraftsButton.tsx:135 msgid "Keep editing" msgstr "" @@ -8427,7 +8433,7 @@ msgstr "" #. Title of the error screen shown when the GIF picker crashes unexpectedly. #: src/components/dialogs/LanguageSelectDialog.tsx:347 #: src/features/gifPicker/components/GifPickerErrorBoundary.tsx:22 -#: src/view/com/util/ErrorBoundary.tsx:57 +#: src/view/com/util/ErrorBoundary.tsx:62 msgid "Oh no!" msgstr "" @@ -8445,7 +8451,7 @@ msgstr "" #: src/components/dms/InitiateChatFlow.tsx:838 #: src/components/dms/MessageItem.tsx:743 #: src/screens/Login/PasswordUpdatedForm.tsx:35 -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:642 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:654 msgid "Okay" msgstr "" @@ -8478,27 +8484,27 @@ msgstr "One of the selected recipients does not allow group chats." msgid "One of the selected recipients has blocked you and cannot be messaged." msgstr "One of the selected recipients has blocked you and cannot be messaged." -#: src/view/com/composer/Composer.tsx:938 +#: src/view/com/composer/Composer.tsx:967 msgid "One or more GIFs is missing alt text." msgstr "" -#: src/view/com/composer/Composer.tsx:935 +#: src/view/com/composer/Composer.tsx:964 msgid "One or more images is missing alt text." msgstr "" -#: src/view/com/composer/SelectMediaButton.tsx:423 +#: src/view/com/composer/SelectMediaButton.tsx:435 msgid "One or more of your selected files are not supported." msgstr "" -#: src/view/com/composer/SelectMediaButton.tsx:446 +#: src/view/com/composer/SelectMediaButton.tsx:458 msgid "One or more of your selected files are too large. Maximum size is {VIDEO_MAX_SIZE_MB} MB." msgstr "One or more of your selected files are too large. Maximum size is {VIDEO_MAX_SIZE_MB} MB." -#: src/view/com/composer/Composer.tsx:741 +#: src/view/com/composer/Composer.tsx:770 msgid "One or more posts are too long to save as a draft. {MAX_DRAFT_GRAPHEME_LENGTH, plural, one {The maximum number of characters is # character.} other {The maximum number of characters is # characters.}}" msgstr "" -#: src/view/com/composer/Composer.tsx:945 +#: src/view/com/composer/Composer.tsx:974 msgid "One or more videos is missing alt text." msgstr "" @@ -8511,7 +8517,7 @@ msgstr "" #. placeholder {0}: result.accepted.length #. placeholder {1}: next.length #. placeholder {2}: next.length -#: src/view/com/composer/Composer.tsx:234 +#: src/view/com/composer/Composer.tsx:235 msgid "Only {0} of {1} {2, plural, one {image} other {images}} added; limit is {MAX_GALLERY_IMAGES}" msgstr "Only {0} of {1} {2, plural, one {image} other {images}} added; limit is {MAX_GALLERY_IMAGES}" @@ -8619,7 +8625,7 @@ msgid "Open drawer menu" msgstr "" #: src/screens/Messages/components/MessageComposer.tsx:213 -#: src/view/com/composer/Composer.tsx:2249 +#: src/view/com/composer/Composer.tsx:2278 msgid "Open emoji picker" msgstr "" @@ -8764,7 +8770,7 @@ msgid "Opens device camera" msgstr "" #. Accessibility hint for button in composer to add images, a video, or a GIF to a post. -#: src/view/com/composer/SelectMediaButton.tsx:517 +#: src/view/com/composer/SelectMediaButton.tsx:537 msgid "Opens device gallery to select up to {MAX_GALLERY_IMAGES, plural, other {# images}}, or a single video or GIF." msgstr "Opens device gallery to select up to {MAX_GALLERY_IMAGES, plural, other {# images}}, or a single video or GIF." @@ -9174,7 +9180,7 @@ msgstr "" msgid "Please complete the verification captcha." msgstr "" -#: src/view/com/composer/state/video.ts:485 +#: src/view/com/composer/state/video.ts:524 msgid "Please confirm your email address to upload videos." msgstr "" @@ -9322,7 +9328,7 @@ msgstr "" msgid "Porn" msgstr "" -#: src/view/com/composer/Composer.tsx:1894 +#: src/view/com/composer/Composer.tsx:1923 msgctxt "action" msgid "Post" msgstr "" @@ -9332,6 +9338,12 @@ msgctxt "description" msgid "Post" msgstr "" +#. Screen reader label indicating post count in a thread, e.g., the 3rd post of 5 total is 'Post 3 of 5' +#: src/screens/PostThread/components/ThreadItemPostNumber.tsx:63 +msgctxt "post-number-in-thread" +msgid "Post {index} of {count}" +msgstr "Post {index} of {count}" + #: src/view/screens/Profile.tsx:489 #: src/view/screens/Profile.tsx:490 msgid "Post a photo" @@ -9342,12 +9354,12 @@ msgstr "" msgid "Post a video" msgstr "" -#: src/view/com/composer/Composer.tsx:1892 +#: src/view/com/composer/Composer.tsx:1921 msgctxt "action" msgid "Post All" msgstr "" -#: src/view/com/composer/Composer.tsx:1553 +#: src/view/com/composer/Composer.tsx:1582 msgid "Post anyway" msgstr "Post anyway" @@ -9372,9 +9384,9 @@ msgstr "" msgid "Post failed to upload. Please check your Internet connection and try again." msgstr "" -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:132 -#: src/screens/PostThread/components/ThreadItemPost.tsx:116 -#: src/screens/PostThread/components/ThreadItemTreePost.tsx:109 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:136 +#: src/screens/PostThread/components/ThreadItemPost.tsx:120 +#: src/screens/PostThread/components/ThreadItemTreePost.tsx:113 #: src/screens/VideoFeed/index.tsx:551 msgid "Post has been deleted" msgstr "" @@ -9531,11 +9543,11 @@ msgstr "" msgid "Privacy violation of a minor" msgstr "" -#: src/view/com/composer/Composer.tsx:2690 +#: src/view/com/composer/Composer.tsx:2719 msgid "Processing GIF..." msgstr "" -#: src/view/com/composer/Composer.tsx:2692 +#: src/view/com/composer/Composer.tsx:2721 msgid "Processing video..." msgstr "" @@ -9582,22 +9594,22 @@ msgid "Public, sharable lists of users to mute or block in bulk." msgstr "" #. Accessibility label for button to publish a single post -#: src/view/com/composer/Composer.tsx:1878 +#: src/view/com/composer/Composer.tsx:1907 msgid "Publish post" msgstr "" #. Accessibility label for button to publish multiple posts in a thread -#: src/view/com/composer/Composer.tsx:1873 +#: src/view/com/composer/Composer.tsx:1902 msgid "Publish posts" msgstr "" #. Accessibility label for button to publish multiple replies in a thread -#: src/view/com/composer/Composer.tsx:1862 +#: src/view/com/composer/Composer.tsx:1891 msgid "Publish replies" msgstr "" #. Accessibility label for button to publish a single reply -#: src/view/com/composer/Composer.tsx:1867 +#: src/view/com/composer/Composer.tsx:1896 msgid "Publish reply" msgstr "" @@ -9660,7 +9672,7 @@ msgstr "" msgid "Quotes" msgstr "" -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:465 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:477 msgid "Quotes of this post" msgstr "" @@ -10090,7 +10102,7 @@ msgstr "" msgid "Reply" msgstr "Reply" -#: src/view/com/composer/Composer.tsx:1890 +#: src/view/com/composer/Composer.tsx:1919 msgctxt "action" msgid "Reply" msgstr "" @@ -10265,7 +10277,7 @@ msgstr "" msgid "Reposts" msgstr "" -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:444 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:456 msgid "Reposts of this post" msgstr "" @@ -10507,22 +10519,22 @@ msgstr "" #: src/screens/SavedFeeds.tsx:124 #: src/screens/SavedFeeds.tsx:311 #: src/screens/SavedFeeds.tsx:315 -#: src/view/com/composer/Composer.tsx:1534 +#: src/view/com/composer/Composer.tsx:1563 #: src/view/com/composer/drafts/DraftsButton.tsx:125 msgid "Save changes" msgstr "" -#: src/view/com/composer/Composer.tsx:1506 +#: src/view/com/composer/Composer.tsx:1535 #: src/view/com/composer/drafts/DraftsButton.tsx:93 msgid "Save changes?" msgstr "" -#: src/view/com/composer/Composer.tsx:1534 +#: src/view/com/composer/Composer.tsx:1563 #: src/view/com/composer/drafts/DraftsButton.tsx:125 msgid "Save draft" msgstr "" -#: src/view/com/composer/Composer.tsx:1508 +#: src/view/com/composer/Composer.tsx:1537 #: src/view/com/composer/drafts/DraftsButton.tsx:95 msgid "Save draft?" msgstr "" @@ -10975,7 +10987,7 @@ msgstr "" msgid "Select your preferred notification channels" msgstr "" -#: src/view/com/composer/SelectMediaButton.tsx:426 +#: src/view/com/composer/SelectMediaButton.tsx:438 msgid "Selecting multiple media types is not supported." msgstr "" @@ -11403,7 +11415,7 @@ msgstr "" msgid "Show when you’re live" msgstr "" -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:583 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:595 msgid "Shows information about when this post was created" msgstr "" @@ -11539,7 +11551,7 @@ msgstr "" msgid "Skip contact sharing and continue to the app" msgstr "" -#: src/view/com/composer/Composer.tsx:1551 +#: src/view/com/composer/Composer.tsx:1580 msgid "Skip empty posts?" msgstr "Skip empty posts?" @@ -12287,20 +12299,32 @@ msgstr "The post you’re replying to was marked as being written in {suggestedL msgid "The Privacy Policy has been moved to <0/>" msgstr "" -#: src/view/com/composer/state/video.ts:429 +#: src/view/com/composer/state/video.ts:471 +msgid "The processed video is too large. Please try again with a smaller file." +msgstr "The processed video is too large. Please try again with a smaller file." + +#: src/view/com/composer/state/video.ts:446 +msgid "The selected video could not be encoded." +msgstr "The selected video could not be encoded." + +#: src/view/com/composer/state/video.ts:436 +msgid "The selected video could not be processed." +msgstr "The selected video could not be processed." + +#: src/view/com/composer/state/video.ts:466 msgid "The selected video has an unsupported aspect ratio." msgstr "The selected video has an unsupported aspect ratio." -#: src/view/com/composer/state/video.ts:443 #: src/view/com/composer/state/video.ts:482 +#: src/view/com/composer/state/video.ts:521 msgid "The selected video is larger than {VIDEO_MAX_SIZE_MB} MB. Please try again with a smaller file." msgstr "The selected video is larger than {VIDEO_MAX_SIZE_MB} MB. Please try again with a smaller file." -#: src/view/com/composer/state/video.ts:427 +#: src/view/com/composer/state/video.ts:464 msgid "The selected video is too long." msgstr "The selected video is too long." -#: src/view/com/composer/state/video.ts:431 +#: src/view/com/composer/state/video.ts:468 msgid "The selected video uses an unsupported format." msgstr "The selected video uses an unsupported format." @@ -12335,6 +12359,10 @@ msgstr "" msgid "The verification provider was unable to send a code to your phone number. Please check your phone number and try again." msgstr "" +#: src/view/com/composer/state/video.ts:449 +msgid "The video could not be uploaded to your PDS. Please try again." +msgstr "The video could not be uploaded to your PDS. Please try again." + #: src/screens/Settings/AppearanceSettings.tsx:137 msgid "Theme" msgstr "" @@ -12450,7 +12478,7 @@ msgstr "" #. Body of the error screen shown when the GIF picker crashes unexpectedly. Encourages the user to report the issue. #: src/components/dialogs/LanguageSelectDialog.tsx:349 #: src/features/gifPicker/components/GifPickerErrorBoundary.tsx:27 -#: src/view/com/util/ErrorBoundary.tsx:59 +#: src/view/com/util/ErrorBoundary.tsx:64 msgid "There was an unexpected issue in the application. Please let us know if this happened to you!" msgstr "" @@ -12746,7 +12774,7 @@ msgstr "This person is blocking you" #. placeholder {0}: niceDate(i18n, createdAt) #. placeholder {1}: niceDate(i18n, indexedAt) -#: src/screens/PostThread/components/ThreadItemAnchor.tsx:623 +#: src/screens/PostThread/components/ThreadItemAnchor.tsx:635 msgid "This post claims to have been created on <0>{0}, but was first seen by Bluesky on <1>{1}." msgstr "" @@ -12766,7 +12794,7 @@ msgstr "" msgid "This post will be hidden from feeds and threads. This cannot be undone." msgstr "" -#: src/view/com/composer/Composer.tsx:1126 +#: src/view/com/composer/Composer.tsx:1155 msgid "This post's author has disabled quote posts." msgstr "" @@ -12844,7 +12872,7 @@ msgstr "" msgid "This user isn't following anyone." msgstr "" -#: src/components/Post/Embed/VideoEmbed/index.web.tsx:304 +#: src/components/Post/Embed/VideoEmbed/index.web.tsx:317 msgid "This video can’t be played on your device. Your browser or system may be missing the required video codecs (H.264/AAC)." msgstr "This video can’t be played on your device. Your browser or system may be missing the required video codecs (H.264/AAC)." @@ -13375,7 +13403,7 @@ msgstr "" msgid "Unsupported clipboard content" msgstr "Unsupported clipboard content" -#: src/view/com/composer/Composer.tsx:1643 +#: src/view/com/composer/Composer.tsx:1672 msgid "Unsupported video type: {mimeType}" msgstr "" @@ -13468,7 +13496,7 @@ msgstr "" msgid "Upload from Library" msgstr "" -#: src/view/com/composer/Composer.tsx:2683 +#: src/view/com/composer/Composer.tsx:2712 msgid "Uploading GIF..." msgstr "" @@ -13482,7 +13510,7 @@ msgstr "" msgid "Uploading link thumbnail..." msgstr "" -#: src/view/com/composer/Composer.tsx:2685 +#: src/view/com/composer/Composer.tsx:2714 msgid "Uploading video..." msgstr "" @@ -13732,7 +13760,7 @@ msgstr "via starter pack <0/><1>{starterPackName}" msgid "Video" msgstr "" -#: src/view/com/composer/state/video.ts:433 +#: src/view/com/composer/state/video.ts:457 msgid "Video failed to process" msgstr "" @@ -13763,7 +13791,7 @@ msgstr "" msgid "Video is playing" msgstr "" -#: src/components/Post/Embed/VideoEmbed/index.web.tsx:299 +#: src/components/Post/Embed/VideoEmbed/index.web.tsx:312 msgid "Video not found." msgstr "" @@ -13771,7 +13799,7 @@ msgstr "" msgid "Video settings" msgstr "" -#: src/view/com/composer/Composer.tsx:2703 +#: src/view/com/composer/Composer.tsx:2732 msgid "Video uploaded" msgstr "" @@ -13784,13 +13812,19 @@ msgstr "" msgid "Videos" msgstr "" -#: src/view/com/composer/Composer.tsx:445 -#: src/view/com/composer/Composer.tsx:577 -#: src/view/com/composer/SelectMediaButton.tsx:440 +#: src/view/com/composer/Composer.tsx:453 +#: src/view/com/composer/Composer.tsx:596 +#: src/view/com/composer/SelectMediaButton.tsx:452 +msgid "Videos must be 10 minutes or less." +msgstr "Videos must be 10 minutes or less." + +#: src/view/com/composer/Composer.tsx:454 +#: src/view/com/composer/Composer.tsx:597 +#: src/view/com/composer/SelectMediaButton.tsx:453 msgid "Videos must be less than 3 minutes long." msgstr "" -#: src/view/com/composer/Composer.tsx:1233 +#: src/view/com/composer/Composer.tsx:1262 msgctxt "Action to view the post the user just created" msgid "View" msgstr "" @@ -13883,7 +13917,7 @@ msgstr "" msgid "View more trending videos" msgstr "" -#: src/view/com/composer/Composer.tsx:1228 +#: src/view/com/composer/Composer.tsx:1257 msgid "View post" msgstr "" @@ -14092,7 +14126,7 @@ msgstr "" msgid "We sent an email to <0>{0} containing a link. Please click on it to complete the email verification process." msgstr "" -#: src/view/com/composer/state/video.ts:465 +#: src/view/com/composer/state/video.ts:504 msgid "We were unable to determine if you are allowed to upload videos. Please try again." msgstr "" @@ -14202,7 +14236,7 @@ msgstr "We’re sorry, but your search could not be completed. Please try again msgid "We're sorry, you cannot access this screen at this time." msgstr "" -#: src/view/com/composer/Composer.tsx:1124 +#: src/view/com/composer/Composer.tsx:1153 msgid "We're sorry! The post you are replying to has been deleted." msgstr "" @@ -14258,7 +14292,7 @@ msgid "what’s up" msgstr "what’s up" #: src/view/com/auth/SplashScreen.web.tsx:100 -#: src/view/com/composer/Composer.tsx:1607 +#: src/view/com/composer/Composer.tsx:1636 #: src/view/com/feeds/ComposerPrompt.tsx:195 msgid "What's up?" msgstr "" @@ -14344,7 +14378,7 @@ msgstr "Would you like to block this user and/or leave this conversation?" msgid "Would you like to save this as a draft before viewing your drafts?" msgstr "" -#: src/view/com/composer/Composer.tsx:1522 +#: src/view/com/composer/Composer.tsx:1551 msgid "Would you like to save this as a draft to edit later?" msgstr "" @@ -14353,12 +14387,12 @@ msgstr "" msgid "Write a post" msgstr "" -#: src/view/com/composer/Composer.tsx:1703 +#: src/view/com/composer/Composer.tsx:1732 msgid "Write post" msgstr "" #: src/screens/PostThread/components/ThreadComposePrompt.tsx:91 -#: src/view/com/composer/Composer.tsx:1605 +#: src/view/com/composer/Composer.tsx:1634 msgid "Write your reply" msgstr "" @@ -14468,7 +14502,7 @@ msgstr "" msgid "You are no longer live" msgstr "" -#: src/view/com/composer/state/video.ts:458 +#: src/view/com/composer/state/video.ts:497 msgid "You are not allowed to upload videos." msgstr "" @@ -14536,11 +14570,11 @@ msgid "You can now sign in with your new password." msgstr "" #. Toast shown when the user tries to add more images but the post gallery is already at the cap -#: src/view/com/composer/Composer.tsx:221 +#: src/view/com/composer/Composer.tsx:222 msgid "You can only add up to {MAX_GALLERY_IMAGES, plural, other {# images}} per post" msgstr "You can only add up to {MAX_GALLERY_IMAGES, plural, other {# images}} per post" -#: src/view/com/composer/Composer.tsx:1527 +#: src/view/com/composer/Composer.tsx:1556 msgid "You can only save drafts up to 1000 characters." msgstr "" @@ -14548,11 +14582,11 @@ msgstr "" msgid "You can only save drafts up to 1000 characters. Would you like to discard this post before viewing your drafts?" msgstr "" -#: src/view/com/composer/SelectMediaButton.tsx:443 +#: src/view/com/composer/SelectMediaButton.tsx:455 msgid "You can only select one GIF at a time." msgstr "" -#: src/view/com/composer/SelectMediaButton.tsx:437 +#: src/view/com/composer/SelectMediaButton.tsx:449 msgid "You can only select one video at a time." msgstr "" @@ -14565,7 +14599,7 @@ msgid "You can read chat history but can’t send new messages." msgstr "You can read chat history but can’t send new messages." #. Error message for maximum number of images that can be selected to add to a post. -#: src/view/com/composer/SelectMediaButton.tsx:429 +#: src/view/com/composer/SelectMediaButton.tsx:441 msgid "You can select up to {MAX_GALLERY_IMAGES, plural, other {# images}} in total." msgstr "You can select up to {MAX_GALLERY_IMAGES, plural, other {# images}} in total." @@ -14688,7 +14722,7 @@ msgstr "" msgid "You have temporarily reached the limit for video uploads. Please try again later." msgstr "" -#: src/view/com/composer/Composer.tsx:1517 +#: src/view/com/composer/Composer.tsx:1546 msgid "You have unsaved changes to this draft, would you like to save them?" msgstr "" @@ -14764,7 +14798,7 @@ msgstr "" msgid "You must grant access to your photo library to save a QR code" msgstr "" -#: src/view/com/composer/SelectMediaButton.tsx:472 +#: src/view/com/composer/SelectMediaButton.tsx:491 msgid "You need to allow access to your media library." msgstr "" @@ -14924,7 +14958,7 @@ msgstr "" msgid "You've reached the end of your feed! Find some more accounts to follow." msgstr "" -#: src/view/com/composer/Composer.tsx:728 +#: src/view/com/composer/Composer.tsx:757 msgid "You've reached the maximum number of drafts" msgstr "" @@ -14940,11 +14974,11 @@ msgstr "You’ve reached the maximum of {MAX_FILTERS, plural, one {# filter} oth msgid "You've reached the start of the active content." msgstr "" -#: src/view/com/composer/state/video.ts:469 +#: src/view/com/composer/state/video.ts:508 msgid "You've reached your daily limit for video uploads (too many bytes)" msgstr "" -#: src/view/com/composer/state/video.ts:473 +#: src/view/com/composer/state/video.ts:512 msgid "You've reached your daily limit for video uploads (too many videos)" msgstr "" @@ -14968,7 +15002,7 @@ msgstr "" msgid "Your account has been suspended" msgstr "" -#: src/view/com/composer/state/video.ts:477 +#: src/view/com/composer/state/video.ts:516 msgid "Your account is not yet old enough to upload videos. Please try again later." msgstr "" @@ -15104,11 +15138,15 @@ msgstr "" msgid "Your password must be at least 8 characters long." msgstr "" -#: src/view/com/composer/Composer.tsx:1224 +#: src/view/com/composer/state/video.ts:453 +msgid "Your PDS does not support videos this large. Please try again with a smaller file." +msgstr "Your PDS does not support videos this large. Please try again with a smaller file." + +#: src/view/com/composer/Composer.tsx:1253 msgid "Your post was sent" msgstr "" -#: src/view/com/composer/Composer.tsx:1221 +#: src/view/com/composer/Composer.tsx:1250 msgid "Your posts were sent" msgstr "" @@ -15129,7 +15167,7 @@ msgstr "" msgid "Your profile, posts, feeds, and lists will no longer be visible to other Bluesky users. You can reactivate your account at any time by logging in." msgstr "" -#: src/view/com/composer/Composer.tsx:1223 +#: src/view/com/composer/Composer.tsx:1252 msgid "Your reply was sent" msgstr "" @@ -15142,7 +15180,7 @@ msgstr "" msgid "Your selected interests help us serve you content you care about." msgstr "" -#: src/view/com/composer/Composer.tsx:1552 +#: src/view/com/composer/Composer.tsx:1581 msgid "Your thread has empty posts that will be skipped. The remaining posts will be published as a thread." msgstr "Your thread has empty posts that will be skipped. The remaining posts will be published as a thread." -- knotmirror 0.0.1 From 61283da52699b03ee2989d33370e50188a909de2 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 6 Aug 2026 14:13:29 +0300 Subject: [PATCH 02/42] Show app build numbers in CI summaries (#11267) --- .github/workflows/build-submit-android.yml | 10 ++++++++++ .github/workflows/build-submit-ios.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/build-submit-android.yml b/.github/workflows/build-submit-android.yml index 4d474a1f0..c1eb6f0ee 100644 --- a/.github/workflows/build-submit-android.yml +++ b/.github/workflows/build-submit-android.yml @@ -132,6 +132,16 @@ jobs: if-no-files-found: error path: build.aab + - name: 📝 Write build summary + env: + REMOTE_VERSION_CODE: ${{ steps.get-build-info.outputs.BSKY_ANDROID_VERSION_CODE }} + run: | + { + echo "### Android build number" + echo + echo "\`$REMOTE_VERSION_CODE\`" + } >> "$GITHUB_STEP_SUMMARY" + submit: name: Submit to Google Play runs-on: ubuntu-latest diff --git a/.github/workflows/build-submit-ios.yml b/.github/workflows/build-submit-ios.yml index bf72ed52c..f1c54c6cb 100644 --- a/.github/workflows/build-submit-ios.yml +++ b/.github/workflows/build-submit-ios.yml @@ -216,6 +216,16 @@ jobs: ${{ env.BUILD_DIR }}/Bluesky.ipa ${{ env.BUILD_DIR }}/Bluesky.app.dSYM.zip + - name: 📝 Write build summary + env: + REMOTE_BUILD_NUMBER: ${{ steps.get-build-info.outputs.BSKY_IOS_BUILD_NUMBER }} + run: | + { + echo "### iOS build number" + echo + echo "\`$REMOTE_BUILD_NUMBER\`" + } >> "$GITHUB_STEP_SUMMARY" + submit: name: Submit iOS # Submission and dSYM upload are I/O bound and don't need the xlarge builder. -- knotmirror 0.0.1 From 1ac5a71d61b8a980957833794e893450c3f389f0 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 6 Aug 2026 14:14:06 +0300 Subject: [PATCH 03/42] Use Claude Opus 5 in GitHub workflows (#11335) --- .github/workflows/claude-mention.yml | 2 +- .github/workflows/claude-review.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude-mention.yml b/.github/workflows/claude-mention.yml index 5ddf02b15..3397707be 100644 --- a/.github/workflows/claude-mention.yml +++ b/.github/workflows/claude-mention.yml @@ -72,5 +72,5 @@ jobs: actions: read track_progress: true claude_args: | - --model global.anthropic.claude-opus-4-8 + --model global.anthropic.claude-opus-5 --allowedTools "mcp__github_inline_comment__create_inline_comment,mcp__github_ci__get_ci_status,mcp__github_ci__download_job_log,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index bcb9a09e3..44ad89bc9 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -58,7 +58,7 @@ jobs: actions: read track_progress: true claude_args: | - --model global.anthropic.claude-opus-4-8 + --model global.anthropic.claude-opus-5 --allowedTools "mcp__github_inline_comment__create_inline_comment,mcp__github_ci__get_ci_status,mcp__github_ci__download_job_log,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" prompt: | REPO: ${{ github.repository }} -- knotmirror 0.0.1 From 5cf6d8fa21f6572bebae61a8e6e981543035db24 Mon Sep 17 00:00:00 2001 From: Spence Pope Date: Thu, 6 Aug 2026 08:16:18 -0400 Subject: [PATCH 04/42] Use toolbox video compressor (#11246) --- package.json | 1 + pnpm-lock.yaml | 17 +++++++++++++ src/analytics/metrics/types.ts | 4 +-- src/lib/media/video/compress.ts | 42 +++++++++++++++----------------- src/lib/media/video/constants.ts | 4 +-- src/lib/media/video/telemetry.ts | 2 +- src/lib/media/video/types.ts | 2 +- 7 files changed, 44 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 2759a5911..6af3698d3 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,7 @@ "@bsky.app/sift": "^0.3.9", "@bsky.app/tapper": "^0.6.1", "@bsky.app/video": "0.3.6", + "@bsky.app/video-compressor": "0.2.0", "@emoji-mart/data": "^1.2.1", "@emoji-mart/react": "^1.1.1", "@expo/html-elements": "^0.12.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ec1f5267..ce0b6b65f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -289,6 +289,9 @@ importers: '@bsky.app/video': specifier: 0.3.6 version: 0.3.6(expo@54.0.35(@babel/core@7.29.0)(react-native-webview@13.15.0(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0) + '@bsky.app/video-compressor': + specifier: 0.2.0 + version: 0.2.0(expo@54.0.35(@babel/core@7.29.0)(react-native-webview@13.15.0(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0) '@emoji-mart/data': specifier: ^1.2.1 version: 1.2.1 @@ -1698,6 +1701,13 @@ packages: react-native: '*' tlds: '*' + '@bsky.app/video-compressor@0.2.0': + resolution: {integrity: sha512-hQPT/zxy3MoODuN7QM5Q0jA5anrrwKfka4o9BTz821sAaiRWW8E4vdw4xsbuhfUXRNOSXknQbDHch2Toh178Xw==} + peerDependencies: + expo: '*' + react: '*' + react-native: '*' + '@bsky.app/video@0.3.6': resolution: {integrity: sha512-Ny7vz9v1lQOw5Llw4xejtJo/Dp/lmdRw1XdUJucOXlq6puXO93tv3mNXUIIyOEVWEwDPg8j/kSQxG/mGy+/hdQ==} peerDependencies: @@ -10439,6 +10449,13 @@ snapshots: react-native: 0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0) tlds: 1.261.0 + '@bsky.app/video-compressor@0.2.0(expo@54.0.35(@babel/core@7.29.0)(react-native-webview@13.15.0(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)': + dependencies: + expo: 54.0.35(@babel/core@7.29.0)(react-native-webview@13.15.0(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0) + mediabunny: 1.49.0 + react: 19.1.0 + react-native: 0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0) + '@bsky.app/video@0.3.6(expo@54.0.35(@babel/core@7.29.0)(react-native-webview@13.15.0(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)': dependencies: expo: 54.0.35(@babel/core@7.29.0)(react-native-webview@13.15.0(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(patch_hash=91fd85363059530dea649a5ca6012b933f79c8491737fbfdc685abc727e48403)(@babel/core@7.29.0)(@react-native/metro-config@0.86.0(@babel/core@7.29.0))(@types/react@19.1.17)(react@19.1.0))(react@19.1.0) diff --git a/src/analytics/metrics/types.ts b/src/analytics/metrics/types.ts index 592f9a563..b5e01d11e 100644 --- a/src/analytics/metrics/types.ts +++ b/src/analytics/metrics/types.ts @@ -1388,7 +1388,7 @@ export type Events = { // === Video upload funnel (Frontend Spec section D) === // Every event carries uploadId (client-generated UUID, ties one upload // session end-to-end) + engine (compression engine id, e.g. - // native:react-native-compressor@1.13.0). jobId is added once the server + // native:@bsky.app/video-compressor@0.2.0). jobId is added once the server // returns it. Sizes / codecs / dimensions / timings only - never content. 'video:upload:picked': { uploadId: string @@ -1407,7 +1407,7 @@ export type Events = { // Native-only. Raw container metadata returned by the new module's probe() // (bitrate, codec, HDR, frame rate, rotation, etc.). Fires once per upload // between compressStarted and the compressSkipped/compressCompleted decision. - // The web (mediabunny) and legacy rn-compressor engines do not surface this. + // The web mediabunny engine also emits this from its own probe. 'video:upload:probed': { uploadId: string engine: string diff --git a/src/lib/media/video/compress.ts b/src/lib/media/video/compress.ts index 72fb2a246..d38c1cdec 100644 --- a/src/lib/media/video/compress.ts +++ b/src/lib/media/video/compress.ts @@ -1,11 +1,13 @@ -import {getVideoMetaData, Video} from 'react-native-compressor' import {type ImagePickerAsset} from 'expo-image-picker' +import {compress, probe, type VideoMetadata} from '@bsky.app/video-compressor' import {SUPPORTED_MIME_TYPES, type SupportedMimeTypes} from '#/lib/constants' import {logger} from '#/logger' -import {probe} from '../../../../modules/expo-bluesky-video-compress' +import { + COMPRESSION_MAX_DIMENSION, + COMPRESSION_TARGET_BITRATE, +} from './constants' import {type CompressedVideo, type ProbedMetadata} from './types' -import {extToMime} from './util' const MIN_SIZE_FOR_COMPRESSION_BYTES = 25 * 1024 * 1024 // 25mb @@ -23,7 +25,7 @@ export async function compressVideo( // future smart-skip thresholds. Failures must not block the upload. if (onProbe && file.mimeType !== 'image/gif') { try { - onProbe(await probe(file.uri)) + onProbe(toProbedMetadata(await probe(file.uri))) } catch (e) { logger.debug('video probe failed', {safeMessage: e}) } @@ -60,31 +62,27 @@ export async function compressVideo( } } - const compressed = await Video.compress( + return compress( file.uri, { - compressionMethod: 'manual', - bitrate: 3_000_000, // 3mbps - maxSize: 1920, + targetBitrate: COMPRESSION_TARGET_BITRATE, + maxSize: COMPRESSION_MAX_DIMENSION, + codec: 'auto', + frameRateCap: 30, + mimeType: file.mimeType, + fileSize: file.fileSize, // Force a transcode for unacceptable-format files regardless of size. - // rnc's default minimumFileSizeForCompress would otherwise pass small + // The compressor's default threshold would otherwise pass small // unacceptable-format files through unchanged and the server would // reject them. Acceptable formats are already short-circuited above so // they never reach this call. - // WARNING: this ONE SPECIFIC ARG is in MB -sfn - minimumFileSizeForCompress: 0, - getCancellationId: id => { - if (signal) { - signal.addEventListener('abort', () => { - Video.cancelCompression(id) - }) - } - }, + passthroughBelowBytes: 0, + passthroughGif: false, }, - onProgress, + {onProgress, signal}, ) +} - const info = await getVideoMetaData(compressed) - - return {uri: compressed, size: info.size, mimeType: extToMime(info.extension)} +function toProbedMetadata(metadata: VideoMetadata): ProbedMetadata { + return metadata } diff --git a/src/lib/media/video/constants.ts b/src/lib/media/video/constants.ts index 60580efc8..0f7401614 100644 --- a/src/lib/media/video/constants.ts +++ b/src/lib/media/video/constants.ts @@ -5,6 +5,6 @@ export const COMPRESSION_TARGET_BITRATE = 3_000_000 // 3 Mbps // Output dimension cap when compressing, and skip threshold for source files. export const COMPRESSION_MAX_DIMENSION = 1920 -// Web only: files under this size skip compression entirely. Native applies -// its own threshold logic inside react-native-compressor. +// Web only: files under this size skip compression entirely. Native uses a +// 25 MiB threshold in compress.ts for compatibility with the previous engine. export const COMPRESSION_MIN_SIZE_BYTES = 25_000_000 diff --git a/src/lib/media/video/telemetry.ts b/src/lib/media/video/telemetry.ts index 9181ec002..188abb6d8 100644 --- a/src/lib/media/video/telemetry.ts +++ b/src/lib/media/video/telemetry.ts @@ -18,7 +18,7 @@ type MetricFn = (event: E, payload: Metrics[E]) => void const COMPRESS_ENGINE = Platform.OS === 'web' ? 'web:mediabunny@1.25.3' - : 'native:react-native-compressor@1.13.0' + : 'native:@bsky.app/video-compressor@0.2.0' type Phase = 'compress' | 'upload' | 'processing' diff --git a/src/lib/media/video/types.ts b/src/lib/media/video/types.ts index 1d2062ce0..6431c567f 100644 --- a/src/lib/media/video/types.ts +++ b/src/lib/media/video/types.ts @@ -22,7 +22,7 @@ export type CompressedVideo = { } // Source container metadata read off the input before any encoding decision. -// Same shape across native (expo-bluesky-video-compress probe) and web +// Same shape across native (@bsky.app/video-compressor probe) and web // (mediabunny Input + track inspection). Numbers are raw - no bucketing. export type ProbedMetadata = { mimeType: string -- knotmirror 0.0.1 From 78a5c222bf3b4d3533ee823709b100ae94cefe27 Mon Sep 17 00:00:00 2001 From: surfdude29 <149612116+surfdude29@users.noreply.github.com> Date: Thu, 6 Aug 2026 13:18:38 +0100 Subject: [PATCH 05/42] Tweak strings (#11407) --- src/components/moderation/ReportDialog/index.tsx | 2 +- src/view/com/composer/state/video.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/moderation/ReportDialog/index.tsx b/src/components/moderation/ReportDialog/index.tsx index 50c780630..6f405372f 100644 --- a/src/components/moderation/ReportDialog/index.tsx +++ b/src/components/moderation/ReportDialog/index.tsx @@ -268,7 +268,7 @@ function Inner(props: ReportDialogProps) { let error = l`Something went wrong. Please try again.` if (classification.kind === 'account-takedown') { - error = l`Your account cannot submit reports while it is taken down.` + error = l`Your account cannot submit reports while it is suspended.` } else if (classification.kind === 'invalid-reason-type') { error = l`This moderation service does not support that report reason. Please choose a different reason or moderation service.` } else if (classification.kind === 'service-unavailable') { diff --git a/src/view/com/composer/state/video.ts b/src/view/com/composer/state/video.ts index d984202d0..13bd71f88 100644 --- a/src/view/com/composer/state/video.ts +++ b/src/view/com/composer/state/video.ts @@ -446,11 +446,11 @@ function getProcessingErrorMessage( return i18n._(msg`The selected video could not be encoded.`) case 'pds_upload_failure': return i18n._( - msg`The video could not be uploaded to your PDS. Please try again.`, + msg`The video could not be uploaded to your hosting provider. Please try again.`, ) case 'pds_upload_unsupported_blob_size': return i18n._( - msg`Your PDS does not support videos this large. Please try again with a smaller file.`, + msg`Your hosting provider does not support videos this large. Please try again with a smaller file.`, ) case 'generic_failure': default: -- knotmirror 0.0.1 From 1cbe7a39e6e28ed615b1f45beafeec9cab2b2503 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 6 Aug 2026 15:20:11 +0300 Subject: [PATCH 06/42] increase ci node heap (#11406) --- .github/workflows/pull-request-commit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-commit.yml b/.github/workflows/pull-request-commit.yml index 16566672a..4d45adffd 100644 --- a/.github/workflows/pull-request-commit.yml +++ b/.github/workflows/pull-request-commit.yml @@ -22,6 +22,7 @@ permissions: {} # job downloads. Bump this one line to roll denis. env: DENIS_RELEASE_TAG: denis-v0.1.1 + NODE_OPTIONS: --max-old-space-size=4096 jobs: # Populate this from main so every PR can restore the same trusted baseline. -- knotmirror 0.0.1 From 724013df1be54990e069907c66c379e077d67e61 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 6 Aug 2026 13:53:02 -0500 Subject: [PATCH 07/42] Add repost-only mutes (#11223) Co-authored-by: DS Boyce <260543580+ds-boyce@users.noreply.github.com> --- .../repostStrike_stroke2_corner0_rounded.svg | 1 + oxlint-suppressions.json | 5 - package.json | 2 +- pnpm-lock.yaml | 28 ++-- src/analytics/metrics/types.ts | 2 + src/components/Pills.tsx | 25 ++- src/components/ProfileCard.tsx | 4 +- src/components/icons/Repost.tsx | 4 + .../moderation/ProfileHeaderAlerts.tsx | 8 +- src/screens/Profile/Header/GrowableBanner.tsx | 4 +- src/screens/Profile/Header/Shell.tsx | 5 +- src/state/cache/profile-shadow.ts | 12 +- src/state/queries/profile.ts | 79 +++++++++- src/view/com/profile/ProfileMenu.tsx | 144 +++++++++++++----- 14 files changed, 259 insertions(+), 64 deletions(-) create mode 100644 assets/icons/repostStrike_stroke2_corner0_rounded.svg diff --git a/assets/icons/repostStrike_stroke2_corner0_rounded.svg b/assets/icons/repostStrike_stroke2_corner0_rounded.svg new file mode 100644 index 000000000..755fb0049 --- /dev/null +++ b/assets/icons/repostStrike_stroke2_corner0_rounded.svg @@ -0,0 +1 @@ + diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index 2bc0ab246..2aee77333 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -992,11 +992,6 @@ "count": 3 } }, - "src/screens/Profile/Header/Shell.tsx": { - "typescript/no-explicit-any": { - "count": 1 - } - }, "src/screens/Profile/KnownFollowers.tsx": { "typescript/no-misused-promises": { "count": 2 diff --git a/package.json b/package.json index 6af3698d3..d457df50f 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ }, "dependencies": { "@atproto/api": "0.20.37", - "@atproto/common-web": "0.5.6", + "@atproto/common-web": "0.5.7", "@atproto/syntax": "0.7.2", "@bitdrift/react-native": "^0.6.8", "@braintree/sanitize-url": "^6.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ce0b6b65f..ded12e931 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -245,8 +245,8 @@ importers: specifier: 0.20.37 version: 0.20.37 '@atproto/common-web': - specifier: 0.5.6 - version: 0.5.6 + specifier: 0.5.7 + version: 0.5.7 '@atproto/syntax': specifier: 0.7.2 version: 0.7.2 @@ -878,24 +878,24 @@ packages: resolution: {integrity: sha512-TEt8oKMbuC+1GvqyLKDBLqmptnk1mh52FdHPQEomlPIWxh88YcNnk0g0iKNVBevaeeLtWZF1a7Am/t/q255u5Q==} engines: {node: '>=22'} - '@atproto/common-web@0.5.6': - resolution: {integrity: sha512-5Y4MIK9dpkJPiKiE6u7iEHitxj+g3aAU2GfGL686JlKE2zDKD4y18BJb+uVek6nXQKb5XOdNVvw+7BHarpn8Fw==} + '@atproto/common-web@0.5.7': + resolution: {integrity: sha512-lvU8lFO5UByacsl3AReXkpTWjcPBS8mBqt40B45HwCt+s58a+xT/YI/+AUpmzSmsPVZCpeCmP6wgsOSC8RILXg==} engines: {node: '>=22'} '@atproto/common-web@0.5.8': resolution: {integrity: sha512-GiYY2Jgbg1aWe9QGT3TswC/wZNicipBDz0nFo4FrP6XqENEJJRxGKAf/zjvqbesfIQFhHXi1VbSFY7GStB8v8w==} engines: {node: '>=22'} - '@atproto/lex-data@0.1.5': - resolution: {integrity: sha512-TEM6GHuYpNm4O90LjNgbYq1Gmcr875S+BHrDxkg4PB5w/nlsz4HlbkGQG/WP/xbIV5O8TF5nNHDpCZ5ezTRrFA==} + '@atproto/lex-data@0.1.6': + resolution: {integrity: sha512-rvovRrYWDEuerX+ZeQbdI5dKs0bYvuMjhwDOtT+pkOvdY4MkfN41DJCz/RAYVAQ7noPdaalB6pAX9euukheE/w==} engines: {node: '>=22'} '@atproto/lex-data@0.1.7': resolution: {integrity: sha512-kW/dPLqo/WgCLV+XESR4JKwV6c1rZWJGOfuPupZGTjEDAKoBbKXdaEzX9/1vKQYbZ9U3j0DS/n7OFFK7wBugyQ==} engines: {node: '>=22'} - '@atproto/lex-json@0.1.4': - resolution: {integrity: sha512-ENR2cWkVrES+UL6TovbCRdX9BJOyHHJUS8jYx3Lxp3j4vEphjn/u+DW7bWloST2O8ID2OuVlt6+28ftNEEjmQQ==} + '@atproto/lex-json@0.1.5': + resolution: {integrity: sha512-qOp6+Za5p/xDXACYIP3vySbKaf9CJDwiZEN78ghPT1gRoJohKG3ONt/WmvOxBVJqc6VTRaqEpbG9vX9oLF2qsA==} engines: {node: '>=22'} '@atproto/lex-json@0.1.6': @@ -9426,10 +9426,10 @@ snapshots: tlds: 1.261.0 zod: 3.25.76 - '@atproto/common-web@0.5.6': + '@atproto/common-web@0.5.7': dependencies: - '@atproto/lex-data': 0.1.5 - '@atproto/lex-json': 0.1.4 + '@atproto/lex-data': 0.1.6 + '@atproto/lex-json': 0.1.5 '@atproto/syntax': 0.7.2 zod: 3.25.76 @@ -9440,7 +9440,7 @@ snapshots: '@atproto/syntax': 0.7.3 zod: 3.25.76 - '@atproto/lex-data@0.1.5': + '@atproto/lex-data@0.1.6': dependencies: multiformats: 13.4.2 tslib: 2.8.1 @@ -9452,9 +9452,9 @@ snapshots: tslib: 2.8.1 unicode-segmenter: 0.14.5 - '@atproto/lex-json@0.1.4': + '@atproto/lex-json@0.1.5': dependencies: - '@atproto/lex-data': 0.1.5 + '@atproto/lex-data': 0.1.6 tslib: 2.8.1 '@atproto/lex-json@0.1.6': diff --git a/src/analytics/metrics/types.ts b/src/analytics/metrics/types.ts index b5e01d11e..9e5358e23 100644 --- a/src/analytics/metrics/types.ts +++ b/src/analytics/metrics/types.ts @@ -510,6 +510,8 @@ export type Events = { } 'profile:mute': {} 'profile:unmute': {} + 'profile:muteReposts': {} + 'profile:unmuteReposts': {} 'profile:block': {} 'profile:unblock': {} 'suggestedUser:follow': { diff --git a/src/components/Pills.tsx b/src/components/Pills.tsx index c24e51047..e38afb6c8 100644 --- a/src/components/Pills.tsx +++ b/src/components/Pills.tsx @@ -1,12 +1,13 @@ import {useMemo} from 'react' import {View} from 'react-native' import {BSKY_LABELER_DID, type ModerationCause} from '@atproto/api' -import {Trans} from '@lingui/react/macro' +import {Trans, useLingui} from '@lingui/react/macro' import {useModerationCauseDescription} from '#/lib/moderation/useModerationCauseDescription' import {UserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, useTheme, type ViewStyleProp} from '#/alf' import {Button} from '#/components/Button' +import {RepostStrike_Stroke2_Corner0_Rounded as RepostStrikeIcon} from '#/components/icons/Repost' import { ModerationDetailsDialog, useModerationDetailsDialogControl, @@ -215,3 +216,25 @@ export function FollowsYou({size = 'sm'}: CommonProps) { ) } + +export function MutedOnlyReposts(props: CommonProps) { + const t = useTheme() + const {t: l} = useLingui() + + const size = props.size === 'lg' ? 16 : 12 + + return ( + + } + disabled={true} + onPress={() => {}} + /> + ) +} diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index 7b4d75164..c37f99c07 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -623,8 +623,9 @@ export function Labels({ const moderation = moderateProfile(profile, moderationOpts) const modui = moderation.ui('profileList') const followedBy = profile.viewer?.followedBy + const mutedOnlyReposts = profile.viewer?.mutedOnlyReposts - if (!followedBy && !modui.inform && !modui.alert) { + if (!followedBy && !mutedOnlyReposts && !modui.inform && !modui.alert) { return null } @@ -637,6 +638,7 @@ export function Labels({ {modui.informs.map(inform => ( ))} + {mutedOnlyReposts && } ) } diff --git a/src/components/icons/Repost.tsx b/src/components/icons/Repost.tsx index abf2c8ac2..41d76fd21 100644 --- a/src/components/icons/Repost.tsx +++ b/src/components/icons/Repost.tsx @@ -15,3 +15,7 @@ export const Repost_Stroke2_Corner3_Rounded = createSinglePathSVG({ export const RepostRepost_Stroke2_Corner2_Rounded = createSinglePathSVG({ path: 'M6.043 14.293a1 1 0 1 1 1.414 1.414L5.164 18l2.293 2.293.068.076a1 1 0 0 1-1.406 1.406l-.076-.068-2.47-2.47a1.75 1.75 0 0 1 0-2.474l2.47-2.47Zm6.22 0a1 1 0 0 1 1.414 1.414L12.384 17H18a1 1 0 0 0 1-1v-3a1 1 0 1 1 2 0v3a3 3 0 0 1-3 3h-5.616l1.293 1.293.068.076a1 1 0 0 1-1.406 1.406l-.076-.068-2.47-2.47a1.75 1.75 0 0 1 0-2.474l2.47-2.47ZM3 11V8a3 3 0 0 1 3-3h5.586l-1.293-1.293-.068-.076a1 1 0 0 1 1.406-1.406l.076.068 2.47 2.47.12.133a1.75 1.75 0 0 1 0 2.209l-.12.132-2.47 2.47a1 1 0 1 1-1.414-1.414L11.586 7H6a1 1 0 0 0-1 1v3a1 1 0 1 1-2 0Zm13.543-8.707a1 1 0 0 1 1.338-.068l.076.068 2.47 2.47.12.133a1.75 1.75 0 0 1 0 2.209l-.12.132-2.47 2.47a1 1 0 1 1-1.414-1.414L18.836 6l-2.293-2.293-.068-.076a1 1 0 0 1 .068-1.338Z', }) + +export const RepostStrike_Stroke2_Corner0_Rounded = createSinglePathSVG({ + path: 'M2.293 2.293a1 1 0 0 1 1.414 0l18 18a1 1 0 0 1-1.414 1.414L17.586 19H6.414l1.293 1.293a1 1 0 0 1-1.414 1.414l-3-3a1 1 0 0 1 0-1.414l3-3a1 1 0 1 1 1.414 1.414L6.414 17h9.172L5.909 7.323A2 2 0 0 0 5 9v2a1 1 0 0 1-2 0V9c0-1.255.579-2.372 1.482-3.104L2.293 3.707a1 1 0 0 1 0-1.414M20 12a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1M16.293 2.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L17.586 7H11a1 1 0 0 1 0-2h6.586l-1.293-1.293a1 1 0 0 1 0-1.414', +}) diff --git a/src/components/moderation/ProfileHeaderAlerts.tsx b/src/components/moderation/ProfileHeaderAlerts.tsx index f35bf14fe..e6a13e294 100644 --- a/src/components/moderation/ProfileHeaderAlerts.tsx +++ b/src/components/moderation/ProfileHeaderAlerts.tsx @@ -3,16 +3,21 @@ import {type ModerationDecision} from '@atproto/api' import {getModerationCauseKey, unique} from '#/lib/moderation' import * as Pills from '#/components/Pills' +import type * as bsky from '#/types/bsky' export function ProfileHeaderAlerts({ moderation, + profile, style, }: { moderation: ModerationDecision + profile: bsky.profile.AnyProfileView style?: StyleProp }) { const modui = moderation.ui('profileView') - if (!modui.alert && !modui.inform) { + const mutedOnlyReposts = profile.viewer?.mutedOnlyReposts + + if (!mutedOnlyReposts && !modui.alert && !modui.inform) { return null } @@ -32,6 +37,7 @@ export function ProfileHeaderAlerts({ cause={cause} /> ))} + {mutedOnlyReposts && } ) } diff --git a/src/screens/Profile/Header/GrowableBanner.tsx b/src/screens/Profile/Header/GrowableBanner.tsx index ef152aa32..1c2ba2ae1 100644 --- a/src/screens/Profile/Header/GrowableBanner.tsx +++ b/src/screens/Profile/Header/GrowableBanner.tsx @@ -35,7 +35,7 @@ export function GrowableBanner({ backButton?: React.ReactNode children: React.ReactNode onPress?: () => void - bannerRef?: AnimatedRef + bannerRef?: AnimatedRef testID?: string label?: string }) { @@ -87,7 +87,7 @@ function GrowableBannerInner({ backButton?: React.ReactNode children: React.ReactNode onPress?: () => void - bannerRef?: AnimatedRef + bannerRef?: AnimatedRef testID?: string label?: string }) { diff --git a/src/screens/Profile/Header/Shell.tsx b/src/screens/Profile/Header/Shell.tsx index 94a2a9bb1..a142e1139 100644 --- a/src/screens/Profile/Header/Shell.tsx +++ b/src/screens/Profile/Header/Shell.tsx @@ -60,7 +60,7 @@ let ProfileHeaderShell = ({ const liveStatusControl = useDialogControl() const aviRef = useAnimatedRef() - const bannerRef = useAnimatedRef() + const bannerRef = useAnimatedRef() const onPressBack = useCallback(() => { if (navigation.canGoBack()) { @@ -73,7 +73,7 @@ let ProfileHeaderShell = ({ const _openLightbox = useCallback( ( uri: string, - thumbRef: AnimatedRef, + thumbRef: AnimatedRef, type: 'circle-avi' | 'rect-avi' | 'image' = 'circle-avi', ) => { openLightbox({ @@ -239,6 +239,7 @@ let ProfileHeaderShell = ({ ) : ( ( ? shadow.followingUri : profile.viewer?.following, muted: 'muted' in shadow ? shadow.muted : profile.viewer?.muted, + mutedOnlyReposts: + 'mutedOnlyReposts' in shadow + ? shadow.mutedOnlyReposts + : profile.viewer?.mutedOnlyReposts, blocking: 'blockingUri' in shadow ? shadow.blockingUri : profile.viewer?.blocking, activitySubscription: 'activitySubscription' in shadow ? shadow.activitySubscription : profile.viewer?.activitySubscription, - }, + } satisfies AppBskyActorDefs.ViewerState, verification: 'verification' in shadow ? shadow.verification : profile.verification, status: diff --git a/src/state/queries/profile.ts b/src/state/queries/profile.ts index 526a9df8f..23fd4340a 100644 --- a/src/state/queries/profile.ts +++ b/src/state/queries/profile.ts @@ -449,9 +449,13 @@ export function useProfileMuteMutationQueue( }) const queueMute = useCallback(() => { - // optimistically update + /* + * Optimistically update. A full mute replaces any stored repost-only + * scope on the server, so clear it here too. + */ updateProfileShadow(queryClient, did, { muted: true, + mutedOnlyReposts: false, }) return queueToggle(true) }, [queryClient, did, queueToggle]) @@ -460,6 +464,7 @@ export function useProfileMuteMutationQueue( // optimistically update updateProfileShadow(queryClient, did, { muted: false, + mutedOnlyReposts: false, }) return queueToggle(false) }, [queryClient, did, queueToggle]) @@ -467,6 +472,65 @@ export function useProfileMuteMutationQueue( return [queueMute, queueUnmute] as const } +/** + * Toggles a repost-only mute: muting hides just the account's reposts, + * unmuting removes the mute entirely. Not applicable when the account is + * fully muted (viewer.muted). + */ +export function useProfileMuteRepostsMutationQueue( + profile: Shadow, +) { + const ax = useAnalytics() + const queryClient = useQueryClient() + const did = profile.did + const initialMutedOnlyReposts = !!profile.viewer?.mutedOnlyReposts + const muteRepostsMutation = useProfileMuteRepostsMutation() + const unmuteMutation = useProfileUnmuteMutation() + + const queueToggle = useToggleMutationQueue({ + initialState: initialMutedOnlyReposts, + runMutation: async (_prevMutedOnlyReposts, shouldMute) => { + if (shouldMute) { + await muteRepostsMutation.mutateAsync({ + did, + }) + ax.metric('profile:muteReposts', {}) + return true + } else { + await unmuteMutation.mutateAsync({ + did, + }) + ax.metric('profile:unmuteReposts', {}) + return false + } + }, + onSuccess(finalMutedOnlyReposts) { + // finalize + updateProfileShadow(queryClient, did, { + mutedOnlyReposts: finalMutedOnlyReposts, + }) + }, + }) + + const queueMuteReposts = useCallback(() => { + // optimistically update + updateProfileShadow(queryClient, did, { + mutedOnlyReposts: true, + }) + return queueToggle(true) + }, [queryClient, did, queueToggle]) + + const queueUnmuteReposts = useCallback(() => { + // optimistically update + updateProfileShadow(queryClient, did, { + mutedOnlyReposts: false, + }) + return queueToggle(false) + }, [queryClient, did, queueToggle]) + + return [queueMuteReposts, queueUnmuteReposts] as const +} + function useProfileMuteMutation() { const queryClient = useQueryClient() const agent = useAgent() @@ -480,6 +544,19 @@ function useProfileMuteMutation() { }) } +function useProfileMuteRepostsMutation() { + const queryClient = useQueryClient() + const agent = useAgent() + return useMutation({ + mutationFn: async ({did}) => { + await agent.mute(did, {onlyReposts: true}) + }, + onSuccess() { + void queryClient.invalidateQueries({queryKey: RQKEY_MY_MUTED()}) + }, + }) +} + function useProfileUnmuteMutation() { const queryClient = useQueryClient() const agent = useAgent() diff --git a/src/view/com/profile/ProfileMenu.tsx b/src/view/com/profile/ProfileMenu.tsx index 51e89f843..0ea99f802 100644 --- a/src/view/com/profile/ProfileMenu.tsx +++ b/src/view/com/profile/ProfileMenu.tsx @@ -15,6 +15,7 @@ import { useProfileBlockMutationQueue, useProfileFollowMutationQueue, useProfileMuteMutationQueue, + useProfileMuteRepostsMutationQueue, } from '#/state/queries/profile' import {useSession} from '#/state/session' import {EventStopper} from '#/view/com/util/EventStopper' @@ -28,20 +29,24 @@ import {ChainLink_Stroke2_Corner0_Rounded as ChainLinkIcon} from '#/components/i import {CircleCheck_Stroke2_Corner0_Rounded as CircleCheckIcon} from '#/components/icons/CircleCheck' import {CircleX_Stroke2_Corner0_Rounded as CircleXIcon} from '#/components/icons/CircleX' import {Clipboard_Stroke2_Corner2_Rounded as ClipboardIcon} from '#/components/icons/Clipboard' -import {DotGrid3x1_Stroke2_Corner0_Rounded as Ellipsis} from '#/components/icons/DotGrid' -import {Flag_Stroke2_Corner0_Rounded as Flag} from '#/components/icons/Flag' -import {ListSparkle_Stroke2_Corner0_Rounded as List} from '#/components/icons/ListSparkle' +import {DotGrid3x1_Stroke2_Corner0_Rounded as EllipsisIcon} from '#/components/icons/DotGrid' +import {Flag_Stroke2_Corner0_Rounded as FlagIcon} from '#/components/icons/Flag' +import {ListSparkle_Stroke2_Corner0_Rounded as ListIcon} from '#/components/icons/ListSparkle' import {Live_Stroke2_Corner0_Rounded as LiveIcon} from '#/components/icons/Live' import {MagnifyingGlass_Stroke2_Corner0_Rounded as SearchIcon} from '#/components/icons/MagnifyingGlass' -import {Mute_Stroke2_Corner0_Rounded as Mute} from '#/components/icons/Mute' -import {PeopleRemove2_Stroke2_Corner0_Rounded as UserMinus} from '#/components/icons/PeopleRemove2' +import {Mute_Stroke2_Corner0_Rounded as MuteIcon} from '#/components/icons/Mute' +import {PeopleRemove2_Stroke2_Corner0_Rounded as UserMinusIcon} from '#/components/icons/PeopleRemove2' import { - PersonCheck_Stroke2_Corner0_Rounded as PersonCheck, - PersonX_Stroke2_Corner0_Rounded as PersonX, + PersonCheck_Stroke2_Corner0_Rounded as PersonCheckIcon, + PersonX_Stroke2_Corner0_Rounded as PersonXIcon, } from '#/components/icons/Person' -import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus' -import {SpeakerVolumeFull_Stroke2_Corner0_Rounded as Unmute} from '#/components/icons/Speaker' -import {StarterPack} from '#/components/icons/StarterPack' +import {PlusLarge_Stroke2_Corner0_Rounded as PlusIcon} from '#/components/icons/Plus' +import { + Repost_Stroke2_Corner0_Rounded as RepostIcon, + RepostStrike_Stroke2_Corner0_Rounded as RepostStrikeIcon, +} from '#/components/icons/Repost' +import {SpeakerVolumeFull_Stroke2_Corner0_Rounded as UnmuteIcon} from '#/components/icons/Speaker' +import {StarterPack as StarterPackIcon} from '#/components/icons/StarterPack' import * as Menu from '#/components/Menu' import {BlockDialog} from '#/components/moderation/BlockDialog' import { @@ -93,6 +98,8 @@ let ProfileMenu = ({ const {mutate: saveNux} = useSaveNux() const [queueMute, queueUnmute] = useProfileMuteMutationQueue(profile) + const [queueMuteReposts, queueUnmuteReposts] = + useProfileMuteRepostsMutationQueue(profile) const [queueBlock, queueUnblock] = useProfileBlockMutationQueue(profile) const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue( profile, @@ -162,6 +169,40 @@ let ProfileMenu = ({ } }, [ax, profile.viewer?.muted, queueUnmute, l, queueMute]) + const onPressMuteReposts = useCallback(async () => { + if (profile.viewer?.mutedOnlyReposts) { + try { + await queueUnmuteReposts() + Toast.show( + l({message: 'Reposts will be shown in feeds', context: 'toast'}), + ) + } catch (err) { + const e = err as Error + if (e?.name !== 'AbortError') { + ax.logger.error('Failed to show reposts', {message: e}) + Toast.show(l`There was an issue! ${e.toString()}`, { + type: 'error', + }) + } + } + } else { + try { + await queueMuteReposts() + Toast.show( + l({message: 'Reposts will be hidden in feeds', context: 'toast'}), + ) + } catch (err) { + const e = err as Error + if (e?.name !== 'AbortError') { + ax.logger.error('Failed to hide reposts', {message: e}) + Toast.show(l`There was an issue! ${e.toString()}`, { + type: 'error', + }) + } + } + } + }, [ax, profile.viewer, queueUnmuteReposts, l, queueMuteReposts]) + const blockAccount = useCallback(async () => { if (profile.viewer?.blocking) { try { @@ -265,7 +306,7 @@ let ProfileMenu = ({ size="small" shape="round"> {statusNudgeActive && } - + {statusNudgeActive && } @@ -331,7 +372,9 @@ let ProfileMenu = ({ Follow account )} - + )} @@ -343,7 +386,7 @@ let ProfileMenu = ({ Add to starter packs - + Add to lists - + {isSelf && canGoLive && ( {!profile.viewer?.blocking && !profile.viewer?.mutedByList && ( - void onPressMuteAccount()}> - - {profile.viewer?.muted ? ( - Unmute account - ) : ( - Mute account - )} - - - + <> + {!profile.viewer?.muted && ( + void onPressMuteReposts()}> + + {profile.viewer?.mutedOnlyReposts ? ( + Show reposts in feeds + ) : ( + Hide reposts in feeds + )} + + + + )} + void onPressMuteAccount()}> + + {profile.viewer?.muted ? ( + Unmute account + ) : ( + Mute account + )} + + + + )} {!profile.viewer?.blockingByList && ( @@ -485,7 +559,7 @@ let ProfileMenu = ({ Report account - + )} -- knotmirror 0.0.1 From 1c349ad7da4fd835d3bc1067046292fc07f92271 Mon Sep 17 00:00:00 2001 From: DS Boyce <260543580+ds-boyce@users.noreply.github.com> Date: Thu, 6 Aug 2026 12:11:05 -0700 Subject: [PATCH 08/42] Add timestamp field to video report dialog (#11339) --- oxlint-suppressions.json | 11 --- src/analytics/metrics/types.ts | 1 + src/components/Dialog/index.tsx | 4 +- src/components/Dialog/index.web.tsx | 4 +- src/components/Dialog/types.ts | 1 + .../VideoEmbedInner/VideoEmbedInnerNative.tsx | 47 +++++---- .../VideoEmbedInner/VideoEmbedInnerWeb.tsx | 27 ++++-- .../VideoEmbedInner/web-controls/Scrubber.tsx | 2 +- .../web-controls/VideoControls.tsx | 3 +- .../VideoEmbedInner/web-controls/utils.tsx | 13 --- src/components/Post/Embed/index.tsx | 5 +- src/components/forms/Toggle/index.tsx | 1 + .../ReportDialogMetadataContext.tsx | 24 +++++ .../moderation/ReportDialog/action.ts | 24 ++++- .../moderation/ReportDialog/const.ts | 13 +++ .../moderation/ReportDialog/index.tsx | 95 ++++++++++++++++++- .../moderation/ReportDialog/state.test.ts | 40 ++++++++ .../moderation/ReportDialog/state.ts | 23 +++++ .../media/video/__tests__/formatTime.test.ts | 16 ++++ src/lib/media/video/formatTime.ts | 16 ++++ .../components/ThreadItemAnchor.tsx | 21 ++-- .../PostThread/components/ThreadItemPost.tsx | 17 ++-- .../components/ThreadItemTreePost.tsx | 19 ++-- src/screens/VideoFeed/components/Scrubber.tsx | 2 +- src/screens/VideoFeed/index.tsx | 26 ++++- src/view/com/post/Post.tsx | 23 +++-- src/view/com/posts/PostFeedItem.tsx | 43 +++++---- 27 files changed, 402 insertions(+), 119 deletions(-) create mode 100644 src/components/moderation/ReportDialog/ReportDialogMetadataContext.tsx create mode 100644 src/lib/media/video/__tests__/formatTime.test.ts create mode 100644 src/lib/media/video/formatTime.ts diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index 2aee77333..ae3513a25 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -244,17 +244,6 @@ "count": 3 } }, - "src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx": { - "typescript/no-floating-promises": { - "count": 2 - }, - "typescript/no-unsafe-enum-comparison": { - "count": 1 - }, - "typescript/no-unsafe-member-access": { - "count": 1 - } - }, "src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx": { "typescript/no-explicit-any": { "count": 2 diff --git a/src/analytics/metrics/types.ts b/src/analytics/metrics/types.ts index 9e5358e23..739b52f62 100644 --- a/src/analytics/metrics/types.ts +++ b/src/analytics/metrics/types.ts @@ -857,6 +857,7 @@ export type Events = { reason: string labeler: string details: boolean + videoTimestamp: boolean } 'reportDialog:failure': {} diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx index 4f48dfce8..4f6984a4a 100644 --- a/src/components/Dialog/index.tsx +++ b/src/components/Dialog/index.tsx @@ -62,6 +62,7 @@ export const Input = createInput(TextInput) export function Outer({ children, control, + onOpen, onClose, nativeOptions, testID, @@ -97,9 +98,10 @@ export function Outer({ const open = useCallback(() => { // Run any leftover callbacks that might have been queued up before calling `.open()` callQueuedCallbacks() + onOpen?.() setDialogIsOpen(control.id, true) ref.current?.present() - }, [setDialogIsOpen, control.id, callQueuedCallbacks]) + }, [setDialogIsOpen, control.id, callQueuedCallbacks, onOpen]) // This is the function that we call when we want to dismiss the dialog. const close = useCallback(cb => { diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 5363fbf1b..c26a71825 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -52,6 +52,7 @@ const preventDefault = (e: any) => e.preventDefault() export function Outer({ children, control, + onOpen, onClose, webOptions, }: React.PropsWithChildren) { @@ -61,9 +62,10 @@ export function Outer({ const {setDialogIsOpen} = useDialogStateControlContext() const open = useCallback(() => { + onOpen?.() setDialogIsOpen(control.id, true) setIsOpen(true) - }, [setIsOpen, setDialogIsOpen, control.id]) + }, [setIsOpen, setDialogIsOpen, control.id, onOpen]) const close = useCallback( cb => { diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts index 79c40942d..341cb6c36 100644 --- a/src/components/Dialog/types.ts +++ b/src/components/Dialog/types.ts @@ -60,6 +60,7 @@ export type DialogControlOpenOptions = { export type DialogOuterProps = { control: DialogControlProps + onOpen?: () => void onClose?: () => void nativeOptions?: Omit webOptions?: { diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerNative.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerNative.tsx index bead58fd9..bcc33ba50 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerNative.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerNative.tsx @@ -2,8 +2,7 @@ import {useImperativeHandle, useRef, useState} from 'react' import {Pressable, type StyleProp, View, type ViewStyle} from 'react-native' import {type AppBskyEmbedVideo} from '@atproto/api' import {BlueskyVideoView} from '@bsky.app/video' -import {msg} from '@lingui/core/macro' -import {useLingui} from '@lingui/react' +import {useLingui} from '@lingui/react/macro' import {HITSLOP_30} from '#/lib/constants' import {useAutoplayDisabled} from '#/state/preferences' @@ -16,6 +15,7 @@ import {Play_Filled_Corner0_Rounded as PlayIcon} from '#/components/icons/Play' import {SpeakerVolumeFull_Stroke2_Corner0_Rounded as UnmuteIcon} from '#/components/icons/Speaker' import {KeepAwake} from '#/components/KeepAwake' import {MediaInsetBorder} from '#/components/MediaInsetBorder' +import {useReportDialogMetadataContext} from '#/components/moderation/ReportDialog/ReportDialogMetadataContext' import {useVideoMuteState} from '#/components/Post/Embed/VideoEmbed/VideoVolumeContext' import {GifPresentationControls} from '../GifPresentationControls' import {TimeIndicator} from './TimeIndicator' @@ -39,11 +39,13 @@ export function VideoEmbedInnerNative({ */ onError?: (error: string) => void }) { - const {_} = useLingui() + const {t: l} = useLingui() const videoRef = useRef(null) const autoplayDisabled = useAutoplayDisabled() const isWithinMessage = useIsWithinMessage() const [muted, setMuted] = useVideoMuteState() + const reportDialogMetadata = useReportDialogMetadataContext() + const maxTimeRemainingSeconds = useRef(0) const [isPlaying, setIsPlaying] = useState(false) const [timeRemaining, setTimeRemaining] = useState(0) @@ -84,16 +86,30 @@ export function VideoEmbedInnerNative({ setIsPlaying(e.nativeEvent.status === 'playing') }} onTimeRemainingChange={e => { - setTimeRemaining(e.nativeEvent.timeRemaining) + const {timeRemaining} = e.nativeEvent + setTimeRemaining(timeRemaining) + if ( + !isGif && + reportDialogMetadata && + Number.isFinite(timeRemaining) && + timeRemaining >= 0 + ) { + maxTimeRemainingSeconds.current = Math.max( + maxTimeRemainingSeconds.current, + timeRemaining, + ) + reportDialogMetadata.current.videoTimestampSeconds = Math.max( + 0, + maxTimeRemainingSeconds.current - timeRemaining, + ) + } }} onError={e => { onError?.(e.nativeEvent.error) setError(e.nativeEvent.error) }} ref={videoRef} - accessibilityLabel={ - embed.alt ? _(msg`Video: ${embed.alt}`) : _(msg`Video`) - } + accessibilityLabel={embed.alt ? l`Video: ${embed.alt}` : l`Video`} accessibilityHint="" /> {isGif ? ( @@ -144,7 +160,7 @@ function VideoPresentationControls({ timeRemaining: number isPlaying: boolean }) { - const {_} = useLingui() + const {t: l} = useLingui() const t = useTheme() const [muted] = useVideoMuteState() @@ -159,14 +175,14 @@ function VideoPresentationControls({ {isPlaying ? ( @@ -175,15 +191,14 @@ function VideoPresentationControls({ )} {showTime && } - {muted ? ( diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx index 059924081..d20cc0d90 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx @@ -1,13 +1,13 @@ import {useCallback, useEffect, useId, useRef, useState} from 'react' import {View} from 'react-native' -import {msg} from '@lingui/core/macro' -import {useLingui} from '@lingui/react' +import {useLingui} from '@lingui/react/macro' import type * as HlsTypes from 'hls.js' import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback' import {atoms as a} from '#/alf' import {AltBadgeWithDialog} from '#/components/AltBadgeWithDialog' import {useFullscreen} from '#/components/hooks/useFullscreen' +import {useReportDialogMetadataContext} from '#/components/moderation/ReportDialog/ReportDialogMetadataContext' import * as BandwidthEstimate from './bandwidth-estimate' import { HLSFatalError, @@ -36,9 +36,10 @@ export function VideoEmbedInnerWeb({ const [hasSubtitleTrack, setHasSubtitleTrack] = useState(false) const [hlsLoading, setHlsLoading] = useState(false) const figId = useId() - const {_} = useLingui() + const {t: l} = useLingui() const [isFullscreen] = useFullscreen(containerRef) const isGif = embed.presentation === 'gif' + const reportDialogMetadata = useReportDialogMetadataContext() // send error up to error boundary const [error, setError] = useState(null) @@ -63,7 +64,7 @@ export function VideoEmbedInnerWeb({ return (
@@ -76,7 +77,16 @@ export function VideoEmbedInnerWeb({ muted={embed.presentation === 'gif' || !focused} aria-labelledby={embed.alt ? figId : undefined} onTimeUpdate={e => { - lastKnownTime.current = e.currentTarget.currentTime + const currentTime = e.currentTarget.currentTime + lastKnownTime.current = currentTime + if ( + !isGif && + reportDialogMetadata && + Number.isFinite(currentTime) && + currentTime >= 0 + ) { + reportDialogMetadata.current.videoTimestampSeconds = currentTime + } }} loop={loop} /> @@ -141,9 +151,10 @@ type CachedPromise = Promise & {value: undefined | T} const promiseForHls = import( // @ts-ignore 'hls.js/dist/hls.min' + // oxlint-disable-next-line typescript/no-unsafe-member-access ).then(mod => mod.default) as CachedPromise promiseForHls.value = undefined -promiseForHls.then(Hls => { +void promiseForHls.then(Hls => { promiseForHls.value = Hls }) @@ -166,7 +177,7 @@ function useHLS({ useEffect(() => { if (!Hls) { setHlsLoading(true) - promiseForHls.then(loadedHls => { + void promiseForHls.then(loadedHls => { setHls(() => loadedHls) setHlsLoading(false) }) @@ -303,7 +314,7 @@ function useHLS({ hls.on(Hls.Events.ERROR, (_event, data) => { if (data.fatal) { if ( - data.details === 'manifestLoadError' && + (data.details as string) === 'manifestLoadError' && data.response?.code === 404 ) { setError(new VideoNotFoundError()) diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx index 13fe496a4..7ee85107d 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx @@ -3,11 +3,11 @@ import {View} from 'react-native' import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' +import {formatTime} from '#/lib/media/video/formatTime' import {clamp} from '#/lib/numbers' import {atoms as a, useTheme, web} from '#/alf' import {useInteractionState} from '#/components/hooks/useInteractionState' import {IS_WEB_FIREFOX, IS_WEB_TOUCH_DEVICE} from '#/env' -import {formatTime} from './utils' export function Scrubber({ duration, diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx index 57f52e2f2..e852db3b2 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx @@ -4,6 +4,7 @@ import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' import {Trans} from '@lingui/react/macro' +import {formatTime} from '#/lib/media/video/formatTime' import {clamp} from '#/lib/numbers' import { useAutoplayDisabled, @@ -31,7 +32,7 @@ import {GifPresentationControls} from '../../GifPresentationControls' import {TimeIndicator} from '../TimeIndicator' import {ControlButton} from './ControlButton' import {Scrubber} from './Scrubber' -import {formatTime, useVideoElement} from './utils' +import {useVideoElement} from './utils' import {type ControlsProps} from './VideoControls.shared' import {VolumeControl} from './VolumeControl' diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx index 164b214ce..9c0f644b5 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx @@ -238,16 +238,3 @@ export function useVideoElement(ref: RefObject) { canPlay, } } - -export function formatTime(time: number) { - if (isNaN(time)) { - return '--' - } - - time = Math.round(time) - - const minutes = Math.floor(time / 60) - const seconds = String(time % 60).padStart(2, '0') - - return `${minutes}:${seconds}` -} diff --git a/src/components/Post/Embed/index.tsx b/src/components/Post/Embed/index.tsx index c715dbd3a..02d20caf1 100644 --- a/src/components/Post/Embed/index.tsx +++ b/src/components/Post/Embed/index.tsx @@ -23,6 +23,7 @@ import {useInteractionState} from '#/components/hooks/useInteractionState' import {GalleryBleed} from '#/components/images/Gallery' import {ContentHider} from '#/components/moderation/ContentHider' import {PostAlerts} from '#/components/moderation/PostAlerts' +import * as ReportDialogMetadataContext from '#/components/moderation/ReportDialog/ReportDialogMetadataContext' import {StandardSiteEmbed} from '#/components/Post/Embed/StandardSiteEmbed' import {isStandardSiteEmbed} from '#/components/Post/Embed/StandardSiteEmbed/utils' import {RichText} from '#/components/RichText' @@ -311,7 +312,7 @@ export function QuoteEmbed({ } = useInteractionState() const contents = ( - <> + )} - + ) return ( diff --git a/src/components/forms/Toggle/index.tsx b/src/components/forms/Toggle/index.tsx index a62a82b62..6d5f8f2a8 100644 --- a/src/components/forms/Toggle/index.tsx +++ b/src/components/forms/Toggle/index.tsx @@ -82,6 +82,7 @@ export type ItemProps = ViewStyleProp & { children: ((props: ItemState) => React.ReactNode) | React.ReactNode hitSlop?: PressableProps['hitSlop'] highlightRow?: boolean + testID?: string } export function useItemContext() { diff --git a/src/components/moderation/ReportDialog/ReportDialogMetadataContext.tsx b/src/components/moderation/ReportDialog/ReportDialogMetadataContext.tsx new file mode 100644 index 000000000..b4f0c205f --- /dev/null +++ b/src/components/moderation/ReportDialog/ReportDialogMetadataContext.tsx @@ -0,0 +1,24 @@ +import {createContext, useContext, useRef} from 'react' + +export type ReportDialogMetadata = { + videoTimestampSeconds?: number +} + +export type ReportDialogMetadataRef = React.RefObject + +const Context = createContext(null) +Context.displayName = 'ReportDialogMetadataContext' + +/** + * Scopes report metadata to a rendered subject. The mutable ref lets media + * events update metadata without rerendering the post on every playback tick. + */ +export function Provider({children}: React.PropsWithChildren) { + const metadata = useRef({}) + + return {children} +} + +export function useReportDialogMetadataContext() { + return useContext(Context) +} diff --git a/src/components/moderation/ReportDialog/action.ts b/src/components/moderation/ReportDialog/action.ts index ac702abd6..20303ddef 100644 --- a/src/components/moderation/ReportDialog/action.ts +++ b/src/components/moderation/ReportDialog/action.ts @@ -1,5 +1,6 @@ import { type $Typed, + BSKY_LABELER_DID, type ChatBskyConvoDefs, type ComAtprotoModerationCreateReport, } from '@atproto/api' @@ -9,7 +10,7 @@ import {useMutation} from '@tanstack/react-query' import {logger} from '#/logger' import {useAgent} from '#/state/session' -import {NEW_TO_OLD_REASONS_MAP} from './const' +import {NEW_TO_OLD_REASONS_MAP, REPORT_MOD_TOOL_NAME} from './const' import {type ReportState} from './state' import {type ParsedReportSubject} from './types' @@ -21,9 +22,15 @@ export function useSubmitReportMutation() { async mutationFn({ subject, state, + videoTimestampSeconds, }: { subject: ParsedReportSubject state: ReportState + /** + * How far the viewer watched when the dialog opened, if the subject is a + * post with a video. + */ + videoTimestampSeconds?: number }) { if (!state.selectedOption) { throw new Error(_(msg`Please select a reason for this report`)) @@ -115,6 +122,21 @@ export function useSubmitReportMutation() { } } + const modToolMeta = + state.includeVideoTimestamp && + videoTimestampSeconds != null && + subject.type === 'post' && + labeler.creator.did === BSKY_LABELER_DID + ? {videoTimestampSeconds} + : undefined + + if (modToolMeta) { + report.modTool = { + name: REPORT_MOD_TOOL_NAME, + meta: modToolMeta, + } + } + if (__DEV__) { logger.info('Submitting report (dry run)', { labeler: { diff --git a/src/components/moderation/ReportDialog/const.ts b/src/components/moderation/ReportDialog/const.ts index 8f5f16db9..727b2f90e 100644 --- a/src/components/moderation/ReportDialog/const.ts +++ b/src/components/moderation/ReportDialog/const.ts @@ -1,14 +1,27 @@ +import {applicationId} from 'expo-application' import { ComAtprotoModerationDefs as RootReportDefs, ToolsOzoneReportDefs as OzoneReportDefs, } from '@atproto/api' import {type ParsedReportSubject} from '#/components/moderation/ReportDialog/types' +import {IS_ANDROID, IS_IOS, IS_WEB} from '#/env' export const DMCA_LINK = 'https://bsky.social/about/support/copyright' export const SUPPORT_PAGE = 'https://bsky.social/about/support' export const NCII_FORM = 'https://forms.bsky.app/f/ncii' +/** + * Identifies this client as the source of a report. + */ +export const REPORT_MOD_TOOL_NAME = IS_IOS + ? `bsky-app/ios/${applicationId}` + : IS_ANDROID + ? `bsky-app/android/${applicationId}` + : IS_WEB + ? `bsky-web/${window.location.hostname}` + : 'bsky' // Should never occur + export const NEW_TO_OLD_REASON_MAPPING: Record = {} /** diff --git a/src/components/moderation/ReportDialog/index.tsx b/src/components/moderation/ReportDialog/index.tsx index 6f405372f..7c63d04a4 100644 --- a/src/components/moderation/ReportDialog/index.tsx +++ b/src/components/moderation/ReportDialog/index.tsx @@ -11,6 +11,7 @@ import {type AppBskyLabelerDefs, BSKY_LABELER_DID} from '@atproto/api' import {Trans, useLingui} from '@lingui/react/macro' import {wait} from '#/lib/async/wait' +import {formatTime} from '#/lib/media/video/formatTime' import {getLabelingServiceTitle} from '#/lib/moderation' import {useCallOnce} from '#/lib/once' import {sanitizeHandle} from '#/lib/strings/handles' @@ -22,6 +23,7 @@ import * as Admonition from '#/components/Admonition' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {useGlobalDialogsControlContext} from '#/components/dialogs/Context' +import * as Toggle from '#/components/forms/Toggle' import {useDelayedLoading} from '#/components/hooks/useDelayedLoading' import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as Retry} from '#/components/icons/ArrowRotate' import { @@ -46,6 +48,7 @@ import { } from './const' import {useCopyForSubject} from './copy' import {classifyReportError} from './errors' +import {useReportDialogMetadataContext} from './ReportDialogMetadataContext' import { getNciiQualificationOutcome, initialState, @@ -79,19 +82,47 @@ export function ReportDialog( }, ) { const ax = useAnalytics() + const reportDialogMetadata = useReportDialogMetadataContext() const subject = useMemo( () => (props.subject ? parseReportSubject(props.subject) : undefined), [props.subject], ) + const [presentation, setPresentation] = useState<{ + openCount: number + videoTimestampSeconds?: number + }>({openCount: 0}) + const onOpen = useCallback(() => { + const seconds = + subject?.type === 'post' && subject.attributes.video + ? reportDialogMetadata?.current.videoTimestampSeconds + : undefined + + setPresentation(current => ({ + openCount: current.openCount + 1, + // Values below one second indicate that the video was never meaningfully + // played, so avoid offering to attach a noisy "0:00" timestamp. + videoTimestampSeconds: + seconds !== undefined && seconds >= 1 ? Math.floor(seconds) : undefined, + })) + }, [reportDialogMetadata, subject]) const propsOnClose = props.onClose const onClose = useCallback(() => { ax.metric('reportDialog:close', {}) propsOnClose?.() }, [ax, propsOnClose]) return ( - + - {subject ? : } + {subject ? ( + + ) : ( + + )} ) } @@ -118,7 +149,11 @@ function Invalid() { ) } -function Inner(props: ReportDialogProps) { +function Inner( + props: ReportDialogProps & { + videoTimestampSeconds?: number + }, +) { const ax = useAnalytics() const logger = ax.logger.useChild(ax.logger.Context.ReportDialog) const t = useTheme() @@ -142,6 +177,8 @@ function Inner(props: ReportDialogProps) { const [isPending, setIsPending] = useState(false) const [isSuccess, setIsSuccess] = useState(false) + const {videoTimestampSeconds} = props + // some reasons ONLY go to Bluesky const isBskyOnlyReason = state?.selectedOption?.reason ? BSKY_LABELER_ONLY_REPORT_REASONS.has(state.selectedOption.reason) @@ -230,6 +267,7 @@ function Inner(props: ReportDialogProps) { submitReport({ subject: props.subject, state, + videoTimestampSeconds, }), ) setIsSuccess(true) @@ -237,6 +275,7 @@ function Inner(props: ReportDialogProps) { reason: state.selectedOption?.reason ?? '', labeler: state.selectedLabeler?.creator.handle ?? '', details: !!state.details, + videoTimestamp: state.includeVideoTimestamp, }) // give time for user feedback setTimeout(() => { @@ -282,7 +321,7 @@ function Inner(props: ReportDialogProps) { } finally { setIsPending(false) } - }, [logger, submitReport, props, state, ax, l]) + }, [logger, submitReport, props, state, ax, l, videoTimestampSeconds]) useCallOnce(() => { ax.metric('reportDialog:open', { @@ -602,6 +641,18 @@ function Inner(props: ReportDialogProps) { )} + + {videoTimestampSeconds !== undefined && + state.selectedLabeler?.creator.did === BSKY_LABELER_DID && ( + { + dispatch({type: 'setIncludeVideoTimestamp', include}) + }} + /> + )} +