# ViewModels

- File ID: file:1rikffk:viewmodels-cs
- Path: NexusReader.Application/Queries/Reader/ViewModels.cs
- Role: dto
- Layer: application

## Purpose

Defines polymorphic content-block models and a reader page view model used by the application query layer to transport reader UI data (blocks, chapter indexes, ebook id).

## Key Details

Defines JSON polymorphism via JsonDerivedType attributes mapping discriminator values "text" and "trigger" to concrete record types; used in the Application.Queries.Reader boundary for transporting reader UI data.

## Symbols

- ContentBlock: Abstract base record for polymorphic content blocks carrying an Id.
- TextSegmentBlock: Represents a text segment block containing textual content.
- AiActionTriggerBlock: Represents an actionable AI-trigger block with dialogue and selectable action options.
- ReaderPageViewModel: Aggregates content blocks and chapter/ebook metadata for rendering a reader page.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Coverage

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

## Diagrams

### ViewModels Neighborhood

```mermaid
flowchart LR
    file_1rikffk_viewmodels_cs("ViewModels")
    type_15iy4fl_textsegmentblock[/"TextSegmentBlock"/]
    type_1jbz88m_aiactiontriggerblock[/"AiActionTriggerBlock"/]
    type_6l0ozw_readerpageviewmodel[/"ReaderPageViewModel"/]
    type_aqqzdn_contentblock[/"ContentBlock"/]
```

## Diagram Validation

- Status: pass
