# Routes

- File ID: file:1sm6kjd:routes-razor
- Path: NexusReader.UI.Shared/Routes.razor
- Role: ui-component
- Layer: frontend

## Purpose

Blazor routing and global error boundary component that wires application-level navigation, authorization gating, NotFound fallback and a UI error screen with a retry (recover) action.

## Key Details

Provides application-level routing and a global UI error boundary with a manual recover control; uses AuthorizeRouteView to redirect unauthorized users to a login helper and renders a NotFound page for unmatched routes.

## Symbols

- Routes: Blazor routing and global error boundary component that wires application-level navigation, authorization gating, NotFound fallback and a UI error screen with a retry (recover) action.
- Render (component markup): Renders the app Router, wraps route rendering in an authorization view and an error boundary; shows NotFound and an error UI with a retry action.

## Dependencies

- imports NexusReader.UI.Shared/Pages/NotFound.razor

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.UI.Shared/RedirectToLogin.razor
- dependency-target: NexusReader.UI.Shared/Layouts/MainHubLayout.razor
- dependency-target: NexusReader.UI.Shared/Components/NexusIcon.razor
- call-target: NexusReader.UI.Shared/RedirectToLogin.razor
- call-target: NexusReader.UI.Shared/Layouts/MainHubLayout.razor
- call-target: NexusReader.UI.Shared/Pages/NotFound.razor
- call-target: NexusReader.UI.Shared/Components/NexusIcon.razor
- call-target: NexusReader.UI.Shared/Components/NexusIcon.razor

## Coverage

- Symbols: 2
- Executable symbols: 1
- Executable symbols with control flow: 1
- Grounded edges: 3
- Unresolved references: 8
- Control-flow fragments: 1
- Unresolved jumps: 5
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 3

## Control Flow Fragments

- Render (component markup): 27 nodes, 30 edges, 5 jumps, 0 unsupported constructs

## Diagrams

### Routes Neighborhood

```mermaid
flowchart LR
    class_19wn0m3_routes("Routes")
    file_1sm6kjd_routes_razor("Routes")
    method_1bnazn2_render_component_markup[["Render (component markup)"]]
    file_13jb3vh_notfound_razor[/"NotFound"/]
    file_1sm6kjd_routes_razor -->|NotFound| file_13jb3vh_notfound_razor
```

### Routes Execution Overview

```mermaid
flowchart TD
    class_19wn0m3_routes("Routes")
    method_1bnazn2_render_component_markup[["Render (component markup)"]]
    unresolved_unresolved_1f2vk8v_call_target{"Unresolved: RedirectToLogin"}
    unresolved_unresolved_1r4ovr6_call_target{"Unresolved: NotFound"}
    unresolved_unresolved_oz0xm_call_target{"Unresolved: NexusIcon"}
    unresolved_unresolved_tq0ur7_call_target{"Unresolved: MainHubLayout"}
    class_19wn0m3_routes -->|contains| method_1bnazn2_render_component_markup
    method_1bnazn2_render_component_markup -->|unresolved call| unresolved_unresolved_1f2vk8v_call_target
    method_1bnazn2_render_component_markup -->|unresolved call| unresolved_unresolved_1r4ovr6_call_target
    method_1bnazn2_render_component_markup -->|unresolved call| unresolved_unresolved_oz0xm_call_target
    method_1bnazn2_render_component_markup -->|unresolved call| unresolved_unresolved_oz0xm_call_target
    method_1bnazn2_render_component_markup -->|unresolved call| unresolved_unresolved_tq0ur7_call_target
```

### Render (component markup)() Control Flow

_Warnings: diagram method_1bnazn2_render_component_markup__fragment_diagram exceeds preferred complexity thresholds (27 nodes, 30 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1bnazn2_render_component_markup__call_13_NotFound[["NotFound"]]
    method_1bnazn2_render_component_markup__call_21_NexusIcon[["NexusIcon"]]
    method_1bnazn2_render_component_markup__call_31_NexusIcon[["NexusIcon"]]
    method_1bnazn2_render_component_markup__call_5_MainHubLayout[["MainHubLayout"]]
    method_1bnazn2_render_component_markup__call_7_RedirectToLogin[["RedirectToLogin"]]
    method_1bnazn2_render_component_markup__action_1_error_boundary_1__linear("Global error handling UI")
    method_1bnazn2_render_component_markup__action_10_focus_navigation_10__linear("FocusOnNavigate usage")
    method_1bnazn2_render_component_markup__action_12_fallback_12__condition{"NotFound fallback"}
    method_1bnazn2_render_component_markup__action_12_fallback_12__false("false")
    method_1bnazn2_render_component_markup__action_12_fallback_12__merge("merge")
    method_1bnazn2_render_component_markup__action_12_fallback_12__true("true")
    method_1bnazn2_render_component_markup__action_27_display_27__linear("Surface exception message")
    method_1bnazn2_render_component_markup__action_3_orchestration_3__linear("Routing orchestration")
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__condition{"_errorBoundary != null"}
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__false("no-op")
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__merge("merge")
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__true("calls Recover()")
    method_1bnazn2_render_component_markup__action_30_retry_30__loop_body[["Button onclick triggers lambda that calls _errorBoundary?.Recover() to attempt UI recovery"]]
    method_1bnazn2_render_component_markup__action_30_retry_30__loop_entry("Retry/recover action")
    method_1bnazn2_render_component_markup__action_30_retry_30__loop_exit("exit loop")
    method_1bnazn2_render_component_markup__action_5_authorization_gate_5__linear("AuthorizeRouteView enforces authorization for routed pages")
    method_1bnazn2_render_component_markup__action_6_fallback_6__condition{"NotAuthorized fallback"}
    method_1bnazn2_render_component_markup__action_6_fallback_6__false("false")
    method_1bnazn2_render_component_markup__action_6_fallback_6__merge("merge")
    method_1bnazn2_render_component_markup__action_6_fallback_6__true("true")
    method_1bnazn2_render_component_markup__entry(["Render (component markup) entry"])
    method_1bnazn2_render_component_markup__implicit_return(["return"])
    method_1bnazn2_render_component_markup__action_1_error_boundary_1__linear -->|next| method_1bnazn2_render_component_markup__action_3_orchestration_3__linear
    method_1bnazn2_render_component_markup__action_10_focus_navigation_10__linear -->|fallback| method_1bnazn2_render_component_markup__action_12_fallback_12__condition
    method_1bnazn2_render_component_markup__action_12_fallback_12__condition -->|false| method_1bnazn2_render_component_markup__action_12_fallback_12__false
    method_1bnazn2_render_component_markup__action_12_fallback_12__condition -->|true| method_1bnazn2_render_component_markup__action_12_fallback_12__true
    method_1bnazn2_render_component_markup__action_12_fallback_12__false -->|next| method_1bnazn2_render_component_markup__action_12_fallback_12__merge
    method_1bnazn2_render_component_markup__action_12_fallback_12__merge -->|renders NotFound page for unmatched routes| method_1bnazn2_render_component_markup__call_13_NotFound
    method_1bnazn2_render_component_markup__action_12_fallback_12__true -->|next| method_1bnazn2_render_component_markup__action_12_fallback_12__merge
    method_1bnazn2_render_component_markup__action_27_display_27__linear -->|next| method_1bnazn2_render_component_markup__action_30_retry_30__loop_entry
    method_1bnazn2_render_component_markup__action_3_orchestration_3__linear -->|next| method_1bnazn2_render_component_markup__action_5_authorization_gate_5__linear
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__condition -->|no-op| method_1bnazn2_render_component_markup__action_30_guard_clause_30__false
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__condition -->|calls Recover| method_1bnazn2_render_component_markup__action_30_guard_clause_30__true
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__false -->|next| method_1bnazn2_render_component_markup__action_30_guard_clause_30__merge
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__merge -->|calls| method_1bnazn2_render_component_markup__call_31_NexusIcon
    method_1bnazn2_render_component_markup__action_30_guard_clause_30__true -->|next| method_1bnazn2_render_component_markup__action_30_guard_clause_30__merge
    method_1bnazn2_render_component_markup__action_30_retry_30__loop_body -->|retry| method_1bnazn2_render_component_markup__action_30_retry_30__loop_entry
    method_1bnazn2_render_component_markup__action_30_retry_30__loop_entry -->|iterate| method_1bnazn2_render_component_markup__action_30_retry_30__loop_body
    method_1bnazn2_render_component_markup__action_30_retry_30__loop_entry -->|exit| method_1bnazn2_render_component_markup__action_30_retry_30__loop_exit
    method_1bnazn2_render_component_markup__action_30_retry_30__loop_exit -->|next| method_1bnazn2_render_component_markup__action_30_guard_clause_30__condition
    method_1bnazn2_render_component_markup__action_5_authorization_gate_5__linear -->|used as DefaultLayout for AuthorizeRouteView| method_1bnazn2_render_component_markup__call_5_MainHubLayout
    method_1bnazn2_render_component_markup__action_6_fallback_6__condition -->|false| method_1bnazn2_render_component_markup__action_6_fallback_6__false
    method_1bnazn2_render_component_markup__action_6_fallback_6__condition -->|true| method_1bnazn2_render_component_markup__action_6_fallback_6__true
    method_1bnazn2_render_component_markup__action_6_fallback_6__false -->|next| method_1bnazn2_render_component_markup__action_6_fallback_6__merge
    method_1bnazn2_render_component_markup__action_6_fallback_6__merge -->|none renders redirect-to-login component in NotAuthorized slot| method_1bnazn2_render_component_markup__call_7_RedirectToLogin
    method_1bnazn2_render_component_markup__action_6_fallback_6__true -->|next| method_1bnazn2_render_component_markup__action_6_fallback_6__merge
    method_1bnazn2_render_component_markup__call_13_NotFound -->|calls| method_1bnazn2_render_component_markup__call_21_NexusIcon
    method_1bnazn2_render_component_markup__call_21_NexusIcon -->|next| method_1bnazn2_render_component_markup__action_27_display_27__linear
    method_1bnazn2_render_component_markup__call_31_NexusIcon -->|return| method_1bnazn2_render_component_markup__implicit_return
    method_1bnazn2_render_component_markup__call_5_MainHubLayout -->|fallback| method_1bnazn2_render_component_markup__action_6_fallback_6__condition
    method_1bnazn2_render_component_markup__call_7_RedirectToLogin -->|next| method_1bnazn2_render_component_markup__action_10_focus_navigation_10__linear
    method_1bnazn2_render_component_markup__entry -->|next| method_1bnazn2_render_component_markup__action_1_error_boundary_1__linear
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 5 unresolved jumps.
- Warning: control-flow: diagram method_1bnazn2_render_component_markup__fragment_diagram exceeds preferred complexity thresholds (27 nodes, 30 edges).
