diff --git a/.cursor/rules/typescript.mdc b/.cursor/rules/typescript.mdc index ccf11590eb..661f3e46c0 100644 --- a/.cursor/rules/typescript.mdc +++ b/.cursor/rules/typescript.mdc @@ -13,6 +13,7 @@ Code Style and Structure - Prefer iteration and modularization over code duplication. - Use descriptive variable names with auxiliary verbs (e.g., isLoaded, hasError). - Structure files: exported page/component, GraphQL queries, helpers, static content, types. +- When creating a new component, place it in its own file rather than grouping multiple components in a single file. Naming Conventions diff --git a/packages/desktop-client/src/components/App.tsx b/packages/desktop-client/src/components/App.tsx index dedb6bbfd0..be885168d0 100644 --- a/packages/desktop-client/src/components/App.tsx +++ b/packages/desktop-client/src/components/App.tsx @@ -242,7 +242,9 @@ export function App() { - + + + diff --git a/packages/desktop-client/src/components/FatalError.tsx b/packages/desktop-client/src/components/FatalError.tsx index 0f80a80847..f8e1fcf605 100644 --- a/packages/desktop-client/src/components/FatalError.tsx +++ b/packages/desktop-client/src/components/FatalError.tsx @@ -14,6 +14,8 @@ import { Link } from './common/Link'; import { Modal, ModalHeader } from './common/Modal'; import { Checkbox } from './forms'; +import { useModalState } from '@desktop-client/hooks/useModalState'; + type AppError = Error & { type?: string; IDBFailure?: boolean; @@ -194,13 +196,16 @@ function SharedArrayBufferOverride() { export function FatalError({ error }: FatalErrorProps) { const { t } = useTranslation(); + const { modalStack } = useModalState(); + const lastModal = modalStack[modalStack.length - 1]; + const [showError, setShowError] = useState(false); const showSimpleRender = 'type' in error && error.type === 'app-init-failure'; const isLazyLoadError = error instanceof LazyLoadFailedError; return ( - + diff --git a/upcoming-release-notes/5649.md b/upcoming-release-notes/5649.md new file mode 100644 index 0000000000..aad14df9a4 --- /dev/null +++ b/upcoming-release-notes/5649.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [MatissJanis] +--- + +Add error boundary for modal windows