PlotDirector/PlotLine/Views/Onboarding/StoryIntelligenceReviewCentre.cshtml

153 lines
7.4 KiB
Plaintext

@model StoryIntelligenceProgressViewModel
@{
ViewData["Title"] = "Story Intelligence Review Centre";
}
<section class="onboarding-shell" aria-labelledby="story-review-centre-title">
<div class="onboarding-panel onboarding-review-panel story-review-page">
<partial name="_StoryIntelligencePipelineHeader" model="@(new StoryIntelligencePipelineHeaderViewModel { CurrentStage = "Review Centre" })" />
<div class="onboarding-copy story-review-heading">
<p class="eyebrow">Story Intelligence</p>
<h1 id="story-review-centre-title">Review Centre</h1>
<p>Review only the story intelligence that needs an author decision. Everything here is saved and can be picked up later.</p>
</div>
@if (TempData["OnboardingStoryIntelligenceError"] is string error)
{
<div class="alert alert-danger">@error</div>
}
@if (TempData["OnboardingStoryIntelligenceMessage"] is string message)
{
<div class="alert alert-success">@message</div>
}
<partial name="_StoryIntelligencePipelineSummary" model="Model.PipelineDashboard" />
<section class="story-review-centre-list" aria-label="Story Intelligence review categories">
@ReviewModule(
"Characters",
Model.CharacterNeedsAttentionCount,
Model.PipelineDashboard.CharacterStageComplete ? "Resolved" : "Needs attention",
"Resolve identity questions before reviewing dependent story intelligence.",
"Review characters",
"StoryIntelligenceCharacters",
false)
@ReviewModule(
"Locations",
Model.LocationNeedsAttentionCount,
Model.PipelineDashboard.LocationStageComplete ? "Reviewed" : AttentionLabel(Model.LocationNeedsAttentionCount),
"Places found in the manuscript that may be worth creating, linking, or ignoring.",
"Review locations",
"StoryIntelligenceLocations",
!Model.CharacterGateSatisfied)
@ReviewModule(
"Assets",
Model.AssetNeedsAttentionCount,
Model.PipelineDashboard.AssetStageComplete ? "Reviewed" : AttentionLabel(Model.AssetNeedsAttentionCount),
"Important objects and possessions detected from generic evidence such as recurrence, ownership, and scene prominence.",
"Review assets",
"StoryIntelligenceAssets",
!Model.CharacterGateSatisfied)
@ReviewModule(
"Relationships",
Model.RelationshipNeedsAttentionCount,
Model.PipelineDashboard.RelationshipStageComplete ? "Reviewed" : AttentionLabel(Model.RelationshipNeedsAttentionCount),
"Relationship candidates grouped by the canonical character identities involved.",
"Review relationships",
"StoryIntelligenceRelationships",
!Model.CharacterGateSatisfied)
@ReviewModule(
"Knowledge",
Model.KnowledgeNeedsAttentionCount,
Model.PipelineDashboard.KnowledgeStageComplete ? "Reviewed" : AttentionLabel(Model.KnowledgeNeedsAttentionCount),
"Facts, discoveries, beliefs, and suspicions that need a create, link, merge, or ignore decision.",
"Review knowledge",
"StoryIntelligenceKnowledge",
!Model.CharacterGateSatisfied)
@ReviewModule(
"Plot Lines & Threads",
Model.NarrativeNeedsAttentionCount,
Model.PipelineDashboard.NarrativeStageComplete ? "Reviewed" : AttentionLabel(Model.NarrativeNeedsAttentionCount),
"Recurring arcs and threads organised by the narrative hierarchy discovered from scene evidence.",
"Review plot lines",
"StoryIntelligenceNarrative",
!Model.CharacterGateSatisfied)
<article class="story-review-centre-row">
<div>
<h2>Scene Metrics</h2>
<p>Available from the imported scene analysis. Metrics are auto-applied where configured and do not require a mandatory review step.</p>
</div>
<strong class="story-review-status story-review-status--ready">Available</strong>
<span class="story-review-centre-row__count">0 need attention</span>
</article>
@if (Model.AnalysisIssueCount > 0)
{
<article class="story-review-centre-row">
<div>
<h2>Analysis Issues</h2>
<p>Some chapters or scenes reported analysis issues. Canonical chapters and scenes remain intact.</p>
</div>
<strong class="story-review-status story-review-status--warning">Needs attention</strong>
<a class="btn btn-outline-primary btn-sm" asp-action="StoryIntelligenceReview" asp-route-batchId="@Model.BatchID">View issues</a>
<span class="story-review-centre-row__count">@Model.AnalysisIssueCount.ToString("N0") need attention</span>
</article>
}
</section>
<div class="onboarding-actions">
<a class="btn btn-outline-secondary" asp-controller="Books" asp-action="Details" asp-route-id="@Model.BookID">Return to book</a>
<a class="btn btn-outline-primary" asp-controller="Writer" asp-action="Index" asp-route-projectId="@Model.ProjectID">Open writer workspace</a>
</div>
</div>
</section>
@functions {
private string AttentionLabel(int count) => count == 0 ? "No outstanding decisions" : "Needs attention";
private Microsoft.AspNetCore.Html.IHtmlContent ReviewModule(
string title,
int count,
string status,
string description,
string actionLabel,
string action,
bool blocked)
{
var statusClass = blocked
? "story-review-status story-review-status--active"
: count > 0
? "story-review-status story-review-status--warning"
: "story-review-status story-review-status--ready";
var statusText = blocked ? "Blocked by character resolution" : status;
var countText = blocked
? "Resolve characters first"
: count == 1
? "1 needs attention"
: $"{count:N0} need attention";
var disabled = blocked ? " disabled aria-disabled=\"true\"" : string.Empty;
var href = blocked
? "#"
: Url.Action(action, "Onboarding", new { batchId = Model.BatchID }) ?? "#";
return new Microsoft.AspNetCore.Html.HtmlString($$"""
<article class="story-review-centre-row">
<div>
<h2>{{System.Net.WebUtility.HtmlEncode(title)}}</h2>
<p>{{System.Net.WebUtility.HtmlEncode(description)}}</p>
</div>
<strong class="{{statusClass}}">{{System.Net.WebUtility.HtmlEncode(statusText)}}</strong>
<a class="btn btn-outline-primary btn-sm{{(blocked ? " disabled" : string.Empty)}}" href="{{href}}"{{disabled}}>{{System.Net.WebUtility.HtmlEncode(actionLabel)}}</a>
<span class="story-review-centre-row__count">{{System.Net.WebUtility.HtmlEncode(countText)}}</span>
</article>
""");
}
}