Pages Reference

All routed pages live in MILTON.Client/Pages/. Each file contains an @page directive that registers its URL route with the Blazor router.

Route Map

PageRouteLayoutPrimary Stores
Home.razor/MainLayoutProjectStore
ProjectDashboard.razor/projects/{ProjectId:int}/dashboardProjectLayoutProjectStore, DocumentStore, TemplateStore
DocumentsList.razor/projects/{ProjectId:int}/documentsProjectLayoutDocumentStore
DocumentEditor.razor/projects/{ProjectId:int}/documents/{Id:guid}ProjectLayoutDocumentStore
Templates.razor/projects/{ProjectId:int}/templatesProjectLayoutTemplateStore
CreateTemplate.razor/projects/{ProjectId:int}/templates/createProjectLayoutTemplateStore, DocumentStore
EditTemplate.razor/projects/{ProjectId:int}/templates/{TemplateId:guid}/editProjectLayoutTemplateStore, DocumentStore
ProjectConfig.razor/projects/{ProjectId:int}/configProjectLayoutProjectStore
New-project.razor/projects/newMainLayoutProjectStore
NotFound.razor/not-foundMainLayout

Home

File: Home.razor Route: / Layout: MainLayout

The landing page and project gallery. Displays all MILTON projects as a responsive card grid with search filtering. Each card shows the project title, description, repository count, configuration status, and last-updated timestamp.

Key behaviour:

  • Loads the project list from GET /api/projects into ProjectStore on first visit.
  • Subsequent visits within the same session reuse the cached list.
  • Client-side search filters by title and description (case-insensitive).
  • Skeleton loading placeholders render while the API call is in-flight.
  • “New Project” button navigates to /projects/new.

API calls: GET /api/projects


ProjectDashboard

File: ProjectDashboard.razor Route: /projects/{ProjectId:int}/dashboard Layout: ProjectLayout

The main dashboard for a single project. Displays hero stats (template count, document count, repository count), a list of the five most recent documents, and quick-action buttons.

Key behaviour:

  • Loads project, documents, and templates in parallel using Task.WhenAll.
  • Subscribes to DocumentStateService for live progress, completion, error, and update events via SignalR.
  • Real-time events update the document list and counters without a page reload.
  • Implements IAsyncDisposable and IDisposable to unsubscribe from SignalR events and leave the project group on teardown.

Parameters: ProjectId (int) API calls: GET /api/projects, GET /api/projects/{ProjectId}/documents, GET /api/projects/{ProjectId}/templates


DocumentsList

File: DocumentsList.razor Route: /projects/{ProjectId:int}/documents Layout: ProjectLayout

A filterable list of all documents in a project. Supports search by title, filtering by category (SRS, SDD, STP, SVR, Custom) and status (Processing, Pending, Completed, Error).

Key behaviour:

  • Displays a live-activity banner when a document is actively being processed.
  • Shows real-time progress bars for documents in Processing or Pending state.
  • Maintains a SignalR connection to receive DocumentListChanged, DocumentUpdated, and Progress events at the project level.
  • Clicking a document card navigates to the DocumentEditor.

Parameters: ProjectId (int) API calls: GET /api/projects/{ProjectId}/documents


DocumentEditor

File: DocumentEditor.razor Route: /projects/{ProjectId:int}/documents/{Id:guid} Layout: ProjectLayout

The full document editor with a three-panel layout: section tree sidebar, block content area, and an optional document preview panel.

Key behaviour:

  • Section tree (left sidebar): Displays document sections as a navigable tree using SectionTreeItem. Clicking a section filters the main content area to show only that section’s blocks.
  • Block content (center): Renders sections and their blocks using RenderSection and BlockRenderer. Supports drag-and-drop reordering of both sections and blocks.
  • Preview panel (right): Togglable panel using DocumentPreviewPanel that renders the document as HTML in a sandboxed iframe.
  • Toolbar: Shows document title, category, live processing progress (block counts, spinner), and PDF generation/download buttons.
  • SignalR integration: Subscribes to document-level events (Progress, DocumentCompleted, Error, BlockUpdated, BlocksAdded, SectionsAdded, BlockRemoved) and updates the local DOM organically without full reloads.
  • PDF generation: Triggers POST /api/documents/{Id}/pdf and enables download of the generated PDF.
  • Processing log: A timeline in the sidebar showing the last 10 progress events with timestamps.

Parameters: ProjectId (int), Id (Guid) API calls: GET /api/documents/{Id}, POST /api/documents/{Id}/pdf, GET /api/documents/{Id}/pdf


Templates

File: Templates.razor Route: /projects/{ProjectId:int}/templates Layout: ProjectLayout

A card grid of all document templates in a project. Each card shows the template name, category label, description, and creation date with actions to create a document from the template or edit it.

Key behaviour:

  • Loads templates from GET /api/projects/{ProjectId}/templates into TemplateStore.
  • “Create Document” opens the InstantiateTemplateDialog.
  • After successful instantiation, navigates directly to the new document in DocumentEditor.

Parameters: ProjectId (int) API calls: GET /api/projects/{ProjectId}/templates


CreateTemplate

File: CreateTemplate.razor Route: /projects/{ProjectId:int}/templates/create Layout: ProjectLayout

A two or three-panel template builder for creating new document templates from scratch.

Key behaviour:

  • Editor panel (left): Template name, category selector (SRS/SDD/STP/SVR/Custom), description, document style configuration (page size, orientation, margins, fonts), and a recursive section editor via TemplateSectionEditor.
  • Preview panel (right, togglable): Live preview of the template rendered as HTML via TemplatePreviewPanel.
  • Quick-start presets: One-click loading of SRS and STP section structures.
  • Section editor: Supports nested sections with context sources (Clustering, Repository, Document), system prompts, source files, and scan-and-cluster functionality.
  • Saves via POST /api/documents/templates and clears TemplateStore cache on success.

Parameters: ProjectId (int) API calls: POST /api/documents/templates, GET /api/projects/{ProjectId}/config, GET /api/projects/{ProjectId}/documents


EditTemplate

File: EditTemplate.razor Route: /projects/{ProjectId:int}/templates/{TemplateId:guid}/edit Layout: ProjectLayout

Shares the same two/three-panel layout as CreateTemplate but loads an existing template for editing.

Key behaviour:

  • Resolves the template from TemplateStore cache first; falls back to GET /api/documents/templates/{TemplateId}.
  • Saves via PUT /api/documents/templates/{TemplateId} and clears TemplateStore cache.
  • Identical editor and preview functionality to CreateTemplate.

Parameters: ProjectId (int), TemplateId (Guid) API calls: GET /api/documents/templates/{TemplateId}, PUT /api/documents/templates/{TemplateId}, GET /api/projects/{ProjectId}/config, GET /api/projects/{ProjectId}/documents


ProjectConfig

File: ProjectConfig.razor Route: /projects/{ProjectId:int}/config Layout: ProjectLayout

A tabbed settings page for managing project configuration.

Tabs:

  1. General: Project info (name, description, repository count, last-updated timestamp) and quick-start links.
  2. Git Repositories: Add, edit, and remove git repositories with URL, display name, per-repository encrypted token, and file exclusion patterns.
  3. LLM Configuration: Manage AI presets with endpoint URL, model name, encrypted API key, and per-preset parameters (temperature, max tokens, etc.).

Key behaviour:

  • Loads project config from GET /api/projects/{ProjectId}/config.
  • Saves all configuration changes via PUT /api/projects/{ProjectId}/config.
  • Repository tokens and LLM API keys use password input fields with placeholder masking for existing secrets.

Parameters: ProjectId (int) API calls: GET /api/projects/{ProjectId}/config, PUT /api/projects/{ProjectId}/config, GET /api/projects


New-project

File: New-project.razor Route: /projects/new Layout: MainLayout

A simple form for creating a new MILTON project with a name and optional description.

Key behaviour:

  • Posts to POST /api/projects.
  • Clears ProjectStore cache on success so the home page picks up the new project.
  • Redirects to the new project’s configuration page (/projects/{id}/config) after creation.

API calls: POST /api/projects


NotFound

File: NotFound.razor Route: /not-found Layout: MainLayout

A static 404 page shown when a route does not match any known page. Displays a friendly message and a button to return to the project list. Allows anonymous access via [AllowAnonymous].