18 lines
2.7 KiB
Plaintext
Raw 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; }
<div class="container py-4" 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-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>
<label><input type="checkbox" id="native-follow" /> Follow this manuscript’s saved chapter and scene</label>
<p class="small text-muted">Manual navigation pauses following. No Word commands or manuscript text are sent by this page. Context and Intent remain available without Word.</p>
<nav class="d-flex gap-3"><a href="/Books/Details/@Model.Book">Book workspace</a><a href="/Writing/Context?projectId=@Model.Project&bookId=@Model.Book&pinned=true">Saved Context</a><a href="/Writing/Intent?projectId=@Model.Project&bookId=@Model.Book&pinned=true">Saved Intent</a></nav>
</div></div>
<iframe id="native-story-workspace" title="Saved story workspace" class="w-100 border rounded" style="height:65vh" hidden></iframe>
<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. Detect Heading 1 chapters in the tray Companion, select chapters and explicitly confirm analysis.</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/native-companion-workspace.js" asp-append-version="true" defer></script>