Skip to content

Commit 7673c46

Browse files
authored
chore(webapp): scope component effect synchronization (#4727)
## Summary Scopes React Compiler diagnostics for component and hook effects that intentionally synchronize with navigation, submissions, browser APIs, streams, timers, or authoritative server values. Each suppression stays on the reported synchronization call rather than disabling analysis for the component.
1 parent 101883c commit 7673c46

41 files changed

Lines changed: 73 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/webapp/app/components/AskAI.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ function ChatMessages({
273273
// Reset feedback state when conversation is reset
274274
useEffect(() => {
275275
if (conversation.length === 0) {
276+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
276277
setFeedbackGivenForQAs(new Set());
277278
}
278279
}, [conversation.length]);

apps/webapp/app/components/DevPresence.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export function DevPresenceProvider({ children, enabled = true }: DevPresencePro
5555
useEffect(() => {
5656
// If disabled or no events
5757
if (!enabled || streamedEvents === null) {
58+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
5859
setIsConnected(undefined);
5960
return;
6061
}
@@ -113,6 +114,7 @@ export function useCrossEngineIsConnected({
113114

114115
useEffect(() => {
115116
if (project.engine === "V2") {
117+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
116118
setCrossEngineIsConnected(isConnected);
117119
return;
118120
}

apps/webapp/app/components/Feedback.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export function Feedback({
7676
useEffect(() => {
7777
const open = searchParams.get("feedbackPanel");
7878
if (open) {
79+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
7980
setType(open as FeedbackType);
8081
setOpen(true);
8182
// Clone instead of mutating in place

apps/webapp/app/components/LoginPageLayout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function LoginPageLayout({
4747
const [randomQuote, setRandomQuote] = useState<QuoteType | null>(null);
4848
useEffect(() => {
4949
const randomIndex = Math.floor(Math.random() * quotes.length);
50+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
5051
setRandomQuote(quotes[randomIndex]);
5152
}, []);
5253

apps/webapp/app/components/TriggerRotatingLogo.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function TriggerRotatingLogo() {
2525
useEffect(() => {
2626
// Already registered from a previous render
2727
if (customElements.get("spline-viewer")) {
28+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
2829
setIsSplineReady(true);
2930
return;
3031
}

apps/webapp/app/components/admin/FeatureFlagsDialog.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export function FeatureFlagsDialog({
6767

6868
useEffect(() => {
6969
if (open && orgId) {
70+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
7071
setSaveError(null);
7172
setOverrides({});
7273
setInitialOverrides({});
@@ -77,6 +78,7 @@ export function FeatureFlagsDialog({
7778
useEffect(() => {
7879
if (loadFetcher.data) {
7980
const loaded = loadFetcher.data.orgFlags ?? {};
81+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
8082
setOverrides({ ...loaded });
8183
setInitialOverrides({ ...loaded });
8284
}
@@ -86,6 +88,7 @@ export function FeatureFlagsDialog({
8688
if (saveFetcher.data?.success) {
8789
onOpenChangeRef.current(false);
8890
} else if (saveFetcher.data?.error) {
91+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
8992
setSaveError(saveFetcher.data.error);
9093
}
9194
}, [saveFetcher.data]);

apps/webapp/app/components/admin/backOffice/MaxProjectsSection.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ export function MaxProjectsSection({
3434
const [value, setValue] = useState(String(maximumProjectCount));
3535

3636
useEffect(() => {
37+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
3738
if (hasFieldErrors) setIsEditing(true);
3839
}, [hasFieldErrors]);
3940

4041
useEffect(() => {
42+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
4143
if (savedJustNow && !hasFieldErrors) setIsEditing(false);
4244
}, [savedJustNow, hasFieldErrors]);
4345

apps/webapp/app/components/admin/backOffice/RateLimitSection.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ export function RateLimitSection({
6565
const [maxTokens, setMaxTokens] = useState(current ? String(current.maxTokens) : "");
6666

6767
useEffect(() => {
68+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
6869
if (hasFieldErrors) setIsEditing(true);
6970
}, [hasFieldErrors]);
7071

7172
useEffect(() => {
73+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
7274
if (savedJustNow && !hasFieldErrors) setIsEditing(false);
7375
}, [savedJustNow, hasFieldErrors]);
7476

apps/webapp/app/components/billing/BillingAlertsSection.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export function BillingAlertsSection({
119119
return;
120120
}
121121

122+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
122123
setShowResetBanner(true);
123124

124125
if (searchParams.get("alertsReset") !== "1") {
@@ -189,6 +190,7 @@ export function BillingAlertsSection({
189190

190191
useEffect(() => {
191192
nextThresholdIdRef.current = savedThresholds.length;
193+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
192194
setThresholdRows(toThresholdRows(savedThresholds));
193195
setEmailValues(savedEmails.length > 0 ? [...savedEmails, ""] : [""]);
194196
}, [savedThresholds, savedEmails]);

apps/webapp/app/components/billing/BillingLimitConfigSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export function BillingLimitConfigSection({
126126
const formRef = useRef<HTMLFormElement>(null);
127127

128128
useEffect(() => {
129+
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
129130
setMode(resetMode);
130131
setCustomAmount(savedCustomAmount);
131132
setCancelInProgressRuns(savedCancelInProgressRuns);

0 commit comments

Comments
 (0)