From c769e1119a2542e256374db3c48eeb324c2663ab Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Mon, 16 Nov 2026 15:13:29 +0000 Subject: [PATCH] fix(writer): establish Writer 3 foundation and scoped workflows --- Docs/Writer/Writer3/Context-Contract.md | 22 ++ Docs/Writer/Writer3/Help-Coverage.md | 70 ++++ Docs/Writer/Writer3/Implementation-Tracker.md | 318 +++++++++++++++ Docs/Writer/Writer3/Master-Specification.md | 365 ++++++++++++++++++ .../Browser/writer-foundation-live.cjs | 62 +++ PlotLine.Tests/Program.cs | 1 + PlotLine.Tests/Sql/WriterFoundation.sql | 49 +++ PlotLine.Tests/WriterFoundationTests.cs | 89 +++++ PlotLine.Tests/WritingIntegrationTests.cs | 1 + PlotLine/Controllers/WriterController.cs | 55 ++- PlotLine/Controllers/WritingController.cs | 27 +- PlotLine/Data/Repositories.cs | 6 +- .../Help/Articles/Workspace/ChapterGoals.md | 4 + PlotLine/Help/Articles/Workspace/Overview.md | 61 ++- .../Help/Articles/Workspace/PolishingQueue.md | 12 +- .../Help/Articles/Workspace/RevisionQueue.md | 4 + .../Articles/Workspace/WorkflowSummary.md | 4 + .../Help/Articles/Workspace/WorkingContext.md | 39 ++ PlotLine/Help/Articles/Workspace/WriteNext.md | 12 +- .../Help/Articles/Workspace/WritingPlans.md | 42 ++ PlotLine/Services/CoreServices.cs | 25 +- .../Manuscript/ManuscriptReaderService.cs | 2 + PlotLine/Services/Writer/WriterContext.cs | 66 ++++ PlotLine/Sql/264_WriterFoundationQueues.sql | 99 +++++ PlotLine/ViewModels/CoreViewModels.cs | 7 + PlotLine/Views/Writer/EditWritingPlan.cshtml | 6 +- PlotLine/Views/Writer/Index.cshtml | 4 +- PlotLine/Views/Writer/SchedulePreview.cshtml | 13 +- PlotLine/Views/Writer/ScheduleSetup.cshtml | 8 +- PlotLine/Views/Writer/WritingPlans.cshtml | 14 +- .../Views/Writer/_WriterSceneQueue.cshtml | 2 +- PlotLine/Views/Writing/Context.cshtml | 1 + PlotLine/Views/Writing/Intent.cshtml | 1 + .../Writing/_WritingIntentChecklist.cshtml | 4 +- 34 files changed, 1396 insertions(+), 99 deletions(-) create mode 100644 Docs/Writer/Writer3/Context-Contract.md create mode 100644 Docs/Writer/Writer3/Help-Coverage.md create mode 100644 Docs/Writer/Writer3/Implementation-Tracker.md create mode 100644 Docs/Writer/Writer3/Master-Specification.md create mode 100644 PlotLine.Tests/Browser/writer-foundation-live.cjs create mode 100644 PlotLine.Tests/Sql/WriterFoundation.sql create mode 100644 PlotLine.Tests/WriterFoundationTests.cs create mode 100644 PlotLine/Help/Articles/Workspace/WorkingContext.md create mode 100644 PlotLine/Help/Articles/Workspace/WritingPlans.md create mode 100644 PlotLine/Services/Writer/WriterContext.cs create mode 100644 PlotLine/Sql/264_WriterFoundationQueues.sql diff --git a/Docs/Writer/Writer3/Context-Contract.md b/Docs/Writer/Writer3/Context-Contract.md new file mode 100644 index 00000000..cb323544 --- /dev/null +++ b/Docs/Writer/Writer3/Context-Contract.md @@ -0,0 +1,22 @@ +# Writer working context — Phase 1 contract + +`Services/Writer/WriterContext.cs` is an immutable projection of already-authorised entity selections, not an authorisation service, persistent global selector or Word-navigation operation. Constructors validate positive scope, scene/chapter completeness and cross-book selection; existing services still validate entity membership and permissions. + +| Slot | Source / authority | Update and propagation | +|---|---|---| +| Scope | Authorised request/model project and book | New book means a new context, never reuse selections from the previous book. | +| SavedObjective | WriterObjective read for actor/book | Explicit SaveObjective only; unavailable target is omitted by existing SQL. | +| Working | Initially saved objective on dashboard | Separate slot for future explicit Write focus; no inferred change from a reference. | +| Exploration | Resolved saved Context/Intent scene, or temporary chart/map inspection | Independent and transient. Contract construction never navigates Word; existing explicitly trusted navigation controls remain unchanged in Phase1. Phase4 distinguishes exploration commands from Go to scene. | +| PinnedReference | Resolved saved snapshot selection | Does not subscribe to live Word following or change working objective. Invalid route IDs cannot become a valid selection. | +| Reader | Reader service’s authorised selected chapter | Reader model adapter; chapter changes do not retarget an active session or working objective. | +| Session | Explicit session book/chapter | Existing WriterWork state/start binding remains authoritative, including UUID/activity/native lease. Slot supports composition by future shell; dashboard does not invent a session from objective or URL. | +| VerifiedWord | Exact instance/document/manuscript, observed and accepted revision with resolved selection | Set only after existing saved-document, live-lease, accepted-position and race checks in WritingController. Invalidated target is cleared; no raw query ID is proof. | + +Dashboard populates Scope, SavedObjective and Working. Resolved Context/Intent pages populate pinned/exploration and, after native verification, VerifiedWord; unresolved pages have no projected reference. Reader exposes its independent Reader slot. Active session remains fetched through existing WriterWork API/client polling; its identity/kind/native binding are not replaced by a route selection. There is no schema change, localStorage global focus, new native protocol or automatic state fan-out. + +Existing standalone windows, SignalR follow, exact native/session/grant checks, accepted manuscript revision boundaries, explicit Word navigation and named-window placement remain intact. Phase1 records these contracts and consumes them in view models/selection-role metadata; interactive cross-destination focus persistence/selection indicators belong to Phases2–4, not a hidden Phase1 shell redesign. + +Status authority: scene RevisionStatusID plus the existing lookup describes canonical readiness. Legacy SceneWorkflow.DraftStatus/readiness fields are retained for compatibility; Intent no longer displays legacy DraftStatus as a conflicting workflow stage. No data backfill or silent overwrite occurs. + +Scheduling remains two stores: legacy WritingScheduleItems with Planned/Done/Skipped/Moved and reviewed WriterPlannedActivities with Planned/Done. Completion is author-declared per record; it does not change scene status, checklist completion or work-session evidence. Preview filters by request scope before default plan choice, includes project-wide plans, and rejects an explicit out-of-scope plan. Unscoped direct Preview retains the existing personal all-plan behavior. Availability edits do not relocate reviewed allocations; explicit review/confirmation is required. diff --git a/Docs/Writer/Writer3/Help-Coverage.md b/Docs/Writer/Writer3/Help-Coverage.md new file mode 100644 index 00000000..ffda9cf3 --- /dev/null +++ b/Docs/Writer/Writer3/Help-Coverage.md @@ -0,0 +1,70 @@ +# Writer 3.0 Help coverage register + +HelpService loads front-matter Markdown; HelpIconTagHelper resolves contextKey and exposes micro/quickTitle/quickSummary plus full Help links. Existing client handles popups; HelpController renders full articles. No alternative system introduced. Plain names/obvious buttons do not need field icons. Source articles remain authoritative for all three presentations. + +Phase1: corrected workspace/queue/goal guidance; added workingContext and writingPlans articles; added icons on the desk, workspace heading, Intent workflow and four schedule pages. Review all applicable tooltip, popup and full-article content before each phase completes. Videos remain optional Phase8 scripts/captions/transcripts, not a Phase1 dependency. Mapping is ownership coverage, not a claim every feature already has a dedicated article/icon; later destinations need targeted Help in their delivery phase. + +| Audit feature | Capability | Help key/owner | Coverage / follow-up | +|---|---|---|---| +| F01 | Desk identity and Companion status | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F02 | Help Me | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F03 | Start Here / objective setup | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F04 | Continue Writing | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F05 | Next Planned Session | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F06 | Your Manuscript / Writing Progress | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F07 | Recent Activity | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F08 | Month calendar | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F09 | Year overview | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F10 | Selected day and session history | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F11 | Planned work ahead | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F12 | Writing Rhythm session toolbar | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F13 | Audio Review controls | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F14 | Workspace navigation | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F15 | Scene queue cards | workspace.overview | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F16 | Story Health reminders | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F17 | Today's planned writing | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F18 | Word Companion & Display Setup | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F19 | Plan management table | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F20 | Delete Writing Plan modal | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F21 | Plan scope and goal form | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F22 | Writing Availability | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F23 | Candidate review and budgets | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F24 | No candidates / replacement warning | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F25 | Writing Plan Selection | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F26 | Reviewed writing activities | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F27 | Legacy schedule summary/table | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F28 | Availability/deadline editor | workspace.writingPlans | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F29 | Chapter workflow counters | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F30 | Chapter Goals | workspace.chapterGoals | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F31 | Workflow Summary | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F32 | Retained evidence table | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F33 | Baseline prompt | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F34 | Privacy and retention | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F35 | Delete retained activity | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F36 | Scene navigation and follow status | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F37 | Overview tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F38 | People tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F39 | Relationships tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F40 | Maps tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F41 | Floor Plans tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F42 | Story tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F43 | Plot Lines tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F44 | Metrics tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F45 | Intent navigation and identity | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F46 | Plan tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F47 | Must Include tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F48 | Notes tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F49 | Threads tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F50 | Evidence tab and result cards | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F51 | Checklist tab | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F52 | Reader chapter navigation | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F53 | Reader update controls | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F54 | Reading & Audio Review disclosure | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F55 | Drafting support card and menu | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F56 | Purpose editor | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F57 | Notes editor | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F58 | Checklist editor | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F59 | Workflow editor | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F60 | Attachments editor | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F61 | Problem Solver questions, browse and results | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | +| F62 | Workspace context chooser | workspace.workingContext | Existing Help tooltip/popup/full article; destination-specific expansion in delivery phase | diff --git a/Docs/Writer/Writer3/Implementation-Tracker.md b/Docs/Writer/Writer3/Implementation-Tracker.md new file mode 100644 index 00000000..e0ed44b9 --- /dev/null +++ b/Docs/Writer/Writer3/Implementation-Tracker.md @@ -0,0 +1,318 @@ +# Writer 3.0 implementation tracker + +Baseline: `9a8b9a3`, shared branch `codex/word-companion-native-phase1-20261104`, 16 November 2026. The attached kickoff authorises Phase 1 implementation and Development deployment only; the master specification governs product direction even though its header says Proposed. Phase 2 requires explicit acceptance. No feature is retired. Unrelated investigation file is preserved. + +## Phase 1 screen and interaction states before implementation + +No new workspace shell in this phase. Existing Overview/Journey/Workspaces routes, ribbon and disclosures remain. Queue tabs consistently say Write Next / In Progress / Revision / Final Pass; empty help describes their canonical statuses. Intent Checklist shows canonical Revision Status; legacy stored DraftStatus is preserved but not presented as a competing status. Plan management returns to the selected project/book after mutations; scoped Preview lists the chosen book plus All Books plans. Explicit selection of another accessible plan changes plan context visibly. Setup/edit validation loads after jQuery. No exploratory/pinned/Reader selection becomes a Word-navigation command merely by constructing the shared context. Standalone Context/Intent keep existing native verification, layouts and display controls. + +## Eight-phase execution breakdown + +### Phase 1 — Foundation and corrections + +- Objective/deliverables: Queue repair and book-before-cap filtering; canonical status presentation; typed independent focus contracts; scoped plan navigation/selection; validation ordering; Help and regressions. +- Batches: 1A queue/SQL; 1B status/context; 1C scheduling/validation; 1D Help/tests/deployment +- Reuse: WriterController, WriterWorkspaceService/Repository, WritingController, Reader, schedule service, existing HelpService/tag helper +- New/change: implement the batch deliverables inside the existing MVC application; no parallel Writer. +- Database: 264 forward-only procedure repair; no new tables. +- Dependencies/risks: shared-branch concurrency; live/source procedure drift; existing permissions and native compatibility. +- Acceptance: Queue >40 other-book fixture; permissions and cross-book IDs; status divergence; independently selected session/Reader/pinned targets; browser/PWA forms; native-follow regression; Development smoke. +- Preservation: all mapped F/I capabilities below; reader/source/privacy/native safeguards remain authoritative. +- Help: review existing Markdown keys for affected capabilities; update tooltip, popup and full article together; register coverage. +- Status / Development deployment: In progress; not deployed at tracker creation. + +### Phase 2 — Writer Home and workspace shell + +- Objective/deliverables: Three Home actions and five destinations; resizable workspace/companion; contextual ribbon and return state. +- Batches: 2A state/layout sketches; 2B Home and destinations; 2C resize/ribbon/returns; 2D empty/responsive/Help qualification +- Reuse: ApplicationNavigation/Ribbon, existing theme/PWA shell and workspace maximise conventions +- New/change: implement the batch deliverables inside the existing MVC application; no parallel Writer. +- Database: None assumed. +- Dependencies/risks: Phase 1 acceptance; preserve canonical records and scoped return state; avoid hidden context changes. +- Acceptance: New author entry; existing deep links; keyboard resizing; mobile/PWA; all preservation mappings reachable. +- Preservation: all mapped F/I capabilities below; reader/source/privacy/native safeguards remain authoritative. +- Help: review existing Markdown keys for affected capabilities; update tooltip, popup and full article together; register coverage. +- Status / Development deployment: Not started — Phase 1 acceptance required; not deployed at tracker creation. + +### Phase 3 — Write and Review integration + +- Objective/deliverables: Inline chapter goals, purpose/outcome, notes/checklist/workflow/attachments; Reader/Audio Review and revision handoff. +- Batches: 3A authoring composition; 3B inline editors; 3C review/return actions; 3D qualified acceptance +- Reuse: ChapterGoal/Scene repositories, SceneInspectorV2 editors, Reader, IntentAssessmentService, WriterWork toolbar +- New/change: implement the batch deliverables inside the existing MVC application; no parallel Writer. +- Database: Reuse authoritative storage; new revision-task storage only after gap review. +- Dependencies/risks: Phase 2 acceptance; preserve canonical records and scoped return state; avoid hidden context changes. +- Acceptance: Round-trip authored fields; attachment permissions/quota; focused Reader/refresh; session scope; evidence decisions never complete objectives automatically. +- Preservation: all mapped F/I capabilities below; reader/source/privacy/native safeguards remain authoritative. +- Help: review existing Markdown keys for affected capabilities; update tooltip, popup and full article together; register coverage. +- Status / Development deployment: Not started; not deployed at tracker creation. + +### Phase 4 — Context, Intent and display modes + +- Objective/deliverables: Integrated/separate/adaptive arrangements; compact integrated references; preserve eight standalone Context categories and persistent standalone Intent. +- Batches: 4A standalone baselines; 4B integrated Context/Intent; 4C modes/preferences; 4D concurrent windows +- Reuse: WritingController, writing-follow/workspace/launcher, lazy maps/plots/metrics, native presence and accepted-position validation +- New/change: implement the batch deliverables inside the existing MVC application; no parallel Writer. +- Database: Prefer existing browser preferences; review account persistence only if needed. +- Dependencies/risks: Phase 3 acceptance; preserve canonical records and scoped return state; avoid hidden context changes. +- Acceptance: Single-screen versus physical multiple monitors; denied permissions; named-window reuse; pinned/exploration do not silently move Word; stale mapping conflicts. +- Preservation: all mapped F/I capabilities below; reader/source/privacy/native safeguards remain authoritative. +- Help: review existing Markdown keys for affected capabilities; update tooltip, popup and full article together; register coverage. +- Status / Development deployment: Not started; not deployed at tracker creation. + +### Phase 5 — Explore and creative guidance + +- Objective/deliverables: Question-first author journeys; solver reuse; persistent back/skip/resume; saved next actions; separately validated manuscript-aware guidance. +- Batches: 5A plain-language paths; 5B history/resume; 5C save canonical outcomes; 5D separate evidence-backed manuscript analysis +- Reuse: WritingSolverEngine/editorial graph, workspace chooser, canonical notes/goals/plot records +- New/change: implement the batch deliverables inside the existing MVC application; no parallel Writer. +- Database: Persistent journey/decision record may be needed; design bounded retention and permission before migration. +- Dependencies/risks: Phase 4 acceptance; preserve canonical records and scoped return state; avoid hidden context changes. +- Acceptance: Graph branches/back/skip/resume; author-fact/inference separation; canonical writes only after author action; missing source/entitlement states. +- Preservation: all mapped F/I capabilities below; reader/source/privacy/native safeguards remain authoritative. +- Help: review existing Markdown keys for affected capabilities; update tooltip, popup and full article together; register coverage. +- Status / Development deployment: Not started; not deployed at tracker creation. + +### Phase 6 — Writing Plans and Dashboard + +- Objective/deliverables: Goal-first visual calendar, transparent assumptions, editable draft allocation; coherent legacy/reviewed presentation without destructive conversion. +- Batches: 6A draft planning model; 6B calendar edit/confirm; 6C legacy/reviewed adapters; 6D dashboard +- Reuse: WritingPlans/ScheduleItems/WriterPlannedActivities, allocation and schedule services, Journey/calendar primitives +- New/change: implement the batch deliverables inside the existing MVC application; no parallel Writer. +- Database: No conversion assumed; milestones/exceptions only if existing data insufficient. +- Dependencies/risks: Phase 5 acceptance; preserve canonical records and scoped return state; avoid hidden context changes. +- Acceptance: Chapters without estimates; insufficient capacity; overlapping activities; completed-work preservation; All Books; no fictitious forecast precision. +- Preservation: all mapped F/I capabilities below; reader/source/privacy/native safeguards remain authoritative. +- Help: review existing Markdown keys for affected capabilities; update tooltip, popup and full article together; register coverage. +- Status / Development deployment: Not started; not deployed at tracker creation. + +### Phase 7 — Writing Process and reflective insights + +- Objective/deliverables: Optional self-description, evidence-threshold observations, expectation comparison, disagreement/dismiss/revisit, reversible preferences. +- Batches: 7A evidence specification; 7B preferences/self-description; 7C visual comparisons; 7D thresholds/privacy tests +- Reuse: WritingActivity/WriterWork retained evidence, privacy/retention, existing preferences +- New/change: implement the batch deliverables inside the existing MVC application; no parallel Writer. +- Database: Likely explicit self-description/insight decision records; minimise observations and respect existing erasure. +- Dependencies/risks: Phase 6 acceptance; preserve canonical records and scoped return state; avoid hidden context changes. +- Acceptance: Sparse/paused/retention-limited history; sample size; no quality inference; no automatic schedule/style changes; revoke/disagree. +- Preservation: all mapped F/I capabilities below; reader/source/privacy/native safeguards remain authoritative. +- Help: review existing Markdown keys for affected capabilities; update tooltip, popup and full article together; register coverage. +- Status / Development deployment: Not started; not deployed at tracker creation. + +### Phase 8 — Help, tutorials and final qualification + +- Objective/deliverables: Full Help coverage, companion full articles, accessible optional tutorial entry points, video scripts/transcripts; complete feature qualification. +- Batches: 8A final Help audit; 8B tutorial scripts/transcripts; 8C full browser/PWA/accessibility/native acceptance; 8D final report +- Reuse: HelpService, HelpIconTagHelper, Markdown, current Help controller/client; existing browser/native harness +- New/change: implement the batch deliverables inside the existing MVC application; no parallel Writer. +- Database: None expected. +- Dependencies/risks: Phase 7 acceptance; preserve canonical records and scoped return state; avoid hidden context changes. +- Acceptance: Tooltip/popup/full Help in integrated/standalone; every F/I destination; physical Windows/multimonitor; caption/transcript access; complete regressions. +- Preservation: all mapped F/I capabilities below; reader/source/privacy/native safeguards remain authoritative. +- Help: review existing Markdown keys for affected capabilities; update tooltip, popup and full article together; register coverage. +- Status / Development deployment: Not started; not deployed at tracker creation. + +## Writer 2.0 reconciliation + +Read baseline: `Docs/Investigations/Writer2Audit/Writer2_Spec.md`, sprint `Docs/Sprints/Writer2/{Implementation,UsabilityCorrection,IntelligentWorkspace,SprintResults}.md` and Writer audit. Verified current routes/services before editing. + +| Writer 2.0 requirement | Current implementation | Writer 3.0 disposition | +|---|---|---| +| Existing ribbon/Overview/Journey/Plans/Workspaces/Reports/deep links | Implemented; redirects retained | Preserve Phase 1; reuse within five destinations Phase 2; old links continue | +| Gross accepted additions/deletions/net, baseline/dedup/coverage/privacy | Implemented259/260 and paragraph acceptance | Preserve unchanged; Reflect reuses in Phases6/7 | +| Explicit sessions/return notes and monthly/yearly Journey | Implemented262; engagement separate from elapsed; not full timed sprint | Preserve; integrate Phases3/6; no claim timer/pause/extend already exists | +| Weekly rhythm painting, irregular availability, holidays/exceptions | Only day/minute availability currently | Deferred to Phase6; preserve existing plans; no silent removal | +| Timed focus sprints/presets/break/pause/extend | Not delivered by current session toolbar | Product scope question for Phase3/6: retain as outstanding Writer2 requirement, do not replace explicit sessions with inferred activity | +| Zoomable timeline, overlapping passes/milestones/chapter-pass matrix | Month/year Journey and separate task systems, not full pass model | Phase6/7; pass/milestone semantics require explicit design before schema | +| Display detection, arbitrary screens, profiles | Existing placement/detection/fallback and named windows; no complete profile editor | Preserve standalone facilities; Phase4 extends integrated/separate/adaptive; physical verification required | +| Insights with evidence thresholds/dismissal | Not implemented | Phase7; no quality judgements/automatic preferences | +| Collaboration/editorial assignments | General access exists; Writer assignment model not delivered | Deferred beyond currently concrete Phase1 scope; preserve permissions; product decision before promising assignments | +| Detailed provenance reports and signed PDF/verification | Retained JSON evidence/export exists; signing/report model absent | Explicitly deferred; separate security/product gate; not silently retired or folded into ordinary progress | +| Help Me generic suggestions / explicit Intent AI / Reader / Audio Review | Delivered current functionality | Preserve; Phase5 manuscript-aware guidance separate from generic solver; Phase3/4 keep saved-evidence boundaries | + +Master3 supersedes navigation layout and staged delivery, not completed functionality. Its “migration rollback” wording means application rollback compatibility for forward-only SQL; old numbered scripts will not be edited or destructive reverse migrations introduced. + +## Feature preservation map — all 62 audit units + +Classification describes destination intent; Phase1 only repairs foundations. “Reused” does not mean already moved. Utilities includes existing standalone windows/connection/display/settings. No retirement authorised. + +| Audit ID | Existing unit | Destination | Classification | Delivery / preservation | +|---|---|---|---|---| +| F01 | Desk identity and Companion status | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F02 | Help Me | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F03 | Start Here / objective setup | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F04 | Continue Writing | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F05 | Next Planned Session | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F06 | Your Manuscript / Writing Progress | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F07 | Recent Activity | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F08 | Month calendar | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F09 | Year overview | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F10 | Selected day and session history | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F11 | Planned work ahead | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F12 | Writing Rhythm session toolbar | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F13 | Audio Review controls | Review | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F14 | Workspace navigation | Write | Enhanced or consolidated | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F15 | Scene queue cards | Write | Enhanced or consolidated | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F16 | Story Health reminders | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F17 | Today's planned writing | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F18 | Word Companion & Display Setup | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F19 | Plan management table | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F20 | Delete Writing Plan modal | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F21 | Plan scope and goal form | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F22 | Writing Availability | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F23 | Candidate review and budgets | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F24 | No candidates / replacement warning | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F25 | Writing Plan Selection | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F26 | Reviewed writing activities | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F27 | Legacy schedule summary/table | Plan / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F28 | Availability/deadline editor | Plan / Dashboard | Enhanced or consolidated | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F29 | Chapter workflow counters | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F30 | Chapter Goals | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F31 | Workflow Summary | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F32 | Retained evidence table | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F33 | Baseline prompt | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F34 | Privacy and retention | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F35 | Delete retained activity | Reflect / Dashboard | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F36 | Scene navigation and follow status | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F37 | Overview tab | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F38 | People tab | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F39 | Relationships tab | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F40 | Maps tab | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F41 | Floor Plans tab | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F42 | Story tab | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F43 | Plot Lines tab | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F44 | Metrics tab | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F45 | Intent navigation and identity | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F46 | Plan tab | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F47 | Must Include tab | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F48 | Notes tab | Write / Utilities standalone | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F49 | Threads tab | Review | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F50 | Evidence tab and result cards | Review | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F51 | Checklist tab | Review | Enhanced or consolidated | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F52 | Reader chapter navigation | Review | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F53 | Reader update controls | Review | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F54 | Reading & Audio Review disclosure | Review | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F55 | Drafting support card and menu | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F56 | Purpose editor | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F57 | Notes editor | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F58 | Checklist editor | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F59 | Workflow editor | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F60 | Attachments editor | Write | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F61 | Problem Solver questions, browse and results | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | +| F62 | Workspace context chooser | Explore | Reused within redesigned destination | Phase1 preserves route/storage; Phases2–4 integration, or5 Explore,6 Plan,7 Reflect as applicable. | + +## Interaction preservation map — all 96 families + +| Audit ID | Existing location / controls | Destination | Classification | Existing handler preservation | +|---|---|---|---|---| +| I001 | Shell — Overview; Writing Journey; Writing Plan; Workspaces; Reports; Display Setup | Home / destination ribbon | Reused within redesigned destination | Preserve Follow named ribbon route with projectId/bookId; Reports owner-only; Display Setup redirects to fragment | +| I002 | Shell — Book choice | Home / destination ribbon | Reused within redesigned destination | Preserve Navigates Writer Index with selected project/book when active Writer; elsewhere Book Details | +| I003 | Help Me — Help Me | Explore / saved focus | Reused within redesigned destination | Preserve Unhides #writer-help-options and sets aria-expanded=true | +| I004 | Help Me — Dismiss suggestions | Explore / saved focus | Reused within redesigned destination | Preserve Hides panel and restores focus to Help Me | +| I005 | Help Me — Return to Writing | Explore / saved focus | Reused within redesigned destination | Preserve Writer.Index with project/book and #working-focus | +| I006 | Help Me — Return to your current focus | Explore / saved focus | Reused within redesigned destination | Preserve Scenes.Edit(scene), Writer.Chapter(chapter) or Writer.Index(book) | +| I007 | Help Me — Open your next planned activity; Open this planned scene | Explore / saved focus | Reused within redesigned destination | Preserve Reviewed activity target or workflow scene editor | +| I008 | Help Me — Set this chapter's Intent | Explore / saved focus | Reused within redesigned destination | Preserve Writer.Chapter(id) goal form | +| I009 | Help Me — Review this scene; Work on the next outlined scene | Explore / saved focus | Reused within redesigned destination | Preserve Scenes.Edit(id) | +| I010 | Help Me — Review the change evidence | Explore / saved focus | Reused within redesigned destination | Preserve WritingActivity.Index with bookId | +| I011 | Help Me — Read or start Audio Review | Explore / saved focus | Reused within redesigned destination | Preserve ManuscriptReader.Index with chapterId/bookId | +| I012 | Help Me — Review this captured note; Explore or add chapters | Explore / saved focus | Reused within redesigned destination | Preserve Scenes.Edit(note scene) or Books.Details(book) | +| I013 | Objective — Continue an existing manuscript | Write | Reused within redesigned destination | Preserve Opens objective-setup disclosure via writer-objective.js | +| I014 | Objective — Working activity; Begin with; Scene (optional) | Write | Reused within redesigned destination | Preserve Choose Activity, ChapterID, SceneID; chapter change filters scene options | +| I015 | Objective — Save objective · start without a schedule | Write | Reused within redesigned destination | Preserve POST Writer.SaveObjective scheduleNow=false → Writer.Index(bookId) | +| I016 | Objective — Save & plan writing time | Write | Reused within redesigned destination | Preserve Same save with scheduleNow=true → ScheduleSetup(bookId) | +| I017 | Objective — Continue Writing; Change objective | Write | Reused within redesigned destination | Preserve Scene editor/chapter workflow/book chapters, or Writer?setup=true#working-objective | +| I018 | Next plan / progress — Create a writing plan; Manage writing plans; Open Chapters; Browse chapters | Write | Reused within redesigned destination | Preserve ScheduleSetup/WritingPlans/Books.Details#chapters | +| I019 | Progress / queue strip — Write Next; In Progress; Revision; Final Pass | Write | Reused within redesigned destination | Preserve Writer.Workspaces(workspace=WriteNext/InProgress/Revision/FinalPass) | +| I020 | Progress — Reports & activity settings; Writing Journey; activity date cell | Write | Reused within redesigned destination | Preserve Activity(book) or Journey(book,year,month,day) | +| I021 | Workspaces — Chapter and scene workspaces | Write | Reused within redesigned destination | Preserve Toggle native details open state | +| I022 | Workspaces — Story Health | Write | Reused within redesigned destination | Preserve Writer.Workspaces(workspace=StoryHealth) | +| I023 | Queue cards — Scene title; Open scene; Session brief; Timeline; Warnings | Write | Reused within redesigned destination | Preserve Scenes.Edit; Exports.WritingSession(sceneId); Timeline(projectId,bookId,selectedSceneId); Warnings(projectId,bookId,sceneId) | +| I024 | Story Health — Reminder title; Project story health | Write | Reused within redesigned destination | Preserve Writer.Chapter(id), Scenes.Edit(sceneId), or Analytics.Index(projectId,bookId) | +| I025 | Today's tasks — Mark complete; Skip | Review / Reflect | Reused within redesigned destination | Preserve POST Writer.MarkScheduleItemComplete / SkipScheduleItem → Index(projectId,bookId) | +| I026 | Journey — Previous month; Next month; date; year cell; year overview | Review / Reflect | Reused within redesigned destination | Preserve Journey GET with book/year/month/day; native details toggle for year | +| I027 | Journey — Accepted-change evidence; Export recent session evidence (up to 50) | Review / Reflect | Reused within redesigned destination | Preserve WritingActivity.Index(bookId,day); WriterWork.Export(bookId,day) | +| I028 | Work session — Activity; Chapter; Start session / Start Audio Review | Review / Reflect | Reused within redesigned destination | Preserve POST /Writer/Work/Start with kind, chapterId, request UUID, pauseOnEdit | +| I029 | Work session — Return / review note (optional); End session & save note | Review / Reflect | Reused within redesigned destination | Preserve POST /Writer/Work/End with sessionId and note ≤2000 chars | +| I030 | Work session — Writing Rhythm & Journey | Review / Reflect | Reused within redesigned destination | Preserve Writer.Journey(bookId) | +| I031 | Audio — Play; Pause; Back 15 seconds; Forward 15 seconds | Review / Reflect | Reused within redesigned destination | Preserve POST /Writer/Work/Command play/pause/back15/forward15 | +| I032 | Audio — Pause on Edit | Review / Reflect | Reused within redesigned destination | Preserve POST /Writer/Work/Preference | +| I033 | Display — Word Companion & Display Setup; Connection & Display Setup | Utilities / standalone references | Reused within redesigned destination | Preserve Details toggle / #display-setup auto-opens details | +| I034 | Display — Context display; Intent display | Utilities / standalone references | Reused within redesigned destination | Preserve Select left/primary/right or detected physical screen; savePreferences | +| I035 | Display — Detect displays | Utilities / standalone references | Reused within redesigned destination | Preserve getScreenLayout(true), browser window-management permission/enumeration | +| I036 | Display — Open Context; Open Intent | Utilities / standalone references | Reused within redesigned destination | Preserve Open/reuse named reference window with project/book scope | +| I037 | Display — Start / Reapply Workspace; Focus Context; Focus Intent | Utilities / standalone references | Reused within redesigned destination | Preserve Register launcher/open reference windows or focus existing window | +| I038 | Plans — View plans across all projects and books; Create Writing Schedule; Schedule Preview | Plan | Reused within redesigned destination | Preserve Unfiltered WritingPlans; scoped ScheduleSetup; unscoped Preview | +| I039 | Plans — View Schedule; Edit Plan; Review chapter activities | Plan | Reused within redesigned destination | Preserve Preview/Edit/PlanActivities(writingPlanId) | +| I040 | Plans — Activate Plan; Deactivate Plan | Plan | Reused within redesigned destination | Preserve POST Writer.ActivateWritingPlan/DeactivateWritingPlan → unfiltered WritingPlans | +| I041 | Plans — Regenerate workflow scene tasks | Plan | Reused within redesigned destination | Preserve POST Writer.RegenerateWritingPlanSchedule; existing reviewed allocations redirect to PlanActivities | +| I042 | Plans — Delete Plan; Close; Cancel; Delete | Plan | Reused within redesigned destination | Preserve Open/close per-plan modal; Delete POST Writer.DeleteWritingPlan | +| I043 | Setup — Plan Name; Goal Type; Project; Book; Start Date; Deadline Date | Plan | Reused within redesigned destination | Preserve Edit setup model; Book blank means All Books | +| I044 | Setup — Rebalance Mode; Available; Session Length; Include Blocked Scenes | Plan | Reused within redesigned destination | Preserve Edit seven-day capacity and planning options | +| I045 | Setup — Review activities | Plan | Reused within redesigned destination | Preserve POST ScheduleSetup → creates active WritingPlan → /Writer/PlanActivities | +| I046 | Setup — Skip scheduling · return to Writer; Schedule Preview | Plan | Reused within redesigned destination | Preserve Scoped Writer or unscoped Preview | +| I047 | Review activities — Include; Activity; Working budget (minutes) | Plan | Reused within redesigned destination | Preserve Per-candidate Selected, Kind, Minutes | +| I048 | Review activities — I have reviewed these activities and budgets…; Commit reviewed schedule | Plan | Reused within redesigned destination | Preserve POST WriterPlanning.Index → Allocate → repository.Save → Preview | +| I049 | Review activities — Edit availability / deadline; Return to Writing; View existing schedule; Review chapters and scenes | Plan | Reused within redesigned destination | Preserve Edit plan, Writer, Preview or Book chapter catalogue | +| I050 | Preview — Writing plan; Select; row Select | Plan | Reused within redesigned destination | Preserve GET SchedulePreview(writingPlanId) | +| I051 | Preview — Mark complete | Plan | Reused within redesigned destination | Preserve POST /Writer/PlanActivities/Complete(writingPlanId,activityId) | +| I052 | Edit Plan — Plan Name; Deadline Date; Rebalance Mode; day availability/minutes; Include Blocked Scenes; Active | Plan | Reused within redesigned destination | Preserve Edit mutable settings | +| I053 | Edit Plan — Save Plan; Cancel; Review and reallocate them | Plan | Reused within redesigned destination | Preserve POST EditWritingPlan; scoped WritingPlans; PlanActivities | +| I054 | Chapter — Goal summary; Emotional goal; Reader takeaway; Must include; Risks or concerns; Save chapter goals | Write | Reused within redesigned destination | Preserve POST SaveChapterGoal → Chapter(id), AJAX branch returns ok | +| I055 | Chapter — Open timeline; Export brief; Markdown; Warnings; Open scene | Write | Reused within redesigned destination | Preserve Timeline(project/book), Exports.ChapterBrief(id[,format=markdown]), Warnings(book), Scenes.Edit | +| I056 | Reports — Record current baseline / Record current accepted baseline | Reflect | Reused within redesigned destination | Preserve POST Activity.Baseline | +| I057 | Reports — Export recent evidence (JSON); Earlier evidence; All retained activity; chapter link | Reflect | Reused within redesigned destination | Preserve Activity.Export(book), Index(book,before,day), Index(book), Writer.Chapter | +| I058 | Reports — Record activity for this book; Keep activity for; Save privacy settings | Reflect | Reused within redesigned destination | Preserve POST Activity.Settings(enabled,retentionDays) | +| I059 | Reports — Delete retained activity; confirmation; Delete activity | Reflect | Reused within redesigned destination | Preserve Expand, then POST Activity.Erase(confirm=true) | +| I060 | Reports — Export recent work and Audio Review sessions (up to 50); Back to Writer | Reflect | Reused within redesigned destination | Preserve WriterWork.Export(book); Writer.Index(project/book) | +| I061 | Context — Overview; People; Relationships; Maps; Floor Plans; Story; Plot Lines; Metrics | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Activate data-writing-context-tab; lazy fetch map/plot/metrics on demand | +| I062 | Context navigation — ← Previous; Next →; Jump to scene; Open Scene | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Load saved scene fragment; explicit trusted action may request Word navigation; editor in new tab | +| I063 | Context Maps — Map; Lens; Refresh saved data; Fit map; Show scene location; +; −; Inspect place | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Fetch selected saved map; adjust lens/viewport/focus/inspection | +| I064 | Context Maps — Map pointer drag; wheel; arrow keys; Enter / Space on feature | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Pan/zoom canvas or select saved place | +| I065 | Context Floor Plans — Zoom; scroll/pan | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Range70–200 scales floor-plan preview; native scrolling | +| I066 | Context Plot Lines — Active here; Nearby; Elsewhere; Show all; Explore scenes; ‹; ›; Show current scene; Go to scene in Word; Refresh saved data | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Filter saved plot cards, explore different scene, explicit navigate/fetch | +| I067 | Context Metrics — Metric; Show current scene; manuscript scene buttons; Explore scenes; Go to scene; Refresh saved data | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Select stored metric graph, inspect indexed scene, explicit navigate/fetch | +| I068 | Context reference links — Source scene; Calendar; Story Maps · choose a saved map; Linked floor plan; Plot Lines; Characters and relationships; thread title | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Scenes.Edit, StoryCalendar, Maps story, FloorPlans.Edit, PlotLineWorkspace, RelationshipMap, PlotThreads.Edit | +| I069 | Intent — Plan; Must Include; Notes; Threads; Evidence; Checklist | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Activate Intent tab via writing-follow.js | +| I070 | Intent navigation — Jump to chapter; Jump to scene; Edit Scene; Edit Chapter Plan | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Load intent fragment or navigate to Scenes.Edit/Writer.Chapter | +| I071 | Intent evidence — Show saved evidence | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve GET IntentAssessment.Read(sceneId), partial result | +| I072 | Intent evidence — Assess saved prose with AI; Cancel | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve POST Analyse; AbortController cancellation | +| I073 | Intent evidence cards — Expand objective; Keep evidence; Dismiss; Defer; Revisit | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Disclosure or POST decision(sceneId,hash,key,acknowledged/dismissed/deferred/pending) | +| I074 | Intent checklist — Review objectives and completion in the scene editor; Edit intentions and objective completion | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Scenes.Edit(scene) | +| I075 | Reference tabs keyboard — ArrowLeft; ArrowRight; Home; End | Write / Explore / Utilities standalone | Reused within redesigned destination | Preserve Focus/activate adjacent/first/last tab through writing-follow.js | +| I076 | Reader — ← Previous chapter; Next chapter →; Chapter; Read; Refresh manuscript | Review | Reused within redesigned destination | Preserve Reader.Index with book/chapter/focus or enhanced chapter fetch | +| I077 | Reader — Focus reading; Escape | Review | Reused within redesigned destination | Preserve Toggle reader focus class/query state; Escape exits focus | +| I078 | Reader — Pause automatic updates while listening; Show updated chapter | Review | Reused within redesigned destination | Preserve Pause accepted-text replacement, then explicitly fetch queued new chapter | +| I079 | Reader — Reading & Audio Review; Return to Writing; Return to Chapters | Review | Reused within redesigned destination | Preserve Toggle embedded session toolbar; Writer.Index(book); Books.Details(book) | +| I080 | Scene card — Edit Writer; Show writer editor actions; Notes; Checklist; Workflow; Attachments | Write | Reused within redesigned destination | Preserve Load corresponding Scenes.Scene…Editor partial into inspector drawer | +| I081 | Scene Purpose — Purpose types; purpose notes; expected outcome; Save purpose; Cancel | Write | Reused within redesigned destination | Preserve POST Scenes.SaveScenePurpose or close drawer | +| I082 | Scene Notes — Type; Title; Text; Pinned; Resolved; Remove; new note; Save notes; Cancel | Write | Reused within redesigned destination | Preserve POST SaveSceneNotes, iterate validated scene-owned records | +| I083 | Scene Checklist — Item text; completed; Remove; new item; Save checklist; Cancel | Write | Reused within redesigned destination | Preserve POST SaveSceneChecklist, validated existing items and optional new | +| I084 | Scene Workflow — Priority; Estimated words; Actual words; Drafted date; Last worked on; Blocked; Blocked reason; Save workflow; Cancel | Write | Reused within redesigned destination | Preserve POST SaveSceneWorkflow → writer service | +| I085 | Scene Attachments — Type; Title; file; External link; Notes; Add attachment; Save attachment | Write | Reused within redesigned destination | Preserve POST Scenes.SaveAttachment multipart | +| I086 | Scene Attachments — Open; Download; Open link; Remove attachment; Close | Write | Reused within redesigned destination | Preserve Stored href/download/new tab; POST DeleteAttachment; close drawer | +| I087 | Scene header — Prepare Writing Session | Write | Reused within redesigned destination | Preserve Exports.WritingSession(sceneId) | +| I088 | Word ribbon — Book; Chapter; Scene | Utilities / native Word | Reused within redesigned destination | Preserve Read-only display editBoxes restored via RestoreTitle | +| I089 | Word ribbon — Writing Context; Writing Intent; PlotDirector | Utilities / native Word | Reused within redesigned destination | Preserve WordAdapter.OpenWritingWorkspace tray-context/tray-intent/tray-workspace | +| I090 | Word ribbon — Open Companion; Audio Review | Utilities / native Word | Reused within redesigned destination | Preserve Both NativeRibbon.OpenCompanion | +| I091 | Word ribbon — Play; Pause; Back 15 seconds; Forward 15 seconds | Utilities / native Word | Reused within redesigned destination | Preserve WordAdapter.RequestAudio same four command names | +| I092 | Word ribbon — Synchronise; Repair Synchronisation | Utilities / native Word | Reused within redesigned destination | Preserve RequestChapterSynchronisation(false/true) | +| I093 | Word ribbon Tools — Remove Legacy Markers; Troubleshooting | Utilities / native Word | Reused within redesigned destination | Preserve WordAdapter.RemoveLegacyMarkers / ShowTroubleshooting | +| I094 | Office.js shell — Open PlotDirector Companion | Utilities / native Word | Reused within redesigned destination | Preserve Manifest task pane loads /word-companion | +| I095 | Problem Solver — Question choices; continue/back/start; browse area; result capability link | Explore | Reused within redesigned destination | Preserve Protected answer history POST /problem-solver/answer → graph evaluation/editorial result | +| I096 | Problem Solver workspace — Project / character; Open capability → | Explore | Reused within redesigned destination | Preserve GET /problem-solver/workspace/{capability}; validate IDs then LocalRedirect | + +## Phase 1 qualification ledger + +| Batch | Implementation | Automated / fixture qualification | Development | +|---|---|---|---| +|1A queues / book scope|Implemented264; optional BookID reaches SQL before TOP40; legacy queues retained|Transactional Development fixture passes4 statuses,45 other-book scenes,40 per-book cap,legacy Blocked; rolled back|Copy-only checksum backup succeeded;264 applied; no data conversion| +|1B canonical status / independent context|Canonical Intent status; immutable independent selection projection on desk/reference/Reader; existing native checks retained|Context separation/cross-scope/invalid mapping tests and full harness pass; physical host manual|Application deployment pending| +|1C scheduling / validation / navigation|Scoped Preview selection/returns; reviewed data retained on rebalance GET; validation loads after jQuery; queue/waiting copy corrected|Service/controller tests pass; isolated browser/PWA suites passing; live post-deploy pending|Application deployment pending| +|1D Help / qualification / release|62-feature Help ownership map; existing articles corrected; new context/plan articles and existing tag-helper icons|Build0warnings; full harness exit0; Reader/Intent/standalone browser suites pass|Release/post-deploy pending| + +Physical Windows Word, actual media playback, installed Windows PWA and multiple-monitor placement are manual acceptance gates; a Chromium simulated PWA is labelled as such. Stop after Phase1 report. Recommended Phase2 first batch: Home/destination route state and static viewport layouts, retaining old URLs and utilities before resizable composition. + +## Bounded follow-up after Phase 1 + +Legacy rebalance operations remain callable but no replacement rebalance review UI is added here; unify their presentation and explain Automatic mode in Phase6 after its scheduling design. Existing project change in setup is still server-validated rather than introducing a new dependent-selector API; visual goal-first planning replaces this in Phase6. Phase1 typed context is a projection/adaptation layer, not persisted cross-window global focus; explicit interactive indicators/returns and independent exploration commands are Phases2–4. Timed sprints, overlapping passes, collaboration assignments and signed provenance remain outstanding Writer2 requirements recorded above; none is falsely labelled delivered. No author-data semantics or native protocol changed. diff --git a/Docs/Writer/Writer3/Master-Specification.md b/Docs/Writer/Writer3/Master-Specification.md new file mode 100644 index 00000000..93f514ff --- /dev/null +++ b/Docs/Writer/Writer3/Master-Specification.md @@ -0,0 +1,365 @@ +# PlotDirector Writer 3.0 +## Master Implementation Plan and Phased Delivery Specification + +**Status:** Proposed implementation baseline +**Target:** PlotDirector Development +**Scope:** Writer experience, existing integrations, contextual Help and new guided capabilities + +### 1. Product objective + +Transform Writer from a collection of sophisticated but fragmented tools into a connected authoring environment that helps people write, develop, plan, review and understand their stories. + +The primary audience includes people who have a story to tell but little or no formal understanding of novel-writing methods. + +Experienced authors must retain direct access to detailed controls and specialist workspaces. + +**Central principle:** The author should receive useful assistance before being expected to invest substantial time entering supporting information. + +### 2. Non-negotiable design requirements + +1. Preserve existing functionality and authoritative story records. +2. Retain the PlotDirector theme, ribbon, PWA behaviour and familiar application conventions. +3. Provide three clear Writer Home choices: Continue Writing, Explore Your Story and Writing Dashboard. +4. Organise detailed functionality into five destinations: Write, Explore, Plan, Review and Reflect. +5. Avoid long, vertically stacked feature pages. Use viewport-aware workspaces, tabs, drawers and independently scrolling content regions. +6. Use a resizable main workspace and contextual companion where appropriate. +7. Preserve dedicated standalone Context and Intent windows for multi-monitor working. +8. Create distinct integrated Context and Intent presentations for single-screen working. +9. Preserve Word Companion integration, synchronisation, native follow, Reader and Audio Review. +10. Allow inline authoring of information where its absence becomes relevant. +11. Make planning and story exploration useful without compulsory metadata preparation. +12. Reuse existing Plot Lines, Relationships, Maps, Floor Plans, Threads and Emotion Metrics information rather than duplicating their storage or business logic. +13. Preserve the existing Markdown Help/tag-helper architecture, including tooltip, popup and full-document content. +14. Keep all suggested creative interpretations distinguishable from recorded author facts. +15. Never silently change manuscript text, author intentions, scene status or writing preferences based on AI recommendations. +16. Support new books, partially planned books and existing manuscripts with substantial content. + +### 3. Navigation architecture + +**Writer Home** + +Present three clear actions, with current book and optional recent focus: + +- Continue Writing → Write +- Explore Your Story → Explore +- Writing Dashboard → overview of Plan and Reflect + +The ribbon provides direct access to Write, Explore, Plan, Review and Reflect without forcing authors through Home repeatedly. + +Contextual ribbon tabs change with the selected destination. A separate Utilities area retains Workspaces, Display Setup, Word Companion connection information and relevant settings. + +The active book must be explicit and authorised. Chapter/scene focus must be distinguishable from temporary exploration and pinned references. + +### 4. Functional destination requirements + +#### Write + +Provide a primary working surface for the current chapter or scene. + +Include current objective, chapter goals, scene purpose/outcome, notes, checklist, workflow, revision status and attachments. + +Provide relevant contextual information in a companion pane, including plot developments, emotional progression and character relationships. + +Allow optional inline editing without leaving the working task. + +Support launching or following Word, saving/synchronising, recording work sessions and returning to the same task. + +Do not require a completed chapter plan or scene checklist before the author can begin. + +#### Explore + +Start with the author's question or concern, not a request to choose a specialist tool. + +Support guided journeys for beginning a story, developing characters, discovering plot direction, resolving uncertainty and improving a developing manuscript. + +Reuse the existing Writing Problem Solver and its editorial question graph where appropriate. + +Allow authors to inspect story references and visualisations during exploration. + +Offer concrete outcomes: save an idea, create or update a chapter/scene intention, add a note, propose a plot development or identify a next writing task. + +Manuscript-aware analysis must be implemented and validated separately from the existing generic Problem Solver. Do not represent current fixed-rule Help Me suggestions as semantic story diagnosis. + +#### Plan + +Begin with the author's intended outcome and a small amount of availability information. + +Produce a useful draft plan from existing chapters, scenes and available scheduling information, with clearly identified assumptions. + +Provide a visual schedule/calendar and allow adjustments before confirmation. + +Support optional scene estimates, priorities, blockers, milestones and more detailed allocations. + +Unify the presentation of existing legacy schedule tasks and reviewed planned activities. Preserve existing data during transition and avoid contradictory completion semantics. + +#### Review + +Bring together the read-only Manuscript Reader, Focused Reading, Audio Review, chapter/scene intentions, evidence assessment and revision decisions. + +Focused Reading must remain distraction-free. + +Provide clear separation between recorded intention, saved manuscript evidence, AI interpretation and author-confirmed completion. + +Allow the author to move from a review finding to a specific revision task and back to the manuscript. + +Preserve Reader automatic-refresh behaviour, focused-mode navigation, source freshness and Word synchronisation boundaries. + +#### Reflect + +Present writing progress, Writing Journey, sessions, accepted manuscript changes, reports and retained activity. + +Introduce Your Writing Process: + +- The author's self-described working preferences. +- Observed activity patterns, subject to evidence thresholds. +- Comparison between expectations and recorded behaviour. +- Optional suggestions for adapting Writer's presentation or planning approach. + +Do not infer writing quality from word counts, editing frequency or session duration. + +Clearly explain insufficient evidence, disabled tracking and data-retention effects. + +Preserve existing activity privacy, export and erasure controls. + +### 5. Single-screen and multi-screen architecture + +Provide three user-selectable arrangements: + +**Integrated:** Context and Intent are presented as task-specific companion views within Writer. + +**Separate windows:** Standalone Context and Intent remain available as persistent reference windows, with their own layouts and controls. + +**Adaptive:** Uses saved preferences and available display capabilities, with explicit user override. + +Preserve display detection, permission handling, placement preferences, named-window reuse, native Word follow and fallback behaviour. + +Distinguish: + +- Working focus: the author's active writing target. +- Exploration focus: an independently selected reference. +- Pinned reference: information intentionally held on screen. + +An exploratory selection must not automatically move Word. + +Integrated and standalone presentations must use the same underlying canonical data and service contracts. + +Standalone Context retains its eight existing reference categories. Standalone Intent should prioritise persistent chapter/scene guidance, objectives, checklist and evidence rather than becoming a full data-entry screen. + +### 6. Contextual Help and tutorials + +Retain the existing Help tag helper and Markdown-backed tooltip, popup and full-document structure. + +For each changed feature, verify that all applicable Help levels remain accurate. + +Make full Help available inside the companion surface when appropriate. + +Plan a small series of core author-journey videos, with optional feature-specific demonstrations. + +Videos must not be required for task completion. + +Provide accessible captions and written transcripts. + +### 7. Shared engineering requirements + +- Maintain a consistent and authorised book/chapter/scene context contract. +- Preserve existing source-of-truth tables and repositories. +- Reuse canonical story services and existing visualisation components. +- Preserve user state when switching destinations, opening Help or returning from specialist editors. +- Use existing PlotDirector architectural conventions and security controls. +- Keep the Word Companion's native/agent integration stable. +- Avoid adding a new database schema where existing records are sufficient. +- Treat missing metadata, stale manuscript evidence and unavailable integrations explicitly. +- Do not invent historical writing activity. +- Ensure browser, PWA, keyboard and responsive behaviour remain usable. +- Ensure privacy, retention and permissions apply to any new observations. + +### 8. Delivery phases + +#### Phase 1 — Foundation and corrections + +**Objective:** Establish reliable integration contracts before changing the interface. + +Tasks: + +1. Reconcile this specification with the existing Writer 2.0 requirements and completed work. +2. Confirm the current repository baseline and preserve existing development work. +3. Fix the scene-queue stored procedure/application naming mismatch and pre-filter result cap. +4. Reconcile canonical revision status with legacy workflow status presentation. +5. Define shared working, exploration and pinned-reference context contracts. +6. Document session, Word-follow and Reader selection behaviour. +7. Clarify legacy versus reviewed scheduling data and completion semantics. +8. Fix confirmed validation and navigation defects affecting planned journeys. +9. Establish regression fixtures covering existing Writer functionality. +10. Review the Help tag-helper integration and create a feature-to-Help coverage register. + +**Acceptance:** Existing Writer, Word Companion, Context, Intent, Reader, plans and reports remain functional. Known defects are corrected or explicitly recorded with bounded follow-up. + +#### Phase 2 — Writer Home and workspace shell + +**Objective:** Deliver the new navigation experience without removing old capabilities. + +Tasks: + +1. Implement calm, single-viewport Writer Home. +2. Add three primary choices. +3. Implement five destination navigation states. +4. Build the resizable main/companion workspace layout. +5. Implement contextual ribbon navigation. +6. Preserve selected book and working focus. +7. Add appropriate empty states and contextual Help. +8. Preserve full specialist-workspace navigation and return context. +9. Verify PWA, desktop and responsive layouts. + +**Acceptance:** A new author can immediately identify where to begin. An experienced author can reach existing tools without extra steps. No main destination requires scrolling merely to discover its features. + +#### Phase 3 — Write and Review integration + +**Objective:** Make everyday writing and reviewing coherent. + +Tasks: + +1. Consolidate current focus, chapter and scene workflows. +2. Provide inline editing for chapter goals and scene support information. +3. Integrate relevant notes, checklists, statuses and attachments. +4. Provide compact contextual story references. +5. Connect working objectives, sessions and Word status. +6. Integrate Reader and Audio Review as Review destinations. +7. Preserve focused reading and automatic accepted-text refresh. +8. Create clear revision-decision and return-to-writing actions. +9. Ensure edits update existing authoritative records. + +**Acceptance:** An author can select a chapter, prepare, write in Word, review accepted text, record a revision and resume without repeatedly searching other sections. + +#### Phase 4 — Context, Intent and display modes + +**Objective:** Support single-screen and multi-monitor working as first-class experiences. + +Tasks: + +1. Preserve and regression-test existing standalone windows. +2. Build compact integrated Context. +3. Build interactive integrated Intent. +4. Improve standalone Intent's persistent reference presentation. +5. Implement integrated/separate/adaptive preferences. +6. Preserve display detection, placement and permission fallbacks. +7. Implement reliable working/exploration/pinned-reference indicators. +8. Preserve verified Word-follow and explicit navigation controls. +9. Verify simultaneous multi-window state and synchronisation. + +**Acceptance:** Single-screen authors can use Context and Intent naturally inside Writer. Multi-monitor authors retain dedicated, persistent companion windows. Exploring references does not unexpectedly retarget Word. + +#### Phase 5 — Explore and creative guidance + +**Objective:** Help authors who know their story but not the tools. + +Tasks: + +1. Build guided entry points using everyday author language. +2. Integrate the existing Writing Problem Solver. +3. Provide persistent question history, back/skip and resumption. +4. Surface relevant story references and contextual visualisations. +5. Support saving decisions to appropriate canonical records. +6. Provide inline access to missing information. +7. Develop manuscript-aware guidance only where source availability, permission and evidence can be verified. +8. Clearly separate guidance, inference and author decisions. +9. Provide beginner and experienced-author routes. + +**Acceptance:** An author can arrive with an idea or story concern, receive meaningful guidance and leave with a saved next step without knowing PlotDirector's technical terminology. + +#### Phase 6 — Writing Plans and Dashboard + +**Objective:** Produce useful visual plans from minimal input. + +Tasks: + +1. Design the goal-first planning entry. +2. Derive available scope and activity candidates from existing records. +3. Propose reasonable, transparent assumptions. +4. Build a visual calendar/schedule with editable allocations. +5. Provide optional detailed planning controls. +6. Integrate reviewed activities and legacy schedule data. +7. Connect plan progress to the Writing Dashboard. +8. Preserve existing activity and session tracking. +9. Explain missing estimates and unavailable forecasts without fabricating precision. + +**Acceptance:** An author with chapters but no detailed scene estimates can produce, adjust and confirm a meaningful draft plan. + +#### Phase 7 — Writing Process and reflective insights + +**Objective:** Help authors discover how they work. + +Tasks: + +1. Provide optional self-description using plain-language writing approaches. +2. Define observable activity signals and their limitations. +3. Reuse retained activity evidence where reliable. +4. Implement evidence thresholds and confidence explanations. +5. Present visual comparisons between perceived and observed process. +6. Support disagreement, dismissal and revisiting insights. +7. Suggest reversible Writer preferences where appropriate. +8. Keep insights separate from judgements about writing quality. +9. Test disabled tracking, limited history and retention boundaries. + +**Acceptance:** Insights appear only when supported by sufficient evidence, remain understandable and never automatically impose a writing style. + +#### Phase 8 — Help, tutorials and final qualification + +**Objective:** Complete the integrated experience and documentation. + +Tasks: + +1. Verify Help coverage for all Writer features and new workflows. +2. Repair missing or outdated Markdown articles and tag-helper links. +3. Validate tooltip, popup and full-document presentation. +4. Add tutorial entry points for selected complex journeys. +5. Prepare core video scripts and a consistent example-story outline. +6. Verify Help works within integrated and standalone presentations. +7. Complete accessibility, PWA, responsive and multi-monitor testing. +8. Run complete Writer and Word Companion regressions. +9. Resolve navigation inconsistencies and duplicated entry points. +10. Produce a final feature coverage and acceptance report. + +**Acceptance:** All audited Writer features have a documented destination, appropriate Help coverage and a verified route to use them. Any remaining limitations are explicitly recorded. + +### 9. Phase execution and quality gates + +Each phase must: + +- Begin from a clean, synchronised shared Git baseline. +- Use the established shared-branch workflow; do not create competing branches for Atlas and Windows work. +- Preserve unrelated changes and avoid force pushes. +- Include implementation, automated tests and relevant browser/PWA tests. +- Include native Word qualification where the change touches Word integration. +- Update affected Help Markdown in the same phase. +- Test both populated and empty/new-book states. +- Test single-screen and standalone-window regression where relevant. +- Validate data permissions and migrations, including rollback when applicable. +- Deploy to Development only after qualification. +- Report commits, tests, deployment results, known limitations and manual acceptance steps. +- Await explicit acceptance before proceeding to the next major phase. + +Do not deploy to Production without explicit approval. + +### 10. Feature preservation and traceability + +Use the existing Writer audit inventory, interaction register, feature activation register, context matrix and Help rules as the starting traceability baseline. + +Every audited feature and interaction family must be classified as: + +- Preserved unchanged. +- Reused within a redesigned destination. +- Enhanced or consolidated. +- Intentionally retired, requiring explicit approval. +- Deferred with a documented reason. + +No feature may disappear merely because its original page or panel has been redesigned. + +### 11. Delivery order and approval + +Proceed sequentially, but allow low-risk preparatory work for later phases when it does not interfere with the current acceptance gate. + +Before substantial implementation, produce screen layouts and interaction states for the affected phase. + +Do not undertake an unbounded application-wide rewrite. + +The successful outcome is not a new-looking Writer. It is a Writer that allows a novice author to begin immediately, supports sophisticated planning when desired, and preserves the powerful specialist and multi-screen facilities already built into PlotDirector. diff --git a/PlotLine.Tests/Browser/writer-foundation-live.cjs b/PlotLine.Tests/Browser/writer-foundation-live.cjs new file mode 100644 index 00000000..169c7a05 --- /dev/null +++ b/PlotLine.Tests/Browser/writer-foundation-live.cjs @@ -0,0 +1,62 @@ +// Explicit Development acceptance; requires the dedicated disposable author and its owned scope. +const {chromium}=require('playwright'); +const fs=require('node:fs'); +const assert=require('node:assert/strict'); +(async()=>{ + const w=JSON.parse(fs.readFileSync(process.env.PD_WRITER_FOUNDATION_IDENTITY)); + assert(w.Database==='PlotDirector_Development'&&/^pwa-browser-.*@example\.invalid$/.test(w.Email)); + for(const key of ['project','book','chapter','scene','other'])assert(Number.isSafeInteger(w[key])&&w[key]>0); + const browser=await chromium.launch(),base='https://dev.plotdirector.com',checks=[]; + try {for(const pwa of [false,true]){ + const context=await browser.newContext({viewport:{width:1440,height:1000}}); + if(pwa)await context.addInitScript(()=>Object.defineProperty(navigator,'standalone',{value:true})); + const page=await context.newPage(),errors=[];page.setDefaultTimeout(20000);page.on('pageerror',e=>errors.push(e.message)); + await page.goto(base+'/Account/Login');await page.locator('[name=Email]').fill(w.Email);await page.locator('[name=Password]').fill(w.Password); + await Promise.all([page.waitForURL('**/Projects'),page.locator('button[type=submit]').click()]); + for(const [queue,status]of [['WriteNext','Outlined'],['InProgress','Drafted'],['Revision','Needs Work'],['FinalPass','Revised']]){ + await page.goto(`${base}/Writer/Workspaces?bookId=${w.book}&workspace=${queue}`); + assert((await page.locator(`[data-writer-queue=${queue}]`).innerText()).includes('Audit '+status)); + } + checks.push('All four selected-book queues render the correct canonical fixture scene'); + await page.goto(`${base}/Writing/Intent?projectId=${w.project}&bookId=${w.book}&sceneId=${w.scene}&pinned=true`); + assert.equal(await page.locator('[data-writing-intent]').getAttribute('data-writer-selection-role'),'pinned'); + await page.locator('[data-writing-intent-tab=checklist]').click(); + const canonical=page.locator('[data-writing-intent-panel=checklist] dt').filter({hasText:'Revision Status'}); + assert.equal((await canonical.locator('xpath=following-sibling::dd[1]').innerText()).trim(),'Outlined'); + checks.push('Pinned Intent displays canonical Outlined without overwriting legacy draft data'); + await page.goto(`${base}/Writer?bookId=${w.other}`);assert.equal(await page.getByRole('heading',{name:'Start Here',exact:true}).isVisible(),true); + await page.goto(`${base}/Writer/ScheduleSetup?bookId=${w.book}`); + await page.waitForFunction(()=>!!window.jQuery?.fn?.validate);assert.equal(await page.locator('[name=BookID]').inputValue(),String(w.book)); + const name='Foundation acceptance '+(pwa?'PWA':'browser');await page.locator('[name=PlanName]').fill(name); + await page.getByRole('button',{name:'Review activities',exact:true}).click();await page.waitForURL('**/Writer/PlanActivities?*'); + const plan=Number(new URL(page.url()).searchParams.get('writingPlanId')); + await page.locator('[name=Confirm][type=checkbox]').check();await page.getByRole('button',{name:'Commit reviewed schedule',exact:true}).click();await page.waitForURL('**/Writer/SchedulePreview?*'); + assert((await page.locator('main').innerText()).includes('Reviewed writing activities')); + await page.goto(`${base}/Writer/WritingPlans?projectId=${w.project}&bookId=${w.book}`); + await page.getByRole('link',{name:'Schedule Preview',exact:true}).click();await page.waitForURL('**/Writer/SchedulePreview?*'); + assert.equal(new URL(page.url()).searchParams.get('bookId'),String(w.book)); + await page.goto(`${base}/Writer/WritingPlans?projectId=${w.project}&bookId=${w.other}`);await page.getByRole('link',{name:'Schedule Preview',exact:true}).click(); + await page.waitForURL('**/Writer/SchedulePreview?*');assert((await page.locator('main').innerText()).includes('No writing plans found.')); + assert.equal(await page.locator('select[name=writingPlanId]').count(),0,'Other-book plans do not leak into an empty book preview'); + await page.goto(`${base}/Writer/WritingPlans?projectId=${w.project}&bookId=${w.book}`); + await page.locator(`tr[data-pd-context-id="${plan}"]`).getByRole('button',{name:'Deactivate Plan',exact:true}).click();await page.waitForLoadState(); + assert.equal(new URL(page.url()).searchParams.get('bookId'),String(w.book)); + await page.locator(`tr[data-pd-context-id="${plan}"]`).getByRole('button',{name:'Activate Plan',exact:true}).click();await page.waitForLoadState(); + assert.equal(new URL(page.url()).searchParams.get('projectId'),String(w.project)); + await page.goto(`${base}/Writer/EditWritingPlan?writingPlanId=${plan}`);await page.waitForFunction(()=>!!window.jQuery?.fn?.validate); + const help=page.locator('[data-help-key="workspace.writingPlans"]').first(); + const heading=await help.getAttribute('data-help-url');assert(heading); + assert((await help.locator('[data-help-micro]').getAttribute('data-help-micro')).includes('measured')); + await help.locator('button').click();await page.locator('.plotline-help-popover').waitFor(); + assert((await page.locator('.plotline-help-popover').innerText()).includes('Reviewed allocations')); + const fullHelp=await page.request.get(base+heading);assert.equal(fullHelp.status(),200);assert((await fullHelp.text()).includes('recorded work')); + checks.push('Real setup/confirmation, empty/scoped Preview, activate/deactivate return filters and validation dependencies pass'); + const otherPlan=await page.request.get(`${base}/Writer/SchedulePreview?writingPlanId=${plan}&bookId=${w.other}`);assert.equal(otherPlan.status(),404); + const invalidNative=await page.request.get(`${base}/Writing/Context?bookId=${w.book}&instanceId=00000000-0000-0000-0000-000000000001`);assert.equal(invalidNative.status(),400); + await page.goto(`${base}/manuscript/reader?bookId=${w.other}`);assert((await page.locator('main').innerText()).includes('No accepted manuscript text')); + assert.deepEqual(errors,[],'No JavaScript errors, including jQuery validation load order'); + checks.push((pwa?'Simulated PWA':'Browser')+': empty Reader, native incomplete-session refusal, out-of-scope plan404 and Help full article pass'); + await context.close(); + }}finally{await browser.close();} + console.log(JSON.stringify({checks,physicalWindows:false,installedPWA:false},null,2)); +})().catch(e=>{console.error(e.message);process.exitCode=1;}); diff --git a/PlotLine.Tests/Program.cs b/PlotLine.Tests/Program.cs index 1e6f9da4..19a207f5 100644 --- a/PlotLine.Tests/Program.cs +++ b/PlotLine.Tests/Program.cs @@ -170,6 +170,7 @@ 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 installation renewal and revocation remain account/security scoped", () => NativeInstallationTests.Run().GetAwaiter().GetResult()), + ("Writer foundation context, queue scope and planning",()=>WriterFoundationTests.Run().GetAwaiter().GetResult()), ("Writer dashboard book scope",()=>WriterDashboardTests.Run().GetAwaiter().GetResult()), ("Writing activity measurement", WritingActivityTests.Run), ("Writer intelligence and measured review", WriterIntelligenceTests.Run), diff --git a/PlotLine.Tests/Sql/WriterFoundation.sql b/PlotLine.Tests/Sql/WriterFoundation.sql new file mode 100644 index 00000000..037309d8 --- /dev/null +++ b/PlotLine.Tests/Sql/WriterFoundation.sql @@ -0,0 +1,49 @@ +-- Development-only transactional fixture; migration264 must already be applied. +-- No real book, author or manuscript is changed. All inserts roll back on success or failure. +SET NOCOUNT ON; +SET XACT_ABORT ON; +IF DB_NAME() <> N'PlotDirector_Development' THROW 51000, 'Development only', 1; +BEGIN TRANSACTION; +BEGIN TRY + DECLARE @p int,@a int,@b int,@ca int,@cb int,@target int,@rev int,@time int,@confidence int; + SELECT @rev=RevisionStatusID FROM dbo.RevisionStatuses WHERE StatusName=N'Outlined'; + SELECT TOP(1) @time=TimeModeID FROM dbo.TimeModes ORDER BY SortOrder; + SELECT TOP(1) @confidence=TimeConfidenceID FROM dbo.TimeConfidences ORDER BY SortOrder; + INSERT dbo.Projects(ProjectName) VALUES(N'Writer foundation transactional regression');SET @p=SCOPE_IDENTITY(); + INSERT dbo.Books(ProjectID,BookTitle,BookNumber,SortOrder) VALUES(@p,N'Other book',1,1);SET @a=SCOPE_IDENTITY(); + INSERT dbo.Books(ProjectID,BookTitle,BookNumber,SortOrder) VALUES(@p,N'Selected book',2,2);SET @b=SCOPE_IDENTITY(); + INSERT dbo.Chapters(BookID,ChapterTitle,ChapterNumber,SortOrder,RevisionStatusID) VALUES(@a,N'Other chapter',1,1,@rev);SET @ca=SCOPE_IDENTITY(); + INSERT dbo.Chapters(BookID,ChapterTitle,ChapterNumber,SortOrder,RevisionStatusID) VALUES(@b,N'Selected chapter',1,1,@rev);SET @cb=SCOPE_IDENTITY(); + DECLARE @i int=1; + WHILE @i<=45 BEGIN + INSERT dbo.Scenes(ChapterID,SceneTitle,SceneNumber,SortOrder,RevisionStatusID,TimeModeID,TimeConfidenceID) + VALUES(@ca,N'Other outlined scene',@i,@i,@rev,@time,@confidence); SET @i+=1; + END; + INSERT dbo.Scenes(ChapterID,SceneTitle,SceneNumber,SortOrder,RevisionStatusID,TimeModeID,TimeConfidenceID) + VALUES(@cb,N'Selected target',1,1,@rev,@time,@confidence);SET @target=SCOPE_IDENTITY(); + -- Capture the procedure's complete result contract, including BookSubtitle retained for consumers. + CREATE TABLE #queue(ProjectID int,ProjectName nvarchar(200),BookID int,BookTitle nvarchar(200),BookSubtitle nvarchar(200),ChapterID int,ChapterNumber decimal(10,2),ChapterTitle nvarchar(200),SceneID int,SceneNumber decimal(10,2),SceneTitle nvarchar(200),Summary nvarchar(max),RevisionStatusID int,RevisionStatusName nvarchar(100),DraftStatus nvarchar(100),Priority int,IsBlocked bit,BlockedReason nvarchar(max),WarningCount int,RemainingChecklistCount int,UnresolvedNoteCount int,ImportantThreads nvarchar(max),PinnedNotes nvarchar(max)); + INSERT #queue EXEC dbo.WriterDashboard_Scenes @ProjectID=@p,@Queue=N'WriteNext',@BookID=@b; + IF (SELECT COUNT(*) FROM #queue)<>1 OR NOT EXISTS(SELECT 1 FROM #queue WHERE SceneID=@target AND BookID=@b) THROW 51000,'Book must filter before cap',1; + TRUNCATE TABLE #queue; + INSERT #queue EXEC dbo.WriterDashboard_Scenes @ProjectID=@p,@Queue=N'WriteNext',@BookID=@a; + IF (SELECT COUNT(*) FROM #queue)<>40 THROW 51000,'Per-book cap must remain bounded',1; + DECLARE @q nvarchar(50),@status nvarchar(50); + DECLARE queues CURSOR LOCAL FAST_FORWARD FOR SELECT * FROM(VALUES(N'ContinueWriting',N'Drafted'),(N'RevisionQueue',N'Needs Work'),(N'PolishingQueue',N'Revised')) x(q,s); + OPEN queues;FETCH NEXT FROM queues INTO @q,@status; + WHILE @@FETCH_STATUS=0 BEGIN + UPDATE dbo.Scenes SET RevisionStatusID=(SELECT RevisionStatusID FROM dbo.RevisionStatuses WHERE StatusName=@status) WHERE SceneID=@target; + TRUNCATE TABLE #queue;INSERT #queue EXEC dbo.WriterDashboard_Scenes @ProjectID=@p,@Queue=@q,@BookID=@b; + IF NOT EXISTS(SELECT 1 FROM #queue WHERE SceneID=@target AND RevisionStatusName=@status) THROW 51000,'Canonical queue status mismatch',1; + FETCH NEXT FROM queues INTO @q,@status; + END;CLOSE queues;DEALLOCATE queues; + INSERT dbo.SceneWorkflow(SceneID,IsBlocked) VALUES(@target,1); + TRUNCATE TABLE #queue;INSERT #queue EXEC dbo.WriterDashboard_Scenes @ProjectID=@p,@Queue=N'Blocked',@BookID=@b; + IF NOT EXISTS(SELECT 1 FROM #queue WHERE SceneID=@target) THROW 51000,'Legacy blocked queue must remain available',1; + ROLLBACK; + SELECT N'PASS scoped cap, four canonical queues and legacy blocked compatibility; fixture rolled back' Result; +END TRY +BEGIN CATCH + IF @@TRANCOUNT>0 ROLLBACK; + THROW; +END CATCH; diff --git a/PlotLine.Tests/WriterFoundationTests.cs b/PlotLine.Tests/WriterFoundationTests.cs new file mode 100644 index 00000000..0423a80a --- /dev/null +++ b/PlotLine.Tests/WriterFoundationTests.cs @@ -0,0 +1,89 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ViewFeatures; +using PlotLine.Controllers; +using PlotLine.Data; +using PlotLine.Models; +using PlotLine.Services; +using PlotLine.Services.Writer; +using PlotLine.ViewModels; + +internal static class WriterFoundationTests +{ + public static async Task Run() + { + void Check(bool ok, string text) { if (!ok) throw new Exception(text); Console.WriteLine("PASS Writer foundation " + text); } + var working = new WriterSelection(1, 2, 10, 20); + var context = new WriterContext(1, 2).Select(WriterFocusRole.Working, working) + .Select(WriterFocusRole.SavedObjective, working) + .Select(WriterFocusRole.Exploration, new(1, 2, 11, 21)) + .Select(WriterFocusRole.PinnedReference, new(1, 2, 12, 22)) + .Select(WriterFocusRole.Reader, new(1, 2, 13)) + .Select(WriterFocusRole.Session, new(1, 2, 14)); + context = context.WithVerifiedWord(new(new(1, 2, 15, 25), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), 4, 3)); + Check(context.Working == working && context.SavedObjective == working && context.Reader!.ChapterID == 13 && context.Session!.ChapterID == 14 && context.VerifiedWord!.Selection.SceneID == 25, + "reference, Reader, session and verified Word selections never overwrite working focus"); + var refused = false; + try { context.Select(WriterFocusRole.Exploration, new(1, 3, 11)); } catch (ArgumentException) { refused = true; } + Check(refused, "cross-book selections require a separate authorised context"); + refused = false; try { _ = new WriterSelection(1, 2, null, 20); } catch (ArgumentException) { refused = true; } + Check(refused, "a scene cannot be projected without its chapter"); + refused = false; try { context.WithVerifiedWord(new(working, Guid.Empty, Guid.NewGuid(), Guid.NewGuid(), 4, 3)); } catch (ArgumentException) { refused = true; } + Check(refused, "incomplete native identity cannot be projected as verified"); + + T Proxy(Func f) where T : class => NativeWorkflowTests.Proxy(f); + var user = Proxy((n,a) => n == "get_UserId" ? (int?)7 : throw new Exception(n)); + var projects = Proxy((n,a) => n == "ListForUserAsync" ? Task.FromResult>([new(){ProjectID=1}]) : throw new Exception(n)); + var books = Proxy((n,a) => throw new Exception(n)); + var chapters = Proxy((n,a) => throw new Exception(n)); + var scopes = new List(); + var repository = Proxy((n,a) => n switch + { + "GetWriterDashboardScenesAsync" => Queue(a), + "GetWriterDashboardRemindersAsync" => Task.FromResult>([]), + _ => throw new Exception(n) + }); + Task> Queue(object?[]? args) + { + scopes.Add((int?)args![2]); + return Task.FromResult>([new(){BookID=3, SceneID=99}]); + } + await new WriterWorkspaceService(projects, books, chapters, repository, user).GetDashboardAsync(1, 3); + Check(scopes.Count == 4 && scopes.All(x => x == 3), "selected book reaches every queue repository before any result limit"); + scopes.Clear(); + await new WriterWorkspaceService(projects, books, chapters, repository, user).GetDashboardAsync(999, 3); + Check(scopes.Count == 0, "inaccessible project never reaches a queue repository"); + + var missingStory = Proxy((n,a) => Task.FromResult(null)); + var references = new WritingController(missingStory, null!, null!, Proxy((n,a)=>throw new Exception(n)), Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance); + var missing = (ViewResult)await references.Context(1,2,null,999,null,pinned:true); + Check(((WritingContextPageViewModel)missing.Model!).WorkingContext == null, "unresolved route scene never becomes a pinned authorised selection"); + + var plans = new WritingPlanSummary[] { new(){WritingPlanID=1,ProjectID=1,BookID=2}, new(){WritingPlanID=2,ProjectID=1,BookID=3}, new(){WritingPlanID=3,ProjectID=1,BookID=null}, new(){WritingPlanID=4,ProjectID=9,BookID=99} }; + var scheduleRepo = Proxy((n,a) => n switch + { + "GetWritingPlanSummariesByUserAsync" => Task.FromResult>(plans), + "GetPlansRequiringRebalanceAsync" => Task.FromResult>([]), + "GetSchedulePreviewItemsAsync" => Task.FromResult>([]), + _ => throw new Exception(n) + }); + var service = new WritingScheduleService(scheduleRepo, projects, books, user); + var preview = await service.GetSchedulePreviewAsync(null, 1, 3); + Check(preview.SelectedWritingPlanID == 2 && preview.Plans.Select(x=>x.WritingPlanID).SequenceEqual([2,3]) && preview.BookID == 3, + "Preview chooses within the selected book and preserves All Books plans"); + Check((await service.GetSchedulePreviewAsync(1, 1, 3)).SelectedPlan == null, "explicit out-of-scope plan cannot silently select another book"); + Check((await service.GetSchedulePreviewAsync(null, 1, 88)).Plans.Single().WritingPlanID == 3, "new book may still use its project-wide plan"); + + var schedule = Proxy((n,a) => n == "RegenerateScheduleAsync" ? Task.FromResult>([]) : Task.CompletedTask); + var controller = new WriterController(Proxy((n,a)=>throw new Exception(n)), schedule) + { TempData = new TempDataDictionary(new DefaultHttpContext(), new MemoryTempData()) }; + foreach (var response in new[] { await controller.ActivateWritingPlan(2,1,3), await controller.DeactivateWritingPlan(2,1,3), await controller.DeleteWritingPlan(2,1,3), await controller.RegenerateWritingPlanSchedule(2,1,3) }) + Check(response is RedirectToActionResult redirect && (int?)redirect.RouteValues!["bookId"] == 3 && (int?)redirect.RouteValues["projectId"] == 1, + "plan management action retains the requesting list scope"); + } + private sealed class MemoryTempData : ITempDataProvider + { + public IDictionary LoadTempData(HttpContext context) => new Dictionary(); + public void SaveTempData(HttpContext context, IDictionary values) { } + } +} diff --git a/PlotLine.Tests/WritingIntegrationTests.cs b/PlotLine.Tests/WritingIntegrationTests.cs index a01b78c6..828f1aad 100644 --- a/PlotLine.Tests/WritingIntegrationTests.cs +++ b/PlotLine.Tests/WritingIntegrationTests.cs @@ -107,6 +107,7 @@ internal static class WritingIntegrationTests {ControllerContext=new(){HttpContext=new DefaultHttpContext{User=new ClaimsPrincipal(new ClaimsIdentity([new Claim(ClaimTypes.NameIdentifier,"7")],"fixture"))}}}; Beat(); var page=(WritingContextPageViewModel)((ViewResult)await controller.Context(1,2,null,null,null,instanceId:instance,sessionId:session)).Model!; + Check(page.WorkingContext?.VerifiedWord?.Selection.SceneID==20 && page.WorkingContext.Working==null,"Verified native projection leaves working focus independent"); Check(page.SceneID==20&&page.Display!.HasScene&&page.Display.FollowStatus=="Following Word","Native launch opens its exact verified scene rather than the book's first scene"); var before=JsonSerializer.Serialize(new{scene.ScenePurposeNotes,scene.SceneOutcomeNotes,goal}); var intent=(WritingIntentPageViewModel)((ViewResult)await controller.Intent(1,2,null,null,null,instanceId:instance,sessionId:session)).Model!; diff --git a/PlotLine/Controllers/WriterController.cs b/PlotLine/Controllers/WriterController.cs index 2b33247a..ad176e4e 100644 --- a/PlotLine/Controllers/WriterController.cs +++ b/PlotLine/Controllers/WriterController.cs @@ -21,15 +21,24 @@ public sealed class WriterController( if(access!=null&&!await access.CanAccessEntityAsync("Book",bookId.Value))return NotFound(); var selected=await bookRepository.GetAsync(bookId.Value);if(selected==null||selected.IsArchived)return NotFound();projectId=selected.ProjectID; } - var model = await writerWorkspace.GetDashboardAsync(projectId); + var model = await writerWorkspace.GetDashboardAsync(projectId, bookId); if(!projectId.HasValue && int.TryParse(model.ProjectOptions.FirstOrDefault()?.Value,out var firstProject)) - { projectId=firstProject;model=await writerWorkspace.GetDashboardAsync(projectId); } + { projectId=firstProject;model=await writerWorkspace.GetDashboardAsync(projectId, bookId); } if(bookRepository!=null && projectId.HasValue) { var available=(await bookRepository.ListByProjectAsync(projectId.Value)).Where(b=>!b.IsArchived).ToArray(); model.Book=bookId.HasValue?available.SingleOrDefault(b=>b.BookID==bookId):available.FirstOrDefault(); if(bookId.HasValue&&model.Book==null)return NotFound(); model.BookID=model.Book?.BookID; + // Resolve a default book before the database applies its per-queue limit. + if (!bookId.HasValue && model.BookID.HasValue) + { + var scoped = await writerWorkspace.GetDashboardAsync(projectId, model.BookID); + model.WriteNext = scoped.WriteNext; + model.ContinueWriting = scoped.ContinueWriting; + model.RevisionQueue = scoped.RevisionQueue; + model.PolishingQueue = scoped.PolishingQueue; + } } else model.BookID=bookId; if(model.BookID.HasValue) @@ -63,6 +72,16 @@ public sealed class WriterController( model.Work = new(){BookID=model.BookID.Value,Year=selectedYear,Month=month is >=1 and <=12 ? month.Value : DateTime.UtcNow.Month,Day=day,Sessions=sessions,Current=sessions.FirstOrDefault(x=>x.EndedUtc==null),Days=calendar}; } if(planning!=null&&model.BookID.HasValue&&int.TryParse(User.FindFirstValue(ClaimTypes.NameIdentifier),out var planner)) model.PlannedActivities=await planning.Upcoming(planner,model.BookID.Value); + if (model.ProjectID is > 0 && model.BookID is > 0) + { + model.WorkingContext = new PlotLine.Services.Writer.WriterContext(model.ProjectID.Value, model.BookID.Value); + if (model.Objective is {} focus) + { + var selected = new PlotLine.Services.Writer.WriterSelection(model.ProjectID.Value, model.BookID.Value, focus.ChapterID, focus.SceneID); + model.WorkingContext = model.WorkingContext.Select(PlotLine.Services.Writer.WriterFocusRole.SavedObjective, selected) + .Select(PlotLine.Services.Writer.WriterFocusRole.Working, selected); + } + } model.Suggestions = (suggestions ?? new PlotLine.Services.Writer.WriterSuggestionProvider()).Suggest(model); return View("Index",model); } @@ -90,9 +109,18 @@ public sealed class WriterController( return model is null ? NotFound() : View(model); } - public async Task SchedulePreview(int? writingPlanId) + public async Task SchedulePreview(int? writingPlanId, int? projectId = null, int? bookId = null) { - var model = await writingSchedule.GetSchedulePreviewAsync(writingPlanId); + if (projectId.HasValue && access != null && !await access.CanAccessProjectAsync(projectId.Value)) return NotFound(); + if (bookId.HasValue && bookRepository != null) + { + if (access != null && !await access.CanAccessEntityAsync("Book", bookId.Value)) return NotFound(); + var book = await bookRepository.GetAsync(bookId.Value); + if (book == null || book.IsArchived || (projectId.HasValue && projectId != book.ProjectID)) return NotFound(); + projectId = book.ProjectID; + } + var model = await writingSchedule.GetSchedulePreviewAsync(writingPlanId, projectId, bookId); + if (writingPlanId.HasValue && model.SelectedPlan == null) return NotFound(); if(planning!=null&&model.SelectedPlan!=null)model.DerivedActivities=await planning.Read(int.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!),model.SelectedPlan.WritingPlanID); return View(model); } @@ -164,7 +192,8 @@ public sealed class WriterController( public async Task PreviewRebalance(int writingPlanId) { - var model = await writingSchedule.GetSchedulePreviewAsync(writingPlanId); + var preview = await SchedulePreview(writingPlanId); + if (preview is not ViewResult page || page.Model is not WritingSchedulePreviewViewModel model) return preview; try { model.RebalancePreview = await writingSchedule.PreviewRebalanceAsync(writingPlanId); @@ -296,7 +325,7 @@ public sealed class WriterController( [HttpPost] [ValidateAntiForgeryToken] - public async Task ActivateWritingPlan(int writingPlanId) + public async Task ActivateWritingPlan(int writingPlanId, int? projectId = null, int? bookId = null) { try { @@ -308,12 +337,12 @@ public sealed class WriterController( TempData["WritingPlansError"] = ex.Message; } - return RedirectToAction(nameof(WritingPlans)); + return RedirectToAction(nameof(WritingPlans), new { projectId, bookId }); } [HttpPost] [ValidateAntiForgeryToken] - public async Task DeactivateWritingPlan(int writingPlanId) + public async Task DeactivateWritingPlan(int writingPlanId, int? projectId = null, int? bookId = null) { try { @@ -325,12 +354,12 @@ public sealed class WriterController( TempData["WritingPlansError"] = ex.Message; } - return RedirectToAction(nameof(WritingPlans)); + return RedirectToAction(nameof(WritingPlans), new { projectId, bookId }); } [HttpPost] [ValidateAntiForgeryToken] - public async Task DeleteWritingPlan(int writingPlanId) + public async Task DeleteWritingPlan(int writingPlanId, int? projectId = null, int? bookId = null) { try { @@ -342,12 +371,12 @@ public sealed class WriterController( TempData["WritingPlansError"] = ex.Message; } - return RedirectToAction(nameof(WritingPlans)); + return RedirectToAction(nameof(WritingPlans), new { projectId, bookId }); } [HttpPost] [ValidateAntiForgeryToken] - public async Task RegenerateWritingPlanSchedule(int writingPlanId) + public async Task RegenerateWritingPlanSchedule(int writingPlanId, int? projectId = null, int? bookId = null) { try{if(planning!=null&&(await planning.Read(int.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!),writingPlanId)).Count>0)return RedirectToAction("Index","WriterPlanning",new{writingPlanId});}catch(SqlException e)when(e.Number==51000){return NotFound();} try @@ -360,7 +389,7 @@ public sealed class WriterController( TempData["WritingPlansError"] = ex.Message; } - return RedirectToAction(nameof(WritingPlans)); + return RedirectToAction(nameof(WritingPlans), new { projectId, bookId }); } [HttpPost] diff --git a/PlotLine/Controllers/WritingController.cs b/PlotLine/Controllers/WritingController.cs index 92eb3e01..f44c6b97 100644 --- a/PlotLine/Controllers/WritingController.cs +++ b/PlotLine/Controllers/WritingController.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc.Rendering; using PlotLine.Models; using PlotLine.Services; using PlotLine.ViewModels; +using PlotLine.Services.Writer; namespace PlotLine.Controllers; @@ -56,7 +57,7 @@ public sealed class WritingController( if(nativeLaunch&&!SameNativeTarget(target,await NativeTarget(bookId,instanceId,sessionId))) { - sceneId=null;chapterId=null; + sceneId=null;chapterId=null;target=null; display=WaitingContextDisplay(projectId,bookId,documentGuid); } if(nativeLaunch&&display!=null)display.FollowStatus=target!=null&&sceneId.HasValue?"Following Word":"Word mapping pending · choose a saved scene to browse manually"; @@ -71,6 +72,9 @@ public sealed class WritingController( Display = display ?? MissingContextDisplay(projectId, bookId, sceneId) }; + model.WorkingContext = ReferenceContext(model.ProjectID, model.BookID, + model.Display?.Context?.Position.ChapterId, + model.Display?.Context?.Position.SceneId, pinned, nativeLaunch ? target : null); return View(model); } @@ -111,7 +115,7 @@ public sealed class WritingController( if(nativeLaunch&&!SameNativeTarget(target,await NativeTarget(bookId,instanceId,sessionId))) { - sceneId=null;chapterId=null; + sceneId=null;chapterId=null;target=null; display=WaitingIntentDisplay(projectId,bookId,documentGuid); } if(nativeLaunch&&display!=null)display.FollowStatus=target!=null&&(sceneId.HasValue||chapterId.HasValue)?"Following Word":"Word mapping pending · choose a saved scene to browse manually"; @@ -126,6 +130,9 @@ public sealed class WritingController( Display = display ?? MissingIntentDisplay(projectId, bookId, chapterId, sceneId) }; + model.WorkingContext = ReferenceContext(model.ProjectID, model.BookID, + model.Display?.Context?.Position.ChapterId ?? model.Display?.ChapterWorkflow?.Chapter.ChapterID, + model.Display?.Context?.Position.SceneId, pinned, nativeLaunch ? target : null); return View(model); } @@ -177,6 +184,20 @@ public sealed class WritingController( return PartialView("~/Views/Writing/_WritingIntentContent.cshtml", MissingIntentDisplay(projectId, bookId, chapterId, sceneId)); } + private static WriterContext? ReferenceContext(int? project, int? book, int? chapter, int? scene, bool pinned, NativeWritingTarget? native) + { + if (project is not > 0 || book is not > 0 || (!chapter.HasValue && !scene.HasValue)) return null; + var context = new WriterContext(project.Value, book.Value); + if (chapter.HasValue || scene.HasValue) + { + var selection = new WriterSelection(project.Value, book.Value, chapter, scene); + context = context.Select(pinned ? WriterFocusRole.PinnedReference : WriterFocusRole.Exploration, selection); + if (!pinned && native != null) + context = context.WithVerifiedWord(new(selection, native.Instance, native.Session, native.Manuscript, native.Revision, native.AcceptedRevision)); + } + return context; + } + private int WritingUser=>int.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!); private sealed record NativeWritingTarget(Guid Instance,Guid Session,Guid Manuscript,long Revision,int? ChapterId,int? SceneId,long AcceptedRevision); private static bool InvalidNativeSelection(Guid? instance,Guid? session)=>instance.HasValue!=session.HasValue||instance==Guid.Empty||session==Guid.Empty; @@ -416,6 +437,8 @@ public sealed class WritingController( private static string MissingScopeMessage(int? projectId, int? bookId, Guid? documentGuid, string screen) { + if (bookId.HasValue) + return "No saved scene is available for this book yet, or Word has not reported a verified scene. Add or select a chapter and scene in PlotDirector, or synchronise the linked manuscript. This reference window does not change your working objective."; if (!projectId.HasValue || !bookId.HasValue) { return $"{screen} did not receive a project/book from Word Companion. Reopen it from a linked manuscript, or choose a scene manually."; diff --git a/PlotLine/Data/Repositories.cs b/PlotLine/Data/Repositories.cs index 0c7618ab..71f7b5db 100644 --- a/PlotLine/Data/Repositories.cs +++ b/PlotLine/Data/Repositories.cs @@ -383,7 +383,7 @@ public interface IWriterWorkspaceRepository Task GetChapterGoalAsync(int chapterId); Task SaveChapterGoalAsync(ChapterGoal goal); Task> GetChapterWorkflowAsync(int chapterId); - Task> GetWriterDashboardScenesAsync(int? projectId, string queue); + Task> GetWriterDashboardScenesAsync(int? projectId, string queue, int? bookId = null); Task> GetWriterDashboardRemindersAsync(int? projectId); } @@ -1340,10 +1340,10 @@ public sealed class WriterWorkspaceRepository(ISqlConnectionFactory connectionFa return rows.ToList(); } - public async Task> GetWriterDashboardScenesAsync(int? projectId, string queue) + public async Task> GetWriterDashboardScenesAsync(int? projectId, string queue, int? bookId = null) { using var connection = connectionFactory.CreateConnection(); - var rows = await connection.QueryAsync("dbo.WriterDashboard_Scenes", new { ProjectID = projectId, Queue = queue }, commandType: CommandType.StoredProcedure); + var rows = await connection.QueryAsync("dbo.WriterDashboard_Scenes", new { ProjectID = projectId, Queue = queue, BookID = bookId }, commandType: CommandType.StoredProcedure); return rows.ToList(); } diff --git a/PlotLine/Help/Articles/Workspace/ChapterGoals.md b/PlotLine/Help/Articles/Workspace/ChapterGoals.md index 03fce01f..711ed115 100644 --- a/PlotLine/Help/Articles/Workspace/ChapterGoals.md +++ b/PlotLine/Help/Articles/Workspace/ChapterGoals.md @@ -50,3 +50,7 @@ If the chapter feels crowded, compare each scene against the goal and ask whethe - [Chapter Workflow](/Help/Article/workspace.chapterWorkflow) - [Chapters](/Help/Article/chapters.overview) - [Revision Queue](/Help/Article/workspace.revisionQueue) + +# Plans, workflow and evidence + +Chapter goals are your saved intentions. The scene’s Revision Status is its workflow stage. Checklist completion, planned-task completion, AI evidence decisions and session records are separate; none silently overwrites the others. See [Your working context](/Help/Article/workspace.workingContext). diff --git a/PlotLine/Help/Articles/Workspace/Overview.md b/PlotLine/Help/Articles/Workspace/Overview.md index 0e3e6b13..b1081abf 100644 --- a/PlotLine/Help/Articles/Workspace/Overview.md +++ b/PlotLine/Help/Articles/Workspace/Overview.md @@ -1,61 +1,44 @@ --- title: Writer Workspace category: Workspace -tags: workspace, drafting, revision, polishing, reminders +tags: writer, context, workflow, planning contextKey: workspace.overview -micro: See what to draft, revise, polish or resolve next. -quickTitle: What is the Writer Workspace? -quickSummary: The Writer Workspace gathers practical next actions so you can move from planning into drafting and revision with less friction. +micro: Choose your next task in the selected book. +quickTitle: Writer Workspace +quickSummary: Writer gathers your saved focus, writing plans, scene queues and recent activity. screenshot: --- # Overview -The Writer Workspace is a practical working view. It helps you decide what to do next without reopening every book, chapter and scene. Instead of showing the whole structure, it gathers scenes and reminders into useful queues: continue writing, needs attention, revision, polishing and story health reminders. +Writer gathers your saved focus, writing plans, scene queues and recent activity. -This is where PlotDirector becomes less like a filing cabinet and more like a desk. The timeline is for seeing story shape. The workspace is for choosing the next piece of work. +Choose a project and book in the application bar. Your saved working objective is a return target; it does not change merely because you browse a reference or read a different chapter. -The queues are based on the information already recorded in your scenes and project. A scene that is planned may belong in a drafting queue. A scene with structural uncertainty may need attention. A nearly finished scene may belong in polishing. Reminders point you back to continuity, research or story health issues that should not be forgotten. +# Scene queues -# When Should I Use This? +| Queue | Scene Revision Status | +|---|---| +| Write Next | Outlined | +| In Progress | Drafted | +| Revision | Needs Work | +| Final Pass | Revised | -Use the Writer Workspace at the start of a writing session, revision session or planning review. It is especially helpful when a project has grown large enough that "what should I work on next?" becomes a real question. +Each queue shows up to 40 scenes from the selected book, ordered by priority and manuscript order. Open the scene to change Revision Status. Planned, Polished, Locked and Cut Candidate scenes are not in these four queues. Chapter and scene workspaces can be expanded on Overview, or opened through Workspaces. -It is also useful when returning after time away. Instead of trying to remember the entire state of the book, you can scan the workspace for scenes that are ready, blocked, or waiting for a final pass. +# What the reminders mean -# How To Use It +Story Health in Writer lists missing chapter goal summaries and selected unresolved writing notes. It is not a complete diagnosis of your story. Help Me offers up to four actions based on saved focus, plans and recorded information; it does not read your novel to diagnose it. -Choose a project focus if needed. Then review the sections from top to bottom. "Continue Writing" is usually the best place to find scenes that can move forward. "Needs Attention" highlights practical blockers. "Revision Queue" points to scenes needing structural or content changes. "Polishing Queue" is for language, rhythm, clarity and final presentation. +# Plans and activity -Use reminders as notes from the system and from your earlier planning. They may point to missing continuity details, unresolved warnings, research follow-up or scenes that deserve another look. +Plans describe intended work. Sessions record declared activity and qualified observations. Accepted manuscript changes are separate evidence. None automatically changes a scene's Revision Status. -# Example +# Related guides -You open the workspace and see: - -- A planned scene ready to draft. -- A scene needing location details for a character. -- Two revised scenes ready for polish. -- A reminder that an important clue has not been paid off. - -That gives you a clear session menu instead of a vague sense that the manuscript needs "work". - -# Writer Tip - -Use the workspace to protect momentum. If you have low energy, pick a polishing task. If you have creative energy, draft a ready scene. If you have analytical energy, clear a blocker. - -# Common Mistakes - -- Treating every queue as urgent. -- Ignoring reminders until they become revision problems. -- Polishing scenes that still have structural uncertainty. -- Staying in planning mode when a scene is ready to draft. - -# Related Guides - -- [Scenes](/Help/Article/scenes.overview) -- [Chapters](/Help/Article/chapters.overview) -- [Project Settings](/Help/Article/projectSettings.overview) +- [Working context](/Help/Article/workspace.workingContext) +- [Writing plans](/Help/Article/workspace.writingPlans) +- [Chapter goals](/Help/Article/workspace.chapterGoals) # Installed desktop app diff --git a/PlotLine/Help/Articles/Workspace/PolishingQueue.md b/PlotLine/Help/Articles/Workspace/PolishingQueue.md index 2d92c341..6ae5bff8 100644 --- a/PlotLine/Help/Articles/Workspace/PolishingQueue.md +++ b/PlotLine/Help/Articles/Workspace/PolishingQueue.md @@ -1,17 +1,17 @@ --- -title: Polishing Queue +title: Final Pass category: Workspace tags: workspace, polish, prose, pacing contextKey: workspace.polishingQueue micro: Find scenes ready for a final clarity and wording pass. -quickTitle: Polishing Queue -quickSummary: Polishing Queue is for scenes whose structure is settled enough for wording, clarity and rhythm work. +quickTitle: Final Pass +quickSummary: Final Pass is for scenes whose structure is settled enough for wording, clarity and rhythm work. screenshot: --- # Overview -Polishing Queue is for scenes that are close enough to finished that language-level work makes sense. This includes clarity, rhythm, pacing, transitions and final presentation. +Final Pass is for scenes that are close enough to finished that language-level work makes sense. This includes clarity, rhythm, pacing, transitions and final presentation. # When Should I Use This? @@ -40,3 +40,7 @@ Polishing is best when the scene has already earned its place. - [Writer Workspace](/Help/Article/workspace.overview) - [Revision Queue](/Help/Article/workspace.revisionQueue) - [Scenes](/Help/Article/scenes.overview) + +# Queue membership + +This queue uses the scene Revision Status **Revised**, not a separate draft-status field. Only scenes in the selected book are considered, with up to 40 shown in priority and manuscript order. diff --git a/PlotLine/Help/Articles/Workspace/RevisionQueue.md b/PlotLine/Help/Articles/Workspace/RevisionQueue.md index 0bfdb109..19461a3a 100644 --- a/PlotLine/Help/Articles/Workspace/RevisionQueue.md +++ b/PlotLine/Help/Articles/Workspace/RevisionQueue.md @@ -40,3 +40,7 @@ Revise before polishing. A beautiful paragraph is still expensive if the scene l - [Writer Workspace](/Help/Article/workspace.overview) - [Chapter Workflow](/Help/Article/workspace.chapterWorkflow) - [Scenes](/Help/Article/scenes.overview) + +# Queue membership + +Scenes appear when Revision Status is **Needs Work**. This is an author-assigned workflow stage, not a new diagnosis. Each queue shows up to 40 scenes from the selected book. diff --git a/PlotLine/Help/Articles/Workspace/WorkflowSummary.md b/PlotLine/Help/Articles/Workspace/WorkflowSummary.md index 08b0b2cf..08c99339 100644 --- a/PlotLine/Help/Articles/Workspace/WorkflowSummary.md +++ b/PlotLine/Help/Articles/Workspace/WorkflowSummary.md @@ -40,3 +40,7 @@ Use the summary to separate creative drafting from practical cleanup. Both matte - [Chapter Workflow](/Help/Article/workspace.chapterWorkflow) - [Writer Workspace](/Help/Article/workspace.overview) - [Scenes](/Help/Article/scenes.overview) + +# Plans, workflow and evidence + +Chapter goals are your saved intentions. The scene’s Revision Status is its workflow stage. Checklist completion, planned-task completion, AI evidence decisions and session records are separate; none silently overwrites the others. See [Your working context](/Help/Article/workspace.workingContext). diff --git a/PlotLine/Help/Articles/Workspace/WorkingContext.md b/PlotLine/Help/Articles/Workspace/WorkingContext.md new file mode 100644 index 00000000..a403cc17 --- /dev/null +++ b/PlotLine/Help/Articles/Workspace/WorkingContext.md @@ -0,0 +1,39 @@ +--- +title: Your working context +category: Workspace +tags: writer, context, workflow, planning +contextKey: workspace.workingContext +micro: Keep writing focus separate from references, Reader and sessions. +quickTitle: Your working context +quickSummary: Your selected book, saved objective, reference selection, Reader chapter and active session have different purposes. +screenshot: +--- + +# Overview + +Your selected book, saved objective, reference selection, Reader chapter and active session have different purposes. + +# Understanding the selections + +| Selection | What it means | +|---|---| +| Selected project and book | The authorised book shown in the application bar. Writer queues and book-scoped plans use it. | +| Saved working objective | Your chosen activity and optional chapter or scene. Change objective updates this saved return target. | +| Working focus | The task you are writing now; initially your saved objective. | +| Exploring | A temporary scene, plot, map or metric you are inspecting. Browsing does not save a new objective. | +| Pinned reference | A saved-data view intentionally held on screen rather than following Word. | +| Verified Word position | The connected document's accepted, mapped position. Unverified positions are not guessed. | +| Reader chapter | The chapter selected in the read-only Reader. Changing it does not retarget an existing session. | +| Work or Audio Review session | The book and chapter chosen when you start tracking. End it and start another to change the tracked target. | + +# Working across displays + +Standalone Context and Intent remain available through Display Setup and Word. Open Context or Intent, choose target displays and allow browser placement permission when offered. Named windows can be reused. Browser and Windows limits may prevent exact placement. Exploring a pinned reference does not move Word; live views retain explicit navigation controls. + +# Status and completion + +Revision Status is the scene's workflow stage. Completing a checklist objective, acknowledging AI evidence, marking a planned task complete and ending a session are separate actions. Legacy saved draft fields are retained; they do not override Revision Status. + +# Audio Review + +Choose the intended chapter before starting. Live controls require compatible Windows Companion and a supported media source. End review stops tracking. Use Pause first if you also want external playback to stop. Resume is always explicit. diff --git a/PlotLine/Help/Articles/Workspace/WriteNext.md b/PlotLine/Help/Articles/Workspace/WriteNext.md index 6181be41..943f9cc7 100644 --- a/PlotLine/Help/Articles/Workspace/WriteNext.md +++ b/PlotLine/Help/Articles/Workspace/WriteNext.md @@ -1,17 +1,17 @@ --- -title: Continue Writing +title: Write Next category: Workspace tags: workspace, drafting, scenes, write next contextKey: workspace.writeNext micro: Find scenes that are ready to move forward in drafting. -quickTitle: Continue Writing -quickSummary: Continue Writing gathers scenes that look ready for your next drafting session. +quickTitle: Write Next +quickSummary: Write Next gathers scenes that look ready for your next drafting session. screenshot: --- # Overview -Continue Writing is the workspace queue for scenes that can move forward now. It helps turn a large project into a smaller set of practical next choices. +Write Next is the workspace queue for scenes that can move forward now. It helps turn a large project into a smaller set of practical next choices. # When Should I Use This? @@ -40,3 +40,7 @@ Momentum often comes from choosing the next workable scene, not the most importa - [Writer Workspace](/Help/Article/workspace.overview) - [Scenes](/Help/Article/scenes.overview) - [Chapters](/Help/Article/chapters.overview) + +# Queue membership + +This queue uses the scene Revision Status **Outlined**, not a separate draft-status field. Only scenes in the selected book are considered, with up to 40 shown in priority and manuscript order. diff --git a/PlotLine/Help/Articles/Workspace/WritingPlans.md b/PlotLine/Help/Articles/Workspace/WritingPlans.md new file mode 100644 index 00000000..80216e1d --- /dev/null +++ b/PlotLine/Help/Articles/Workspace/WritingPlans.md @@ -0,0 +1,42 @@ +--- +title: Writing plans and recorded work +category: Workspace +tags: writer, context, workflow, planning +contextKey: workspace.writingPlans +micro: Plan time without confusing it with measured writing activity. +quickTitle: Writing plans and recorded work +quickSummary: Plans save intended capacity and tasks. Reviewed allocations and existing workflow scene tasks remain separate records. +screenshot: +--- + +# Overview + +Plans save intended capacity and tasks. Reviewed allocations and existing workflow scene tasks remain separate records. + +# Create a plan + +Choose a project and book, or All Books for the project. Set a goal, start/deadline and available days/minutes. Review activities saves these settings first; the next page lets you inspect actual chapter/scene candidates, activity kinds and working budgets before confirming the allocation. You can return without committing allocations; the saved plan remains. + +# Understanding the fields + +| Field or control | Meaning | +|---|---| +| Availability | Planned capacity, not time already worked. | +| Working budget | Adjustable minutes for the selected chapter/scene; an estimate, not a promise. | +| Include Blocked Scenes | Allows blocked scenes to be considered; does not clear their blocker. | +| All Books | A project-wide plan that also appears when viewing plans for one book. | +| Mark complete | Your declaration about that task/allocation. It does not change manuscript text, scene Revision Status or checklist completion. | + +# Existing and reviewed tasks + +Older workflow scene tasks and reviewed chapter/scene allocations both remain available. Preview labels them separately. Regenerate workflow scene tasks applies to the older mechanism; when reviewed allocations exist it takes you to review them instead. Completed reviewed allocations are preserved; create a new plan for another pass. + +Editing availability does not silently move reviewed activities. Save the settings, then choose Review and reallocate them. Reallocation requires confirmation and sufficient capacity. No time is invented to meet the deadline. + +# Scope and returns + +Opening Schedule Preview from a book-scoped plan list retains that book, including project-wide plans. Plan selection displays its project/book. Use View plans across all projects and books for the wider list. Activation and deletion return to the list you were using. + +# Sessions and evidence + +Starting a session is independent of a scheduled task. Browser-engaged time, elapsed time, observed audio and accepted additions/removals have different meanings and can overlap. Reports controls recording, retention, exports and erasure; pausing recording does not stop manuscript synchronisation. diff --git a/PlotLine/Services/CoreServices.cs b/PlotLine/Services/CoreServices.cs index 9b83c682..7e853c49 100644 --- a/PlotLine/Services/CoreServices.cs +++ b/PlotLine/Services/CoreServices.cs @@ -577,7 +577,7 @@ public interface IRelationshipMapService public interface IWriterWorkspaceService { - Task GetDashboardAsync(int? projectId); + Task GetDashboardAsync(int? projectId, int? bookId = null); Task GetChapterWorkflowAsync(int chapterId); Task SaveChapterGoalAsync(ChapterGoalEditViewModel model); Task SaveSceneWorkflowAsync(SceneWorkflowEditViewModel model); @@ -604,7 +604,7 @@ public interface IWritingScheduleService Task DeleteScheduleItemAsync(int writingScheduleItemId); Task UpdateScheduleItemStatusAsync(int writingScheduleItemId, string scheduleStatus, DateTime? completedDateUtc); Task> GenerateSchedule(int writingPlanId); - Task GetSchedulePreviewAsync(int? writingPlanId); + Task GetSchedulePreviewAsync(int? writingPlanId, int? projectId = null, int? bookId = null); Task DeleteScheduleAsync(int writingPlanId); Task GetWritingPlansForManagementAsync(); Task GetWritingPlanSettingsAsync(int writingPlanId); @@ -6144,7 +6144,7 @@ public sealed class WriterWorkspaceService( IWriterWorkspaceRepository writerWorkspace, ICurrentUserService currentUser) : IWriterWorkspaceService { - public async Task GetDashboardAsync(int? projectId) + public async Task GetDashboardAsync(int? projectId, int? bookId = null) { var projectRows = currentUser.UserId.HasValue ? await projects.ListForUserAsync(currentUser.UserId.Value) @@ -6157,20 +6157,20 @@ public sealed class WriterWorkspaceService( { ProjectID = projectId, ProjectOptions = projectRows.Select(x => new SelectListItem(x.ProjectName, x.ProjectID.ToString(), x.ProjectID == projectId)).ToList(), - WriteNext = await GetDashboardScenesAsync(projectIds, "WriteNext"), - ContinueWriting = await GetDashboardScenesAsync(projectIds, "ContinueWriting"), - RevisionQueue = await GetDashboardScenesAsync(projectIds, "RevisionQueue"), - PolishingQueue = await GetDashboardScenesAsync(projectIds, "PolishingQueue"), + WriteNext = await GetDashboardScenesAsync(projectIds, "WriteNext", bookId), + ContinueWriting = await GetDashboardScenesAsync(projectIds, "ContinueWriting", bookId), + RevisionQueue = await GetDashboardScenesAsync(projectIds, "RevisionQueue", bookId), + PolishingQueue = await GetDashboardScenesAsync(projectIds, "PolishingQueue", bookId), StoryHealthReminders = await GetDashboardRemindersAsync(projectIds) }; } - private async Task> GetDashboardScenesAsync(IReadOnlyList projectIds, string queue) + private async Task> GetDashboardScenesAsync(IReadOnlyList projectIds, string queue, int? bookId) { var rows = new List(); foreach (var accessibleProjectId in projectIds) { - rows.AddRange(await writerWorkspace.GetWriterDashboardScenesAsync(accessibleProjectId, queue)); + rows.AddRange(await writerWorkspace.GetWriterDashboardScenesAsync(accessibleProjectId, queue, bookId)); } return rows; @@ -6405,14 +6405,15 @@ public sealed class WritingScheduleService( return savedItems.Select(ToViewModel).ToList(); } - public async Task GetSchedulePreviewAsync(int? writingPlanId) + public async Task GetSchedulePreviewAsync(int? writingPlanId, int? projectId = null, int? bookId = null) { if (!currentUser.UserId.HasValue) { return new WritingSchedulePreviewViewModel(); } - var plans = await writingSchedule.GetWritingPlanSummariesByUserAsync(currentUser.UserId.Value); + var plans = (await writingSchedule.GetWritingPlanSummariesByUserAsync(currentUser.UserId.Value)) + .Where(p => (!projectId.HasValue || p.ProjectID == projectId) && (!bookId.HasValue || p.BookID == null || p.BookID == bookId)).ToArray(); var plansRequiringRebalance = await writingSchedule.GetPlansRequiringRebalanceAsync(currentUser.UserId.Value, DateTime.Today); var selectedPlan = writingPlanId.HasValue ? plans.FirstOrDefault(x => x.WritingPlanID == writingPlanId.Value) @@ -6423,6 +6424,8 @@ public sealed class WritingScheduleService( return new WritingSchedulePreviewViewModel { + ScopeProjectID = projectId, + ScopeBookID = bookId, SelectedWritingPlanID = selectedPlan?.WritingPlanID, Plans = plans, PlansRequiringRebalance = plansRequiringRebalance, diff --git a/PlotLine/Services/Manuscript/ManuscriptReaderService.cs b/PlotLine/Services/Manuscript/ManuscriptReaderService.cs index 71f1793b..f494009b 100644 --- a/PlotLine/Services/Manuscript/ManuscriptReaderService.cs +++ b/PlotLine/Services/Manuscript/ManuscriptReaderService.cs @@ -8,6 +8,8 @@ namespace PlotLine.Services.Manuscript; public sealed record ReaderParagraph(Guid Id, string Text, bool IsHeading); public sealed class ManuscriptReaderModel { + public PlotLine.Services.Writer.WriterContext WorkingContext => new PlotLine.Services.Writer.WriterContext(Book.ProjectID, Book.BookID) + .Select(PlotLine.Services.Writer.WriterFocusRole.Reader, new(Book.ProjectID, Book.BookID, Chapter?.ChapterID)); public long Revision { get; init; } = -1; public bool FocusReading { get; set; } public string ContentVersion => Fingerprint(Paragraphs); diff --git a/PlotLine/Services/Writer/WriterContext.cs b/PlotLine/Services/Writer/WriterContext.cs new file mode 100644 index 00000000..8aa9fdaa --- /dev/null +++ b/PlotLine/Services/Writer/WriterContext.cs @@ -0,0 +1,66 @@ +namespace PlotLine.Services.Writer; + +// A projection of already-authorised selections, never an authorisation or Word navigation command. +// Each surface owns its slot; selecting a reference must not replace the author's working focus. +public sealed record WriterSelection +{ + public int ProjectID { get; } + public int BookID { get; } + public int? ChapterID { get; } + public int? SceneID { get; } + public WriterSelection(int projectID, int bookID, int? chapterID = null, int? sceneID = null) + { + if (projectID <= 0 || bookID <= 0 || chapterID is <= 0 || sceneID is <= 0 || (sceneID.HasValue && !chapterID.HasValue)) + throw new ArgumentException("A scene selection requires a chapter in a positive project/book scope."); + ProjectID = projectID; BookID = bookID; ChapterID = chapterID; SceneID = sceneID; + } +} + +public enum WriterFocusRole { Working, SavedObjective, Exploration, PinnedReference, Reader, Session } + +public sealed record WriterNativePosition(WriterSelection Selection, Guid Instance, Guid DocumentSession, + Guid Manuscript, long ObservedRevision, long AcceptedRevision); + +public sealed record WriterContext +{ + public WriterSelection Scope { get; } + public WriterSelection? Working { get; private init; } + public WriterSelection? SavedObjective { get; private init; } + public WriterSelection? Exploration { get; private init; } + public WriterSelection? PinnedReference { get; private init; } + public WriterSelection? Reader { get; private init; } + public WriterSelection? Session { get; private init; } + public WriterNativePosition? VerifiedWord { get; private init; } + public WriterContext(int projectID, int bookID) => Scope = new(projectID, bookID); + + public WriterContext Select(WriterFocusRole role, WriterSelection selection) + { + CheckScope(selection); + return role switch + { + WriterFocusRole.Working => this with { Working = selection }, + WriterFocusRole.SavedObjective => this with { SavedObjective = selection }, + WriterFocusRole.Exploration => this with { Exploration = selection }, + WriterFocusRole.PinnedReference => this with { PinnedReference = selection }, + WriterFocusRole.Reader => this with { Reader = selection }, + WriterFocusRole.Session => this with { Session = selection }, + _ => throw new ArgumentOutOfRangeException(nameof(role)) + }; + } + + // Called only after the existing native lease, saved-document, accepted-position and race checks. + public WriterContext WithVerifiedWord(WriterNativePosition position) + { + CheckScope(position.Selection); + if (position.Instance == Guid.Empty || position.DocumentSession == Guid.Empty || position.Manuscript == Guid.Empty || + position.ObservedRevision < 0 || position.AcceptedRevision <= 0) + throw new ArgumentException("Verified native position requires complete document and accepted revision identity."); + return this with { VerifiedWord = position }; + } + + private void CheckScope(WriterSelection selection) + { + if (selection.ProjectID != Scope.ProjectID || selection.BookID != Scope.BookID) + throw new ArgumentException("Selections from different books require a new context."); + } +} diff --git a/PlotLine/Sql/264_WriterFoundationQueues.sql b/PlotLine/Sql/264_WriterFoundationQueues.sql new file mode 100644 index 00000000..6c1259e2 --- /dev/null +++ b/PlotLine/Sql/264_WriterFoundationQueues.sql @@ -0,0 +1,99 @@ +SET ANSI_NULLS ON; +SET QUOTED_IDENTIFIER ON; +GO +-- Forward-only live/source reconciliation. Book filtering precedes TOP (40). +CREATE OR ALTER PROCEDURE dbo.WriterDashboard_Scenes + @ProjectID int = NULL, + @Queue nvarchar(50), + @BookID int = NULL +AS +BEGIN + SET NOCOUNT ON; + + WITH SceneBase AS + ( + SELECT p.ProjectID, p.ProjectName, b.BookID, b.BookTitle, b.Subtitle AS BookSubtitle, c.ChapterID, c.ChapterNumber, c.ChapterTitle, + s.SceneID, s.SceneNumber, s.SceneTitle, s.Summary, + s.RevisionStatusID, + rs.StatusName AS RevisionStatusName, + COALESCE(sw.DraftStatus, rs.StatusName, N'Planned') AS DraftStatus, + sw.Priority, + COALESCE(sw.IsBlocked, 0) AS IsBlocked, + sw.BlockedReason, + COALESCE(sw.ReadyForDraft, 0) AS ReadyForDraft, + COALESCE(sw.ReadyForRevision, 0) AS ReadyForRevision, + COALESCE(sw.ReadyForPolish, 0) AS ReadyForPolish, + b.SortOrder AS BookSortOrder, + c.SortOrder AS ChapterSortOrder, + s.SortOrder AS SceneSortOrder + FROM dbo.Projects p + INNER JOIN dbo.Books b ON b.ProjectID = p.ProjectID AND b.IsArchived = 0 + INNER JOIN dbo.Chapters c ON c.BookID = b.BookID AND c.IsArchived = 0 + INNER JOIN dbo.Scenes s ON s.ChapterID = c.ChapterID AND s.IsArchived = 0 + INNER JOIN dbo.RevisionStatuses rs ON rs.RevisionStatusID = s.RevisionStatusID + LEFT JOIN dbo.SceneWorkflow sw ON sw.SceneID = s.SceneID + WHERE p.IsArchived = 0 AND (@ProjectID IS NULL OR p.ProjectID = @ProjectID) + AND (@BookID IS NULL OR b.BookID = @BookID) + ) + SELECT TOP (40) sb.ProjectID, sb.ProjectName, sb.BookID, sb.BookTitle, sb.BookSubtitle, sb.ChapterID, sb.ChapterNumber, sb.ChapterTitle, + sb.SceneID, sb.SceneNumber, sb.SceneTitle, sb.Summary, sb.RevisionStatusID, sb.RevisionStatusName, + sb.DraftStatus, sb.Priority, sb.IsBlocked, sb.BlockedReason, + ISNULL(warnings.WarningCount, 0) AS WarningCount, + ISNULL(checklist.RemainingChecklistCount, 0) AS RemainingChecklistCount, + ISNULL(notes.UnresolvedNoteCount, 0) AS UnresolvedNoteCount, + threads.ImportantThreads, + pinned.PinnedNotes + FROM SceneBase sb + OUTER APPLY + ( + SELECT COUNT(*) AS WarningCount + FROM dbo.ContinuityWarnings cw + WHERE cw.SceneID = sb.SceneID AND cw.IsDismissed = 0 + ) warnings + OUTER APPLY + ( + SELECT COUNT(*) AS RemainingChecklistCount + FROM dbo.SceneChecklistItems sci + WHERE sci.SceneID = sb.SceneID AND sci.IsCompleted = 0 + ) checklist + OUTER APPLY + ( + SELECT COUNT(*) AS UnresolvedNoteCount + FROM dbo.SceneNotes sn + INNER JOIN dbo.SceneNoteTypes snt ON snt.SceneNoteTypeID = sn.SceneNoteTypeID + WHERE sn.SceneID = sb.SceneID AND sn.IsResolved = 0 + AND (@Queue <> N'NeedsAttention' OR snt.TypeName IN (N'TODO', N'Continuity Note')) + ) notes + OUTER APPLY + ( + SELECT STRING_AGG(CONVERT(nvarchar(max), pt.ThreadTitle), N', ') AS ImportantThreads + FROM + ( + SELECT DISTINCT TOP (5) pt.ThreadTitle, pt.Importance + FROM dbo.ThreadEvents te + INNER JOIN dbo.PlotThreads pt ON pt.PlotThreadID = te.PlotThreadID + WHERE te.SceneID = sb.SceneID + ORDER BY pt.Importance DESC, pt.ThreadTitle + ) pt + ) threads + OUTER APPLY + ( + SELECT STRING_AGG(CONVERT(nvarchar(max), COALESCE(sn.NoteTitle, sn.NoteText)), N' | ') AS PinnedNotes + FROM dbo.SceneNotes sn + WHERE sn.SceneID = sb.SceneID AND sn.IsPinned = 1 AND sn.IsResolved = 0 + ) pinned + WHERE + (@Queue = N'WriteNext' AND sb.RevisionStatusName = N'Outlined') + OR (@Queue = N'ContinueWriting' AND sb.RevisionStatusName = N'Drafted') + OR (@Queue = N'NeedsAttention' AND (sb.IsBlocked = 1 OR ISNULL(warnings.WarningCount, 0) > 0 OR ISNULL(notes.UnresolvedNoteCount, 0) > 0)) + OR (@Queue = N'RevisionQueue' AND sb.RevisionStatusName = N'Needs Work') + OR (@Queue = N'PolishingQueue' AND sb.RevisionStatusName = N'Revised') + -- Older consumers retain their original explicit readiness semantics. + OR (@Queue = N'Blocked' AND sb.IsBlocked = 1) + OR (@Queue = N'ReadyForDraft' AND sb.ReadyForDraft = 1) + OR (@Queue = N'ReadyForRevision' AND sb.ReadyForRevision = 1) + OR (@Queue = N'ReadyForPolish' AND sb.ReadyForPolish = 1) + OR (@Queue = N'Warnings' AND ISNULL(warnings.WarningCount, 0) > 0) + ORDER BY ISNULL(sb.Priority, 0) DESC, sb.BookSortOrder, sb.ChapterSortOrder, sb.SceneSortOrder, sb.SceneID; +END; +GO diff --git a/PlotLine/ViewModels/CoreViewModels.cs b/PlotLine/ViewModels/CoreViewModels.cs index 3bb29dfb..55e7cc87 100644 --- a/PlotLine/ViewModels/CoreViewModels.cs +++ b/PlotLine/ViewModels/CoreViewModels.cs @@ -467,6 +467,7 @@ public sealed class SceneEditViewModel public sealed class WritingContextPageViewModel { + public PlotLine.Services.Writer.WriterContext? WorkingContext { get; set; } public int? ProjectID { get; set; } public int? BookID { get; set; } public int? ChapterID { get; set; } @@ -492,6 +493,7 @@ public sealed class WritingContextDisplayViewModel public sealed class WritingIntentPageViewModel { + public PlotLine.Services.Writer.WriterContext? WorkingContext { get; set; } public int? ProjectID { get; set; } public int? BookID { get; set; } public int? ChapterID { get; set; } @@ -925,6 +927,7 @@ public sealed class ChapterWorkflowViewModel public sealed class WriterDashboardViewModel { + public PlotLine.Services.Writer.WriterContext? WorkingContext { get; set; } public IReadOnlyList PlannedActivities { get; set; } = []; public WriterWorkPage? Work { get; set; } public IReadOnlyList Suggestions { get; set; } = []; @@ -1055,6 +1058,10 @@ public sealed class WritingScheduleItemViewModel public sealed class WritingSchedulePreviewViewModel { + public int? ScopeProjectID { get; set; } + public int? ScopeBookID { get; set; } + public int? ProjectID => ScopeProjectID ?? SelectedPlan?.ProjectID; + public int? BookID => ScopeBookID ?? SelectedPlan?.BookID; public IReadOnlyList DerivedActivities { get; set; } = []; public int? SelectedWritingPlanID { get; set; } public IReadOnlyList Plans { get; set; } = []; diff --git a/PlotLine/Views/Writer/EditWritingPlan.cshtml b/PlotLine/Views/Writer/EditWritingPlan.cshtml index 46e1a4c9..f54c3bd4 100644 --- a/PlotLine/Views/Writer/EditWritingPlan.cshtml +++ b/PlotLine/Views/Writer/EditWritingPlan.cshtml @@ -13,7 +13,7 @@

Schedule admin

-

Edit Writing Plan

+

Edit Writing Plan

Update plan settings without changing the project, book, or goal type.

@@ -118,4 +118,6 @@ - +@section Scripts { + +} diff --git a/PlotLine/Views/Writer/Index.cshtml b/PlotLine/Views/Writer/Index.cshtml index dd25584c..b7480503 100644 --- a/PlotLine/Views/Writer/Index.cshtml +++ b/PlotLine/Views/Writer/Index.cshtml @@ -23,7 +23,7 @@
@if(!string.IsNullOrWhiteSpace(Model.Book?.CoverThumbnailPath)){Cover of @bookTitle}else{} -

@(Model.Journey?"Writing Journey":"Your writing desk")

@bookTitle

@(Model.Journey?"Accepted activity and the work ahead.":"Continue your manuscript, review your work, or choose what comes next.")

+

@(Model.Journey?"Writing Journey":"Your writing desk")

@bookTitle

@(Model.Journey?"Accepted activity and the work ahead.":"Continue your manuscript, review your work, or choose what comes next.")

Companion Checking…Connection & Display Setup
@if(TempData["WriterWorkspaceMessage"] is string message){

@message

} @@ -86,7 +86,7 @@ else } @if(bookId.HasValue&&!Model.ActivityIsPrivate){}
-

Workspaces

Choose your next step

@if(bookId.HasValue){Browse chapters}
+

Workspaces

Choose your next step

@if(bookId.HasValue){Browse chapters}
Chapter and scene workspaces @foreach(var q in queues){} diff --git a/PlotLine/Views/Writer/SchedulePreview.cshtml b/PlotLine/Views/Writer/SchedulePreview.cshtml index e360f7ab..ec30f965 100644 --- a/PlotLine/Views/Writer/SchedulePreview.cshtml +++ b/PlotLine/Views/Writer/SchedulePreview.cshtml @@ -7,19 +7,19 @@ }

Schedule

-

Schedule Preview

+

Schedule Preview

Generated writing schedule items.

- Back to Writing Plans + Back to Writing Plans @if (Model.SelectedPlan is not null) { Edit Plan @@ -41,7 +41,7 @@ {

No writing plans found.

- Create Writing Schedule + Create Writing Schedule
} else @@ -55,6 +55,7 @@ else
+ +
} else {
- +
} Review chapter activities
- +
@@ -127,7 +127,7 @@ diff --git a/PlotLine/Views/Writer/_WriterSceneQueue.cshtml b/PlotLine/Views/Writer/_WriterSceneQueue.cshtml index 2681759b..b7ba5b27 100644 --- a/PlotLine/Views/Writer/_WriterSceneQueue.cshtml +++ b/PlotLine/Views/Writer/_WriterSceneQueue.cshtml @@ -2,7 +2,7 @@ @if (!Model.Any()) { -

Scenes appear here based on Revision Status. Use Outlined for Write Next, Drafted for Continue Writing, Needs Work for Revision, and Revised for Polishing.

+

Scenes appear here based on Revision Status. Use Outlined for Write Next, Drafted for In Progress, Needs Work for Revision, and Revised for Final Pass. Each queue shows up to 40 scenes from the selected book, ordered by priority and manuscript order.

} else { diff --git a/PlotLine/Views/Writing/Context.cshtml b/PlotLine/Views/Writing/Context.cshtml index 7ea8f192..af49ca58 100644 --- a/PlotLine/Views/Writing/Context.cshtml +++ b/PlotLine/Views/Writing/Context.cshtml @@ -8,6 +8,7 @@
-

Workflow

+

Workflow

@if (workflow is null || scene is null) {

No current scene workflow.

@@ -16,7 +16,7 @@ else {
-
Status
@workflow.DraftStatus
+
Revision Status
@(scene.RevisionStatuses.FirstOrDefault(x => x.Value == scene.RevisionStatusID.ToString())?.Text ?? "Not set")
Priority
@(workflow.Priority?.ToString() ?? "None")
Estimate
@(workflow.EstimatedWordCount?.ToString("N0") ?? "Not set")
Actual
@(workflow.ActualWordCount?.ToString("N0") ?? "Not set")