Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/webapp/app/components/AskAI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ function ChatMessages({
// Reset feedback state when conversation is reset
useEffect(() => {
if (conversation.length === 0) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
Comment thread
carderne marked this conversation as resolved.
setFeedbackGivenForQAs(new Set());
}
}, [conversation.length]);
Expand Down
2 changes: 2 additions & 0 deletions apps/webapp/app/components/DevPresence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function DevPresenceProvider({ children, enabled = true }: DevPresencePro
useEffect(() => {
// If disabled or no events
if (!enabled || streamedEvents === null) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
Comment thread
carderne marked this conversation as resolved.
setIsConnected(undefined);
return;
}
Expand Down Expand Up @@ -113,6 +114,7 @@ export function useCrossEngineIsConnected({

useEffect(() => {
if (project.engine === "V2") {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setCrossEngineIsConnected(isConnected);
return;
}
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export function Feedback({
useEffect(() => {
const open = searchParams.get("feedbackPanel");
if (open) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setType(open as FeedbackType);
setOpen(true);
// Clone instead of mutating in place
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/LoginPageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function LoginPageLayout({
const [randomQuote, setRandomQuote] = useState<QuoteType | null>(null);
useEffect(() => {
const randomIndex = Math.floor(Math.random() * quotes.length);
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setRandomQuote(quotes[randomIndex]);
}, []);

Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/TriggerRotatingLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function TriggerRotatingLogo() {
useEffect(() => {
// Already registered from a previous render
if (customElements.get("spline-viewer")) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setIsSplineReady(true);
return;
}
Expand Down
3 changes: 3 additions & 0 deletions apps/webapp/app/components/admin/FeatureFlagsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export function FeatureFlagsDialog({

useEffect(() => {
if (open && orgId) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setSaveError(null);
setOverrides({});
setInitialOverrides({});
Expand All @@ -77,6 +78,7 @@ export function FeatureFlagsDialog({
useEffect(() => {
if (loadFetcher.data) {
const loaded = loadFetcher.data.orgFlags ?? {};
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setOverrides({ ...loaded });
setInitialOverrides({ ...loaded });
}
Expand All @@ -86,6 +88,7 @@ export function FeatureFlagsDialog({
if (saveFetcher.data?.success) {
onOpenChangeRef.current(false);
} else if (saveFetcher.data?.error) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setSaveError(saveFetcher.data.error);
}
}, [saveFetcher.data]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ export function MaxProjectsSection({
const [value, setValue] = useState(String(maximumProjectCount));

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ export function RateLimitSection({
const [maxTokens, setMaxTokens] = useState(current ? String(current.maxTokens) : "");

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

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

Expand Down
2 changes: 2 additions & 0 deletions apps/webapp/app/components/billing/BillingAlertsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export function BillingAlertsSection({
return;
}

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

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

useEffect(() => {
nextThresholdIdRef.current = savedThresholds.length;
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setThresholdRows(toThresholdRows(savedThresholds));
setEmailValues(savedEmails.length > 0 ? [...savedEmails, ""] : [""]);
}, [savedThresholds, savedEmails]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export function BillingLimitConfigSection({
const formRef = useRef<HTMLFormElement>(null);

useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setMode(resetMode);
setCustomAmount(savedCustomAmount);
setCancelInProgressRuns(savedCancelInProgressRuns);
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/code/AIQueryInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export function AIQueryInput({
// If mode is edit but there's no current query, switch to new
useEffect(() => {
if (mode === "edit" && !canEdit) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setMode("new");
}
}, [mode, canEdit]);
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/dashboard-agent/AgentChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export function AgentChart({
// The block can render before `query` has streamed in; an empty query 400s.
if (!block.query) return;
if (!organizationId || !projectId || !environmentId) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState({ status: "error", error: "No environment context to run the query." });
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export function DashboardAgentPanel({

// Ordering-safe: if the new chat has not reported yet, its own report re-sets the marker.
useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setThinkingChatId((previous) => markerAfterActiveChat(previous, active?.chatId));
}, [active?.chatId]);

Expand Down Expand Up @@ -313,6 +314,7 @@ export function DashboardAgentPanel({
void loadHistory();
const stored = readLastChat(storageKey);
if (stored && stored.path === location.pathname) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
void openChat(stored.chatId);
} else {
setLoading(false);
Expand Down Expand Up @@ -341,6 +343,7 @@ export function DashboardAgentPanel({
handledOpenChatSeq.current = openChatRequest.seq;
// Reloading the visible transcript would drop a turn in flight.
if (openChatRequest.chatId === active?.chatId) return;
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
void openChat(openChatRequest.chatId);
// `active` is read, not tracked: a later change must not re-run the request.
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand All @@ -357,6 +360,7 @@ export function DashboardAgentPanel({
onChatRead?.(chatId, { leaving: false });
visibleChatId.current = nextVisibleChat(chatId, { leaving: false });
justRead.current.add(chatId);
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setChats((previous) => markChatListRead(previous, chatId));
// Read again on the way out: a wake can land while the chat is open.
return () => {
Expand Down Expand Up @@ -384,6 +388,7 @@ export function DashboardAgentPanel({
if (target === "hold") return;
handledRequestSeq.current = requestedMessage.seq;
if (target === "new-chat") {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
void createChat(requestedMessage.text);
return;
}
Expand Down
12 changes: 12 additions & 0 deletions apps/webapp/app/components/integrations/VercelOnboardingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export function VercelOnboardingModal({
hasSyncedStagingRef.current = false;
hasSyncedPreviewRef.current = false;
} else if (isOpen && state === "idle") {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState(computeInitialState());
}
prevIsOpenRef.current = isOpen;
Expand Down Expand Up @@ -262,6 +263,7 @@ export function VercelOnboardingModal({
// Strip "stg" from build settings when the staging environment mapping is cleared
useEffect(() => {
if (!vercelStagingEnvironment) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setPullEnvVarsBeforeBuild((prev) => prev.filter((s) => s !== "stg"));
setDiscoverEnvVars((prev) => prev.filter((s) => s !== "stg"));
}
Expand Down Expand Up @@ -329,6 +331,7 @@ export function VercelOnboardingModal({
useEffect(() => {
if (!isOpen) {
hasTriggeredMarketplaceRedirectRef.current = false;
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setIsRedirecting(false);
}
}, [isOpen]);
Expand Down Expand Up @@ -390,6 +393,7 @@ export function VercelOnboardingModal({
state === "loading-projects" &&
onboardingData?.availableProjects !== undefined
) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState("project-selection");
}
}, [state, onboardingData?.availableProjects, onboardingData?.authInvalid]);
Expand All @@ -400,6 +404,7 @@ export function VercelOnboardingModal({
state === "loading-env-vars" &&
onboardingData?.environmentVariables
) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState("env-var-sync");
}
}, [state, onboardingData?.environmentVariables, onboardingData?.authInvalid]);
Expand All @@ -415,6 +420,7 @@ export function VercelOnboardingModal({
trackOnboarding("vercel onboarding project selected", {
vercel_project_name: selectedVercelProject?.name,
});
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState("loading-env-mapping");
if (onDataReload) {
onDataReload();
Expand All @@ -437,6 +443,7 @@ export function VercelOnboardingModal({
const hasCustomEnvs =
(onboardingData.customEnvironments?.length ?? 0) > 0 && hasStagingEnvironment;
if (hasCustomEnvs && !fromMarketplaceContext) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState("env-mapping");
} else {
setState("loading-env-vars");
Expand Down Expand Up @@ -661,6 +668,7 @@ export function VercelOnboardingModal({
}
return;
}
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState("completed");
}
}, [completeOnboardingFetcher.data, completeOnboardingFetcher.state, state]);
Expand All @@ -675,6 +683,7 @@ export function VercelOnboardingModal({
return;
}
}
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState("completed");
}
}, [state, isGitHubConnectedForOnboarding, fromMarketplaceContext, nextUrl, trackOnboarding]);
Expand Down Expand Up @@ -704,6 +713,7 @@ export function VercelOnboardingModal({
envMappingFetcher.data.success &&
envMappingFetcher.state === "idle"
) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setState("loading-env-vars");
}
}, [envMappingFetcher.data, envMappingFetcher.state]);
Expand All @@ -719,12 +729,14 @@ export function VercelOnboardingModal({
selectedEnv = stagingEnv ?? customEnvironments[0];
}

// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setVercelStagingEnvironment({ environmentId: selectedEnv.id, displayName: selectedEnv.slug });
}
}, [state, customEnvironments, vercelStagingEnvironment]);

useEffect(() => {
if (state === "project-selection" && availableProjects.length > 0 && !selectedVercelProject) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setSelectedVercelProject(availableProjects[0]);
}
}, [state, availableProjects, selectedVercelProject]);
Expand Down
2 changes: 2 additions & 0 deletions apps/webapp/app/components/logs/LogDetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
useEffect(() => {
if (!logId) return;

// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setError(null);
fetcher.load(
`/resources/orgs/${organization.slug}/projects/${project.slug}/env/${
Expand All @@ -80,6 +81,7 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
// Handle fetch errors
useEffect(() => {
if (fetcher.data && typeof fetcher.data === "object" && "error" in fetcher.data) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setError(fetcher.data.error as string);
} else if (fetcher.state === "idle" && fetcher.data === null && !initialLog) {
setError("Failed to load log details");
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/logs/LogsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export function LogsTable({
// Show load more spinner only after 0.2 seconds of loading time
useEffect(() => {
if (!isLoadingMore) {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setShowLoadMoreSpinner(false);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export function SaveToDashboardDialog({
useEffect(() => {
if (customDashboards.length > 0 && !selectedDashboardId) {
const available = customDashboards.find((d) => d.widgetCount < widgetLimit);
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setSelectedDashboardId(available?.friendlyId ?? customDashboards[0].friendlyId);
}
}, [customDashboards, selectedDashboardId, widgetLimit]);
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/navigation/DashboardDialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function useCreateDashboard({

useEffect(() => {
if (navigation.formAction === formAction && navigation.state === "loading") {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setIsOpen(false);
}
}, [navigation.formAction, navigation.state, formAction]);
Expand Down
2 changes: 2 additions & 0 deletions apps/webapp/app/components/navigation/EnvironmentSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export function EnvironmentSelector({
const revalidator = useRevalidator();

useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setIsMenuOpen(false);
}, [navigation.location?.pathname]);

Expand Down Expand Up @@ -249,6 +250,7 @@ function Branches({
}, []);

useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setMenuOpen(false);
}, [navigation.location?.pathname]);

Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/navigation/FavoritesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function FavoriteMenuItem({

// Watch search too: navigating to a favorite can change only the search on the same pathname
useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setMenuOpen(false);
}, [navigation.location?.pathname, navigation.location?.search]);

Expand Down
6 changes: 6 additions & 0 deletions apps/webapp/app/components/navigation/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ export function SideMenu({
const data = customizationFetcher.data;
if (!data) {
// Settled with no response body (e.g. a session-expiry redirect): fail rather than spin
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setCustomizeConfirmPending(false);
setCustomizeError("Couldn't save your changes. Please try again.");
return;
Expand Down Expand Up @@ -1488,6 +1489,7 @@ function SideMenuMoreItem({

// Watch search too: navigating to a favorite can change only the search on the same pathname
useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setOpen(false);
}, [navigation.location?.pathname, navigation.location?.search]);

Expand Down Expand Up @@ -1701,6 +1703,7 @@ function OrgSelector({
const planTitle = currentPlan?.v3Subscription?.plan?.title;

useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setOrgMenuOpen(false);
}, [navigation.location?.pathname]);

Expand Down Expand Up @@ -1979,6 +1982,7 @@ function AccountMenu({ isAdmin, isImpersonating }: { isAdmin: boolean; isImperso
const navigation = useNavigation();

useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setIsOpen(false);
}, [navigation.location?.pathname]);

Expand Down Expand Up @@ -2033,6 +2037,7 @@ function ProjectSelector({
const { urlForProject } = usePageSwitcher();

useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setIsMenuOpen(false);
}, [navigation.location?.pathname]);

Expand Down Expand Up @@ -2154,6 +2159,7 @@ function SideMenuPopoverSubMenu({

// Close the submenu on navigation (the parent popover closes too).
useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setIsOpen(false);
}, [navigation.location?.pathname]);

Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/components/navigation/SideMenuHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function SideMenuHeader({
const navigation = useNavigation();

useEffect(() => {
// oxlint-disable-next-line react/react-compiler -- This effect intentionally synchronizes local state after an external or lifecycle change.
setHeaderMenuOpen(false);
}, [navigation.location?.pathname]);

Expand Down
Loading