Roo-Code/webview-ui
google-labs-jules[bot] 917bf6a3e4 Fix: Improve webview rendering robustness and error handling
This change addresses potential grey/blank screen or crashing issues in the webview by:

1.  **Adding an ErrorBoundary:** I introduced an `ErrorBoundary` component at the root of `webview-ui/src/App.tsx`. This component catches JavaScript rendering errors in its children, displaying a user-friendly fallback UI instead of a blank or broken screen. It also logs the error to the console for easier debugging.

2.  **Implementing Loading/Timeout Logic:** I modified `webview-ui/src/App.tsx` to:
    *   Display a "Loading..." message while the initial extension state (`didHydrateState`) is being processed.
    *   Implement a 10-second timeout. If state hydration doesn't complete within this period, an error message is shown, guiding you to try reloading or checking for updates. This provides better feedback than a persistent blank screen.

3.  **Adding Unit Tests:**
    *   I created tests for the `ErrorBoundary` to ensure it correctly catches errors and renders the fallback UI or child components as expected.
    *   I created tests for the `App.tsx` loading and timeout logic to verify that loading indicators and error messages are displayed appropriately under different hydration scenarios.

These changes aim to make the webview more resilient to rendering errors and provide better feedback to you during initialization, improving the overall user experience and aiding in diagnosing future issues.
2025-05-21 04:11:02 +00:00
..
.storybook Additional @shadcn/ui components 2025-02-14 23:41:39 -08:00
audio feat: move play audio to webview to ensure cross-platform (#3659) 2025-05-20 01:15:05 -04:00
public Remove CRA cruft 2025-01-30 14:38:41 -08:00
src Fix: Improve webview rendering robustness and error handling 2025-05-21 04:11:02 +00:00
.eslintrc.json fix: command validation failing on shell array indexing (#3530) 2025-05-12 21:31:54 -07:00
.gitignore PR cleanup 2025-03-12 11:23:06 -04:00
.npmrc Improved logic for auto-approving chained commands 2024-12-26 22:45:09 -08:00
components.json Remove lucide 2025-01-30 14:47:59 -08:00
index.html Fix linter warning + run prettier on everything (#3581) 2025-05-13 15:16:24 -07:00
jest.config.cjs Fix linter warning + run prettier on everything (#3581) 2025-05-13 15:16:24 -07:00
package-lock.json feat: move play audio to webview to ensure cross-platform (#3659) 2025-05-20 01:15:05 -04:00
package.json feat: move play audio to webview to ensure cross-platform (#3659) 2025-05-20 01:15:05 -04:00
tsconfig.json build: enable source maps for improved debugging (#3596) 2025-05-14 13:46:53 -04:00
vite.config.ts feat: move play audio to webview to ensure cross-platform (#3659) 2025-05-20 01:15:05 -04:00