# KnowledgeCoordinator

- File ID: file:uvydt4:knowledgecoordinator-cs
- Path: NexusReader.UI.Shared/Services/KnowledgeCoordinator.cs
- Role: service
- Layer: frontend

## Purpose

Coordinates knowledge-graph and quiz generation in the UI layer: subscribes to UI interactions, orchestrates calls to knowledge/graph/quiz/platform services, updates graph state, and exposes an event when graph data is available.

## Key Details

Exposes OnGraphUpdated event; subscribes to interaction service OnNodeSelected; major orchestration points: ProcessFullPageAsync (graph generation flow) and RequestSummaryAndQuizAsync (summary+quiz flow). Uses source-generated logger partial methods and ensures UI-state updates (graphService, quizService) and platform vibration on success.

## Symbols

- KnowledgeCoordinator: Coordinates knowledge-graph and quiz generation in the UI layer: subscribes to UI interactions, orchestrates calls to knowledge/graph/quiz/platform services, updates graph state, and exposes an event when graph data is available.
- KnowledgeCoordinator(): Constructs the coordinator, stores injected services and subscribes to node-selection events from the interaction service.
- HandleNodeSelected(): Handles a node selection event from UI: resolves a target block id (preferring connected 'current' block), then requests scrolling and highlighting of that block.
- ProcessFullPageAsync(): Given full page content, clears and sets graph loading, requests graph data from knowledge service, updates the graph, invokes OnGraphUpdated event, and triggers success vibration; errors are logged.
- OnBlockReachedAsync(): Updates the graph service active node when a content block is reached (UI navigation), intentionally does not trigger highlight.
- RequestSummaryAndQuizAsync(): Orchestrates requesting a summary and quiz from the knowledge service, maps remote quiz DTOs into local QuizDto/QuizQuestionDto, sets quiz state, triggers vibration on success, and handles errors with logging and Result.Fail.
- ClearAsync(): Clears the graph service state and clears the quiz state.
- Dispose(): Unsubscribes the node-selected handler from the interaction service to avoid leaks.
- LogGeneratingGraph(): Source-generated logger stub for informational message when generating a graph.
- LogGraphError(): Source-generated logger stub for graph generation errors.
- LogRequestingSummary(): Source-generated logger stub for requesting summary and quiz.
- LogSummaryWarning(): Source-generated logger stub for warnings when summary/quiz retrieval fails.
- LogSummaryError(): Source-generated logger stub for errors during summary/quiz retrieval.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.Application.Abstractions.Services (IKnowledgeService, IKnowledgeGraphService, IQuizStateService, IPlatformService)
- dependency-target: NexusReader.UI.Shared.Services (IReaderInteractionService)
- dependency-target: NexusReader.Application.DTOs.AI (GraphDataDto, KnowledgePacket, QuizDto, QuizQuestionDto)
- dependency-target: Microsoft.Extensions.Logging
- call-target: unknown
- call-target: unknown
- call-target: self
- call-target: unknown
- call-target: unknown
- call-target: self
- call-target: unknown
- call-target: unknown
- call-target: unknown
- call-target: unknown
- call-target: self
- call-target: unknown
- call-target: self
- call-target: unknown
- call-target: unknown
- call-target: self
- call-target: unknown
- call-target: self
- call-target: unknown
- call-target: unknown
- call-target: self
- call-target: self
- call-target: unknown
- call-target: unknown
- call-target: unknown
- interaction-target: var selectedNode = graph.Nodes.FirstOrDefault(n => n.Id == nodeId);
- interaction-target: var connectedLinks = graph.Links.Where(l => l.Source == nodeId || l.Target == nodeId).ToList();
- interaction-target: var otherNode = graph.Nodes.FirstOrDefault(n => n.Id == otherId);
- interaction-target: calls interaction service to scroll and highlight target block
- interaction-target: await knowledgeService.GetGraphDataAsync(fullContent, tenantId)
- interaction-target: await knowledgeService.GetSummaryAndQuizAsync

## Coverage

- Symbols: 13
- Executable symbols: 12
- Executable symbols with control flow: 12
- Grounded edges: 13
- Unresolved references: 35
- Control-flow fragments: 12
- Unresolved jumps: 20
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 9

## Control Flow Fragments

- KnowledgeCoordinator: 5 nodes, 4 edges, 1 jumps, 0 unsupported constructs
- HandleNodeSelected: 42 nodes, 49 edges, 4 jumps, 0 unsupported constructs
- ProcessFullPageAsync: 47 nodes, 52 edges, 8 jumps, 0 unsupported constructs
- OnBlockReachedAsync: 6 nodes, 5 edges, 1 jumps, 0 unsupported constructs
- RequestSummaryAndQuizAsync: 35 nodes, 36 edges, 8 jumps, 0 unsupported constructs
- ClearAsync: 7 nodes, 6 edges, 2 jumps, 0 unsupported constructs
- Dispose: 4 nodes, 3 edges, 1 jumps, 0 unsupported constructs
- LogGeneratingGraph: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- LogGraphError: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- LogRequestingSummary: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- LogSummaryWarning: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- LogSummaryError: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### KnowledgeCoordinator Neighborhood

_Warnings: diagram file_uvydt4_knowledgecoordinator_cs_neighborhood_view exceeds preferred complexity thresholds (14 nodes, 0 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart LR
    class_1cca8vk_knowledgecoordinator("KnowledgeCoordinator")
    file_uvydt4_knowledgecoordinator_cs("KnowledgeCoordinator")
    method_1b2nffa_knowledgecoordinator[["KnowledgeCoordinator()"]]
    method_1ip44st_loggeneratinggraph[["LogGeneratingGraph()"]]
    method_1nzct8x_loggrapherror[["LogGraphError()"]]
    method_1pdmx9l_onblockreachedasync[["OnBlockReachedAsync()"]]
    method_1sfi79b_logrequestingsummary[["LogRequestingSummary()"]]
    method_1wlwqp0_dispose[["Dispose()"]]
    method_1x9gjeq_processfullpageasync[["ProcessFullPageAsync()"]]
    method_1z06px6_logsummaryerror[["LogSummaryError()"]]
    method_2y4xzb_requestsummaryandquizasync[["RequestSummaryAndQuizAsync()"]]
    method_arton1_logsummarywarning[["LogSummaryWarning()"]]
    method_b6ndo3_clearasync[["ClearAsync()"]]
    method_t1zuul_handlenodeselected[["HandleNodeSelected()"]]
```

### KnowledgeCoordinator Execution Overview

_Warnings: diagram file_uvydt4_knowledgecoordinator_cs_execution_view exceeds preferred complexity thresholds (44 nodes, 43 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    class_1cca8vk_knowledgecoordinator("KnowledgeCoordinator")
    method_1b2nffa_knowledgecoordinator[["KnowledgeCoordinator()"]]
    method_1ip44st_loggeneratinggraph[["LogGeneratingGraph()"]]
    method_1nzct8x_loggrapherror[["LogGraphError()"]]
    method_1pdmx9l_onblockreachedasync[["OnBlockReachedAsync()"]]
    method_1sfi79b_logrequestingsummary[["LogRequestingSummary()"]]
    method_1wlwqp0_dispose[["Dispose()"]]
    method_1x9gjeq_processfullpageasync[["ProcessFullPageAsync()"]]
    method_1z06px6_logsummaryerror[["LogSummaryError()"]]
    method_2y4xzb_requestsummaryandquizasync[["RequestSummaryAndQuizAsync()"]]
    method_arton1_logsummarywarning[["LogSummaryWarning()"]]
    method_b6ndo3_clearasync[["ClearAsync()"]]
    method_t1zuul_handlenodeselected[["HandleNodeSelected()"]]
    unresolved_unresolved_10k0xq2_call_target{"Unresolved: LogSummaryError"}
    unresolved_unresolved_138ieal_call_target{"Unresolved: IPlatformService.VibrateSuccessAsync"}
    unresolved_unresolved_14hsy43_interaction_target{"Unresolved: var selectedNode = graph.Nodes.FirstOrDefault(n => n.Id == nodeId);"}
    unresolved_unresolved_195fh9x_interaction_target{"Unresolved: await knowledgeService.GetGraphDataAsync(fullContent, tenantId)"}
    unresolved_unresolved_19qfwar_call_target{"Unresolved: IKnowledgeGraphService.Clear"}
    unresolved_unresolved_1gdw0l4_interaction_target{"Unresolved: var otherNode = graph.Nodes.FirstOrDefault(n => n.Id == otherId);"}
    unresolved_unresolved_1jeqq7f_call_target{"Unresolved: IKnowledgeGraphService.CurrentGraphData"}
    unresolved_unresolved_1jethnu_call_target{"Unresolved: LogGraphError"}
    unresolved_unresolved_1l2fji5_call_target{"Unresolved: LogRequestingSummary"}
    unresolved_unresolved_1mb4whl_call_target{"Unresolved: IPlatformService.VibrateSuccessAsync"}
    unresolved_unresolved_1tot29h_interaction_target{"Unresolved: calls interaction service to scroll and highlight target block"}
    unresolved_unresolved_1uj8fas_call_target{"Unresolved: LogGeneratingGraph"}
    unresolved_unresolved_1wzgphe_call_target{"Unresolved: IKnowledgeGraphService.Clear"}
    unresolved_unresolved_1x8q8gu_call_target{"Unresolved: IQuizStateService.SetHydrating"}
    unresolved_unresolved_1xmjhl6_call_target{"Unresolved: QuizQuestionDto..ctor"}
    unresolved_unresolved_50r37w_call_target{"Unresolved: IKnowledgeService.GetSummaryAndQuizAsync"}
    unresolved_unresolved_6y3yrp_call_target{"Unresolved: HandleNodeSelected (internal loop logic)"}
    unresolved_unresolved_9p5jul_interaction_target{"Unresolved: var connectedLinks = graph.Links.Where(l => l.Source == nodeId || l.Target == nodeId).ToList();"}
    unresolved_unresolved_aq6gt7_call_target{"Unresolved: IQuizStateService.SetQuiz"}
    unresolved_unresolved_aqqz88_call_target{"Unresolved: IQuizStateService.SetQuiz"}
    unresolved_unresolved_d4g5ep_call_target{"Unresolved: IKnowledgeGraphService.UpdateGraph"}
    unresolved_unresolved_e4ysnj_call_target{"Unresolved: IReaderInteractionService.OnNodeSelected -= HandleNodeSelected"}
    unresolved_unresolved_e519rx_call_target{"Unresolved: IKnowledgeGraphService.SetActiveNode"}
    unresolved_unresolved_gv42wu_call_target{"Unresolved: OnGraphUpdated.Invoke"}
    unresolved_unresolved_jn8a9a_call_target{"Unresolved: IReaderInteractionService.OnNodeSelected += HandleNodeSelected"}
    unresolved_unresolved_jzoxi8_call_target{"Unresolved: LogSummaryWarning"}
    unresolved_unresolved_lfjasv_interaction_target{"Unresolved: await knowledgeService.GetSummaryAndQuizAsync"}
    unresolved_unresolved_o570ld_call_target{"Unresolved: IReaderInteractionService.RequestHighlightBlock"}
    unresolved_unresolved_oerwvi_call_target{"Unresolved: IKnowledgeGraphService.SetLoading"}
    unresolved_unresolved_rs65i9_call_target{"Unresolved: IReaderInteractionService.RequestScrollToBlock"}
    unresolved_unresolved_u4oqdw_call_target{"Unresolved: IKnowledgeService.GetGraphDataAsync"}
    class_1cca8vk_knowledgecoordinator -->|contains| method_1b2nffa_knowledgecoordinator
    class_1cca8vk_knowledgecoordinator -->|contains| method_1ip44st_loggeneratinggraph
    class_1cca8vk_knowledgecoordinator -->|contains| method_1nzct8x_loggrapherror
    class_1cca8vk_knowledgecoordinator -->|contains| method_1pdmx9l_onblockreachedasync
    class_1cca8vk_knowledgecoordinator -->|contains| method_1sfi79b_logrequestingsummary
    class_1cca8vk_knowledgecoordinator -->|contains| method_1wlwqp0_dispose
    class_1cca8vk_knowledgecoordinator -->|contains| method_1x9gjeq_processfullpageasync
    class_1cca8vk_knowledgecoordinator -->|contains| method_1z06px6_logsummaryerror
    class_1cca8vk_knowledgecoordinator -->|contains| method_2y4xzb_requestsummaryandquizasync
    class_1cca8vk_knowledgecoordinator -->|contains| method_arton1_logsummarywarning
    class_1cca8vk_knowledgecoordinator -->|contains| method_b6ndo3_clearasync
    class_1cca8vk_knowledgecoordinator -->|contains| method_t1zuul_handlenodeselected
    class_1cca8vk_knowledgecoordinator -->|unresolved interaction| unresolved_unresolved_14hsy43_interaction_target
    class_1cca8vk_knowledgecoordinator -->|unresolved interaction| unresolved_unresolved_195fh9x_interaction_target
    class_1cca8vk_knowledgecoordinator -->|unresolved interaction| unresolved_unresolved_1gdw0l4_interaction_target
    class_1cca8vk_knowledgecoordinator -->|unresolved interaction| unresolved_unresolved_1tot29h_interaction_target
    class_1cca8vk_knowledgecoordinator -->|unresolved interaction| unresolved_unresolved_9p5jul_interaction_target
    class_1cca8vk_knowledgecoordinator -->|unresolved interaction| unresolved_unresolved_lfjasv_interaction_target
    method_1b2nffa_knowledgecoordinator -->|unresolved call| unresolved_unresolved_jn8a9a_call_target
    method_1pdmx9l_onblockreachedasync -->|unresolved call| unresolved_unresolved_e519rx_call_target
    method_1wlwqp0_dispose -->|unresolved call| unresolved_unresolved_e4ysnj_call_target
    method_1x9gjeq_processfullpageasync -->|unresolved call| unresolved_unresolved_19qfwar_call_target
    method_1x9gjeq_processfullpageasync -->|unresolved call| unresolved_unresolved_1jethnu_call_target
    method_1x9gjeq_processfullpageasync -->|unresolved call| unresolved_unresolved_1mb4whl_call_target
    method_1x9gjeq_processfullpageasync -->|unresolved call| unresolved_unresolved_1uj8fas_call_target
    method_1x9gjeq_processfullpageasync -->|unresolved call| unresolved_unresolved_d4g5ep_call_target
    method_1x9gjeq_processfullpageasync -->|unresolved call| unresolved_unresolved_gv42wu_call_target
    method_1x9gjeq_processfullpageasync -->|unresolved call| unresolved_unresolved_oerwvi_call_target
    method_1x9gjeq_processfullpageasync -->|unresolved call| unresolved_unresolved_u4oqdw_call_target
    method_2y4xzb_requestsummaryandquizasync -->|unresolved call| unresolved_unresolved_10k0xq2_call_target
    method_2y4xzb_requestsummaryandquizasync -->|unresolved call| unresolved_unresolved_138ieal_call_target
    method_2y4xzb_requestsummaryandquizasync -->|unresolved call| unresolved_unresolved_1l2fji5_call_target
    method_2y4xzb_requestsummaryandquizasync -->|unresolved call| unresolved_unresolved_1x8q8gu_call_target
    method_2y4xzb_requestsummaryandquizasync -->|unresolved call| unresolved_unresolved_1xmjhl6_call_target
    method_2y4xzb_requestsummaryandquizasync -->|unresolved call| unresolved_unresolved_50r37w_call_target
    method_2y4xzb_requestsummaryandquizasync -->|unresolved call| unresolved_unresolved_aq6gt7_call_target
    method_2y4xzb_requestsummaryandquizasync -->|unresolved call| unresolved_unresolved_jzoxi8_call_target
    method_b6ndo3_clearasync -->|unresolved call| unresolved_unresolved_1wzgphe_call_target
    method_b6ndo3_clearasync -->|unresolved call| unresolved_unresolved_aqqz88_call_target
    method_t1zuul_handlenodeselected -->|unresolved call| unresolved_unresolved_1jeqq7f_call_target
    method_t1zuul_handlenodeselected -->|unresolved call| unresolved_unresolved_6y3yrp_call_target
    method_t1zuul_handlenodeselected -->|unresolved call| unresolved_unresolved_o570ld_call_target
    method_t1zuul_handlenodeselected -->|unresolved call| unresolved_unresolved_rs65i9_call_target
```

### KnowledgeCoordinator() Control Flow

```mermaid
flowchart TD
    method_1b2nffa_knowledgecoordinator__call_41_IReaderInteractionService_OnNodeSelected_HandleNodeSelected[["IReaderInteractionService.OnNodeSelected += HandleNodeSelected"]]
    method_1b2nffa_knowledgecoordinator__action_34_assignment_34__linear("Store injected services")
    method_1b2nffa_knowledgecoordinator__action_41_event_subscribe_41__linear("Subscribe to node selection")
    method_1b2nffa_knowledgecoordinator__entry(["KnowledgeCoordinator entry"])
    method_1b2nffa_knowledgecoordinator__implicit_return(["return"])
    method_1b2nffa_knowledgecoordinator__action_34_assignment_34__linear -->|next| method_1b2nffa_knowledgecoordinator__action_41_event_subscribe_41__linear
    method_1b2nffa_knowledgecoordinator__action_41_event_subscribe_41__linear -->|event handler HandleNodeSelected| method_1b2nffa_knowledgecoordinator__call_41_IReaderInteractionService_OnNodeSelected_HandleNodeSelected
    method_1b2nffa_knowledgecoordinator__call_41_IReaderInteractionService_OnNodeSelected_HandleNodeSelected -->|return| method_1b2nffa_knowledgecoordinator__implicit_return
    method_1b2nffa_knowledgecoordinator__entry -->|next| method_1b2nffa_knowledgecoordinator__action_34_assignment_34__linear
```

### HandleNodeSelected() Control Flow

_Warnings: diagram method_t1zuul_handlenodeselected__fragment_diagram exceeds preferred complexity thresholds (42 nodes, 49 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_t1zuul_handlenodeselected__call_48_IKnowledgeGraphService_CurrentGraphData[["IKnowledgeGraphService.CurrentGraphData"]]
    method_t1zuul_handlenodeselected__call_55_HandleNodeSelected_internal_loop_logic_[["HandleNodeSelected (internal loop logic)"]]
    method_t1zuul_handlenodeselected__call_71_IReaderInteractionService_RequestScrollToBlock[["IReaderInteractionService.RequestScrollToBlock"]]
    method_t1zuul_handlenodeselected__call_72_IReaderInteractionService_RequestHighlightBlock[["IReaderInteractionService.RequestHighlightBlock"]]
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__condition{"graph != null"}
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__false("resolve connected block")
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__merge("merge")
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__true("skip resolution")
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__condition{"graph != null"}
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__false("false")
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__merge("merge")
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__true("true")
    method_t1zuul_handlenodeselected__action_52_branch_52__condition{"selectedNode.Group == \\"concept\\""}
    method_t1zuul_handlenodeselected__action_52_branch_52__false("use nodeId as block")
    method_t1zuul_handlenodeselected__action_52_branch_52__merge("merge")
    method_t1zuul_handlenodeselected__action_52_branch_52__true("search connected links")
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__condition{"selectedNode != null && selectedNode.Group == \\"concept\\""}
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__false("false")
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__merge("merge")
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__true("true")
    method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_body[["foreach (var link in connectedLinks)"]]
    method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_entry("var link in connectedLinks")
    method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_exit("Leaves the loop when the condition no longer holds.")
    method_t1zuul_handlenodeselected__action_56_loop_56__loop_body[["foreach link in connectedLinks inspect other node"]]
    method_t1zuul_handlenodeselected__action_56_loop_56__loop_entry("Iterate links")
    method_t1zuul_handlenodeselected__action_56_loop_56__loop_exit("exit loop")
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__condition{"otherNode != null && otherNode.Group == \\"current\\""}
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__false("false")
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__merge("merge")
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__true("true")
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__condition{"!string.IsNullOrEmpty(targetBlockId)"}
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__false("false")
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__merge("merge")
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__true("true")
    method_t1zuul_handlenodeselected__action_71_handlenodeselected_await_71_8__await[["Waits for async work"]]
    method_t1zuul_handlenodeselected__action_72_handlenodeselected_await_72_9__await[["Waits for async work"]]
    method_t1zuul_handlenodeselected__entry(["HandleNodeSelected entry"])
    method_t1zuul_handlenodeselected__action_51_handlenodeselected_repository_read_51_1__linear[("Reads repository or persistence state")]
    method_t1zuul_handlenodeselected__action_55_handlenodeselected_repository_read_55_3__linear[("Reads repository or persistence state")]
    method_t1zuul_handlenodeselected__action_59_handlenodeselected_repository_read_59_5__linear[("Reads repository or persistence state")]
    method_t1zuul_handlenodeselected__action_71_external_call_71__linear("Scroll and highlight")
    method_t1zuul_handlenodeselected__implicit_return(["return"])
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__condition -->|resolve connected block| method_t1zuul_handlenodeselected__action_49_guard_clause_49__false
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__condition -->|skip resolution| method_t1zuul_handlenodeselected__action_49_guard_clause_49__true
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__false -->|next| method_t1zuul_handlenodeselected__action_49_guard_clause_49__merge
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__merge -->|next| method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__condition
    method_t1zuul_handlenodeselected__action_49_guard_clause_49__true -->|next| method_t1zuul_handlenodeselected__action_49_guard_clause_49__merge
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__condition -->|false| method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__false
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__condition -->|true| method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__true
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__false -->|next| method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__merge
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__merge -->|next| method_t1zuul_handlenodeselected__action_51_handlenodeselected_repository_read_51_1__linear
    method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__true -->|next| method_t1zuul_handlenodeselected__action_49_handlenodeselected_branch_49_0__merge
    method_t1zuul_handlenodeselected__action_51_handlenodeselected_repository_read_51_1__linear -->|next| method_t1zuul_handlenodeselected__action_52_branch_52__condition
    method_t1zuul_handlenodeselected__action_52_branch_52__condition -->|use nodeId as block| method_t1zuul_handlenodeselected__action_52_branch_52__false
    method_t1zuul_handlenodeselected__action_52_branch_52__condition -->|search connected links| method_t1zuul_handlenodeselected__action_52_branch_52__true
    method_t1zuul_handlenodeselected__action_52_branch_52__false -->|next| method_t1zuul_handlenodeselected__action_52_branch_52__merge
    method_t1zuul_handlenodeselected__action_52_branch_52__merge -->|next| method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__condition
    method_t1zuul_handlenodeselected__action_52_branch_52__true -->|next| method_t1zuul_handlenodeselected__action_52_branch_52__merge
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__condition -->|false| method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__false
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__condition -->|true| method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__true
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__false -->|next| method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__merge
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__merge -->|next| method_t1zuul_handlenodeselected__action_55_handlenodeselected_repository_read_55_3__linear
    method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__true -->|next| method_t1zuul_handlenodeselected__action_52_handlenodeselected_branch_52_2__merge
    method_t1zuul_handlenodeselected__action_55_handlenodeselected_repository_read_55_3__linear -->|calls| method_t1zuul_handlenodeselected__call_55_HandleNodeSelected_internal_loop_logic_
    method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_body -->|continue| method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_entry
    method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_entry -->|var link in connectedLinks| method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_body
    method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_entry -->|Leaves the loop when the condition no longer holds.| method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_exit
    method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_exit -->|next| method_t1zuul_handlenodeselected__action_56_loop_56__loop_entry
    method_t1zuul_handlenodeselected__action_56_loop_56__loop_body -->|continue| method_t1zuul_handlenodeselected__action_56_loop_56__loop_entry
    method_t1zuul_handlenodeselected__action_56_loop_56__loop_entry -->|iterate| method_t1zuul_handlenodeselected__action_56_loop_56__loop_body
    method_t1zuul_handlenodeselected__action_56_loop_56__loop_entry -->|exit| method_t1zuul_handlenodeselected__action_56_loop_56__loop_exit
    method_t1zuul_handlenodeselected__action_56_loop_56__loop_exit -->|next| method_t1zuul_handlenodeselected__action_59_handlenodeselected_repository_read_59_5__linear
    method_t1zuul_handlenodeselected__action_59_handlenodeselected_repository_read_59_5__linear -->|next| method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__condition
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__condition -->|false| method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__false
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__condition -->|true| method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__true
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__false -->|next| method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__merge
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__merge -->|next| method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__condition
    method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__true -->|next| method_t1zuul_handlenodeselected__action_60_handlenodeselected_branch_60_6__merge
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__condition -->|false| method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__false
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__condition -->|true| method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__true
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__false -->|next| method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__merge
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__merge -->|next| method_t1zuul_handlenodeselected__action_71_handlenodeselected_await_71_8__await
    method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__true -->|next| method_t1zuul_handlenodeselected__action_69_handlenodeselected_branch_69_7__merge
    method_t1zuul_handlenodeselected__action_71_external_call_71__linear -->|targetBlockId| method_t1zuul_handlenodeselected__call_71_IReaderInteractionService_RequestScrollToBlock
    method_t1zuul_handlenodeselected__action_71_handlenodeselected_await_71_8__await -->|next| method_t1zuul_handlenodeselected__action_71_external_call_71__linear
    method_t1zuul_handlenodeselected__action_72_handlenodeselected_await_72_9__await -->|targetBlockId| method_t1zuul_handlenodeselected__call_72_IReaderInteractionService_RequestHighlightBlock
    method_t1zuul_handlenodeselected__call_48_IKnowledgeGraphService_CurrentGraphData -->|next| method_t1zuul_handlenodeselected__action_49_guard_clause_49__condition
    method_t1zuul_handlenodeselected__call_55_HandleNodeSelected_internal_loop_logic_ -->|next| method_t1zuul_handlenodeselected__action_56_handlenodeselected_loop_56_4__loop_entry
    method_t1zuul_handlenodeselected__call_71_IReaderInteractionService_RequestScrollToBlock -->|next| method_t1zuul_handlenodeselected__action_72_handlenodeselected_await_72_9__await
    method_t1zuul_handlenodeselected__call_72_IReaderInteractionService_RequestHighlightBlock -->|return| method_t1zuul_handlenodeselected__implicit_return
    method_t1zuul_handlenodeselected__entry -->|none property read| method_t1zuul_handlenodeselected__call_48_IKnowledgeGraphService_CurrentGraphData
```

### ProcessFullPageAsync() Control Flow

_Warnings: diagram method_1x9gjeq_processfullpageasync__fragment_diagram exceeds preferred complexity thresholds (47 nodes, 52 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1x9gjeq_processfullpageasync__call_102_LogGraphError[["LogGraphError"]]
    method_1x9gjeq_processfullpageasync__call_80_LogGeneratingGraph[["LogGeneratingGraph"]]
    method_1x9gjeq_processfullpageasync__call_82_IKnowledgeGraphService_Clear[["IKnowledgeGraphService.Clear"]]
    method_1x9gjeq_processfullpageasync__call_83_IKnowledgeGraphService_SetLoading[["IKnowledgeGraphService.SetLoading"]]
    method_1x9gjeq_processfullpageasync__call_87_IKnowledgeService_GetGraphDataAsync[["IKnowledgeService.GetGraphDataAsync"]]
    method_1x9gjeq_processfullpageasync__call_93_IKnowledgeGraphService_UpdateGraph[["IKnowledgeGraphService.UpdateGraph"]]
    method_1x9gjeq_processfullpageasync__call_95_OnGraphUpdated_Invoke[["OnGraphUpdated.Invoke"]]
    method_1x9gjeq_processfullpageasync__call_96_IPlatformService_VibrateSuccessAsync[["IPlatformService.VibrateSuccessAsync"]]
    method_1x9gjeq_processfullpageasync__action_100_processfullpageasync_catch_100_11__catch("catch Exception ex")
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__condition{"string.IsNullOrWhiteSpace(fullContent)"}
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__false("continue")
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__merge("merge")
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__true("return")
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__condition{"string.IsNullOrWhiteSpace(fullContent)"}
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__false("continue")
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__merge("merge")
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__true("exit")
    method_1x9gjeq_processfullpageasync__action_80_log_80__linear("Start generating graph")
    method_1x9gjeq_processfullpageasync__action_82_processfullpageasync_await_82_1__await[["Waits for async work"]]
    method_1x9gjeq_processfullpageasync__action_82_state_change_82__linear("Graph service reset & loading")
    method_1x9gjeq_processfullpageasync__action_83_processfullpageasync_await_83_2__await[["Waits for async work"]]
    method_1x9gjeq_processfullpageasync__action_85_processfullpageasync_try_85_3__try("Begins protected execution")
    method_1x9gjeq_processfullpageasync__action_85_try_catch_85__linear("Exception handling")
    method_1x9gjeq_processfullpageasync__action_87_processfullpageasync_await_87_4__await[["Waits for async work"]]
    method_1x9gjeq_processfullpageasync__action_88_branch_88__condition{"result.IsSuccess && packet.Graph != null"}
    method_1x9gjeq_processfullpageasync__action_88_branch_88__false("no-op")
    method_1x9gjeq_processfullpageasync__action_88_branch_88__merge("merge")
    method_1x9gjeq_processfullpageasync__action_88_branch_88__true("update graph & notify")
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__condition{"result.IsSuccess"}
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__false("false")
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__merge("merge")
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__true("true")
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__condition{"packet.Graph != null"}
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__false("false")
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__merge("merge")
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__true("true")
    method_1x9gjeq_processfullpageasync__action_93_processfullpageasync_await_93_7__await[["Waits for async work"]]
    method_1x9gjeq_processfullpageasync__action_94_event_invoke_94__linear("Raise OnGraphUpdated")
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__condition{"OnGraphUpdated != null"}
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__false("false")
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__merge("merge")
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__true("true")
    method_1x9gjeq_processfullpageasync__action_95_processfullpageasync_await_95_9__await[["Waits for async work"]]
    method_1x9gjeq_processfullpageasync__action_96_processfullpageasync_await_96_10__await[["Waits for async work"]]
    method_1x9gjeq_processfullpageasync__entry(["ProcessFullPageAsync entry"])
    method_1x9gjeq_processfullpageasync__action_87_external_call_87__linear("Request graph data")
    method_1x9gjeq_processfullpageasync__implicit_return(["return"])
    method_1x9gjeq_processfullpageasync__action_100_processfullpageasync_catch_100_11__catch -->|ex, tenantId| method_1x9gjeq_processfullpageasync__call_102_LogGraphError
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__condition -->|continue| method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__false
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__condition -->|return| method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__true
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__false -->|next| method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__merge
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__merge -->|next| method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__condition
    method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__true -->|next| method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__merge
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__condition -->|continue| method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__false
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__condition -->|exit| method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__true
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__false -->|next| method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__merge
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__merge -->|next| method_1x9gjeq_processfullpageasync__action_80_log_80__linear
    method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__true -->|next| method_1x9gjeq_processfullpageasync__action_78_processfullpageasync_guard_clause_78_0__merge
    method_1x9gjeq_processfullpageasync__action_80_log_80__linear -->|tenantId| method_1x9gjeq_processfullpageasync__call_80_LogGeneratingGraph
    method_1x9gjeq_processfullpageasync__action_82_processfullpageasync_await_82_1__await -->|next| method_1x9gjeq_processfullpageasync__action_82_state_change_82__linear
    method_1x9gjeq_processfullpageasync__action_82_state_change_82__linear -->|none| method_1x9gjeq_processfullpageasync__call_82_IKnowledgeGraphService_Clear
    method_1x9gjeq_processfullpageasync__action_83_processfullpageasync_await_83_2__await -->|true| method_1x9gjeq_processfullpageasync__call_83_IKnowledgeGraphService_SetLoading
    method_1x9gjeq_processfullpageasync__action_85_processfullpageasync_try_85_3__try -->|next| method_1x9gjeq_processfullpageasync__action_87_processfullpageasync_await_87_4__await
    method_1x9gjeq_processfullpageasync__action_85_try_catch_85__linear -->|next| method_1x9gjeq_processfullpageasync__action_85_processfullpageasync_try_85_3__try
    method_1x9gjeq_processfullpageasync__action_87_external_call_87__linear -->|fullContent, tenantId| method_1x9gjeq_processfullpageasync__call_87_IKnowledgeService_GetGraphDataAsync
    method_1x9gjeq_processfullpageasync__action_87_processfullpageasync_await_87_4__await -->|next| method_1x9gjeq_processfullpageasync__action_87_external_call_87__linear
    method_1x9gjeq_processfullpageasync__action_88_branch_88__condition -->|no-op| method_1x9gjeq_processfullpageasync__action_88_branch_88__false
    method_1x9gjeq_processfullpageasync__action_88_branch_88__condition -->|transforms input| method_1x9gjeq_processfullpageasync__action_88_branch_88__true
    method_1x9gjeq_processfullpageasync__action_88_branch_88__false -->|next| method_1x9gjeq_processfullpageasync__action_88_branch_88__merge
    method_1x9gjeq_processfullpageasync__action_88_branch_88__merge -->|next| method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__condition
    method_1x9gjeq_processfullpageasync__action_88_branch_88__true -->|next| method_1x9gjeq_processfullpageasync__action_88_branch_88__merge
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__condition -->|false| method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__false
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__condition -->|true| method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__true
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__false -->|next| method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__merge
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__merge -->|next| method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__condition
    method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__true -->|next| method_1x9gjeq_processfullpageasync__action_88_processfullpageasync_branch_88_5__merge
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__condition -->|false| method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__false
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__condition -->|true| method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__true
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__false -->|next| method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__merge
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__merge -->|next| method_1x9gjeq_processfullpageasync__action_93_processfullpageasync_await_93_7__await
    method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__true -->|next| method_1x9gjeq_processfullpageasync__action_91_processfullpageasync_branch_91_6__merge
    method_1x9gjeq_processfullpageasync__action_93_processfullpageasync_await_93_7__await -->|packet.Graph| method_1x9gjeq_processfullpageasync__call_93_IKnowledgeGraphService_UpdateGraph
    method_1x9gjeq_processfullpageasync__action_94_event_invoke_94__linear -->|next| method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__condition
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__condition -->|false| method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__false
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__condition -->|true| method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__true
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__false -->|next| method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__merge
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__merge -->|next| method_1x9gjeq_processfullpageasync__action_95_processfullpageasync_await_95_9__await
    method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__true -->|next| method_1x9gjeq_processfullpageasync__action_94_processfullpageasync_branch_94_8__merge
    method_1x9gjeq_processfullpageasync__action_95_processfullpageasync_await_95_9__await -->|packet.Graph| method_1x9gjeq_processfullpageasync__call_95_OnGraphUpdated_Invoke
    method_1x9gjeq_processfullpageasync__action_96_processfullpageasync_await_96_10__await -->|none| method_1x9gjeq_processfullpageasync__call_96_IPlatformService_VibrateSuccessAsync
    method_1x9gjeq_processfullpageasync__call_102_LogGraphError -->|return| method_1x9gjeq_processfullpageasync__implicit_return
    method_1x9gjeq_processfullpageasync__call_80_LogGeneratingGraph -->|next| method_1x9gjeq_processfullpageasync__action_82_processfullpageasync_await_82_1__await
    method_1x9gjeq_processfullpageasync__call_82_IKnowledgeGraphService_Clear -->|next| method_1x9gjeq_processfullpageasync__action_83_processfullpageasync_await_83_2__await
    method_1x9gjeq_processfullpageasync__call_83_IKnowledgeGraphService_SetLoading -->|next| method_1x9gjeq_processfullpageasync__action_85_try_catch_85__linear
    method_1x9gjeq_processfullpageasync__call_87_IKnowledgeService_GetGraphDataAsync -->|next| method_1x9gjeq_processfullpageasync__action_88_branch_88__condition
    method_1x9gjeq_processfullpageasync__call_93_IKnowledgeGraphService_UpdateGraph -->|next| method_1x9gjeq_processfullpageasync__action_94_event_invoke_94__linear
    method_1x9gjeq_processfullpageasync__call_95_OnGraphUpdated_Invoke -->|next| method_1x9gjeq_processfullpageasync__action_96_processfullpageasync_await_96_10__await
    method_1x9gjeq_processfullpageasync__call_96_IPlatformService_VibrateSuccessAsync -->|exception| method_1x9gjeq_processfullpageasync__action_100_processfullpageasync_catch_100_11__catch
    method_1x9gjeq_processfullpageasync__entry -->|next| method_1x9gjeq_processfullpageasync__action_78_guard_clause_78__condition
```

### OnBlockReachedAsync() Control Flow

```mermaid
flowchart TD
    method_1pdmx9l_onblockreachedasync__call_109_IKnowledgeGraphService_SetActiveNode[["IKnowledgeGraphService.SetActiveNode"]]
    method_1pdmx9l_onblockreachedasync__action_108_comment_108__linear("Do not highlight here")
    method_1pdmx9l_onblockreachedasync__action_109_onblockreachedasync_await_109_0__await[["Waits for async work"]]
    method_1pdmx9l_onblockreachedasync__action_109_state_change_109__linear("Set active node")
    method_1pdmx9l_onblockreachedasync__entry(["OnBlockReachedAsync entry"])
    method_1pdmx9l_onblockreachedasync__implicit_return(["return"])
    method_1pdmx9l_onblockreachedasync__action_108_comment_108__linear -->|next| method_1pdmx9l_onblockreachedasync__action_109_onblockreachedasync_await_109_0__await
    method_1pdmx9l_onblockreachedasync__action_109_onblockreachedasync_await_109_0__await -->|next| method_1pdmx9l_onblockreachedasync__action_109_state_change_109__linear
    method_1pdmx9l_onblockreachedasync__action_109_state_change_109__linear -->|blockId| method_1pdmx9l_onblockreachedasync__call_109_IKnowledgeGraphService_SetActiveNode
    method_1pdmx9l_onblockreachedasync__call_109_IKnowledgeGraphService_SetActiveNode -->|return| method_1pdmx9l_onblockreachedasync__implicit_return
    method_1pdmx9l_onblockreachedasync__entry -->|next| method_1pdmx9l_onblockreachedasync__action_108_comment_108__linear
```

### RequestSummaryAndQuizAsync() Control Flow

_Warnings: diagram method_2y4xzb_requestsummaryandquizasync__fragment_diagram exceeds preferred complexity thresholds (35 nodes, 36 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_2y4xzb_requestsummaryandquizasync__call_114_IQuizStateService_SetHydrating[["IQuizStateService.SetHydrating"]]
    method_2y4xzb_requestsummaryandquizasync__call_115_LogRequestingSummary[["LogRequestingSummary"]]
    method_2y4xzb_requestsummaryandquizasync__call_118_IKnowledgeService_GetSummaryAndQuizAsync[["IKnowledgeService.GetSummaryAndQuizAsync"]]
    method_2y4xzb_requestsummaryandquizasync__call_123_QuizQuestionDto_ctor[["QuizQuestionDto..ctor"]]
    method_2y4xzb_requestsummaryandquizasync__call_126_IQuizStateService_SetQuiz[["IQuizStateService.SetQuiz"]]
    method_2y4xzb_requestsummaryandquizasync__call_127_IPlatformService_VibrateSuccessAsync[["IPlatformService.VibrateSuccessAsync"]]
    method_2y4xzb_requestsummaryandquizasync__call_131_LogSummaryWarning[["LogSummaryWarning"]]
    method_2y4xzb_requestsummaryandquizasync__call_136_LogSummaryError[["LogSummaryError"]]
    method_2y4xzb_requestsummaryandquizasync__action_114_requestsummaryandquizasync_await_114_0__await[["Waits for async work"]]
    method_2y4xzb_requestsummaryandquizasync__action_114_state_change_114__linear("Mark quiz hydrating")
    method_2y4xzb_requestsummaryandquizasync__action_115_log_115__linear("Requesting summary & quiz")
    method_2y4xzb_requestsummaryandquizasync__action_116_requestsummaryandquizasync_try_116_1__try("Begins protected execution")
    method_2y4xzb_requestsummaryandquizasync__action_116_try_catch_finally_116__linear("Error handling and cleanup")
    method_2y4xzb_requestsummaryandquizasync__action_118_requestsummaryandquizasync_await_118_2__await[["Waits for async work"]]
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__condition{"result.IsSuccess"}
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__false("log warning & fail")
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__merge("merge")
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__true("map & set quiz")
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__condition{"result.IsSuccess"}
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__false("false")
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__merge("merge")
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__true("true")
    method_2y4xzb_requestsummaryandquizasync__action_122_mapping_122__linear("Map remote quizzes to UI DTOs")
    method_2y4xzb_requestsummaryandquizasync__action_123_requestsummaryandquizasync_mapping_123_4__linear("Maps data or transforms shape")
    method_2y4xzb_requestsummaryandquizasync__action_126_requestsummaryandquizasync_await_126_5__await[["Waits for async work"]]
    method_2y4xzb_requestsummaryandquizasync__action_127_requestsummaryandquizasync_await_127_6__await[["Waits for async work"]]
    method_2y4xzb_requestsummaryandquizasync__action_134_requestsummaryandquizasync_catch_134_9__catch("catch Exception ex")
    method_2y4xzb_requestsummaryandquizasync__action_139_requestsummaryandquizasync_finally_139_11__finally("Runs cleanup or finalization")
    method_2y4xzb_requestsummaryandquizasync__action_141_requestsummaryandquizasync_await_141_12__await[["Waits for async work"]]
    method_2y4xzb_requestsummaryandquizasync__entry(["RequestSummaryAndQuizAsync entry"])
    method_2y4xzb_requestsummaryandquizasync__action_118_external_call_118__linear("Request summary+quiz")
    method_2y4xzb_requestsummaryandquizasync__action_128_requestsummaryandquizasync_return_128_7__return(["Returns result"])
    method_2y4xzb_requestsummaryandquizasync__action_132_requestsummaryandquizasync_return_132_8__return(["Returns result"])
    method_2y4xzb_requestsummaryandquizasync__action_137_requestsummaryandquizasync_return_137_10__return(["Returns result"])
    method_2y4xzb_requestsummaryandquizasync__implicit_return(["return"])
    method_2y4xzb_requestsummaryandquizasync__action_114_requestsummaryandquizasync_await_114_0__await -->|next| method_2y4xzb_requestsummaryandquizasync__action_114_state_change_114__linear
    method_2y4xzb_requestsummaryandquizasync__action_114_state_change_114__linear -->|true / false| method_2y4xzb_requestsummaryandquizasync__call_114_IQuizStateService_SetHydrating
    method_2y4xzb_requestsummaryandquizasync__action_115_log_115__linear -->|tenantId| method_2y4xzb_requestsummaryandquizasync__call_115_LogRequestingSummary
    method_2y4xzb_requestsummaryandquizasync__action_116_requestsummaryandquizasync_try_116_1__try -->|next| method_2y4xzb_requestsummaryandquizasync__action_118_requestsummaryandquizasync_await_118_2__await
    method_2y4xzb_requestsummaryandquizasync__action_116_try_catch_finally_116__linear -->|next| method_2y4xzb_requestsummaryandquizasync__action_116_requestsummaryandquizasync_try_116_1__try
    method_2y4xzb_requestsummaryandquizasync__action_118_external_call_118__linear -->|content, tenantId| method_2y4xzb_requestsummaryandquizasync__call_118_IKnowledgeService_GetSummaryAndQuizAsync
    method_2y4xzb_requestsummaryandquizasync__action_118_requestsummaryandquizasync_await_118_2__await -->|next| method_2y4xzb_requestsummaryandquizasync__action_118_external_call_118__linear
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__condition -->|transforms input| method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__false
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__condition -->|transforms input| method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__true
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__false -->|next| method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__merge
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__merge -->|next| method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__condition
    method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__true -->|next| method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__merge
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__condition -->|false| method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__false
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__condition -->|true| method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__true
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__false -->|next| method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__merge
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__merge -->|next| method_2y4xzb_requestsummaryandquizasync__action_122_mapping_122__linear
    method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__true -->|next| method_2y4xzb_requestsummaryandquizasync__action_119_requestsummaryandquizasync_branch_119_3__merge
    method_2y4xzb_requestsummaryandquizasync__action_122_mapping_122__linear -->|next| method_2y4xzb_requestsummaryandquizasync__action_123_requestsummaryandquizasync_mapping_123_4__linear
    method_2y4xzb_requestsummaryandquizasync__action_123_requestsummaryandquizasync_mapping_123_4__linear -->|q.Question, q.Options, q.CorrectIndex| method_2y4xzb_requestsummaryandquizasync__call_123_QuizQuestionDto_ctor
    method_2y4xzb_requestsummaryandquizasync__action_126_requestsummaryandquizasync_await_126_5__await -->|null, new QuizDto quizQuestions| method_2y4xzb_requestsummaryandquizasync__call_126_IQuizStateService_SetQuiz
    method_2y4xzb_requestsummaryandquizasync__action_127_requestsummaryandquizasync_await_127_6__await -->|none| method_2y4xzb_requestsummaryandquizasync__call_127_IPlatformService_VibrateSuccessAsync
    method_2y4xzb_requestsummaryandquizasync__action_128_requestsummaryandquizasync_return_128_7__return -->|tenantId| method_2y4xzb_requestsummaryandquizasync__call_131_LogSummaryWarning
    method_2y4xzb_requestsummaryandquizasync__action_132_requestsummaryandquizasync_return_132_8__return -->|exception| method_2y4xzb_requestsummaryandquizasync__action_134_requestsummaryandquizasync_catch_134_9__catch
    method_2y4xzb_requestsummaryandquizasync__action_134_requestsummaryandquizasync_catch_134_9__catch -->|ex, tenantId| method_2y4xzb_requestsummaryandquizasync__call_136_LogSummaryError
    method_2y4xzb_requestsummaryandquizasync__action_137_requestsummaryandquizasync_return_137_10__return -->|next| method_2y4xzb_requestsummaryandquizasync__action_139_requestsummaryandquizasync_finally_139_11__finally
    method_2y4xzb_requestsummaryandquizasync__action_139_requestsummaryandquizasync_finally_139_11__finally -->|next| method_2y4xzb_requestsummaryandquizasync__action_141_requestsummaryandquizasync_await_141_12__await
    method_2y4xzb_requestsummaryandquizasync__action_141_requestsummaryandquizasync_await_141_12__await -->|return| method_2y4xzb_requestsummaryandquizasync__implicit_return
    method_2y4xzb_requestsummaryandquizasync__call_114_IQuizStateService_SetHydrating -->|next| method_2y4xzb_requestsummaryandquizasync__action_115_log_115__linear
    method_2y4xzb_requestsummaryandquizasync__call_115_LogRequestingSummary -->|next| method_2y4xzb_requestsummaryandquizasync__action_116_try_catch_finally_116__linear
    method_2y4xzb_requestsummaryandquizasync__call_118_IKnowledgeService_GetSummaryAndQuizAsync -->|next| method_2y4xzb_requestsummaryandquizasync__action_119_branch_119__condition
    method_2y4xzb_requestsummaryandquizasync__call_123_QuizQuestionDto_ctor -->|next| method_2y4xzb_requestsummaryandquizasync__action_126_requestsummaryandquizasync_await_126_5__await
    method_2y4xzb_requestsummaryandquizasync__call_126_IQuizStateService_SetQuiz -->|next| method_2y4xzb_requestsummaryandquizasync__action_127_requestsummaryandquizasync_await_127_6__await
    method_2y4xzb_requestsummaryandquizasync__call_127_IPlatformService_VibrateSuccessAsync -->|return| method_2y4xzb_requestsummaryandquizasync__action_128_requestsummaryandquizasync_return_128_7__return
    method_2y4xzb_requestsummaryandquizasync__call_131_LogSummaryWarning -->|return| method_2y4xzb_requestsummaryandquizasync__action_132_requestsummaryandquizasync_return_132_8__return
    method_2y4xzb_requestsummaryandquizasync__call_136_LogSummaryError -->|return| method_2y4xzb_requestsummaryandquizasync__action_137_requestsummaryandquizasync_return_137_10__return
    method_2y4xzb_requestsummaryandquizasync__entry -->|next| method_2y4xzb_requestsummaryandquizasync__action_114_requestsummaryandquizasync_await_114_0__await
```

### ClearAsync() Control Flow

```mermaid
flowchart TD
    method_b6ndo3_clearasync__call_147_IKnowledgeGraphService_Clear[["IKnowledgeGraphService.Clear"]]
    method_b6ndo3_clearasync__call_148_IQuizStateService_SetQuiz[["IQuizStateService.SetQuiz"]]
    method_b6ndo3_clearasync__action_147_clearasync_await_147_0__await[["Waits for async work"]]
    method_b6ndo3_clearasync__action_147_state_change_147__linear("Clear graph and quiz")
    method_b6ndo3_clearasync__action_148_clearasync_await_148_1__await[["Waits for async work"]]
    method_b6ndo3_clearasync__entry(["ClearAsync entry"])
    method_b6ndo3_clearasync__implicit_return(["return"])
    method_b6ndo3_clearasync__action_147_clearasync_await_147_0__await -->|next| method_b6ndo3_clearasync__action_147_state_change_147__linear
    method_b6ndo3_clearasync__action_147_state_change_147__linear -->|none| method_b6ndo3_clearasync__call_147_IKnowledgeGraphService_Clear
    method_b6ndo3_clearasync__action_148_clearasync_await_148_1__await -->|null, null| method_b6ndo3_clearasync__call_148_IQuizStateService_SetQuiz
    method_b6ndo3_clearasync__call_147_IKnowledgeGraphService_Clear -->|next| method_b6ndo3_clearasync__action_148_clearasync_await_148_1__await
    method_b6ndo3_clearasync__call_148_IQuizStateService_SetQuiz -->|return| method_b6ndo3_clearasync__implicit_return
    method_b6ndo3_clearasync__entry -->|next| method_b6ndo3_clearasync__action_147_clearasync_await_147_0__await
```

### Dispose() Control Flow

```mermaid
flowchart TD
    method_1wlwqp0_dispose__call_153_IReaderInteractionService_OnNodeSelected_HandleNodeSelected[["IReaderInteractionService.OnNodeSelected -= HandleNodeSelected"]]
    method_1wlwqp0_dispose__action_153_event_unsubscribe_153__linear("Unsubscribe node selection handler")
    method_1wlwqp0_dispose__entry(["Dispose entry"])
    method_1wlwqp0_dispose__implicit_return(["return"])
    method_1wlwqp0_dispose__action_153_event_unsubscribe_153__linear -->|event handler HandleNodeSelected| method_1wlwqp0_dispose__call_153_IReaderInteractionService_OnNodeSelected_HandleNodeSelected
    method_1wlwqp0_dispose__call_153_IReaderInteractionService_OnNodeSelected_HandleNodeSelected -->|return| method_1wlwqp0_dispose__implicit_return
    method_1wlwqp0_dispose__entry -->|next| method_1wlwqp0_dispose__action_153_event_unsubscribe_153__linear
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 20 unresolved jumps.
- Warning: neighborhood-view: diagram file_uvydt4_knowledgecoordinator_cs_neighborhood_view exceeds preferred complexity thresholds (14 nodes, 0 edges).
- Warning: execution-overview: diagram file_uvydt4_knowledgecoordinator_cs_execution_view exceeds preferred complexity thresholds (44 nodes, 43 edges).
- Warning: control-flow: diagram method_t1zuul_handlenodeselected__fragment_diagram exceeds preferred complexity thresholds (42 nodes, 49 edges).
- Warning: control-flow: diagram method_1x9gjeq_processfullpageasync__fragment_diagram exceeds preferred complexity thresholds (47 nodes, 52 edges).
- Warning: control-flow: diagram method_2y4xzb_requestsummaryandquizasync__fragment_diagram exceeds preferred complexity thresholds (35 nodes, 36 edges).
