From bed58d9b17dbc8b221af9cde0cec9cec299d183b Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Wed, 15 Jul 2026 00:47:34 +0530 Subject: [PATCH] chore: clean up React Doctor warnings in admin app (#9418) * chore: clean up React Doctor warnings in admin app Raises the admin app's React Doctor score from 61 to 89 by resolving 49 of 53 diagnostics (3 errors + 46 warnings). Errors (render purity): - authentication/page.tsx: move ref write out of render into useEffect - workspace/create/form.tsx: guard window.location.origin read - sign-in-form.tsx: drop redundant setState-forwarding arrow Accessibility: - aria-labels on icon-only buttons (password toggles, sidebar, header) - destination-naming aria-labels on ambiguous "learn more"/"here" links - positive tabIndex -> 0; auth-banner dismiss div -> native {sendEmailStep === ESendEmailSteps.SEND_EMAIL && ( - )} diff --git a/apps/admin/app/(all)/(dashboard)/image/form.tsx b/apps/admin/app/(all)/(dashboard)/image/form.tsx index 72ab513398..7a2b165fd0 100644 --- a/apps/admin/app/(all)/(dashboard)/image/form.tsx +++ b/apps/admin/app/(all)/(dashboard)/image/form.tsx @@ -64,6 +64,7 @@ export function InstanceImageConfigForm(props: IInstanceImageConfigForm) { target="_blank" className="text-accent-primary hover:underline" rel="noreferrer" + aria-label="Unsplash developer account documentation" > Learn more. diff --git a/apps/admin/app/(all)/(dashboard)/sidebar-help-section.tsx b/apps/admin/app/(all)/(dashboard)/sidebar-help-section.tsx index 51401f312c..482ba5246a 100644 --- a/apps/admin/app/(all)/(dashboard)/sidebar-help-section.tsx +++ b/apps/admin/app/(all)/(dashboard)/sidebar-help-section.tsx @@ -69,6 +69,7 @@ export const AdminSidebarHelpSection = observer(function AdminSidebarHelpSection ); } diff --git a/apps/admin/app/(all)/(home)/sign-in-form.tsx b/apps/admin/app/(all)/(home)/sign-in-form.tsx index 4e0afb8ea1..7b03b8c1cd 100644 --- a/apps/admin/app/(all)/(home)/sign-in-form.tsx +++ b/apps/admin/app/(all)/(home)/sign-in-form.tsx @@ -127,9 +127,7 @@ export function InstanceSignInForm() { {errorData.type && errorData?.message ? ( ) : ( - <> - {errorInfo && setErrorInfo(value)} />} - + <>{errorInfo && } )} @@ -170,6 +168,7 @@ export function InstanceSignInForm() { {showPassword ? ( ) : ( - )} - {secondaryButton} - - - - ); -} diff --git a/apps/admin/components/common/header/index.tsx b/apps/admin/components/common/header/index.tsx index 48b9ca78e9..8be7107048 100644 --- a/apps/admin/components/common/header/index.tsx +++ b/apps/admin/components/common/header/index.tsx @@ -21,6 +21,8 @@ export const HamburgerToggle = observer(function HamburgerToggle() { const { isSidebarCollapsed, toggleSidebar } = useTheme(); return ( - - - - - ); -} diff --git a/apps/admin/components/instance/loading.tsx b/apps/admin/components/instance/loading.tsx deleted file mode 100644 index 293b44bdcc..0000000000 --- a/apps/admin/components/instance/loading.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import { useTheme } from "next-themes"; -// assets -import LogoSpinnerDark from "@/app/assets/images/logo-spinner-dark.gif?url"; -import LogoSpinnerLight from "@/app/assets/images/logo-spinner-light.gif?url"; - -export function InstanceLoading() { - const { resolvedTheme } = useTheme(); - - const logoSrc = resolvedTheme === "dark" ? LogoSpinnerLight : LogoSpinnerDark; - - return ( -
- logo -
- ); -} diff --git a/apps/admin/components/instance/setup-form.tsx b/apps/admin/components/instance/setup-form.tsx index 74e80db45b..fdb7c80917 100644 --- a/apps/admin/components/instance/setup-form.tsx +++ b/apps/admin/components/instance/setup-form.tsx @@ -273,7 +273,7 @@ export function InstanceSetupForm() { {showPassword.password ? (