PlotDirector/PlotLine/Views/Onboarding/StoryIntelligence.cshtml

96 lines
4.0 KiB
Plaintext

@model StoryIntelligenceOverviewViewModel
@{
ViewData["Title"] = "Analyse manuscript";
}
<section class="onboarding-shell" aria-labelledby="story-intelligence-title">
<div class="onboarding-panel">
<div class="onboarding-copy">
<p class="eyebrow">@Model.SelectedBookTitle</p>
<h1 id="story-intelligence-title">Analyse chapters with Story Intelligence</h1>
<p>PlotDirector can now analyse your manuscript to identify scenes and begin understanding your story.</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>
}
@if (Model.ExistingBatchID.HasValue)
{
<section class="onboarding-story-card">
<h2>Analysis has already started</h2>
<p>You can continue reviewing progress for the approved chapters.</p>
<a class="btn btn-primary" asp-action="StoryIntelligenceProgress" asp-route-batchId="@Model.ExistingBatchID">Review scenes</a>
</section>
}
else
{
<div class="onboarding-story-facts">
<div>
<span>Chapters</span>
<strong>@Model.ApprovedChapterCount</strong>
<p>Approved chapters from your manuscript review.</p>
</div>
<div>
<span>Words</span>
<strong>@Model.ApprovedWordCount.ToString("N0")</strong>
<p>Chapter text ready for analysis.</p>
</div>
<div>
<span>Estimated time</span>
<strong>@EstimateDuration(Model.ApprovedWordCount)</strong>
<p>The analysis runs in the background, so you can leave this page and return later.</p>
</div>
<div>
<span>Review</span>
<strong>You approve creation</strong>
<p>Scenes are created only after the analysis completes and you choose Create scenes.</p>
</div>
</div>
<section class="onboarding-form-section">
<p>It will extract scene summaries, scene purpose, characters, locations, assets, relationships, timeline clues and story observations.</p>
<p>For this step, only scenes are created in PlotDirector. The other discoveries are prepared for later review stages.</p>
</section>
@if (!string.IsNullOrWhiteSpace(Model.Message))
{
<section class="onboarding-form-section">
<p>@Model.Message</p>
@if (Model.MissingChapterTextCount > 0)
{
<p class="text-danger">@Model.MissingChapterTextCount chapter(s) do not include scanned text. Scan the manuscript again before analysing.</p>
}
</section>
}
<div class="onboarding-actions">
<form asp-action="SkipStoryIntelligence" method="post">
<button class="btn btn-outline-secondary" type="submit">Skip for now</button>
</form>
<form asp-action="StartStoryIntelligence" method="post">
<button class="btn btn-primary" type="submit" disabled="@(!Model.CanStart)">Analyse manuscript</button>
</form>
</div>
}
</div>
</section>
@functions {
private static string EstimateDuration(int wordCount)
{
if (wordCount <= 0)
{
return "A few minutes";
}
var minutes = Math.Clamp((int)Math.Ceiling(wordCount / 3000m) * 2, 2, 30);
return minutes <= 2 ? "About 2 minutes" : $"About {minutes:N0} minutes";
}
}