Improve error boundary granularity with page and section level boundaries
Implement three-level error boundary strategy: - Top-level (app shell): catches critical failures - Page-level: preserves navigation when page crashes - Section-level: graceful degradation for charts/tables Create new components: - PageErrorBoundary: wraps page routes - SectionErrorBoundary: wraps data-heavy sections Enhance ErrorBoundary with customizable titles, messages, and reload behavior. Apply page boundaries to all route handlers in App.tsx. Apply section boundaries to: - DashboardPage: server status, ban trend, country charts, ban list - JailsPage: jail overview, ban/unban form, IP lookup - MapPage: world map, ban table - ConfigPage: configuration editor - HistoryPage: history table, IP detail view - BlocklistsPage: sources, schedule, import log Update Web-Development.md with error boundary strategy documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -10,9 +10,13 @@
|
||||
* Actions — structured action.d form editor
|
||||
* Server — server-level settings, map thresholds, service health + log viewer
|
||||
* Regex Tester — live pattern tester
|
||||
*
|
||||
* Configuration content is wrapped with SectionErrorBoundary to prevent
|
||||
* one tab or editor from crashing the entire page.
|
||||
*/
|
||||
|
||||
import { Text, makeStyles, tokens } from "@fluentui/react-components";
|
||||
import { SectionErrorBoundary } from "../components/SectionErrorBoundary";
|
||||
import { ConfigPageContainer } from "../components/config/ConfigPageContainer";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
@@ -44,7 +48,9 @@ export function ConfigPage(): React.JSX.Element {
|
||||
</Text>
|
||||
</div>
|
||||
|
||||
<ConfigPageContainer />
|
||||
<SectionErrorBoundary sectionName="Configuration Editor">
|
||||
<ConfigPageContainer />
|
||||
</SectionErrorBoundary>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user