From e9dac9098211ec873270ed5cbaa4a5d1907b8121 Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Tue, 25 Aug 2026 17:27:44 +0200 Subject: [PATCH] Use block comment syntax for the multiline notes CLAUDE.md reserves `//` for single-line comments. Co-Authored-By: Claude Opus 5 (1M context) --- src/components/Dialog/index.web.tsx | 6 ++++-- src/components/dialogs/lists/CreateOrEditListDialog.tsx | 6 ++++-- src/screens/CustomFeed/components/CustomFeedHeader.tsx | 8 +++++--- src/screens/Onboarding/StepFinished/index.tsx | 6 ++++-- src/screens/ProfileList/components/Header.tsx | 6 ++++-- src/view/com/composer/photos/OpenCameraBtn.tsx | 8 +++++--- src/view/com/feeds/ComposerPrompt.tsx | 6 ++++-- src/view/com/util/UserBanner.tsx | 8 +++++--- 8 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 1c619777d7..ee74da6249 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -73,8 +73,10 @@ export function Outer({ setIsOpen(false) try { - // Nested rather than `&&`: React Compiler cannot lower a logical - // expression in a test position inside a `try`. + /* + * Nested rather than `&&`: React Compiler cannot lower a logical + * expression in a test position inside a `try`. + */ if (cb) { if (typeof cb === 'function') { // This timeout ensures that the callback runs at the same time as it would on native. I.e. diff --git a/src/components/dialogs/lists/CreateOrEditListDialog.tsx b/src/components/dialogs/lists/CreateOrEditListDialog.tsx index 482428e76b..0e8f5ed5a4 100644 --- a/src/components/dialogs/lists/CreateOrEditListDialog.tsx +++ b/src/components/dialogs/lists/CreateOrEditListDialog.tsx @@ -221,8 +221,10 @@ function DialogInner({ const onPressSave = useCallback(async () => { setImageError('') setDisplayNameTooShort(false) - // Hoisted above the `try`: React Compiler cannot lower a conditional - // expression inside one. + /* + * Hoisted above the `try`: React Compiler cannot lower a conditional + * expression inside one. + */ const updatedMessage = isCurateList ? _(msg({message: 'User list updated', context: 'toast'})) : _(msg({message: 'Moderation list updated', context: 'toast'})) diff --git a/src/screens/CustomFeed/components/CustomFeedHeader.tsx b/src/screens/CustomFeed/components/CustomFeedHeader.tsx index a7531e4726..6582b43115 100644 --- a/src/screens/CustomFeed/components/CustomFeedHeader.tsx +++ b/src/screens/CustomFeed/components/CustomFeedHeader.tsx @@ -450,9 +450,11 @@ function DialogInner({ const feedRkey = useMemo(() => new AtUri(info.uri).rkey, [info.uri]) const onToggleLiked = async () => { - // Hoisted out of the `try`: React Compiler cannot lower a logical - // expression in a test position there, and the `else` below rules out - // splitting this into nested ifs. + /* + * Hoisted out of the `try`: React Compiler cannot lower a logical + * expression in a test position there, and the `else` below rules out + * splitting this into nested ifs. + */ const shouldUnlike = isLiked && likeUri try { playHaptic() diff --git a/src/screens/Onboarding/StepFinished/index.tsx b/src/screens/Onboarding/StepFinished/index.tsx index e868200e37..69b8008b0b 100644 --- a/src/screens/Onboarding/StepFinished/index.tsx +++ b/src/screens/Onboarding/StepFinished/index.tsx @@ -94,8 +94,10 @@ export function StepFinished() { } } - // Hoisted above the `try`: React Compiler cannot lower these inside one, and - // `listItems` is already settled by the earlier try/catch. + /* + * Hoisted above the `try`: React Compiler cannot lower these inside one, and + * `listItems` is already settled by the earlier try/catch. + */ const followDids = [ BSKY_APP_ACCOUNT_DID, ...(listItems?.map(i => i.subject.did) ?? []), diff --git a/src/screens/ProfileList/components/Header.tsx b/src/screens/ProfileList/components/Header.tsx index 7a3716a243..071ca34f23 100644 --- a/src/screens/ProfileList/components/Header.tsx +++ b/src/screens/ProfileList/components/Header.tsx @@ -64,8 +64,10 @@ export function Header({ const onTogglePinned = async () => { playHaptic() - // Hoisted above the `try`: inside it, `pinned` is `!savedFeedConfig.pinned`, - // which is `!isPinned` on the branch that uses this. + /* + * Hoisted above the `try`: inside it, `pinned` is `!savedFeedConfig.pinned`, + * which is `!isPinned` on the branch that uses this. + */ const pinnedMessage = !isPinned ? _(msg`Pinned to your feeds`) : _(msg`Unpinned from your feeds`) diff --git a/src/view/com/composer/photos/OpenCameraBtn.tsx b/src/view/com/composer/photos/OpenCameraBtn.tsx index 89743626b4..085233ff11 100644 --- a/src/view/com/composer/photos/OpenCameraBtn.tsx +++ b/src/view/com/composer/photos/OpenCameraBtn.tsx @@ -22,9 +22,11 @@ export function OpenCameraBtn({disabled, onAdd}: OpenCameraBtnProps) { const mediaGranted = mediaPermissionRes?.granted const mediaCanAskAgain = mediaPermissionRes?.canAskAgain - // No useCallback: with the diagnostics above resolved this component compiles, - // so React Compiler memoizes it, and the hand-written deps were what it could - // not preserve. + /* + * No useCallback: with the diagnostics above resolved this component compiles, + * so React Compiler memoizes it, and the hand-written deps were what it could + * not preserve. + */ const onPressTakePicture = async () => { try { if (!(await requestCameraAccessIfNeeded())) { diff --git a/src/view/com/feeds/ComposerPrompt.tsx b/src/view/com/feeds/ComposerPrompt.tsx index 9e3dd4d7a5..22f55e8631 100644 --- a/src/view/com/feeds/ComposerPrompt.tsx +++ b/src/view/com/feeds/ComposerPrompt.tsx @@ -131,8 +131,10 @@ export function ComposerPrompt() { }, ] - // Statement form rather than a ternary: React Compiler cannot lower a - // conditional expression inside a `try`, and `imageUris` is built here. + /* + * Statement form rather than a ternary: React Compiler cannot lower a + * conditional expression inside a `try`, and `imageUris` is built here. + */ let nativeImageUris if (IS_NATIVE) { nativeImageUris = imageUris diff --git a/src/view/com/util/UserBanner.tsx b/src/view/com/util/UserBanner.tsx index ab3cf785cd..a807165f38 100644 --- a/src/view/com/util/UserBanner.tsx +++ b/src/view/com/util/UserBanner.tsx @@ -79,9 +79,11 @@ export function UserBanner({ try { if (IS_NATIVE) { - // Nested rather than `?.()`: React Compiler cannot lower an optional - // call inside a `try`. Like `?.()`, this leaves the arguments - // unevaluated when the callback is absent. + /* + * Nested rather than `?.()`: React Compiler cannot lower an optional + * call inside a `try`. Like `?.()`, this leaves the arguments + * unevaluated when the callback is absent. + */ if (onSelectNewBanner) { onSelectNewBanner( await compressIfNeeded(