PlotDirector/PlotLine/Views/Writing/_IntentAssessment.cshtml

15 lines
2.0 KiB
Plaintext

@model PlotLine.Services.IntentAssessmentFrame
@using System.Text.Json
@{var saved=Model.Saved;var stale=saved is not null&&saved.InputHash!=Model.Hash;var decisions=saved is null?new Dictionary<string,string>():JsonSerializer.Deserialize<Dictionary<string,string>>(saved.DecisionsJson)??new();}
<div data-intent-evidence-result>
<p class="eyebrow">Saved prose compared with your plan</p>
@if(string.IsNullOrEmpty(Model.Source)){<p>No saved manuscript prose is available. Import this scene first. Word edits are not automatically synchronised.</p>}
else if(Model.Objectives.Length==0){<p>Add a purpose, outcome or checklist objective in the scene editor.</p>}
else{<p>@Model.Objectives.Length planned objectives · uses saved PlotDirector prose, not unsaved Word changes.</p>}
@if(saved is null){<p>No assessment saved yet. Analyse explicitly when you are ready; this may incur AI costs.</p>}
else{
<p role="status">@(stale?"Out of date — saved prose or intentions changed. Reassess before acting.":"Evidence matches the saved prose and plan.") · @saved.CreatedUtc.ToString("d MMM yyyy HH:mm") UTC</p>
@foreach(var item in saved.Evidence){var objective=Model.Objectives.FirstOrDefault(x=>x.Key==item.Key);<details class="intent-evidence-card"><summary><strong>@(string.IsNullOrWhiteSpace(item.ObjectiveText)?objective?.Text??"Previous objective":item.ObjectiveText)</strong> · @item.Status.Replace('-',' ') <span>@decisions.GetValueOrDefault(item.Key,"pending")</span></summary><p>@item.Reason</p>@if(!string.IsNullOrWhiteSpace(item.Quote)){<blockquote>@item.Quote</blockquote>}<p>AI suggestion · final completion remains your decision.</p>@if(!stale){<div class="intent-decision-actions">@foreach(var choice in new[]{"acknowledged","dismissed","deferred","pending"}){<button type="button" class="btn btn-outline-secondary btn-sm" data-intent-decision="@choice" data-intent-key="@item.Key" data-intent-hash="@saved.InputHash">@(choice=="pending"?"Revisit":choice=="acknowledged"?"Keep evidence":choice=="dismissed"?"Dismiss":"Defer")</button>}</div>}</details>}
}
</div>