@devries-cameron20 / t3code Mirror · read-only / commits / 762b047f67
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 17:00 UTC

chore(lint): React effects can't grow past each file's budget (#24964)

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

Julius Marminge committed Oct 25, 2026 at 14:14 UTC 762b047f673aa68fb892b2ea9d53798183ea300b
6 files changed +548
AGENTS.md
+1
@@ -194,6 +194,7 @@ Architecture and its constraints: `docs/internals/overview.md`. Glossary: `docs/
194 options, and pass combinators as additional function-builder arguments.
195 - Inferred types over annotations. `any` is the enemy.
196 - Default to no comment. Write one only for a constraint, an external quirk, or an invariant the code can't show, in one line where you can and four at most. Don't restate names or signatures, narrate steps, record history, or explain the fix you just made; the PR carries that. `t3code/no-low-value-comments` enforces the length cap and the mechanical cases.
197 +- React effects are a last resort: derive in render, act in handlers, reset with `key`, or use a ref callback or store. The `t3code/react-effect-budget` lint rule holds each file to its entry in `scripts/effect-budget.json`; raise an entry only in the PR that needs the effect, and lower it when you remove one.
198 - Our users drive agents all day and notice a dropped frame, a lying spinner, and a stale label. No continuously repainting animations; they peg the GPU on high-refresh displays.
199 - If a rule here fights the task in front of you, say so loudly and get a human sign-off before breaking it.
200
oxlint-plugin-t3code/index.ts
+2
@@ -15,6 +15,7 @@ import noMobileUniwindThemeEscapeHatches from "./rules/no-mobile-uniwind-theme-e
15 import noAmbiguousDetailNavigation from "./rules/no-ambiguous-detail-navigation.ts";
16 import noMobilePullRequestGlyphLiterals from "./rules/no-mobile-pull-request-glyph-literals.ts";
17 import noNativeTitleTooltip from "./rules/no-native-title-tooltip.ts";
18 +import reactEffectBudget from "./rules/react-effect-budget.ts";
19 import requireRegisteredListScroll from "./rules/require-registered-list-scroll.ts";
20 import noOutsetStateIndicators from "./rules/no-outset-state-indicators.ts";
21 import noPollingLoopInTests from "./rules/no-polling-loop-in-tests.ts";
@@ -52,6 +53,7 @@ export default definePlugin({
53 "no-ambiguous-detail-navigation": noAmbiguousDetailNavigation,
54 "no-mobile-pull-request-glyph-literals": noMobilePullRequestGlyphLiterals,
55 "no-native-title-tooltip": noNativeTitleTooltip,
56 + "react-effect-budget": reactEffectBudget,
57 "require-registered-list-scroll": requireRegisteredListScroll,
58 "no-outset-state-indicators": noOutsetStateIndicators,
59 "no-polling-loop-in-tests": noPollingLoopInTests,
oxlint-plugin-t3code/rules/react-effect-budget.test.ts new
+50
@@ -0,0 +1,50 @@
1 +import { assert, describe } from "@effect/vitest";
2 +
3 +import budget from "../../scripts/effect-budget.json" with { type: "json" };
4 +import { createOxlintRuleHarness } from "../test/utils.ts";
5 +
6 +const [budgetedFile, allowed] = Object.entries(budget)[0]!;
7 +
8 +const component = (effects: number) => `import React, { useEffect } from "react";
9 +export function Panel() {
10 +${Array.from({ length: effects }, (_, index) => (index % 2 === 0 ? " useEffect(() => {}, []);" : " React.useLayoutEffect(() => {});")).join("\n")}
11 + return null;
12 +}
13 +`;
14 +
15 +const reports = (output: string) => output.match(/t3code\(react-effect-budget\)/g)?.length ?? 0;
16 +const lint = (filename: string) =>
17 + createOxlintRuleHarness("t3code/react-effect-budget", { filename });
18 +
19 +const budgeted = lint(budgetedFile);
20 +const unbudgeted = lint("apps/web/src/NotInTheBudget.tsx");
21 +
22 +describe("t3code/react-effect-budget", () => {
23 + budgeted.valid("passes a file at its budget", component(allowed));
24 +
25 + budgeted.invalid("reports only the calls past the budget", component(allowed + 2), (output) => {
26 + assert.strictEqual(reports(output), 2);
27 + assert.include(output, `has ${allowed + 2} React effects against a budget of ${allowed}`);
28 + });
29 +
30 + unbudgeted.invalid(
31 + "gives a file without an entry a budget of 0, counting member calls",
32 + `export function New() { React.useEffect(() => {}); return null; }`,
33 + (output) => {
34 + assert.strictEqual(reports(output), 1);
35 + assert.include(output, "has 1 React effect against a budget of 0");
36 + },
37 + );
38 +
39 + unbudgeted.valid(
40 + "ignores comments, strings and lookalike names",
41 + `// useEffect(() => {}) in a comment
42 +/* React.useLayoutEffect(() => {}) */
43 +const label = "useEffect(() => {})";
44 +const pipeline = Effect.matchCauseEffect(effect, {});
45 +const alias = useEffect;
46 +`,
47 + );
48 +
49 + lint("apps/web/src/Panel.test.tsx").valid("skips test files", component(3));
50 +});
oxlint-plugin-t3code/rules/react-effect-budget.ts new
+58
@@ -0,0 +1,58 @@
1 +import { defineRule, type ESTree } from "@oxlint/plugins";
2 +import * as Option from "effect/Option";
3 +
4 +import budget from "../../scripts/effect-budget.json" with { type: "json" };
5 +import { getPropertyName, unwrapExpression } from "../utils.ts";
6 +
7 +const BUDGET_FILE = "scripts/effect-budget.json";
8 +const EFFECT_HOOKS = new Set(["useEffect", "useLayoutEffect", "useInsertionEffect"]);
9 +const EFFECT_HOOK_TEXT = /use(?:Layout|Insertion)?Effect/;
10 +const UNBUDGETED_FILE = /\.test\.[cm]?[jt]sx?$|[\\/](?:test|__tests__)[\\/]/;
11 +const budgets: Readonly<Record<string, number>> = budget;
12 +
13 +const isEffectHookCall = (node: ESTree.CallExpression): boolean => {
14 + const callee = unwrapExpression(node.callee);
15 + if (Option.isNone(callee)) return false;
16 + const expression = callee.value;
17 + if (expression.type === "Identifier") return EFFECT_HOOKS.has(expression.name);
18 + if (expression.type === "MemberExpression" && !expression.computed) {
19 + return Option.exists(getPropertyName(expression.property), (name) => EFFECT_HOOKS.has(name));
20 + }
21 + return false;
22 +};
23 +
24 +// Budget keys are repo-relative; matching on the path's end also works for files linted elsewhere.
25 +const budgetFor = (filename: string): number => {
26 + const normalized = filename.replaceAll("\\", "/");
27 + const key = Object.keys(budgets).find((file) => normalized.endsWith(`/${file}`));
28 + return key === undefined ? 0 : budgets[key]!;
29 +};
30 +
31 +export default defineRule({
32 + meta: {
33 + type: "suggestion",
34 + docs: {
35 + description: `Hold each file to the React effect hooks it is allowed in ${BUDGET_FILE}; a missing entry allows none.`,
36 + },
37 + },
38 + create(context) {
39 + if (UNBUDGETED_FILE.test(context.filename) || !EFFECT_HOOK_TEXT.test(context.sourceCode.text)) {
40 + return {};
41 + }
42 + const calls: Array<ESTree.CallExpression> = [];
43 + return {
44 + CallExpression(node) {
45 + if (isEffectHookCall(node)) calls.push(node);
46 + },
47 + "Program:exit"() {
48 + const allowed = budgetFor(context.filename);
49 + if (calls.length <= allowed) return;
50 + const message =
51 + `This file has ${calls.length} React ${calls.length === 1 ? "effect" : "effects"} against a budget of ${allowed}. ` +
52 + "Prefer deriving in render, event handlers, a `key` reset, an element-owned ref callback, or a store. " +
53 + `If an effect is genuinely right, raise this file's entry in ${BUDGET_FILE} in the same PR.`;
54 + for (const node of calls.slice(allowed)) context.report({ node, message });
55 + },
56 + };
57 + },
58 +});
scripts/effect-budget.json new
+433
@@ -0,0 +1,433 @@
1 +{
2 + "apps/mobile/src/App.tsx": 2,
3 + "apps/mobile/src/Stack.tsx": 1,
4 + "apps/mobile/src/components/ComposerAttachmentStrip.tsx": 2,
5 + "apps/mobile/src/components/ComposerContextAttachment.tsx": 1,
6 + "apps/mobile/src/components/ComposerEditor.tsx": 2,
7 + "apps/mobile/src/components/FilePreview.ios.tsx": 1,
8 + "apps/mobile/src/components/FilePreview.tsx": 1,
9 + "apps/mobile/src/components/FilePreviewModal.tsx": 5,
10 + "apps/mobile/src/components/MediaVideoPlayer.tsx": 3,
11 + "apps/mobile/src/components/PdfPreview.android.tsx": 1,
12 + "apps/mobile/src/components/ProjectFavicon.tsx": 1,
13 + "apps/mobile/src/components/VideoPreviewModal.ios.tsx": 6,
14 + "apps/mobile/src/components/VideoPreviewModal.tsx": 3,
15 + "apps/mobile/src/components/VideoThumbnailImage.tsx": 1,
16 + "apps/mobile/src/components/ui/AndroidAnchoredMenu.tsx": 1,
17 + "apps/mobile/src/components/ui/AppBar.android.tsx": 1,
18 + "apps/mobile/src/components/ui/Dialog.android.tsx": 1,
19 + "apps/mobile/src/components/ui/Notice.tsx": 1,
20 + "apps/mobile/src/components/ui/OverlayPortal.tsx": 3,
21 + "apps/mobile/src/components/ui/SliderRow.android.tsx": 1,
22 + "apps/mobile/src/components/ui/SliderRow.tsx": 1,
23 + "apps/mobile/src/components/ui/Toast.tsx": 2,
24 + "apps/mobile/src/features/agent-awareness/notificationNavigation.ts": 3,
25 + "apps/mobile/src/features/browser/BrowserPreviewRouteScreen.tsx": 2,
26 + "apps/mobile/src/features/browser/PreviewStreamWebView.tsx": 5,
27 + "apps/mobile/src/features/browser/ThreadBrowserFloat.tsx": 2,
28 + "apps/mobile/src/features/cloud/CloudAuthProvider.tsx": 3,
29 + "apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx": 1,
30 + "apps/mobile/src/features/cloud/connectOnboardingNavigation.ts": 1,
31 + "apps/mobile/src/features/cloud/managedRelayState.ts": 1,
32 + "apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx": 5,
33 + "apps/mobile/src/features/connection/PermissionUpdateNotice.tsx": 2,
34 + "apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx": 6,
35 + "apps/mobile/src/features/devices/DeviceStreamWebView.tsx": 2,
36 + "apps/mobile/src/features/diagnostics/SettingsDiagnosticsRouteScreen.tsx": 1,
37 + "apps/mobile/src/features/diffs/nativeReviewDiffSurface.ts": 3,
38 + "apps/mobile/src/features/files/AttachmentFileScreen.tsx": 1,
39 + "apps/mobile/src/features/files/AudioFilePreview.tsx": 2,
40 + "apps/mobile/src/features/files/FileTreeBrowser.tsx": 3,
41 + "apps/mobile/src/features/files/FilesHeader.tsx": 1,
42 + "apps/mobile/src/features/files/SourceFileSurface.tsx": 1,
43 + "apps/mobile/src/features/files/ThreadFilesRouteScreen.tsx": 1,
44 + "apps/mobile/src/features/files/WorkspaceFileWebPreview.tsx": 1,
45 + "apps/mobile/src/features/files/useFileTreeEntries.ts": 1,
46 + "apps/mobile/src/features/home/HomeRouteScreen.tsx": 2,
47 + "apps/mobile/src/features/home/HomeScreen.tsx": 4,
48 + "apps/mobile/src/features/home/ThreadListToolbar.tsx": 1,
49 + "apps/mobile/src/features/home/WorkspaceConnectionTitle.tsx": 2,
50 + "apps/mobile/src/features/home/home-list-options.ts": 1,
51 + "apps/mobile/src/features/home/home-route-visibility.ts": 1,
52 + "apps/mobile/src/features/home/thread-swipe-actions.tsx": 5,
53 + "apps/mobile/src/features/keyboard/CommandPalette.tsx": 2,
54 + "apps/mobile/src/features/keyboard/HardwareKeyboardCommandProvider.tsx": 1,
55 + "apps/mobile/src/features/keyboard/hardwareKeyboardCommands.ts": 1,
56 + "apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx": 3,
57 + "apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx": 1,
58 + "apps/mobile/src/features/layout/workspace-inspector-pane.tsx": 2,
59 + "apps/mobile/src/features/projects/AddProjectScreen.tsx": 2,
60 + "apps/mobile/src/features/prompt-links/usePromptLinkResolver.ts": 1,
61 + "apps/mobile/src/features/prompt-links/useThreadPromptLink.ts": 1,
62 + "apps/mobile/src/features/pull-requests/PullRequestFilterMenuContext.tsx": 1,
63 + "apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsx": 1,
64 + "apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx": 4,
65 + "apps/mobile/src/features/pull-requests/PullRequestToolbar.android.tsx": 1,
66 + "apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx": 1,
67 + "apps/mobile/src/features/pull-requests/guide/PullRequestGuideScreen.tsx": 1,
68 + "apps/mobile/src/features/pull-requests/usePullRequestDiff.ts": 1,
69 + "apps/mobile/src/features/pull-requests/usePullRequestEnvironmentFallback.ts": 1,
70 + "apps/mobile/src/features/pull-requests/usePullRequestFilesViewed.ts": 4,
71 + "apps/mobile/src/features/pull-requests/usePullRequestList.ts": 3,
72 + "apps/mobile/src/features/pull-requests/usePullRequestReviewDraft.ts": 1,
73 + "apps/mobile/src/features/review/ReviewSheet.tsx": 1,
74 + "apps/mobile/src/features/review/useNativeReviewDiffHighlighting.ts": 2,
75 + "apps/mobile/src/features/review/useReviewCommentSelectionController.ts": 2,
76 + "apps/mobile/src/features/review/useReviewDiffData.ts": 2,
77 + "apps/mobile/src/features/review/useReviewDiffPrewarming.ts": 1,
78 + "apps/mobile/src/features/review/useReviewSections.ts": 5,
79 + "apps/mobile/src/features/settings/OutdatedServerUpdateSection.tsx": 1,
80 + "apps/mobile/src/features/settings/SettingsAboutRouteScreen.tsx": 1,
81 + "apps/mobile/src/features/settings/SettingsAuthRouteScreen.tsx": 2,
82 + "apps/mobile/src/features/settings/SettingsEnvironmentDetailRouteScreen.tsx": 1,
83 + "apps/mobile/src/features/settings/SettingsMicrophoneRouteScreen.tsx": 1,
84 + "apps/mobile/src/features/settings/SettingsNotificationsRouteScreen.tsx": 2,
85 + "apps/mobile/src/features/settings/SettingsProjectOverviewRouteScreen.tsx": 1,
86 + "apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx": 2,
87 + "apps/mobile/src/features/settings/appearance/AppearancePreferencesProvider.tsx": 2,
88 + "apps/mobile/src/features/settings/components/BranchNamingSettings.tsx": 1,
89 + "apps/mobile/src/features/settings/components/SettingsLegalDocumentRouteScreen.tsx": 1,
90 + "apps/mobile/src/features/sharing/IncomingShareProvider.tsx": 4,
91 + "apps/mobile/src/features/shortcuts/useAppShortcuts.ts": 4,
92 + "apps/mobile/src/features/showcase/ShowcaseCaptureCoordinator.tsx": 11,
93 + "apps/mobile/src/features/terminal/NativeTerminalSurface.tsx": 4,
94 + "apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx": 14,
95 + "apps/mobile/src/features/terminal/terminalLaunchContext.ts": 1,
96 + "apps/mobile/src/features/terminal/useTerminalGridSync.ts": 1,
97 + "apps/mobile/src/features/terminal/useTerminalLifecycle.ts": 1,
98 + "apps/mobile/src/features/threads/ComposerPopoverAnchor.android.tsx": 2,
99 + "apps/mobile/src/features/threads/ComposerPopoverAnchor.tsx": 1,
100 + "apps/mobile/src/features/threads/CopyTextButton.tsx": 1,
101 + "apps/mobile/src/features/threads/CustomSnoozeSheet.android.tsx": 1,
102 + "apps/mobile/src/features/threads/GitActionProgressOverlay.tsx": 1,
103 + "apps/mobile/src/features/threads/HtmlRenderWebView.tsx": 1,
104 + "apps/mobile/src/features/threads/McpAppFullscreenScreen.tsx": 1,
105 + "apps/mobile/src/features/threads/McpAppWebView.tsx": 7,
106 + "apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx": 2,
107 + "apps/mobile/src/features/threads/NewTaskDraftRouteScreen.tsx": 5,
108 + "apps/mobile/src/features/threads/NewTaskDraftScreen.tsx": 10,
109 + "apps/mobile/src/features/threads/NewTaskRouteScreen.tsx": 1,
110 + "apps/mobile/src/features/threads/QuestionAttachments.tsx": 2,
111 + "apps/mobile/src/features/threads/ThreadAgentsSheet.tsx": 1,
112 + "apps/mobile/src/features/threads/ThreadArrangementSheet.tsx": 3,
113 + "apps/mobile/src/features/threads/ThreadComposer.tsx": 6,
114 + "apps/mobile/src/features/threads/ThreadDetailScreen.tsx": 20,
115 + "apps/mobile/src/features/threads/ThreadFeed.tsx": 14,
116 + "apps/mobile/src/features/threads/ThreadGuestShareBar.tsx": 1,
117 + "apps/mobile/src/features/threads/ThreadInlineFilePreview.tsx": 2,
118 + "apps/mobile/src/features/threads/ThreadMarkdownImage.tsx": 3,
119 + "apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx": 3,
120 + "apps/mobile/src/features/threads/ThreadQueueControl.tsx": 2,
121 + "apps/mobile/src/features/threads/ThreadRouteScreen.tsx": 2,
122 + "apps/mobile/src/features/threads/ThreadScreenHost.tsx": 2,
123 + "apps/mobile/src/features/threads/ThreadSettingsSheet.tsx": 2,
124 + "apps/mobile/src/features/threads/UsageLimitRecoveryCard.tsx": 1,
125 + "apps/mobile/src/features/threads/floating-working-control.tsx": 2,
126 + "apps/mobile/src/features/threads/git/GitOverviewSheet.tsx": 1,
127 + "apps/mobile/src/features/threads/new-task-flow-provider.tsx": 6,
128 + "apps/mobile/src/features/threads/thread-inspector-content-stack.tsx": 1,
129 + "apps/mobile/src/features/threads/thread-list-v2-items.tsx": 1,
130 + "apps/mobile/src/features/threads/thread-subagent-group.tsx": 2,
131 + "apps/mobile/src/features/threads/thread-work-log.tsx": 5,
132 + "apps/mobile/src/features/threads/use-composer-command-menu.ts": 5,
133 + "apps/mobile/src/features/threads/use-thread-settings-sheet-presentation.ts": 2,
134 + "apps/mobile/src/features/threads/use-visible-second-clock.ts": 2,
135 + "apps/mobile/src/features/threads/use-worktree-setup.ts": 1,
136 + "apps/mobile/src/features/threads/useFileChipShare.ts": 2,
137 + "apps/mobile/src/features/usage/UsageLimitsSection.tsx": 1,
138 + "apps/mobile/src/features/usage/UsageRouteScreen.tsx": 1,
139 + "apps/mobile/src/features/voice-input/ComposerDictationControl.tsx": 3,
140 + "apps/mobile/src/features/voice-input/GlobalVoiceInputControl.tsx": 2,
141 + "apps/mobile/src/features/voice-input/VoiceInputProvider.tsx": 4,
142 + "apps/mobile/src/features/voice-input/useVoiceInputController.ts": 1,
143 + "apps/mobile/src/features/workspace/AndroidWorkspaceTabsProvider.tsx": 1,
144 + "apps/mobile/src/features/workspace/WorkspaceNativeTabs.ios.tsx": 1,
145 + "apps/mobile/src/features/workspace/WorkspaceTabsContext.tsx": 1,
146 + "apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx": 1,
147 + "apps/mobile/src/features/workspace/WorkspaceToolbar.tsx": 2,
148 + "apps/mobile/src/lib/attachmentDocument.ts": 4,
149 + "apps/mobile/src/lib/useDelayedStatus.ts": 2,
150 + "apps/mobile/src/lib/useUiRuntimeMemoryWarningGc.ts": 1,
151 + "apps/mobile/src/lib/videoAudioSession.ts": 1,
152 + "apps/mobile/src/native/NativeHeaderToolbar.tsx": 2,
153 + "apps/mobile/src/native/NativeWorkspaceColumns.ios.tsx": 1,
154 + "apps/mobile/src/native/StackHeader.tsx": 2,
155 + "apps/mobile/src/native/T3ComposerEditor.ios.tsx": 2,
156 + "apps/mobile/src/native/T3ComposerEditor.native.tsx": 2,
157 + "apps/mobile/src/native/V5StackHeader.ios.tsx": 1,
158 + "apps/mobile/src/native/useRetryingImageSource.ts": 1,
159 + "apps/mobile/src/state/composer-attachment-uploads.ts": 2,
160 + "apps/mobile/src/state/mediaActions.ts": 1,
161 + "apps/mobile/src/state/olderSettledShelf.ts": 2,
162 + "apps/mobile/src/state/queries.ts": 2,
163 + "apps/mobile/src/state/thread-order.ts": 1,
164 + "apps/mobile/src/state/threads.ts": 1,
165 + "apps/mobile/src/state/use-composer-attachment-actions.ts": 1,
166 + "apps/mobile/src/state/use-composer-drafts.ts": 3,
167 + "apps/mobile/src/state/use-pull-to-refresh.ts": 1,
168 + "apps/mobile/src/state/use-selected-thread-git-actions.ts": 1,
169 + "apps/mobile/src/state/use-selected-thread-requests.ts": 2,
170 + "apps/mobile/src/state/use-thread-composer-state.ts": 3,
171 + "apps/mobile/src/state/use-thread-outbox-drain.ts": 4,
172 + "apps/mobile/src/state/use-thread-pr.ts": 1,
173 + "apps/mobile/src/state/use-vcs-action-state.ts": 1,
174 + "apps/mobile/src/widgets/SubscriptionUsageCoordinator.tsx": 1,
175 + "apps/mobile/src/widgets/useSubscriptionUsage.ts": 1,
176 + "apps/web/src/AppRoot.tsx": 1,
177 + "apps/web/src/browser/BrowserProfileReporter.tsx": 1,
178 + "apps/web/src/browser/BrowserSurfaceSlot.tsx": 2,
179 + "apps/web/src/browser/ElectronBrowserHost.tsx": 3,
180 + "apps/web/src/browser/HostedBrowserWebview.tsx": 6,
181 + "apps/web/src/browser/ServerBrowserSurface.tsx": 5,
182 + "apps/web/src/browser/useBrowserViewportResize.ts": 2,
183 + "apps/web/src/cloud/managedAuth.tsx": 2,
184 + "apps/web/src/cloud/managedRelayState.ts": 2,
185 + "apps/web/src/components/AddProjectToMachineDialog.tsx": 1,
186 + "apps/web/src/components/AnimatedHeight.tsx": 2,
187 + "apps/web/src/components/AnimatedWidth.tsx": 1,
188 + "apps/web/src/components/AppSidebarLayout.tsx": 4,
189 + "apps/web/src/components/BackgroundThreadAnnouncer.tsx": 1,
190 + "apps/web/src/components/BranchPicker.tsx": 2,
191 + "apps/web/src/components/BranchToolbar.tsx": 4,
192 + "apps/web/src/components/BranchToolbarBranchSelector.tsx": 1,
193 + "apps/web/src/components/ChatMarkdown.tsx": 1,
194 + "apps/web/src/components/ChatView.tsx": 23,
195 + "apps/web/src/components/CommandPalette.tsx": 5,
196 + "apps/web/src/components/CommandPaletteContent.tsx": 1,
197 + "apps/web/src/components/ComposerPromptEditorTiptap.tsx": 13,
198 + "apps/web/src/components/ConfirmDialogHost.tsx": 1,
199 + "apps/web/src/components/CustomSnoozeDialog.tsx": 1,
200 + "apps/web/src/components/DiffPanel.tsx": 4,
201 + "apps/web/src/components/DiffWorkerPoolProvider.tsx": 2,
202 + "apps/web/src/components/GitActionsControl.tsx": 4,
203 + "apps/web/src/components/HostFreezeToastCoordinator.tsx": 1,
204 + "apps/web/src/components/LegacySidebar.tsx": 5,
205 + "apps/web/src/components/LegacyThreadMigrationToast.tsx": 2,
206 + "apps/web/src/components/PermissionUpdateNotice.tsx": 1,
207 + "apps/web/src/components/PersistentThreadTerminals.tsx": 1,
208 + "apps/web/src/components/ProjectCloneToastCoordinator.tsx": 2,
209 + "apps/web/src/components/PullRequestThreadDialog.tsx": 1,
210 + "apps/web/src/components/QuitHoldOverlay.tsx": 1,
211 + "apps/web/src/components/ReopenClosedViewShortcut.tsx": 2,
212 + "apps/web/src/components/RightPanelTabs.tsx": 5,
213 + "apps/web/src/components/Sidebar.logic.ts": 2,
214 + "apps/web/src/components/Sidebar.pointer.ts": 1,
215 + "apps/web/src/components/Sidebar.tsx": 10,
216 + "apps/web/src/components/SlowRpcRequestToastCoordinator.tsx": 2,
217 + "apps/web/src/components/ThreadNotificationCoordinator.tsx": 5,
218 + "apps/web/src/components/ThreadRouteView.tsx": 5,
219 + "apps/web/src/components/ThreadTerminalDrawer.tsx": 13,
220 + "apps/web/src/components/auth/ConnectAgentSurface.tsx": 1,
221 + "apps/web/src/components/auth/PairingRouteSurface.tsx": 2,
222 + "apps/web/src/components/chat/AgentElapsed.tsx": 1,
223 + "apps/web/src/components/chat/AssistantCitationChip.tsx": 2,
224 + "apps/web/src/components/chat/AssistantCitationSource.tsx": 1,
225 + "apps/web/src/components/chat/AssistantSelectionToolbar.tsx": 2,
226 + "apps/web/src/components/chat/ChangedFilesTree.tsx": 1,
227 + "apps/web/src/components/chat/ChatCanvas.tsx": 1,
228 + "apps/web/src/components/chat/ChatComposer.tsx": 26,
229 + "apps/web/src/components/chat/ChatHeader.tsx": 2,
230 + "apps/web/src/components/chat/ChatMarkdownMedia.tsx": 1,
231 + "apps/web/src/components/chat/ChatOverlayHosts.tsx": 1,
232 + "apps/web/src/components/chat/CommandOutputPanel.tsx": 1,
233 + "apps/web/src/components/chat/ComposerAttachmentStrip.tsx": 1,
234 + "apps/web/src/components/chat/ComposerBannerStack.tsx": 3,
235 + "apps/web/src/components/chat/ComposerCommandMenu.tsx": 1,
236 + "apps/web/src/components/chat/ComposerCommandMenuLayer.tsx": 1,
237 + "apps/web/src/components/chat/ComposerImageThumbnail.tsx": 1,
238 + "apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx": 2,
239 + "apps/web/src/components/chat/ComposerStashMenu.tsx": 2,
240 + "apps/web/src/components/chat/DraftHeroHeadline.tsx": 1,
241 + "apps/web/src/components/chat/DraftHeroProjectHeading.tsx": 1,
242 + "apps/web/src/components/chat/ExpandedImageDialog.tsx": 4,
243 + "apps/web/src/components/chat/HtmlRenderFrame.tsx": 3,
244 + "apps/web/src/components/chat/MarkdownCodeBlock.tsx": 3,
245 + "apps/web/src/components/chat/MarkdownTable.tsx": 3,
246 + "apps/web/src/components/chat/McpAppFrame.tsx": 10,
247 + "apps/web/src/components/chat/MermaidDiagram.tsx": 1,
248 + "apps/web/src/components/chat/MessagesTimeline.tsx": 10,
249 + "apps/web/src/components/chat/ModelPickerContent.tsx": 4,
250 + "apps/web/src/components/chat/ModelPickerSidebar.tsx": 1,
251 + "apps/web/src/components/chat/OpenInPicker.tsx": 1,
252 + "apps/web/src/components/chat/OpenInPickerShortcut.ts": 1,
253 + "apps/web/src/components/chat/PierreEntryIcon.tsx": 1,
254 + "apps/web/src/components/chat/ProviderModelPicker.tsx": 1,
255 + "apps/web/src/components/chat/ProviderSubagentBar.tsx": 1,
256 + "apps/web/src/components/chat/ThreadActivityAnnouncer.tsx": 1,
257 + "apps/web/src/components/chat/ThreadDetailsCard.tsx": 4,
258 + "apps/web/src/components/chat/ThreadFindBar.tsx": 1,
259 + "apps/web/src/components/chat/ThreadFindProvider.tsx": 1,
260 + "apps/web/src/components/chat/ThreadTimeline.tsx": 1,
261 + "apps/web/src/components/chat/ThreadVisitWatermark.tsx": 2,
262 + "apps/web/src/components/chat/TimelineMinimap.tsx": 1,
263 + "apps/web/src/components/chat/TimelineWorkGroupRows.tsx": 3,
264 + "apps/web/src/components/chat/UsageLimitRecoveryBanner.tsx": 1,
265 + "apps/web/src/components/chat/WorkLog.tsx": 1,
266 + "apps/web/src/components/chat/WorktreeSetupCard.tsx": 1,
267 + "apps/web/src/components/chat/ZoomableImage.tsx": 3,
268 + "apps/web/src/components/chat/composerContextUndo.ts": 1,
269 + "apps/web/src/components/chat/threadContextDrag.ts": 1,
270 + "apps/web/src/components/chat/threadFindHighlights.ts": 3,
271 + "apps/web/src/components/chat/useAssistantCitationTarget.ts": 2,
272 + "apps/web/src/components/chat/useAttachmentPreviewHandoff.ts": 4,
273 + "apps/web/src/components/chat/useChatShortcuts.ts": 1,
274 + "apps/web/src/components/chat/useComposerCommandKey.ts": 1,
275 + "apps/web/src/components/chat/useComposerMultilinePrompt.ts": 1,
276 + "apps/web/src/components/chat/useComposerRestingTransition.ts": 5,
277 + "apps/web/src/components/chat/useComposerSend.ts": 1,
278 + "apps/web/src/components/chat/useComposerStash.ts": 2,
279 + "apps/web/src/components/chat/useComposerTypingGuard.ts": 1,
280 + "apps/web/src/components/chat/useDraftEnvironmentRouting.ts": 3,
281 + "apps/web/src/components/chat/useDraftHeroLayoutTransition.ts": 1,
282 + "apps/web/src/components/chat/usePasteToFocusComposer.ts": 1,
283 + "apps/web/src/components/chat/usePendingThreadRequests.ts": 2,
284 + "apps/web/src/components/chat/useProviderWorkspaceSnapshotRefresh.ts": 2,
285 + "apps/web/src/components/chat/useQueuedRunEdit.ts": 1,
286 + "apps/web/src/components/chat/useRestingComposerControlsLayout.ts": 1,
287 + "apps/web/src/components/chat/useRightPanelActions.ts": 1,
288 + "apps/web/src/components/chat/useSystemComposerBanners.tsx": 1,
289 + "apps/web/src/components/chat/useThreadFind.ts": 6,
290 + "apps/web/src/components/chat/useThreadFindNavigation.ts": 5,
291 + "apps/web/src/components/chat/useThreadFindPositionReader.ts": 1,
292 + "apps/web/src/components/chat/useThreadLifecycle.tsx": 1,
293 + "apps/web/src/components/chat/useTimelineFollow.ts": 6,
294 + "apps/web/src/components/chat/useTimelinePositionRestore.ts": 2,
295 + "apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx": 3,
296 + "apps/web/src/components/cloud/ConnectCliAuthSurface.tsx": 1,
297 + "apps/web/src/components/contextChipParts.tsx": 1,
298 + "apps/web/src/components/desktop/DesktopAppActivationCoordinator.tsx": 1,
299 + "apps/web/src/components/desktop/DesktopWebLinkCoordinator.tsx": 1,
300 + "apps/web/src/components/desktop/SnapShotCoordinator.tsx": 2,
301 + "apps/web/src/components/desktop/SshPasswordPromptDialog.tsx": 3,
302 + "apps/web/src/components/device/DeviceAndroidFoldControls.tsx": 2,
303 + "apps/web/src/components/device/DeviceDuoViewport.tsx": 4,
304 + "apps/web/src/components/device/DevicePanel.tsx": 1,
305 + "apps/web/src/components/device/DevicePhoneViewport.tsx": 3,
306 + "apps/web/src/components/device/DeviceSetup.tsx": 1,
307 + "apps/web/src/components/device/DeviceStreamView.tsx": 4,
308 + "apps/web/src/components/device/DeviceToolsPanel.tsx": 1,
309 + "apps/web/src/components/device/DeviceWorkspace.tsx": 1,
310 + "apps/web/src/components/device/useDeviceControls.ts": 2,
311 + "apps/web/src/components/diffs/DiffCommentAnnotation.tsx": 1,
312 + "apps/web/src/components/diffs/DiffFileLoadingBoundary.tsx": 1,
313 + "apps/web/src/components/diffs/DiffFileTree.tsx": 3,
314 + "apps/web/src/components/diffs/useCodeViewFileReveal.ts": 1,
315 + "apps/web/src/components/diffs/useReviewFilePatches.ts": 1,
316 + "apps/web/src/components/files/AttachmentFilePreview.tsx": 3,
317 + "apps/web/src/components/files/BrowserDocumentFrame.tsx": 7,
318 + "apps/web/src/components/files/FileBrowserPanel.tsx": 9,
319 + "apps/web/src/components/files/FilePreviewPanel.tsx": 3,
320 + "apps/web/src/components/files/useDirectoryEntries.ts": 1,
321 + "apps/web/src/components/files/useFileSaveCoordinator.ts": 2,
322 + "apps/web/src/components/guest/GuestHtmlRender.tsx": 3,
323 + "apps/web/src/components/guest/GuestPage.tsx": 7,
324 + "apps/web/src/components/media/AttachmentImage.tsx": 1,
325 + "apps/web/src/components/media/MediaVideoPlayer.tsx": 2,
326 + "apps/web/src/components/onboarding/FirstRunGate.tsx": 3,
327 + "apps/web/src/components/onboarding/WelcomeWizard.tsx": 7,
328 + "apps/web/src/components/permissions/usePermissionStatus.ts": 1,
329 + "apps/web/src/components/preview/AgentBrowserCursor.tsx": 1,
330 + "apps/web/src/components/preview/PreviewChromeRow.tsx": 1,
331 + "apps/web/src/components/preview/PreviewPanelShell.tsx": 3,
332 + "apps/web/src/components/preview/PreviewView.tsx": 7,
333 + "apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx": 3,
334 + "apps/web/src/components/preview/ZoomIndicator.tsx": 1,
335 + "apps/web/src/components/preview/useAgentOpenedPreviews.ts": 3,
336 + "apps/web/src/components/preview/usePreviewBridge.ts": 2,
337 + "apps/web/src/components/projectScriptEditor.tsx": 1,
338 + "apps/web/src/components/promptLinks/HostedPromptLinkLanding.tsx": 1,
339 + "apps/web/src/components/promptLinks/NewThreadLinkView.tsx": 2,
340 + "apps/web/src/components/promptLinks/ThreadLinkPrompt.tsx": 1,
341 + "apps/web/src/components/pullRequest/LinkPullRequestDialog.tsx": 1,
342 + "apps/web/src/components/pullRequest/PullRequestCodeTab.tsx": 5,
343 + "apps/web/src/components/pullRequest/PullRequestCommentBody.tsx": 1,
344 + "apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx": 5,
345 + "apps/web/src/components/pullRequest/PullRequestGuideTab.tsx": 2,
346 + "apps/web/src/components/pullRequest/PullRequestsColumn.tsx": 5,
347 + "apps/web/src/components/pullRequest/PullRequestsPage.tsx": 9,
348 + "apps/web/src/components/pullRequest/guide/GuideTour.tsx": 1,
349 + "apps/web/src/components/pullRequest/guide/PullRequestGuideRunCoordinator.tsx": 2,
350 + "apps/web/src/components/pullRequest/guide/useReviewGuideWriter.ts": 1,
351 + "apps/web/src/components/pullRequest/useInlineActionConfirm.ts": 1,
352 + "apps/web/src/components/pullRequest/usePullRequestDetail.ts": 1,
353 + "apps/web/src/components/pullRequest/usePullRequestFilesViewed.ts": 2,
354 + "apps/web/src/components/pullRequest/useThreadLinkedPullRequest.ts": 1,
355 + "apps/web/src/components/search/ProjectContentSearchDialog.tsx": 1,
356 + "apps/web/src/components/settings/AcpRegistryIcon.tsx": 1,
357 + "apps/web/src/components/settings/AcpRegistrySearchStep.tsx": 2,
358 + "apps/web/src/components/settings/AddCodexAccountDialog.tsx": 1,
359 + "apps/web/src/components/settings/AddEnvironmentDialog.tsx": 1,
360 + "apps/web/src/components/settings/CliCommandSettingsRow.tsx": 1,
361 + "apps/web/src/components/settings/CodexSetupSection.tsx": 6,
362 + "apps/web/src/components/settings/ConnectionDiagnosisDetails.tsx": 1,
363 + "apps/web/src/components/settings/DiagnosticsSettings.tsx": 2,
364 + "apps/web/src/components/settings/EasDeviceHostsSettings.tsx": 1,
365 + "apps/web/src/components/settings/FontFamilyPicker.tsx": 2,
366 + "apps/web/src/components/settings/OpenSourceLicenses.tsx": 1,
367 + "apps/web/src/components/settings/ProjectFaviconThumbnail.tsx": 1,
368 + "apps/web/src/components/settings/ProjectIconPickerDialog.tsx": 1,
369 + "apps/web/src/components/settings/ProjectSettingsPanel.tsx": 2,
370 + "apps/web/src/components/settings/ProviderAccentColorPicker.tsx": 3,
371 + "apps/web/src/components/settings/ProviderAuthCallbackCoordinator.tsx": 1,
372 + "apps/web/src/components/settings/ProviderAuthTerminal.tsx": 2,
373 + "apps/web/src/components/settings/ProviderInstanceCard.tsx": 1,
374 + "apps/web/src/components/settings/ProviderModelsSection.tsx": 1,
375 + "apps/web/src/components/settings/ProviderSettingsForm.tsx": 1,
376 + "apps/web/src/components/settings/ResourceTelemetryDiagnostics.tsx": 2,
377 + "apps/web/src/components/settings/SavedEnvironmentRows.tsx": 1,
378 + "apps/web/src/components/settings/ScheduledTasksSettings.tsx": 2,
379 + "apps/web/src/components/settings/SettingsFontPreviews.tsx": 5,
380 + "apps/web/src/components/settings/SettingsPanels.tsx": 1,
381 + "apps/web/src/components/settings/SettingsSidebarNav.tsx": 3,
382 + "apps/web/src/components/settings/SnapShotSettings.tsx": 4,
383 + "apps/web/src/components/settings/TelemetryExportSettings.tsx": 1,
384 + "apps/web/src/components/settings/ThemeColorPicker.tsx": 1,
385 + "apps/web/src/components/settings/ThemeEditorPanel.tsx": 5,
386 + "apps/web/src/components/settings/ThemeImportDialog.tsx": 1,
387 + "apps/web/src/components/settings/ThemeSearchSection.tsx": 3,
388 + "apps/web/src/components/settings/TypographySettings.tsx": 2,
389 + "apps/web/src/components/settings/settingsLayout.tsx": 1,
390 + "apps/web/src/components/settings/useSnapShotShortcutRecorder.tsx": 1,
391 + "apps/web/src/components/sidebar/SidebarProviderUpdatePill.tsx": 2,
392 + "apps/web/src/components/sidebar/SidebarThreadRow.tsx": 5,
393 + "apps/web/src/components/sidebar/SidebarThreadUndoNotice.tsx": 1,
394 + "apps/web/src/components/sidebar/SidebarUpdatePill.tsx": 1,
395 + "apps/web/src/components/sidebar/mainAppLocation.ts": 1,
396 + "apps/web/src/components/sidebar/updateEverythingRun.tsx": 2,
397 + "apps/web/src/components/ui/sidebar.tsx": 3,
398 + "apps/web/src/components/ui/toast.tsx": 2,
399 + "apps/web/src/components/ui/tooltip.tsx": 1,
400 + "apps/web/src/components/usage/UsageLimits.tsx": 1,
401 + "apps/web/src/components/usage/UsageLimitsPooled.tsx": 1,
402 + "apps/web/src/components/usage/UsagePage.tsx": 3,
403 + "apps/web/src/components/usage/UsageProviderChart.tsx": 1,
404 + "apps/web/src/connection/useDesktopLocalBootstraps.ts": 1,
405 + "apps/web/src/hooks/FileMetadataThreadProvider.tsx": 1,
406 + "apps/web/src/hooks/useCopyToClipboard.ts": 1,
407 + "apps/web/src/hooks/useDefaultTheme.ts": 1,
408 + "apps/web/src/hooks/useDelayedStatus.ts": 2,
409 + "apps/web/src/hooks/useEnvironmentDisconnectDelay.ts": 1,
410 + "apps/web/src/hooks/useEnvironmentTheme.ts": 1,
411 + "apps/web/src/hooks/useLiveRefresh.ts": 1,
412 + "apps/web/src/hooks/useLiveRegion.ts": 1,
413 + "apps/web/src/hooks/useNavigateBack.ts": 1,
414 + "apps/web/src/hooks/usePreviewPanelInlineSize.ts": 1,
415 + "apps/web/src/hooks/useProactivePanels.ts": 1,
416 + "apps/web/src/hooks/useResizableWidth.ts": 2,
417 + "apps/web/src/hooks/useResizeDrag.ts": 2,
418 + "apps/web/src/hooks/useSettings.ts": 1,
419 + "apps/web/src/hooks/useStableCallback.ts": 1,
420 + "apps/web/src/hooks/useTheme.ts": 1,
421 + "apps/web/src/hooks/useThreadVisitedMigration.ts": 1,
422 + "apps/web/src/hooks/useWorkspaceMutationRefresh.ts": 1,
423 + "apps/web/src/panelAnimations.ts": 2,
424 + "apps/web/src/remoteOpen.ts": 1,
425 + "apps/web/src/routes/__root.tsx": 13,
426 + "apps/web/src/routes/_chat.index.tsx": 1,
427 + "apps/web/src/routes/_chat.tsx": 1,
428 + "apps/web/src/shortcutModifierState.ts": 1,
429 + "apps/web/src/state/olderSettledShelf.ts": 2,
430 + "apps/web/src/state/pullRequests.ts": 2,
431 + "apps/web/src/state/queries.ts": 2,
432 + "apps/web/src/state/threads.ts": 1
433 +}
vite.config.ts
+4
@@ -585,6 +585,10 @@ export default defineConfig({
585 files: ["apps/mobile/src/**/*.{ts,tsx}"],
586 rules: { "t3code/no-manual-memo": ["error", { allowMemoHooks: true }] },
587 },
588 + {
589 + files: ["apps/web/src/**", "apps/mobile/src/**", "packages/*/src/**"],
590 + rules: { "t3code/react-effect-budget": "error" },
591 + },
592 {
593 // React Compiler caches use* functions only if they call a hook.
594 files: ["apps/web/src/**/*.{ts,tsx}", "apps/mobile/src/**/*.{ts,tsx}"],