bbovenzi commented on code in PR #53981:
URL: https://github.com/apache/airflow/pull/53981#discussion_r2283236534


##########
airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/src/main.tsx:
##########
@@ -16,25 +16,144 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { ChakraProvider, defaultSystem } from "@chakra-ui/react";
+import { ChakraProvider } from "@chakra-ui/react";
 import { QueryClientProvider } from "@tanstack/react-query";
 import { ThemeProvider } from "next-themes";
+import React from "react";
 import { CookiesProvider } from "react-cookie";
 import { createRoot } from "react-dom/client";
 import { RouterProvider } from "react-router-dom";
 
 import { router } from "src/router";
+import { system } from "src/theme";
 
 import { queryClient } from "./queryClient";
 
-createRoot(document.querySelector("#root") as HTMLDivElement).render(
-  <ChakraProvider value={defaultSystem}>
-    <ThemeProvider attribute="class" disableTransitionOnChange>
-      <QueryClientProvider client={queryClient}>
-        <CookiesProvider>
-          <RouterProvider router={router} />
-        </CookiesProvider>
-      </QueryClientProvider>
-    </ThemeProvider>
-  </ChakraProvider>,
+// Add global accessibility styles
+const globalStyles = `
+  .sr-only {
+    position: absolute;
+    width: 1px;
+    height: 1px;
+    padding: 0;
+    margin: -1px;
+    overflow: hidden;
+    clip: rect(0, 0, 0, 0);
+    white-space: nowrap;
+    border: 0;
+  }
+
+  /* Ensure focus is visible for keyboard navigation */
+  *:focus-visible {
+    outline: 2px solid #005fcc;
+    outline-offset: 2px;
+  }
+
+  /* Reduce motion for users who prefer it */
+  @media (prefers-reduced-motion: reduce) {
+    *,
+    *::before,
+    *::after {
+      animation-duration: 0.01ms !important;
+      animation-iteration-count: 1 !important;
+      transition-duration: 0.01ms !important;
+    }
+  }
+
+  /* High contrast mode support */
+  @media (prefers-contrast: high) {
+    * {
+      text-shadow: none !important;
+      box-shadow: none !important;
+    }
+  }
+`;
+
+// Inject global styles
+const styleSheet = document.createElement("style");
+
+styleSheet.type = "text/css";
+styleSheet.innerHTML = globalStyles;
+document.head.append(styleSheet);
+
+type ErrorBoundaryProps = {
+  readonly children: React.ReactNode;
+}
+
+type ErrorBoundaryState = {
+  hasError: boolean;
+}
+
+// Error boundary component for better error handling
+class ErrorBoundary extends React.Component<ErrorBoundaryProps, 
ErrorBoundaryState> {

Review Comment:
   Let's move ErrorBoundary to its own file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to