diff --git a/PlotLine.Tests/Program.cs b/PlotLine.Tests/Program.cs index bdeb192..70f5695 100644 --- a/PlotLine.Tests/Program.cs +++ b/PlotLine.Tests/Program.cs @@ -1131,7 +1131,7 @@ static void Phase21UEnforcesAliasAgeSemanticAndUiResetRules() Assert(!StoryIntelligenceIllustrationCompatibility.AssetCompatible("Hatchback", "SportsCar"), "Hatchback must not use sports-car art when demand generation is available."); var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine"); - var onboarding = File.ReadAllText(Path.Combine(root, "Views/Onboarding/StoryIntelligence.cshtml")); + var onboarding = File.ReadAllText(Path.Combine(root, "Views/Onboarding/StoryIntelligenceContext.cshtml")); var adminController = File.ReadAllText(Path.Combine(root, "Controllers/AdminController.cs")); var adminDiagnostics = File.ReadAllText(Path.Combine(root, "Views/Admin/StoryIntelligenceDiagnostics.cshtml")); var program = File.ReadAllText(Path.Combine(root, "Program.cs")); diff --git a/PlotLine/Controllers/OnboardingController.cs b/PlotLine/Controllers/OnboardingController.cs index dce5565..17e0974 100644 --- a/PlotLine/Controllers/OnboardingController.cs +++ b/PlotLine/Controllers/OnboardingController.cs @@ -79,6 +79,13 @@ public sealed class OnboardingController(IOnboardingService onboarding, IOnboard return View(model); } + [HttpGet("story-intelligence/context")] + public async Task StoryIntelligenceContext() + { + var model = await storyIntelligence.GetOverviewAsync(); + return View(model); + } + [HttpGet("story-intelligence/book/{bookId:int}/continue")] public async Task ContinueStoryIntelligence(int bookId) { @@ -113,7 +120,7 @@ public sealed class OnboardingController(IOnboardingService onboarding, IOnboard if (job is null) { TempData["OnboardingStoryIntelligenceError"] = "Review the manuscript scan before starting Story Intelligence."; - return RedirectToAction(nameof(StoryIntelligence)); + return RedirectToAction(nameof(StoryIntelligenceContext)); } return RedirectToAction(nameof(StoryIntelligenceProgress), new { batchId = job.BatchID }); diff --git a/PlotLine/Services/OnboardingStoryIntelligenceService.cs b/PlotLine/Services/OnboardingStoryIntelligenceService.cs index eee44ac..e8032fb 100644 --- a/PlotLine/Services/OnboardingStoryIntelligenceService.cs +++ b/PlotLine/Services/OnboardingStoryIntelligenceService.cs @@ -68,7 +68,7 @@ public sealed class OnboardingStoryIntelligenceService( var missingTextCount = included.Count(chapter => string.IsNullOrWhiteSpace(chapter.Preview.ChapterText)); var primaryCharacterCount = preview.CharacterCandidates.Count(candidate => !string.Equals(candidate.Category, "Excluded", StringComparison.OrdinalIgnoreCase)); var characterPageCount = Math.Max(1, (int)Math.Ceiling(primaryCharacterCount / 10d)); - var totalWizardSteps = 7 + characterPageCount + 2; + var totalWizardSteps = 7 + characterPageCount + 3; return new StoryIntelligenceOverviewViewModel { PreviewID = preview.PreviewID, @@ -79,7 +79,8 @@ public sealed class OnboardingStoryIntelligenceService( ApprovedChapterCount = included.Count, ApprovedWordCount = included.Sum(chapter => chapter.Preview.WordCount), MissingChapterTextCount = missingTextCount, - WizardCurrentStep = totalWizardSteps - 1, + WizardCurrentStep = totalWizardSteps - 2, + WizardContextStep = totalWizardSteps - 1, WizardTotalSteps = totalWizardSteps, ExistingBatchID = existingBatch?.BatchID, CanStart = included.Count > 0 && missingTextCount == 0, diff --git a/PlotLine/ViewModels/OnboardingViewModels.cs b/PlotLine/ViewModels/OnboardingViewModels.cs index 9d943d9..926db36 100644 --- a/PlotLine/ViewModels/OnboardingViewModels.cs +++ b/PlotLine/ViewModels/OnboardingViewModels.cs @@ -128,6 +128,7 @@ public sealed class StoryIntelligenceOverviewViewModel public int ApprovedWordCount { get; init; } public int MissingChapterTextCount { get; init; } public int WizardCurrentStep { get; init; } = 9; + public int WizardContextStep { get; init; } = 10; public int WizardTotalSteps { get; init; } = 10; public string? Message { get; init; } public Guid? ExistingBatchID { get; init; } diff --git a/PlotLine/Views/Onboarding/StoryIntelligence.cshtml b/PlotLine/Views/Onboarding/StoryIntelligence.cshtml index cf4420c..f14cea7 100644 --- a/PlotLine/Views/Onboarding/StoryIntelligence.cshtml +++ b/PlotLine/Views/Onboarding/StoryIntelligence.cshtml @@ -1,6 +1,6 @@ @model StoryIntelligenceOverviewViewModel @{ - ViewData["Title"] = "Story and portrait context"; + ViewData["Title"] = "Ready to analyse manuscript"; }
@@ -8,8 +8,8 @@

Step @Model.WizardCurrentStep of @Model.WizardTotalSteps

-

Story and Portrait Context

-

Set the context choices for this manuscript before the analysis starts.

+

Ready to Analyse Manuscript

+

Review the approved manuscript scope before setting final story and portrait context.

@if (TempData["OnboardingStoryIntelligenceError"] is string error) @@ -70,83 +70,17 @@
} -
-
-
-

Pre-analysis setup

-

Context choices

-

Explicit manuscript evidence always wins. These choices guide unresolved generated portraits and broad story context.

-
- Required before analysis -
+
+
1Analyse chapters
+
2Review scenes
+
3Review story entities
+
4Build database
+
-
- - - - -
- -
-
1Analyse chapters
-
2Review scenes
-
3Review story entities
-
4Build database
-
- -
- Back to scan review - -
-
+
diff --git a/PlotLine/Views/Onboarding/StoryIntelligenceContext.cshtml b/PlotLine/Views/Onboarding/StoryIntelligenceContext.cshtml new file mode 100644 index 0000000..466e3b3 --- /dev/null +++ b/PlotLine/Views/Onboarding/StoryIntelligenceContext.cshtml @@ -0,0 +1,107 @@ +@model StoryIntelligenceOverviewViewModel +@{ + ViewData["Title"] = "Story and portrait context"; +} + +
+
+ +
+

Step @Model.WizardContextStep of @Model.WizardTotalSteps

+

Story and Portrait Context

+

Set the context choices for this manuscript before the analysis starts.

+
+ + @if (TempData["OnboardingStoryIntelligenceError"] is string error) + { +
@error
+ } + + @if (Model.ExistingBatchID.HasValue) + { +
+

Analysis has already started

+

You can continue reviewing progress for the approved chapters.

+
+ Continue pipeline + + + +
+
+ } + else + { +
+
+
+

Pre-analysis setup

+

Context choices

+

Explicit manuscript evidence always wins. These choices guide unresolved generated portraits and broad story context.

+
+ Required before analysis +
+ +
+ + + + +
+ +
+ Back + +
+
+ } +
+
diff --git a/PlotLine/Views/Onboarding/_OnboardingJourneyHeader.cshtml b/PlotLine/Views/Onboarding/_OnboardingJourneyHeader.cshtml index c35e00c..a4fb124 100644 --- a/PlotLine/Views/Onboarding/_OnboardingJourneyHeader.cshtml +++ b/PlotLine/Views/Onboarding/_OnboardingJourneyHeader.cshtml @@ -1,6 +1,6 @@ @model OnboardingJourneyHeaderViewModel @{ - var characterReviewStepCount = Math.Max(1, Model.TotalSteps - 9); + var characterReviewStepCount = Math.Max(1, Model.TotalSteps - 10); var steps = Model.TotalSteps <= 10 ? BuildDefaultSteps() : BuildDynamicSteps(characterReviewStepCount, Model.TotalSteps); @@ -60,6 +60,7 @@ steps.Add(new HeaderStep($"Characters {index}", 7 + index)); } + steps.Add(new HeaderStep("Story Summary", totalSteps - 2)); steps.Add(new HeaderStep("Story Context", totalSteps - 1)); steps.Add(new HeaderStep("Complete", totalSteps)); return steps;