23 lines
3.6 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;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-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>
<div class="d-flex flex-wrap gap-3 align-items-center"><label><input type="checkbox" id="native-follow" /> Follow this manuscript’s saved chapter and scene</label><button type="button" id="native-return" class="btn btn-sm btn-outline-primary">Return to current Word scene</button></div>
<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 target="_blank" rel="noopener" href="/Books/Details/@Model.Book">Book workspace</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 is "context" or "intent"){
<label class="form-label" for="native-manual-scene">Explore a saved scene · Word is optional</label><select id="native-manual-scene" class="form-select mb-2"><option value="">Choose a saved scene</option>@foreach(var chapter in Model.Chapters??[]){<optgroup label="@chapter.Title">@foreach(var scene in chapter.Scenes){<option value="@scene.SceneId" data-chapter="@chapter.ChapterId">@scene.Title</option>}</optgroup>}</select>}
<iframe id="native-story-workspace" title="Saved story workspace" class="w-100 border rounded" style="height:65vh" hidden></iframe>
@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>