@devries-cameron20 / t3code-1 / commits / 001111c360
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

perf(mobile): pull request screens compile with the React Compiler (#21136)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 18, 2026 at 14:33 UTC 001111c360d336c3873acc247b12d610db135bce
14 files changed +387 -409
apps/mobile/src/features/pull-requests/PullRequestDiscussionScreen.tsx
+20 -15
@@ -2,7 +2,11 @@ import { Toolbar } from "../../components/ui/Toolbar";
2 import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
3 import { useAtomRefresh } from "@effect/atom-react";
4 import { useNavigation, type StaticScreenProps } from "@react-navigation/native";
5 -import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
5 +import {
6 + type AtomCommandResult,
7 + squashAtomCommandFailure,
8 +} from "@t3tools/client-runtime/state/runtime";
9 +import { AsyncResult } from "effect/reactivity";
10 import type { PullRequestThreadComment } from "@t3tools/contracts";
11 import { useRef, useState } from "react";
12 import { Platform, ScrollView, View } from "react-native";
@@ -59,57 +63,58 @@ function Discussion({ params }: { params: PullRequestParams & { readonly discuss
63 const [error, setError] = useState<string | null>(null);
64 const [notice, setNotice] = useState<string | null>(null);
65 const [composerHeight, setComposerHeight] = useState(64);
62 - const operation = async (run: () => Promise<void>) => {
66 + const operation = async (run: () => Promise<AtomCommandResult<unknown, unknown> | undefined>) => {
67 if (pending.current) return;
68 pending.current = true;
69 setBusy(true);
70 setError(null);
71 setNotice(null);
68 - try {
69 - await run();
70 - } catch (cause) {
72 + const result = await run();
73 + pending.current = false;
74 + setBusy(false);
75 + if (result && AsyncResult.isFailure(result)) {
76 + const cause = squashAtomCommandFailure(result);
77 setError(
78 cause instanceof Error ? cause.message : "The provider could not complete this action.",
79 );
74 - } finally {
75 - pending.current = false;
76 - setBusy(false);
80 }
81 };
82 const post = () =>
83 operation(async () => {
81 - if (!permissions.canReply || !body.trim() || !thread) return;
84 + if (!permissions.canReply || !body.trim() || !thread) return undefined;
85 const submitted = body;
86 const response = await reply({
87 ...target,
88 input: { ...target.input, threadId: thread.id, body: submitted },
89 });
87 - if (response._tag === "Failure") throw squashAtomCommandFailure(response);
90 + if (AsyncResult.isFailure(response)) return response;
91 setBody((current) => (current === submitted ? "" : current));
92 setNotice("Reply posted.");
93 refresh();
94 + return response;
95 });
96 const toggleResolved = () =>
97 operation(async () => {
94 - if (!thread || !permissions.canResolve) return;
98 + if (!thread || !permissions.canResolve) return undefined;
99 const response = await resolve({
100 ...target,
101 input: { ...target.input, threadId: thread.id, resolved: !thread.isResolved },
102 });
99 - if (response._tag === "Failure") throw squashAtomCommandFailure(response);
100 - refresh();
103 + if (AsyncResult.isSuccess(response)) refresh();
104 + return response;
105 });
106 const nextCursor = cursor === undefined ? thread?.nextCommentsCursor : cursor;
107 const more = () =>
108 operation(async () => {
105 - if (!thread || !nextCursor) return;
109 + if (!thread || !nextCursor) return undefined;
110 const response = await loadMore({
111 ...target,
112 input: { ...target.input, threadId: thread.id, cursor: nextCursor },
113 });
110 - if (response._tag === "Failure") throw squashAtomCommandFailure(response);
114 + if (AsyncResult.isFailure(response)) return response;
115 setExtra((comments) => [...comments, ...response.value.comments]);
116 setCursor(response.value.nextCursor);
117 + return response;
118 });
119 const comments = [
120 ...new Map(
apps/mobile/src/features/pull-requests/PullRequestInlineCommentScreen.tsx
+9 -9
@@ -1,6 +1,8 @@
1 +import { settlePromise } from "@t3tools/client-runtime/state/runtime";
2 +import { AsyncResult } from "effect/reactivity";
3 import * as Dialog from "../../components/ui/Dialog";
4 import { useFocusEffect, useNavigation, type StaticScreenProps } from "@react-navigation/native";
3 -import { useCallback, useRef, useState } from "react";
5 +import { useRef, useState } from "react";
6 import { View } from "react-native";
7 import type { PullRequestReviewPosition } from "@t3tools/contracts";
8 import { AppText as Text, AppTextInput as TextInput } from "../../components/ui/AppText";
@@ -31,7 +33,7 @@ export function PullRequestInlineCommentScreen({ route }: StaticScreenProps<Inli
33 const body = editedBody ?? saved?.body ?? "";
34 const detail = useEnvironmentQuery(composerPullRequests.detail(pullRequestTarget(params)));
35 const { refresh: refreshDetail } = detail;
34 - useFocusEffect(useCallback(() => refreshDetail(), [refreshDetail]));
36 + useFocusEffect(() => refreshDetail());
37 const permissions = usePullRequestPermissions(params, detail.data);
38 const stale = detail.data && detail.data.headSha !== params.headSha;
39 const pending = useRef(false);
@@ -64,13 +66,11 @@ export function PullRequestInlineCommentScreen({ route }: StaticScreenProps<Inli
66 },
67 ],
68 }));
67 - try {
68 - await store.flush();
69 - navigation.goBack();
70 - } finally {
71 - pending.current = false;
72 - setBusy(false);
73 - }
69 + // flush reports write failures through the draft store's error field.
70 + const result = await settlePromise(() => store.flush());
71 + pending.current = false;
72 + setBusy(false);
73 + if (AsyncResult.isSuccess(result)) navigation.goBack();
74 };
75 return (
76 <PullRequestSheetContent
apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx
+33 -35
@@ -98,47 +98,45 @@ export function PullRequestMergeControls(props: {
98 return;
99 pending.current = true;
100 setBusy(true);
101 - try {
102 - const response = await runAction({
103 - ...target,
104 - input: {
105 - ...target.input,
106 - action,
107 - ...(action === "merge" && method && stack.stack && scope
101 + const response = await runAction({
102 + ...target,
103 + input: {
104 + ...target.input,
105 + action,
106 + ...(action === "merge" && method && stack.stack && scope
107 + ? {
108 + stackNumber: stack.stack.number,
109 + expectedStackHeads: scope.heads,
110 + mergeMethod: method,
111 + }
112 + : action === "merge" && method
113 ? {
109 - stackNumber: stack.stack.number,
110 - expectedStackHeads: scope.heads,
111 - mergeMethod: method,
114 + resolveMergeMethod: (fresh) => {
115 + if (
116 + !canPerformPullRequestAction(fresh, "merge") ||
117 + !allowedMergeMethods(fresh).includes(method)
118 + )
119 + throw new Error("The pull request changed. Refresh before merging.");
120 + return method;
121 + },
122 }
113 - : action === "merge" && method
114 - ? {
115 - resolveMergeMethod: (fresh) => {
116 - if (
117 - !canPerformPullRequestAction(fresh, "merge") ||
118 - !allowedMergeMethods(fresh).includes(method)
119 - )
120 - throw new Error("The pull request changed. Refresh before merging.");
121 - return method;
122 - },
123 - }
124 - : action === "enable-auto-merge" && method
125 - ? { mergeMethod: method }
126 - : {}),
127 - },
128 - });
129 - if (response._tag === "Failure") throw squashAtomCommandFailure(response);
130 - } catch (cause) {
123 + : action === "enable-auto-merge" && method
124 + ? { mergeMethod: method }
125 + : {}),
126 + },
127 + });
128 + // A stack can partly merge before the provider reports a failure.
129 + refreshDetail();
130 + refreshActivity();
131 + stack.refresh();
132 + pending.current = false;
133 + setBusy(false);
134 + if (AsyncResult.isFailure(response)) {
135 + const cause = squashAtomCommandFailure(response);
136 Dialog.alert(
137 "Couldn't complete the merge action",
138 cause instanceof Error ? cause.message : "Try again.",
139 );
135 - } finally {
136 - // A stack can partly merge before the provider reports a failure.
137 - refreshDetail();
138 - refreshActivity();
139 - stack.refresh();
140 - pending.current = false;
141 - setBusy(false);
140 }
141 };
142 const confirm = (action: "merge" | "enable-auto-merge" | "disable-auto-merge") => {
apps/mobile/src/features/pull-requests/PullRequestReviewSheet.tsx
+10 -8
@@ -1,9 +1,10 @@
1 +import { AsyncResult } from "effect/reactivity";
2 import { useAtomRefresh } from "@effect/atom-react";
3 import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
4 import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
4 -import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
5 +import { settlePromise, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
6 import type { PullRequestReviewVerdict } from "@t3tools/contracts";
6 -import { useCallback, useRef, useState } from "react";
7 +import { useRef, useState } from "react";
8 import { useFocusEffect } from "@react-navigation/native";
9 import { Platform, Pressable, View } from "react-native";
10 import { clearSubmittedReview } from "./pullRequestReviewDrafts";
@@ -31,20 +32,21 @@ function useActionSubmission(params: PullRequestParams) {
32 pending.current = true;
33 setBusy(true);
34 setError(null);
34 - try {
35 + const result = await settlePromise(async () => {
36 await operation();
37 refreshDetail();
38 refreshActivity();
39 navigation.goBack();
39 - } catch (cause) {
40 + });
41 + pending.current = false;
42 + setBusy(false);
43 + if (AsyncResult.isFailure(result)) {
44 + const cause = squashAtomCommandFailure(result);
45 setError(
46 cause instanceof Error
47 ? cause.message
48 : "The provider could not complete this action. Try again.",
49 );
45 - } finally {
46 - pending.current = false;
47 - setBusy(false);
50 }
51 };
52 return { busy, error, submit };
@@ -66,7 +68,7 @@ export function PullRequestReviewSheet({
68 const target = pullRequestTarget(params);
69 const result = useEnvironmentQuery(composerPullRequests.detail(target));
70 const { refresh: refreshDetail } = result;
69 - useFocusEffect(useCallback(() => refreshDetail(), [refreshDetail]));
71 + useFocusEffect(() => refreshDetail());
72 const permissions = usePullRequestPermissions(params, result.data);
73 const submission = useActionSubmission(params);
74 const review = useAtomCommand(composerPullRequests.submitReview, { reportFailure: false });
apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsx
+21 -21
@@ -1,3 +1,4 @@
1 +import { AsyncResult } from "effect/reactivity";
2 import { Toolbar } from "../../components/ui/Toolbar";
3 import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
4 import { usePullRequestConnected } from "./usePullRequestConnected";
@@ -5,7 +6,7 @@ import { useAtomValue } from "@effect/atom-react";
6 import { useNavigation, type StaticScreenProps } from "@react-navigation/native";
7 import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
8 import type { PullRequestReviewerCandidate } from "@t3tools/contracts";
8 -import { useEffect, useMemo, useRef, useState } from "react";
9 +import { useEffect, useRef, useState } from "react";
10 import {
11 FlatList,
12 Platform,
@@ -79,7 +80,7 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
80 const [pending, setPending] = useState<string | null>(null);
81 const [error, setError] = useState<string | null>(null);
82 const inFlight = useRef(false);
82 - const candidates = useMemo(() => {
83 + const candidates = (() => {
84 const needle = query.trim().toLowerCase();
85 return [...(result.data?.candidates ?? [])]
86 .filter((candidate) =>
@@ -88,7 +89,7 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
89 .sort(
90 (a, b) => Number(b.isRequested) - Number(a.isRequested) || a.login.localeCompare(b.login),
91 );
91 - }, [result.data, query]);
92 + })();
93 useEffect(() => {
94 if (candidates.length === 0) return;
95 listRef.current?.scrollToOffset({
@@ -103,27 +104,26 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
104 inFlight.current = true;
105 setPending(`${candidate.kind}:${candidate.id}`);
106 setError(null);
106 - try {
107 - const response = await request({
108 - ...target,
109 - input: {
110 - ...target.input,
111 - reviewers: [{ id: candidate.id, kind: candidate.kind }],
112 - requested: !candidate.isRequested,
113 - },
114 - });
115 - if (response._tag === "Failure") throw squashAtomCommandFailure(response);
116 - if (!pr?.capabilities.reviewers.listCandidates) {
117 - setQuery("");
118 - detail.refresh();
119 - }
120 - } catch (cause) {
107 + const response = await request({
108 + ...target,
109 + input: {
110 + ...target.input,
111 + reviewers: [{ id: candidate.id, kind: candidate.kind }],
112 + requested: !candidate.isRequested,
113 + },
114 + });
115 + inFlight.current = false;
116 + setPending(null);
117 + if (AsyncResult.isFailure(response)) {
118 + const cause = squashAtomCommandFailure(response);
119 setError(
120 cause instanceof Error ? cause.message : "Couldn't update this review request. Try again.",
121 );
124 - } finally {
125 - inFlight.current = false;
126 - setPending(null);
122 + return;
123 + }
124 + if (!pr?.capabilities.reviewers.listCandidates) {
125 + setQuery("");
126 + detail.refresh();
127 }
128 };
129 const listCandidates = pr?.capabilities.reviewers.listCandidates === true;
apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
+49 -62
@@ -50,7 +50,7 @@ import { type PullRequestDetail, type PullRequestListEntry } from "@t3tools/cont
50 import { PullRequestOverviewLoading } from "./PullRequestOverviewLoading";
51 import { copyPullRequestLink, sharePullRequestLink } from "./pullRequestLink";
52 import { pullRequestStatus } from "./pullRequestStatus";
53 -import { useCallback, useEffect, useMemo, useRef, useState } from "react";
53 +import { useEffect, useRef, useState } from "react";
54 import {
55 Linking,
56 Platform,
@@ -139,11 +139,8 @@ function PullRequestTabScrollView(props: ScrollViewProps) {
139 function usePullRequestActivityRows(params: PullRequestParams, filter: ActivityFilter) {
140 const navigation = useNavigation();
141 const result = useEnvironmentQuery(composerPullRequests.activity(requestTarget(params)));
142 - const filtered = useMemo(
143 - () => (result.data ? filterPullRequestActivity(result.data, filter) : null),
144 - [result.data, filter],
145 - );
146 - const rows = useMemo(() => {
142 + const filtered = result.data ? filterPullRequestActivity(result.data, filter) : null;
143 + const rows = (() => {
144 if (!filtered) return [];
145 const rows = pullRequestTimelineRows(filtered.activity, params, navigation);
146 if (filter.newestFirst) {
@@ -162,7 +159,7 @@ function usePullRequestActivityRows(params: PullRequestParams, filter: ActivityF
159 ),
160 });
161 return rows;
165 - }, [filtered, filter.newestFirst, params, navigation]);
162 + })();
163 return {
164 rows,
165 hiddenCount: filtered?.hiddenCount ?? 0,
@@ -340,7 +337,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
337 const result = useEnvironmentQuery(detailAtom);
338 const pullRefresh = usePullToRefresh(detailAtom);
339 const { refresh: refreshDetail } = result;
343 - useFocusEffect(useCallback(() => refreshDetail(), [refreshDetail]));
340 + useFocusEffect(() => refreshDetail());
341 const pr = result.data;
342 const summary = params.initialSummary;
343 const identity = pr ?? summary;
@@ -791,7 +788,7 @@ export function PullRequestFileRouteScreen({
788 );
789 const detail = useEnvironmentQuery(composerPullRequests.detail(requestTarget(route.params)));
790 const { refresh: refreshDetail } = detail;
794 - useFocusEffect(useCallback(() => refreshDetail(), [refreshDetail]));
791 + useFocusEffect(() => refreshDetail());
792 const { loadMore } = result;
793 const parsed = filter.parsed;
794 const reviewDraft = usePullRequestReviewDraft(route.params);
@@ -813,16 +810,12 @@ export function PullRequestFileRouteScreen({
810 !result.isPending &&
811 !result.error;
812 const activity = useEnvironmentQuery(composerPullRequests.activity(requestTarget(route.params)));
816 - const baseData = useMemo(() => buildNativeReviewDiffData(parsed), [parsed]);
817 - const data = useMemo(
818 - () =>
819 - annotatePullRequestDiff(
820 - baseData,
821 - staleDiff || commit ? [] : (activity.data?.reviewThreads ?? []),
822 - commit ? [] : reviewDraft.draft.comments,
823 - diffHead.sha ?? undefined,
824 - ),
825 - [baseData, activity.data, reviewDraft.draft.comments, diffHead.sha, staleDiff, commit],
813 + const baseData = buildNativeReviewDiffData(parsed);
814 + const data = annotatePullRequestDiff(
815 + baseData,
816 + staleDiff || commit ? [] : (activity.data?.reviewThreads ?? []),
817 + commit ? [] : reviewDraft.draft.comments,
818 + diffHead.sha ?? undefined,
819 );
820 const viewedIds = data.files
821 .filter((file) => (commit ? commitViewedPaths.has(file.path) : viewed.isViewed(file.path)))
@@ -916,49 +909,43 @@ export function PullRequestFileRouteScreen({
909 if (!targetFile) loadMore();
910 }, [targetFile, loadMore]);
911 const { onDebug: updateVisibleRange } = bridge;
919 - const onDebug = useCallback<NonNullable<NativeReviewDiffViewProps["onDebug"]>>(
920 - (event) => {
921 - const drawn = isNativeReviewDiffDrawEvent(event.nativeEvent);
922 - const decoded =
923 - event.nativeEvent.message === "rows-decoded" && event.nativeEvent.rows === data.rows.length;
924 - if (!drawn && !decoded) return;
925 - // Filtering replaces the native row payload asynchronously. Old draw events
926 - // must not consume the file jump or highlight the new payload's row indices.
927 - if (
928 - typeof event.nativeEvent.totalRows === "number" &&
929 - event.nativeEvent.totalRows !== data.rows.length
930 - )
931 - return;
932 - if (drawn) updateVisibleRange(event);
933 - if (
934 - targetFile &&
935 - !jumpStarted.current &&
936 - nativeView.current &&
937 - (Platform.OS !== "ios" || decoded)
938 - ) {
939 - jumpStarted.current = true;
940 - if (focusIndex >= 0) return;
941 - void nativeView.current.scrollToFile(targetFile.id, false).catch(() => {
942 - jumpStarted.current = false;
943 - });
944 - return;
945 - }
946 - if (!drawn) return;
947 - const lastRow = event.nativeEvent.lastRowIndex;
948 - if (typeof lastRow === "number" && lastRow >= data.rows.length - 40) loadMore();
949 - },
950 - [updateVisibleRange, data.rows.length, loadMore, targetFile, focusIndex],
951 - );
952 - const onToggleFile = useCallback<NonNullable<NativeReviewDiffViewProps["onToggleFile"]>>(
953 - (event) => {
954 - const id = event.nativeEvent.fileId;
955 - if (!id) return;
956 - setCollapsedIds((ids) =>
957 - ids.includes(id) ? ids.filter((value) => value !== id) : [...ids, id],
958 - );
959 - },
960 - [],
961 - );
912 + const onDebug: NonNullable<NativeReviewDiffViewProps["onDebug"]> = (event) => {
913 + const drawn = isNativeReviewDiffDrawEvent(event.nativeEvent);
914 + const decoded =
915 + event.nativeEvent.message === "rows-decoded" && event.nativeEvent.rows === data.rows.length;
916 + if (!drawn && !decoded) return;
917 + // Filtering replaces the native row payload asynchronously. Old draw events
918 + // must not consume the file jump or highlight the new payload's row indices.
919 + if (
920 + typeof event.nativeEvent.totalRows === "number" &&
921 + event.nativeEvent.totalRows !== data.rows.length
922 + )
923 + return;
924 + if (drawn) updateVisibleRange(event);
925 + if (
926 + targetFile &&
927 + !jumpStarted.current &&
928 + nativeView.current &&
929 + (Platform.OS !== "ios" || decoded)
930 + ) {
931 + jumpStarted.current = true;
932 + if (focusIndex >= 0) return;
933 + void nativeView.current.scrollToFile(targetFile.id, false).catch(() => {
934 + jumpStarted.current = false;
935 + });
936 + return;
937 + }
938 + if (!drawn) return;
939 + const lastRow = event.nativeEvent.lastRowIndex;
940 + if (typeof lastRow === "number" && lastRow >= data.rows.length - 40) loadMore();
941 + };
942 + const onToggleFile: NonNullable<NativeReviewDiffViewProps["onToggleFile"]> = (event) => {
943 + const id = event.nativeEvent.fileId;
944 + if (!id) return;
945 + setCollapsedIds((ids) =>
946 + ids.includes(id) ? ids.filter((value) => value !== id) : [...ids, id],
947 + );
948 + };
949 const visibleFile = data.files.find((file) => file.id === visibleFileId) ?? targetFile;
950 const toggleTestFiles = () => {
951 setJumpPath(visibleFile?.path ?? route.params.path);
apps/mobile/src/features/pull-requests/guide/PullRequestGuideScreen.tsx
+16 -14
@@ -2,7 +2,7 @@ import { Toolbar } from "../../../components/ui/Toolbar";
2 import { parsePatchFiles } from "@pierre/diffs/utils/parsePatchFiles";
3 import type { FileDiffMetadata } from "@pierre/diffs";
4 import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
5 -import { useEffect, useMemo } from "react";
5 +import { useEffect } from "react";
6 import { Platform, Pressable, View } from "react-native";
7 import { AndroidScreenHeader } from "../../../components/ui/AndroidScreenHeader";
8 import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -102,19 +102,8 @@ export function PullRequestGuideStopScreen({ route }: StaticScreenProps<GuideSto
102 const position = Math.max(0, Math.min(route.params.position, (guide?.stops.length ?? 1) - 1));
103 const stop = guide?.stops[Math.max(0, position)];
104 const diff = usePullRequestDiff(route.params);
105 - const excerptFiles = useMemo(() => {
106 - const files = new Map<string, FileDiffMetadata>();
107 - try {
108 - for (const patch of parsePatchFiles(diff.patch)) {
109 - for (const file of patch.files) {
110 - files.set(file.name, file);
111 - if (file.prevName) files.set(file.prevName, file);
112 - }
113 - }
114 - } catch {}
115 - return files;
116 - }, [diff.patch]);
117 - const wanted = useMemo(() => (stop ? stopFilePaths(stop) : []), [stop]);
105 + const excerptFiles = diffFilesByPath(diff.patch);
106 + const wanted = stop ? stopFilePaths(stop) : [];
107 const loadedPaths = new Set(
108 diff.parsed.kind === "files" ? diff.parsed.files.map((file) => file.path) : [],
109 );
@@ -332,3 +321,16 @@ export function PullRequestGuideStopScreen({ route }: StaticScreenProps<GuideSto
321 </View>
322 );
323 }
324 +
325 +function diffFilesByPath(patchText: string): Map<string, FileDiffMetadata> {
326 + const files = new Map<string, FileDiffMetadata>();
327 + try {
328 + for (const patch of parsePatchFiles(patchText)) {
329 + for (const file of patch.files) {
330 + files.set(file.name, file);
331 + if (file.prevName) files.set(file.prevName, file);
332 + }
333 + }
334 + } catch {}
335 + return files;
336 +}
apps/mobile/src/features/pull-requests/guide/ReviewGuideExcerpt.tsx
+20 -15
@@ -1,4 +1,4 @@
1 -import { useMemo, useState } from "react";
1 +import { useState } from "react";
2 import { Pressable, View } from "react-native";
3 import type { FileDiffMetadata } from "@pierre/diffs";
4 import type { PullRequestReviewGuideExcerpt } from "@t3tools/contracts";
@@ -28,19 +28,8 @@ export function ReviewGuideExcerpt({
28 }) {
29 const { nativeReviewDiffStyle, codeWordBreak } = useAppearanceCodeSurface();
30 const { themeAppearance } = useAppearancePreferences();
31 - const slice = useMemo(() => {
32 - try {
33 - if (!file) return "";
34 - return rowsToPatch(
35 - excerpt.path,
36 - file.prevName ?? excerpt.path,
37 - excerptRows(fileDiffRows(file), excerpt),
38 - );
39 - } catch {
40 - return "";
41 - }
42 - }, [file, excerpt]);
43 - const data = useMemo(() => {
31 + const slice = excerptPatch(file, excerpt);
32 + const data = (() => {
33 const parsed = buildNativeReviewDiffData(
34 buildReviewParsedDiff(slice, `guide:${excerpt.path}:${excerpt.start}`),
35 );
@@ -48,7 +37,7 @@ export function ReviewGuideExcerpt({
37 ...parsed,
38 rows: parsed.rows.filter((row) => row.kind !== "file" && row.kind !== "hunk"),
39 };
51 - }, [slice, excerpt.path, excerpt.start]);
40 + })();
41 const bridge = useNativeReviewDiffBridge({
42 threadKey: null,
43 sectionId: `guide:${excerpt.path}:${excerpt.start}`,
@@ -132,3 +121,19 @@ export function ReviewGuideExcerpt({
121 </View>
122 );
123 }
124 +
125 +function excerptPatch(
126 + file: FileDiffMetadata | undefined,
127 + excerpt: PullRequestReviewGuideExcerpt,
128 +): string {
129 + if (!file) return "";
130 + try {
131 + return rowsToPatch(
132 + excerpt.path,
133 + file.prevName ?? excerpt.path,
134 + excerptRows(fileDiffRows(file), excerpt),
135 + );
136 + } catch {
137 + return "";
138 + }
139 +}
apps/mobile/src/features/pull-requests/guide/useReviewGuide.ts
+15 -19
@@ -1,7 +1,8 @@
1 import { useAtomValue } from "@effect/atom-react";
2 import { useFocusEffect } from "@react-navigation/native";
3 import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
4 -import { useCallback, useRef, useState } from "react";
4 +import { AsyncResult } from "effect/reactivity";
5 +import { useRef, useState } from "react";
6 import { usePullRequestConnected } from "../usePullRequestConnected";
7 import { composerPullRequests } from "../../../state/pull-requests";
8 import { useEnvironmentQuery } from "../../../state/query";
@@ -33,29 +34,24 @@ export function useReviewGuide(params: PullRequestParams) {
34 const pending = useRef(false);
35 const running = starting || query.data?.run?._tag === "Running";
36 const refresh = query.refresh;
36 - useFocusEffect(
37 - useCallback(() => {
38 - if (!enabled) return;
39 - refresh();
40 - if (!running) return;
41 - const timer = setInterval(refresh, 5_000);
42 - return () => clearInterval(timer);
43 - }, [enabled, refresh, running]),
44 - );
37 + useFocusEffect(() => {
38 + if (!enabled) return;
39 + refresh();
40 + if (!running) return;
41 + const timer = setInterval(refresh, 5_000);
42 + return () => clearInterval(timer);
43 + });
44 const write = async () => {
45 if (!enabled || !canWrite || running || pending.current) return;
46 pending.current = true;
47 setStarting(true);
48 setError(null);
50 - try {
51 - const result = await generate(target);
52 - if (result._tag === "Failure") {
53 - const cause = squashAtomCommandFailure(result);
54 - setError(cause instanceof Error ? cause.message : "Could not start the review guide.");
55 - }
56 - } finally {
57 - pending.current = false;
58 - setStarting(false);
49 + const result = await generate(target);
50 + pending.current = false;
51 + setStarting(false);
52 + if (AsyncResult.isFailure(result)) {
53 + const cause = squashAtomCommandFailure(result);
54 + setError(cause instanceof Error ? cause.message : "Could not start the review guide.");
55 }
56 };
57 return { ...query, enabled, canWrite, running, write, startError: error };
apps/mobile/src/features/pull-requests/usePullRequestAction.ts
+12 -12
@@ -1,3 +1,4 @@
1 +import { AsyncResult } from "effect/reactivity";
2 import * as Dialog from "../../components/ui/Dialog";
3 import { useAtomRefresh } from "@effect/atom-react";
4 import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
@@ -27,23 +28,22 @@ export function usePullRequestAction(params: PullRequestParams, pr: PullRequestD
28 if (pending.current || !available(action)) return;
29 pending.current = true;
30 setBusy(true);
30 - try {
31 - const response = await run({
32 - ...target,
33 - input: { ...target.input, action, ...(updateMethod ? { updateMethod } : {}) },
34 - });
35 - if (response._tag === "Failure") throw squashAtomCommandFailure(response);
36 - refreshDetail();
37 - refreshActivity();
38 - } catch (cause) {
31 + const response = await run({
32 + ...target,
33 + input: { ...target.input, action, ...(updateMethod ? { updateMethod } : {}) },
34 + });
35 + pending.current = false;
36 + setBusy(false);
37 + if (AsyncResult.isFailure(response)) {
38 + const cause = squashAtomCommandFailure(response);
39 Dialog.alert(
40 "Couldn't update this pull request",
41 cause instanceof Error ? cause.message : "Try again.",
42 );
43 - } finally {
44 - pending.current = false;
45 - setBusy(false);
43 + return;
44 }
45 + refreshDetail();
46 + refreshActivity();
47 };
48 const confirm = (action: PullRequestAction, title: string, message: string) =>
49 Dialog.alert(title, message, [
apps/mobile/src/features/pull-requests/usePullRequestListActions.ts
+144 -151
@@ -1,10 +1,14 @@
1 import * as Dialog from "../../components/ui/Dialog";
2 import { RegistryContext, useAtomValue } from "@effect/atom-react";
3 import { useNavigation } from "@react-navigation/native";
4 -import { executeAtomQuery, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
4 +import {
5 + executeAtomQuery,
6 + settlePromise,
7 + squashAtomCommandFailure,
8 +} from "@t3tools/client-runtime/state/runtime";
9 import type { EnvironmentId, PullRequestAction } from "@t3tools/contracts";
6 -import { Atom } from "effect/reactivity";
7 -import { use, useCallback, useMemo, useRef, useState } from "react";
10 +import { Atom, AsyncResult } from "effect/reactivity";
11 +import { use, useRef, useState } from "react";
12 import { Linking, Platform } from "react-native";
13 import type { MenuProps } from "../../components/ui/Menu.types";
14 import { composerPullRequests } from "../../state/pull-requests";
@@ -30,172 +34,161 @@ export function usePullRequestListActions(
34 const navigation = useNavigation();
35 const selectAndroidWorkspace = useAndroidWorkspaceSelection();
36 const permissionKey = JSON.stringify(environmentIds);
33 - const permissionAtom = useMemo(() => {
37 + const permissionAtom = (() => {
38 const ids: readonly EnvironmentId[] = JSON.parse(permissionKey);
39 return Atom.make(
40 (get) => new Set(ids.filter((id) => get(composerPullRequests.runAction.permissionAtom(id)))),
41 );
38 - }, [permissionKey]);
42 + })();
43 const writableEnvironments = useAtomValue(permissionAtom);
44 const run = useAtomCommand(composerPullRequests.runAction, { reportFailure: false });
45 const pending = useRef(false);
46 const [busyKey, setBusyKey] = useState<string | null>(null);
43 - const params = useCallback(
44 - (entry: EnvironmentPullRequestListEntry) => ({
45 - environmentId: String(entry.environmentId),
46 - projectId: String(entry.projectId),
47 - host: entry.host,
48 - repository: entry.repository,
49 - number: entry.number,
50 - initialSummary: entry,
51 - }),
52 - [],
53 - );
54 - const perform = useCallback(
55 - async (
56 - entry: EnvironmentPullRequestListEntry,
57 - action: PullRequestAction | "request-review",
58 - ) => {
59 - const { environmentId } = entry;
60 - if (pending.current) return;
61 - pending.current = true;
62 - setBusyKey(scopedPullRequestListKey(entry));
63 - try {
64 - const target = pullRequestTarget(params(entry));
65 - // List rows do not subscribe to expensive detail reads.
66 - const response = await executeAtomQuery(registry, composerPullRequests.detail(target), {
67 - refresh: true,
68 - reportFailure: false,
69 - });
70 - if (response._tag === "Failure") throw squashAtomCommandFailure(response);
71 - const pr = response.value;
72 - if (action === "request-review") {
73 - if (
74 - !registry.get(composerPullRequests.requestReviewers.permissionAtom(environmentId)) ||
75 - pr.state !== "open" ||
76 - !pr.capabilities.reviewers.request ||
77 - !pr.viewerPermissions.requestReviewers
78 - )
79 - throw new Error("Review requests aren't available for this pull request.");
80 - if (Platform.OS === "android") {
81 - selectAndroidWorkspace({ name: "PullRequest", params: params(entry) }, params(entry));
82 - } else navigation.navigate("PullRequestReviewers", params(entry));
83 - return;
84 - }
47 + const params = (entry: EnvironmentPullRequestListEntry) => ({
48 + environmentId: String(entry.environmentId),
49 + projectId: String(entry.projectId),
50 + host: entry.host,
51 + repository: entry.repository,
52 + number: entry.number,
53 + initialSummary: entry,
54 + });
55 + const perform = async (
56 + entry: EnvironmentPullRequestListEntry,
57 + action: PullRequestAction | "request-review",
58 + ) => {
59 + const { environmentId } = entry;
60 + if (pending.current) return;
61 + pending.current = true;
62 + setBusyKey(scopedPullRequestListKey(entry));
63 + const result = await settlePromise(async () => {
64 + const target = pullRequestTarget(params(entry));
65 + // List rows do not subscribe to expensive detail reads.
66 + const response = await executeAtomQuery(registry, composerPullRequests.detail(target), {
67 + refresh: true,
68 + reportFailure: false,
69 + });
70 + if (response._tag === "Failure") throw squashAtomCommandFailure(response);
71 + const pr = response.value;
72 + if (action === "request-review") {
73 if (
86 - !registry.get(composerPullRequests.runAction.permissionAtom(environmentId)) ||
87 - !canPerformPullRequestAction(pr, action)
74 + !registry.get(composerPullRequests.requestReviewers.permissionAtom(environmentId)) ||
75 + pr.state !== "open" ||
76 + !pr.capabilities.reviewers.request ||
77 + !pr.viewerPermissions.requestReviewers
78 )
89 - throw new Error("This action isn't available for this pull request.");
90 - const result = await run({ ...target, input: { ...target.input, action } });
91 - if (result._tag === "Failure") throw squashAtomCommandFailure(result);
92 - onChanged(
93 - entry,
94 - action === "close"
95 - ? { state: "closed" }
96 - : action === "reopen"
97 - ? { state: "open" }
98 - : { isDraft: action === "draft" },
99 - );
100 - } catch (cause) {
101 - Dialog.alert(
102 - "Couldn't update this pull request",
103 - cause instanceof Error ? cause.message : "Try again.",
104 - );
105 - } finally {
106 - pending.current = false;
107 - setBusyKey(null);
108 - }
109 - },
110 - [registry, navigation, params, run, onChanged, selectAndroidWorkspace],
111 - );
112 - const select = useCallback(
113 - (entry: EnvironmentPullRequestListEntry, action: string) => {
114 - if (action === "open") {
115 - if (Platform.OS === "android")
116 - selectAndroidWorkspace({ name: "PullRequest", params: params(entry) });
117 - else navigation.navigate("PullRequest", params(entry));
118 - return;
119 - }
120 - if (action === "request-review") {
121 - void perform(entry, action);
122 - return;
123 - }
124 - if (action === "copy") {
125 - copyPullRequestLink(entry);
126 - return;
127 - }
128 - if (action === "provider") {
129 - void Linking.openURL(entry.url);
130 - return;
131 - }
132 - if (action === "share") {
133 - sharePullRequestLink(entry);
79 + throw new Error("Review requests aren't available for this pull request.");
80 + if (Platform.OS === "android") {
81 + selectAndroidWorkspace({ name: "PullRequest", params: params(entry) }, params(entry));
82 + } else navigation.navigate("PullRequestReviewers", params(entry));
83 return;
84 }
136 - const supported = (["close", "reopen", "ready", "draft"] as const).find(
137 - (value) => value === action,
85 + if (
86 + !registry.get(composerPullRequests.runAction.permissionAtom(environmentId)) ||
87 + !canPerformPullRequestAction(pr, action)
88 + )
89 + throw new Error("This action isn't available for this pull request.");
90 + const result = await run({ ...target, input: { ...target.input, action } });
91 + if (result._tag === "Failure") throw squashAtomCommandFailure(result);
92 + onChanged(
93 + entry,
94 + action === "close"
95 + ? { state: "closed" }
96 + : action === "reopen"
97 + ? { state: "open" }
98 + : { isDraft: action === "draft" },
99 );
139 - if (!supported) return;
140 - Dialog.alert(`${PR_ACTION_LABELS[supported]}?`, `#${entry.number} · ${entry.title}`, [
141 - { text: "Cancel", style: "cancel" },
142 - {
143 - text: PR_ACTION_LABELS[supported],
144 - style: supported === "close" ? "destructive" : "default",
145 - onPress: () => void perform(entry, supported),
146 - },
147 - ]);
148 - },
149 - [navigation, params, perform, selectAndroidWorkspace],
150 - );
151 - const actions = useCallback(
152 - (entry: EnvironmentPullRequestListEntry): MenuProps["actions"] => [
100 + });
101 + pending.current = false;
102 + setBusyKey(null);
103 + if (AsyncResult.isFailure(result)) {
104 + const cause = squashAtomCommandFailure(result);
105 + Dialog.alert(
106 + "Couldn't update this pull request",
107 + cause instanceof Error ? cause.message : "Try again.",
108 + );
109 + }
110 + };
111 + const select = (entry: EnvironmentPullRequestListEntry, action: string) => {
112 + if (action === "open") {
113 + if (Platform.OS === "android")
114 + selectAndroidWorkspace({ name: "PullRequest", params: params(entry) });
115 + else navigation.navigate("PullRequest", params(entry));
116 + return;
117 + }
118 + if (action === "request-review") {
119 + void perform(entry, action);
120 + return;
121 + }
122 + if (action === "copy") {
123 + copyPullRequestLink(entry);
124 + return;
125 + }
126 + if (action === "provider") {
127 + void Linking.openURL(entry.url);
128 + return;
129 + }
130 + if (action === "share") {
131 + sharePullRequestLink(entry);
132 + return;
133 + }
134 + const supported = (["close", "reopen", "ready", "draft"] as const).find(
135 + (value) => value === action,
136 + );
137 + if (!supported) return;
138 + Dialog.alert(`${PR_ACTION_LABELS[supported]}?`, `#${entry.number} · ${entry.title}`, [
139 + { text: "Cancel", style: "cancel" },
140 {
154 - id: "open",
155 - title: "Open pull request",
156 - image: Platform.OS === "ios" ? "arrow.up.right" : "open_in_new",
141 + text: PR_ACTION_LABELS[supported],
142 + style: supported === "close" ? "destructive" : "default",
143 + onPress: () => void perform(entry, supported),
144 },
158 - ...(writableEnvironments.has(entry.environmentId) && entry.state === "open"
145 + ]);
146 + };
147 + const actions = (entry: EnvironmentPullRequestListEntry): MenuProps["actions"] => [
148 + {
149 + id: "open",
150 + title: "Open pull request",
151 + image: Platform.OS === "ios" ? "arrow.up.right" : "open_in_new",
152 + },
153 + ...(writableEnvironments.has(entry.environmentId) && entry.state === "open"
154 + ? [
155 + {
156 + id: "request-review",
157 + title: "Request review",
158 + image: Platform.OS === "ios" ? "person.badge.plus" : "person_add",
159 + },
160 + {
161 + id: entry.isDraft ? "ready" : "draft",
162 + title: entry.isDraft ? "Mark ready for review" : "Convert to draft",
163 + image: Platform.OS === "ios" ? "pencil" : "edit",
164 + },
165 + {
166 + id: "close",
167 + title: "Close pull request",
168 + image: Platform.OS === "ios" ? "xmark" : "close",
169 + attributes: { destructive: true },
170 + },
171 + ]
172 + : writableEnvironments.has(entry.environmentId) && entry.state === "closed"
173 ? [
174 {
161 - id: "request-review",
162 - title: "Request review",
163 - image: Platform.OS === "ios" ? "person.badge.plus" : "person_add",
164 - },
165 - {
166 - id: entry.isDraft ? "ready" : "draft",
167 - title: entry.isDraft ? "Mark ready for review" : "Convert to draft",
168 - image: Platform.OS === "ios" ? "pencil" : "edit",
169 - },
170 - {
171 - id: "close",
172 - title: "Close pull request",
173 - image: Platform.OS === "ios" ? "xmark" : "close",
174 - attributes: { destructive: true },
175 + id: "reopen",
176 + title: "Reopen pull request",
177 + image: Platform.OS === "ios" ? "arrow.clockwise" : "refresh",
178 },
179 ]
177 - : writableEnvironments.has(entry.environmentId) && entry.state === "closed"
178 - ? [
179 - {
180 - id: "reopen",
181 - title: "Reopen pull request",
182 - image: Platform.OS === "ios" ? "arrow.clockwise" : "refresh",
183 - },
184 - ]
185 - : []),
186 - {
187 - id: "share",
188 - title: "Share…",
189 - image: Platform.OS === "ios" ? "square.and.arrow.up" : "share",
190 - },
191 - { id: "copy", title: "Copy link", image: Platform.OS === "ios" ? "link" : "link" },
192 - {
193 - id: "provider",
194 - title: openOnProviderLabel(entry.provider),
195 - image: Platform.OS === "ios" ? "safari" : "open_in_browser",
196 - },
197 - ],
198 - [writableEnvironments],
199 - );
180 + : []),
181 + {
182 + id: "share",
183 + title: "Share…",
184 + image: Platform.OS === "ios" ? "square.and.arrow.up" : "share",
185 + },
186 + { id: "copy", title: "Copy link", image: Platform.OS === "ios" ? "link" : "link" },
187 + {
188 + id: "provider",
189 + title: openOnProviderLabel(entry.provider),
190 + image: Platform.OS === "ios" ? "safari" : "open_in_browser",
191 + },
192 + ];
193 return { actions, select, busyKey };
194 }
apps/mobile/src/features/pull-requests/usePullRequestListControls.ts
+30 -30
@@ -1,6 +1,5 @@
1 import { useAtomSet, useAtomValue } from "@effect/atom-react";
2 import { AsyncResult } from "effect/reactivity";
3 -import { useCallback } from "react";
3
4 import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
5 import { DEFAULT_PR_LIST_CONTROLS, type PullRequestListControls } from "./pullRequestList";
@@ -12,36 +11,37 @@ export function usePullRequestListControls() {
11 ? preferences.value.pullRequestListFilters
12 : undefined;
13 const environmentId = saved?.environmentId ?? null;
15 - const controlsFor = useCallback(
16 - (environment: string | null) => saved?.controls[environment ?? ""] ?? DEFAULT_PR_LIST_CONTROLS,
17 - [saved],
18 - );
19 - const setEnvironmentId = useCallback(
20 - (next: string | null) =>
21 - savePreferences({
22 - transform: (current) => ({
23 - pullRequestListFilters: {
24 - controls: current.pullRequestListFilters?.controls ?? {},
25 - environmentId: next,
26 - },
27 - }),
14 + const controlsFor = (environment: string | null) =>
15 + saved?.controls[environment ?? ""] ?? DEFAULT_PR_LIST_CONTROLS;
16 + const setEnvironmentId = (next: string | null) =>
17 + savePreferences({
18 + transform: (current) => ({
19 + pullRequestListFilters: {
20 + controls: current.pullRequestListFilters?.controls ?? {},
21 + environmentId: next,
22 + },
23 }),
29 - [savePreferences],
30 - );
31 - const setControls = useCallback(
32 - (environment: string | null, controls: PullRequestListControls) =>
33 - savePreferences({
34 - transform: (current) => ({
35 - pullRequestListFilters: {
36 - environmentId: current.pullRequestListFilters?.environmentId ?? null,
37 - controls: {
38 - ...current.pullRequestListFilters?.controls,
39 - [environment ?? ""]: controls,
40 - },
41 - },
42 - }),
24 + });
25 + const setControls = (environment: string | null, controls: PullRequestListControls) =>
26 + savePreferences({
27 + transform: (current) => ({
28 + pullRequestListFilters: {
29 + environmentId: current.pullRequestListFilters?.environmentId ?? null,
30 + controls: withEnvironmentControls(
31 + current.pullRequestListFilters?.controls,
32 + environment ?? "",
33 + controls,
34 + ),
35 + },
36 }),
44 - [savePreferences],
45 - );
37 + });
38 return { environmentId, controlsFor, setEnvironmentId, setControls } as const;
39 }
40 +
41 +function withEnvironmentControls(
42 + saved: Readonly<Record<string, PullRequestListControls>> | undefined,
43 + environment: string,
44 + controls: PullRequestListControls,
45 +): Record<string, PullRequestListControls> {
46 + return { ...saved, [environment]: controls };
47 +}
apps/mobile/src/features/pull-requests/usePullRequestThreads.ts
+8 -5
@@ -1,3 +1,5 @@
1 +import { AsyncResult } from "effect/reactivity";
2 +import { settlePromise, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
3 import * as Dialog from "../../components/ui/Dialog";
4 import { useNavigation, useNavigationState, useRoute } from "@react-navigation/native";
5 import { threadPullRequestLinkMode } from "@t3tools/client-runtime/thread-pull-request-compatibility";
@@ -83,7 +85,7 @@ export function usePullRequestThreads(
85 if (!pr || !canAsk || pending.current) return;
86 pending.current = true;
87 setBusy(true);
86 - try {
88 + const result = await settlePromise(async () => {
89 if (connected && !thread && !canCheckout)
90 throw new Error("Starting work from this PR requires source control write access.");
91 await waitForComposerDraftsLoaded();
@@ -148,11 +150,12 @@ export function usePullRequestThreads(
150 screen: "NewTaskDraft",
151 params: { draftId: draftKey, title: `Ask about #${pr.number}` },
152 });
151 - } catch (cause) {
153 + });
154 + pending.current = false;
155 + setBusy(false);
156 + if (AsyncResult.isFailure(result)) {
157 + const cause = squashAtomCommandFailure(result);
158 Dialog.alert("Couldn't open a thread", cause instanceof Error ? cause.message : "Try again.");
153 - } finally {
154 - pending.current = false;
155 - setBusy(false);
159 }
160 };
161 return {
apps/mobile/src/reactCompilerCoverage.test.ts
-13
@@ -28,19 +28,6 @@ const KNOWN_BAILOUTS: Record<string, string> = {
28 "src/features/diffs/nativeReviewDiffSurface.ts": "ref read during render",
29 "src/features/home/thread-swipe-actions.tsx": "ref read during render",
30 "src/features/projects/AddProjectScreen.tsx": "try without catch",
31 - "src/features/pull-requests/PullRequestDiscussionScreen.tsx": "try/finally",
32 - "src/features/pull-requests/PullRequestInlineCommentScreen.tsx": "try without catch",
33 - "src/features/pull-requests/PullRequestMergeControls.tsx": "throw inside try, try/finally",
34 - "src/features/pull-requests/PullRequestReviewSheet.tsx": "try/finally",
35 - "src/features/pull-requests/PullRequestReviewersScreen.tsx": "throw inside try, try/finally",
36 - "src/features/pull-requests/PullRequestRouteScreen.tsx": "manual memo not preserved",
37 - "src/features/pull-requests/guide/PullRequestGuideScreen.tsx": "conditional inside try",
38 - "src/features/pull-requests/guide/ReviewGuideExcerpt.tsx": "conditional inside try",
39 - "src/features/pull-requests/guide/useReviewGuide.ts": "try without catch",
40 - "src/features/pull-requests/usePullRequestAction.ts": "throw inside try, try/finally",
41 - "src/features/pull-requests/usePullRequestListActions.ts": "throw inside try, try/finally",
42 - "src/features/pull-requests/usePullRequestListControls.ts": "unsupported syntax",
43 - "src/features/pull-requests/usePullRequestThreads.ts": "throw inside try, try/finally",
31 "src/features/terminal/ThreadTerminalRouteScreen.tsx": "ref read during render",
32 "src/features/threads/NewTaskContextPickerScreens.tsx":
33 "manual memo not preserved, try without catch",