diff --git a/Docs/WordCompanion/2026-11-05-usability-recovery.md b/Docs/WordCompanion/2026-11-05-usability-recovery.md index 663b2d47..5f67b304 100644 --- a/Docs/WordCompanion/2026-11-05-usability-recovery.md +++ b/Docs/WordCompanion/2026-11-05-usability-recovery.md @@ -56,3 +56,11 @@ Two further Windows defects were found during this qualification. AgentProcess.S The established Update script's Office Clean target also invokes UnregisterOfficeAddin and RemoveOfficeAddInSecurity. Running Clean during the recovery build removed the test registration. The corrected update procedure uses Build;VisualStudioForApplicationsBuild with PrepareForRunDependsOn=CopyFilesToOutputDirectory and omits Clean. The installation is reapplied after building. This prevents future preparation from unregistering the tested add-in. The update remote is read from the shared branch's configured tracking remote. The final build also labels the book-title search explicitly and ensures remembered books without a server project identifier never generate an invalid half-populated ProjectId/BookId descriptor. Native book authorisation remains in the existing workspace flow. ClickOnce/registry rollback records are archived before replacement so earlier recovery steps remain recoverable. + +## Final installed candidate 1.0.0.9 + +Word 1.0.0.8 reopened the saved synthetic manuscript, started its agent automatically without a manual executable launch, and restored the remembered book after the author renewed browser sign-in. The ribbon displayed the selected book and detected Chapter One, and Settings displayed the saved association. Diagnostics showed one session, empty queues and zero COM errors in that run. + +A paste test exposed an additional observation gap: the document held seven words while the last completed snapshot still held two until another observation. Version 1.0.0.9 schedules a coalesced, lightweight position/length/saved-state probe at most once per second on the existing Word STA scheduler. It reuses the existing bounded reader only when observation changes. It does not call Word's full-document statistics API or add another prose reader. Same-length edits while already dirty remain subject to the documented explicit-refresh limitation. + +The final signed Office build passed with zero warnings/errors. A before/after check confirmed Build without Clean retained the existing Manifest and LoadBehavior registration. Read-only reflection checks against the actual compiled startup resolver resolved the registered adjacent agent for matching DLL bytes and refused an unrelated DLL. diff --git a/PlotDirector.NativeCompanion/DeveloperVersion.props b/PlotDirector.NativeCompanion/DeveloperVersion.props index ada6f0a4..aaceeb43 100644 --- a/PlotDirector.NativeCompanion/DeveloperVersion.props +++ b/PlotDirector.NativeCompanion/DeveloperVersion.props @@ -1 +1 @@ -1.0.0.8 +1.0.0.9 diff --git a/PlotDirector.NativeCompanion/Vsto/Properties/AssemblyInfo.cs b/PlotDirector.NativeCompanion/Vsto/Properties/AssemblyInfo.cs index 7a9b11d4..3e0bf079 100644 --- a/PlotDirector.NativeCompanion/Vsto/Properties/AssemblyInfo.cs +++ b/PlotDirector.NativeCompanion/Vsto/Properties/AssemblyInfo.cs @@ -3,6 +3,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("PlotDirector Word Companion — Native development")] [assembly: AssemblyCompany("Nick Beckley")] [assembly: AssemblyProduct("PlotDirector")] -[assembly: AssemblyVersion("1.0.0.8")] -[assembly: AssemblyFileVersion("1.0.0.8")] +[assembly: AssemblyVersion("1.0.0.9")] +[assembly: AssemblyFileVersion("1.0.0.9")] [assembly: ComVisible(false)] diff --git a/PlotDirector.NativeCompanion/Vsto/WordAdapter.cs b/PlotDirector.NativeCompanion/Vsto/WordAdapter.cs index 54de1dbe..2f3cf6bd 100644 --- a/PlotDirector.NativeCompanion/Vsto/WordAdapter.cs +++ b/PlotDirector.NativeCompanion/Vsto/WordAdapter.cs @@ -31,6 +31,7 @@ namespace PlotDirector.WordAddIn private readonly Queue pendingMetrics = new Queue(); private readonly Stopwatch tickClock = Stopwatch.StartNew(); private readonly Stopwatch metricClock = Stopwatch.StartNew(); + private readonly Stopwatch selectionClock = Stopwatch.StartNew(); private void Metric(string name,double milliseconds) { if(pendingMetrics.Count==256)pendingMetrics.Dequeue(); @@ -492,6 +493,10 @@ namespace PlotDirector.WordAddIn private void Tick(object sender,EventArgs args) { Metric("ui-tick-delay",Math.Max(0,tickClock.Elapsed.TotalMilliseconds-25));tickClock.Restart(); + // Paste and some Word edits do not raise WindowSelectionChange. Probe only + // position/length/saved state; reuse the existing bounded reader if changed. + if(!disposed&&active!=null&&selectionClock.ElapsedMilliseconds>=1000) + {selectionClock.Restart();scheduler.Post("selection",CaptureSelection);} if(!disposed)scheduler.Pump(); Message[] responses; lock(reviewGate){responses=reviewReplies.Values.Take(4).ToArray();foreach(var response in responses)reviewReplies.Remove(response.SessionId);}