20 lines
3.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@model PlotLine.Controllers.NativeWorkspaceModel
@{ ViewData["Title"]="Word Companion · "+Model.Title;if(Model.Mode is "context" or "intent"){Layout="_WritingCompanionLayout";} }
<div class="container-fluid px-3 py-3 @(Model.Mode=="book"?"":"native-writing-workspace")" id="native-workspace" data-book="@Model.Book" data-project="@Model.Project" data-instance="@Model.Instance" data-session="@Model.Session" data-mode="@Model.Mode">
<h1 class="h3">@Model.Title</h1><p>Word Companion · live manuscript connection and saved PlotDirector workspaces</p>
<div class="card mb-3"><div class="card-body">
<p id="native-current-scene" class="fw-semibold" role="status">Saved workspace · waiting for a current Word scene</p>
<p id="native-presence-status" role="status">Checking Companion presence…</p>
<label for="native-session">Word document session</label><select id="native-session" class="form-select mb-2"><option value="">Choose a connected manuscript</option></select>
<p class="small text-muted">Connection diagnostics only. Open Context or Intent to follow the manuscript and navigate saved scenes.</p>
<nav class="d-flex gap-3"><a href="/Writer/Write?bookId=@Model.Book&amp;wordInstanceId=@Model.Instance&amp;wordSessionId=@Model.Session">Return to Writer working focus</a><a target="_blank" rel="noopener" href="/Books/Details/@Model.Book">Book workspace</a><a href="/manuscript/paragraphs?bookId=@Model.Book" target="_blank" rel="noopener">Manuscript structure and evidence</a><button class="btn btn-link p-0" type="button" data-native-open-role="Context">Open Context</button><button class="btn btn-link p-0" type="button" data-native-open-role="Intent">Open Intent</button></nav>
</div></div>
@if(Model.Mode=="book"){
<h2 class="h4 mt-4">AI chapter suggestions</h2><p>Generated by PlotDirector’s existing chapter-analysis service. Review titles and summaries before any import. Successful chapters remain available for 30 days.</p>
@if(Model.Reviews.Count==0){<div class="alert alert-secondary">No saved AI suggestions yet. Use Import manuscript in PlotDirector to read and review your manuscript.</div>}
else {<form method="post" action="/native-companion/import/preview">@Html.AntiForgeryToken()<input type="hidden" name="bookId" value="@Model.Book" /><ul class="list-group">@foreach(var review in Model.Reviews){var result=System.Text.Json.JsonSerializer.Deserialize<PlotDirector.Companion.Protocol.AiChapterResult>(review.ResultJson);<li class="list-group-item"><label><input type="checkbox" name="reviews" value="@review.ReviewID" /> Select chapter for preview</label> · <a href="/native-companion/reviews/@review.ReviewID">@(string.IsNullOrWhiteSpace(result?.ChapterTitle)?"Chapter at position "+review.ChapterStart:result.ChapterTitle)</a> · @(result?.Scenes.Length??0) scene suggestions · @review.CreatedUtc.ToString("u")</li>}</ul><button class="btn btn-primary mt-3">Preview approved import</button></form>}
}
</div>
<script src="~/js/writing-workspace.js" asp-append-version="true" defer></script>
<script src="~/js/native-companion-workspace.js" asp-append-version="true" defer></script>