# IReaderNavigationService

- File ID: file:wgkae9:ireadernavigationservice-cs
- Path: NexusReader.UI.Shared/Services/IReaderNavigationService.cs
- Role: service
- Layer: frontend

## Purpose

Defines the shared UI navigation contract for an ebook reader (state, navigation commands, metadata updates and an event to notify consumers).

## Key Details

Interface-only file: no implementations or external calls. Defines navigation contract and an async event used by UI components across clients.

## Symbols

- IReaderNavigationService: Defines the shared UI navigation contract for an ebook reader (state, navigation commands, metadata updates and an event to notify consumers).
- CurrentEbookId(): Exposes the current ebook identifier.
- CurrentChapterIndex(): Exposes the current chapter index within the active ebook.
- TotalChapters(): Exposes the total number of chapters for the active ebook.
- ChapterTitle(): Exposes the title of the current chapter.
- OnNavigationChanged(): Event invoked when navigation state changes to notify subscribers (async).
- GoToChapter(): Navigate to a specific chapter index and notify interested subscribers.
- GoToNextChapter(): Advance navigation to the next chapter and notify subscribers.
- GoToPreviousChapter(): Move navigation to the previous chapter and notify subscribers.
- UpdateMetadataAsync(): Update chapter-related metadata (current index, total chapters, title) asynchronously.
- NavigateToBook(): Navigate to the reader UI for a specific book and record its ebook ID (triggers routing).
- SetBook(): Set the active book context (ID and optional chapter) without performing browser routing.
- IReaderNavigationService: Contract for reader navigation state and operations shared across UI clients.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Coverage

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

## Control Flow Fragments

- CurrentEbookId: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- CurrentChapterIndex: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- TotalChapters: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- ChapterTitle: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- OnNavigationChanged: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- GoToChapter: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- GoToNextChapter: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- GoToPreviousChapter: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- UpdateMetadataAsync: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- NavigateToBook: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- SetBook: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### IReaderNavigationService Neighborhood

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

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart LR
    class_9gxpik_ireadernavigationservice("IReaderNavigationService")
    file_wgkae9_ireadernavigationservice_cs("IReaderNavigationService")
    method_12odud7_gotopreviouschapter[["GoToPreviousChapter()"]]
    method_1d0xirt_onnavigationchanged[["OnNavigationChanged()"]]
    method_1dvbk1u_gotonextchapter[["GoToNextChapter()"]]
    method_1la3caq_navigatetobook[["NavigateToBook()"]]
    method_4hij31_updatemetadataasync[["UpdateMetadataAsync()"]]
    method_4o7htd_setbook[["SetBook()"]]
    method_l33fvs_totalchapters[["TotalChapters()"]]
    method_orf66k_gotochapter[["GoToChapter()"]]
    method_vlhvyc_currentebookid[["CurrentEbookId()"]]
    method_wxhxya_chaptertitle[["ChapterTitle()"]]
    method_xv5ikh_currentchapterindex[["CurrentChapterIndex()"]]
    type_xd8rr7_ireadernavigationservice[/"IReaderNavigationService"/]
```

### IReaderNavigationService Execution Overview

```mermaid
flowchart TD
    class_9gxpik_ireadernavigationservice("IReaderNavigationService")
    method_12odud7_gotopreviouschapter[["GoToPreviousChapter()"]]
    method_1d0xirt_onnavigationchanged[["OnNavigationChanged()"]]
    method_1dvbk1u_gotonextchapter[["GoToNextChapter()"]]
    method_1la3caq_navigatetobook[["NavigateToBook()"]]
    method_4hij31_updatemetadataasync[["UpdateMetadataAsync()"]]
    method_4o7htd_setbook[["SetBook()"]]
    method_l33fvs_totalchapters[["TotalChapters()"]]
    method_orf66k_gotochapter[["GoToChapter()"]]
    method_vlhvyc_currentebookid[["CurrentEbookId()"]]
    method_wxhxya_chaptertitle[["ChapterTitle()"]]
    method_xv5ikh_currentchapterindex[["CurrentChapterIndex()"]]
    class_9gxpik_ireadernavigationservice -->|contains| method_12odud7_gotopreviouschapter
    class_9gxpik_ireadernavigationservice -->|contains| method_1d0xirt_onnavigationchanged
    class_9gxpik_ireadernavigationservice -->|contains| method_1dvbk1u_gotonextchapter
    class_9gxpik_ireadernavigationservice -->|contains| method_1la3caq_navigatetobook
    class_9gxpik_ireadernavigationservice -->|contains| method_4hij31_updatemetadataasync
    class_9gxpik_ireadernavigationservice -->|contains| method_4o7htd_setbook
    class_9gxpik_ireadernavigationservice -->|contains| method_l33fvs_totalchapters
    class_9gxpik_ireadernavigationservice -->|contains| method_orf66k_gotochapter
    class_9gxpik_ireadernavigationservice -->|contains| method_vlhvyc_currentebookid
    class_9gxpik_ireadernavigationservice -->|contains| method_wxhxya_chaptertitle
    class_9gxpik_ireadernavigationservice -->|contains| method_xv5ikh_currentchapterindex
```

## Diagram Validation

- Status: warn
- Warning: neighborhood-view: diagram file_wgkae9_ireadernavigationservice_cs_neighborhood_view exceeds preferred complexity thresholds (14 nodes, 0 edges).
