diff --git a/PlotLine.Tests/Browser/warning-triage.cjs b/PlotLine.Tests/Browser/warning-triage.cjs new file mode 100644 index 00000000..1e3d37b9 --- /dev/null +++ b/PlotLine.Tests/Browser/warning-triage.cjs @@ -0,0 +1,3 @@ +const {chromium}=require('playwright');const fs=require('node:fs');const path=require('node:path');const assert=require('node:assert/strict'); +(async()=>{const browser=await chromium.launch();try{const page=await browser.newPage();await page.goto('about:blank');await page.setContent('
Travel
Arrival evidence
Departure acknowledged
Age
Birthday conflict
'); +await page.evaluate(()=>{window.submissions=0;document.addEventListener('submit',e=>{submissions++;e.preventDefault();});});await page.addScriptTag({content:fs.readFileSync(path.join(__dirname,'../../PlotLine/wwwroot/js/warning-triage.js'),'utf8')});assert.match(await page.locator('#warning-match-count').textContent(),/^3 /);await page.fill('#warning-evidence-search','arrival');assert.match(await page.locator('#warning-match-count').textContent(),/^1 /);assert.equal(await page.locator('[data-warning-cluster]:visible').count(),1);await page.fill('#warning-evidence-search','');await page.selectOption('#warning-review-state','decided');assert.match(await page.locator('#warning-match-count').textContent(),/^1 /);await page.selectOption('#warning-review-state','active');assert.match(await page.locator('#warning-match-count').textContent(),/^2 /);await page.click('#warning-expand');assert.equal(await page.locator('details[open]').count(),2);await page.click('#warning-collapse');assert.equal(await page.locator('details[open]').count(),0);assert.equal(await page.locator('form input').inputValue(),'10');assert.equal(await page.evaluate(()=>submissions),0);console.log('PASS warning triage search, state, expansion and unchanged author-action forms');}finally{await browser.close();}})().catch(e=>{console.error(e);process.exit(1)}); diff --git a/PlotLine.Tests/Program.cs b/PlotLine.Tests/Program.cs index c3d6842e..80d28a06 100644 --- a/PlotLine.Tests/Program.cs +++ b/PlotLine.Tests/Program.cs @@ -122,6 +122,7 @@ if (args.Contains("--plot-lines")) return; } +if(args.Contains("--release-sprint")){ReleaseSprintTests.Run();Console.WriteLine("PASS continuity triage and public onboarding/installer guidance");return;} if(args.Contains("--native-import")){await NativeImportTests.Run();Console.WriteLine("PASS approved native import preview, source preservation, ownership, version and retry");return;} if(args.Contains("--native-tray")){await NativeTrayIntegrationTests.Run();Console.WriteLine("PASS native tray presence, expiry, scope and persistent PWA review decisions");return;} if(args.Contains("--native-workflow")){await NativeWorkflowTests.Run();Console.WriteLine("PASS native saved workspace and safe import preview validation");return;} @@ -130,6 +131,8 @@ if(args.Contains("--native-companion")){await NativeCompanionTests.Run();Console var tests = new (string Name, Action Test)[] { + ("Release triage and browser-only onboarding preserve author decisions", ReleaseSprintTests.Run), + ("Approved native import source and confirmation remain safe", () => NativeImportTests.Run().GetAwaiter().GetResult()), ("Native tray presence and PWA review remain scoped, expiring and non-destructive", () => NativeTrayIntegrationTests.Run().GetAwaiter().GetResult()), ("Native saved workspace and established import eligibility remain scoped and read-only", () => NativeWorkflowTests.Run().GetAwaiter().GetResult()), ("Native companion authentication, canonical AI mapping and isolated chapter retry", () => NativeCompanionTests.Run().GetAwaiter().GetResult()), diff --git a/PlotLine.Tests/ReleaseSprintTests.cs b/PlotLine.Tests/ReleaseSprintTests.cs new file mode 100644 index 00000000..d044ed8a --- /dev/null +++ b/PlotLine.Tests/ReleaseSprintTests.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Hosting; +using PlotLine.Services; +using PlotLine.ViewModels; +internal static class ReleaseSprintTests +{ + public static void Run() + { + void Check(bool value,string text){if(!value)throw new Exception(text);} + var warnings=new[]{new ProjectWarningViewModel{ContinuityWarningID=1,WarningType="Travel",WarningTypeDisplayName="Travel",Severity="Warning",CharacterID=10,CharacterName="A",SceneID=1},new ProjectWarningViewModel{ContinuityWarningID=2,WarningType="Travel",WarningTypeDisplayName="Travel",Severity="Warning",CharacterID=10,CharacterName="A",SceneID=2,IsAcknowledged=true},new ProjectWarningViewModel{ContinuityWarningID=3,WarningType="Travel",Severity="Warning",CharacterID=20},new ProjectWarningViewModel{ContinuityWarningID=4,WarningType="Age",Severity="Warning",CharacterID=10}}; + var groups=WarningTriage.Group(warnings);Check(groups.Count==3&&groups.Sum(g=>g.Warnings.Count)==4,"Triage groups related rule/entity evidence without dropping warnings");var travel=groups.Single(g=>g.Warnings.Count==2);Check(travel.Active==1&&travel.Scenes==2&&warnings[1].IsAcknowledged,"Triage preserves decisions and separates active from acknowledged evidence"); + var environment=NativeWorkflowTests.Proxy((name,args)=>name=="get_ContentRootPath"?Path.GetFullPath("PlotLine"):name=="get_EnvironmentName"?"Development":null); + var help=new HelpService(environment);var first=help.GetByContextKey("gettingStarted.firstBook");var install=help.GetByContextKey("wordCompanion.install");Check(first?.Url=="/help/getting-started/first-book"&&install?.Url=="/help/word-companion/install","New author/Companion guidance resolves through actual help routing");Check(install!.MarkdownContent.Contains("not yet offered")&&!install.MarkdownContent.Contains("C:\\Users"),"Download guidance does not expose an internal installer path or pretend public qualification"); + } +} diff --git a/PlotLine/Help/Articles/GettingStarted/First-Book.md b/PlotLine/Help/Articles/GettingStarted/First-Book.md new file mode 100644 index 00000000..6aac8e2b --- /dev/null +++ b/PlotLine/Help/Articles/GettingStarted/First-Book.md @@ -0,0 +1,35 @@ +--- +title: Your First Book in PlotDirector +slug: first-book +category: Getting Started +tags: new author, first book, onboarding, browser, planning +contextKey: gettingStarted.firstBook +micro: Start with one book and one useful scene; Word is optional. +quickTitle: Your first book +quickSummary: Create a project and book, add a scene, and use Context, Intent and Plot Lines as your story grows. +screenshot: +--- + +# Start with one book + +Create your account, then create a project for your story or series and a book inside it. You can plan and manage your story entirely in the browser or installed PlotDirector app. Microsoft Word and the Companion are optional. + +[Open your projects](/Projects) + +# Add the next scene you want to write + +Add a chapter and scene from the book workspace. Give the scene a useful title, a short summary, its purpose and any known characters, location or story date. Leave unknown details unset rather than guessing. Start small; advanced tools remain available when you need them. + +# Give each screen a job + +**Context** brings together saved scene information, participants, relationships and places. **Intent** shows your scene purpose, chapter goals and saved objectives. Both can be explored manually without Word. With a supported Companion and reliable scene mapping, choose a live manuscript session and enable Follow. Manual exploration pauses following; Return to current Word scene resumes it. + +**Plot Lines** shows how narrative threads develop and meet. A scene can belong to more than one line. Use intersections and the health evidence to investigate quiet or unresolved threads; these observations do not change your author decisions. + +The **Problem Solver** helps when a writing problem needs a clearer diagnosis. Open it from PlotDirector's navigation; you do not need a manuscript import or Word connection to use it. + +# Bring an existing manuscript + +Keep your original manuscript. Use the established manuscript import, or the supported Word Companion analysis/review workflow. Review chapter and scene choices before confirming an import. AI suggestions are proposals, not author-approved story facts. Conflicting existing content must be reconciled explicitly. + +[Word Companion setup and availability](/help/word-companion/install) diff --git a/PlotLine/Help/Articles/WordCompanion/Install.md b/PlotLine/Help/Articles/WordCompanion/Install.md new file mode 100644 index 00000000..a1897180 --- /dev/null +++ b/PlotLine/Help/Articles/WordCompanion/Install.md @@ -0,0 +1,33 @@ +--- +title: Word Companion Setup and Availability +slug: install +category: Word Companion +tags: companion, Word, Windows, install, download, browser +contextKey: wordCompanion.install +micro: Choose browser-only use or the supported Windows desktop Word integration. +quickTitle: Word Companion setup +quickSummary: The Companion is optional. Its verified Windows developer installer is distinct from a publicly qualified download. +screenshot: +--- + +# Choose how you write + +**Browser or PWA:** use PlotDirector's projects, books, scenes, Context, Intent, Plot Lines and Problem Solver without installing anything in Word. + +**Windows desktop Word:** the Companion connects Word's manuscript access to a Windows tray control centre. PlotDirector performs chapter AI analysis and the browser provides review and story workspaces. Word's ribbon stays small: local connection status and Open Companion. + +# Installer availability + +A complete per-user Windows installer has been tested in Development. A publicly qualified, production-signed download is not yet offered on this page. Do not use an internal developer path, a loose Word manifest or an unverified download as a public installer. You can continue using PlotDirector in your browser meanwhile. + +When an approved release is published, use its verified download and close Word normally before installation. Missing prerequisites should produce a clear message, not require changing Visual Studio or disabling Office security. + +# Connect and review + +Open Companion, sign in through your normal PlotDirector browser session and select the authorised book. Remembering a book association is optional and requires permission to modify document metadata; it never saves or rewrites manuscript prose. + +Use Heading 1 for chapter headings. Detect Chapters reads locally. Select chapters and confirm before sending prose for AI analysis. When approving a connection in your browser, you may enable encrypted import capture for chapters you explicitly submit. This option defaults off and does not upload anything automatically. Older suggestions without source need a newly consented submission; unchanged analysis can be reused. + +Review scene titles, summaries and decisions in PlotDirector. Preview an approved import before confirming it. Existing content is not silently replaced. If Word or the Companion disconnects, the browser still works and saved reviews remain available. + +[Get started without Word](/help/getting-started/first-book) diff --git a/PlotLine/ViewModels/WarningTriage.cs b/PlotLine/ViewModels/WarningTriage.cs new file mode 100644 index 00000000..49ef14a6 --- /dev/null +++ b/PlotLine/ViewModels/WarningTriage.cs @@ -0,0 +1,14 @@ +namespace PlotLine.ViewModels; +public sealed record WarningCluster(string Title,IReadOnlyList Warnings) +{ + public int Active=>Warnings.Count(w=>!w.IsDismissed&&!w.IsIntentional&&!w.IsAcknowledged); + public int Scenes=>Warnings.Select(w=>w.CurrentSceneId??w.SceneID).Where(id=>id.HasValue).Distinct().Count(); +} +public static class WarningTriage +{ + // Grouping is navigational evidence, never a claim that warnings share one cause. + public static IReadOnlyList Group(IEnumerable warnings)=>warnings + .GroupBy(w=>$"{w.Severity}|{(string.IsNullOrWhiteSpace(w.WarningType)?w.WarningTypeDisplayName:w.WarningType)}|{w.EntityType}|{w.CharacterID}|{w.AssetID}|{(w.CharacterID.HasValue||w.AssetID.HasValue?null:w.SceneID)}",StringComparer.OrdinalIgnoreCase) + .Select(g=>new WarningCluster(g.First().WarningTypeDisplayName+" · "+(!string.IsNullOrWhiteSpace(g.First().CharacterName)?g.First().CharacterName:!string.IsNullOrWhiteSpace(g.First().EntityType)?g.First().EntityType:"Story evidence"),g.OrderByDescending(w=>w.LastDetectedDate).ToArray())) + .OrderByDescending(g=>g.Active).ThenByDescending(g=>g.Warnings.Count).ThenBy(g=>g.Title).ToArray(); +} diff --git a/PlotLine/Views/Help/Index.cshtml b/PlotLine/Views/Help/Index.cshtml index 043e3c91..ec16b252 100644 --- a/PlotLine/Views/Help/Index.cshtml +++ b/PlotLine/Views/Help/Index.cshtml @@ -15,6 +15,8 @@ + +
diff --git a/PlotLine/Views/Home/Index.cshtml b/PlotLine/Views/Home/Index.cshtml index 81e2d975..9227404c 100644 --- a/PlotLine/Views/Home/Index.cshtml +++ b/PlotLine/Views/Home/Index.cshtml @@ -223,7 +223,7 @@

The next chapter is yours

You've got a book to finish.

Let's give it a little room.

Start writing free -

30 days free · No card needed

+

30 days free · No card needed

Start with your first book · Word Companion is optional

diff --git a/PlotLine/Views/Warnings/Index.cshtml b/PlotLine/Views/Warnings/Index.cshtml index 67be0994..16dcf44a 100644 --- a/PlotLine/Views/Warnings/Index.cshtml +++ b/PlotLine/Views/Warnings/Index.cshtml @@ -138,6 +138,8 @@

Warnings

+
+

Grouped by warning type and known entity. Related evidence may have different causes. Detection dates do not prove that the latest prose was rechecked; investigate before deciding.

@if (!Model.ProjectWarnings.Any()) {

@(Model.HasAnyWarnings ? "No warnings match the current filters." : "No project warnings detected.")

@@ -156,6 +158,8 @@
+ @foreach(var cluster in WarningTriage.Group(group.Warnings)){ +
@cluster.Title · @cluster.Active need attention · @cluster.Warnings.Count warnings · @cluster.Scenes affected scenes
@@ -170,14 +174,14 @@ - @foreach (var warning in group.Warnings) + @foreach (var warning in cluster.Warnings) { - +
@warning.Severity @warning.Category @warning.WarningTypeDisplayName -
@warning.Message
+
@warning.Message
Detected @warning.LastDetectedDate.ToString("u") @if (!string.IsNullOrWhiteSpace(warning.Details)) { @warning.Details @@ -322,7 +326,8 @@ }
-
+
+ }
@@ -330,3 +335,5 @@ }
+ +@section Scripts {} diff --git a/PlotLine/wwwroot/js/warning-triage.js b/PlotLine/wwwroot/js/warning-triage.js new file mode 100644 index 00000000..4494fa66 --- /dev/null +++ b/PlotLine/wwwroot/js/warning-triage.js @@ -0,0 +1,5 @@ +(()=>{ + const search=document.querySelector('#warning-evidence-search'),state=document.querySelector('#warning-review-state'),groups=[...document.querySelectorAll('[data-warning-cluster]')];if(!search||!state)return; + const update=()=>{const query=search.value.trim().toLocaleLowerCase();let total=0;for(const group of groups){let matches=0;for(const row of group.querySelectorAll('[data-warning-evidence]')){const decided=row.dataset.decided==='true';row.hidden=!!query&&!row.textContent.toLocaleLowerCase().includes(query)||state.value==='active'&&decided||state.value==='decided'&&!decided;if(!row.hidden)matches++;}group.hidden=!matches;if(query&&matches)group.open=true;total+=matches;}document.querySelector('#warning-match-count').textContent=total+' matching warnings in loaded results';}; + search.addEventListener('input',update);state.addEventListener('change',update);document.querySelector('#warning-expand')?.addEventListener('click',()=>groups.filter(g=>!g.hidden).forEach(g=>g.open=true));document.querySelector('#warning-collapse')?.addEventListener('click',()=>groups.forEach(g=>g.open=false));update(); +})();