using PlotDirector.Companion.Protocol; namespace PlotDirector.Companion.Agent; // Pure presentation policy shared by portable tests and the Windows Forms view. public static class CompanionPresentation { public static bool Dark(bool? windowsDark)=>windowsDark??false; public static string Connection(ConnectionHealth? health,DateTime now) { if(health==null)return "Welcome · connect to PlotDirector"; if(health.Authentication is "expired" or "unauthorised")return "Sign in again"; if(health.Server=="checking")return "Checking your connection…"; if(health.Server!="online")return health.Server=="offline"?"Offline · Word is still available":"Connect to PlotDirector"; if(now-health.VerifiedUtc>TimeSpan.FromSeconds(90))return "Connection needs checking"; return health.Authentication=="verified"?"Connected to PlotDirector":"Sign in to continue"; } public static string Next(bool document,bool book,int chapters,bool busy)=>!document?"Open a manuscript in Word to begin. You can still use PlotDirector in your browser.":!book?"Choose the PlotDirector book for this manuscript.":busy?"Your manuscript stays editable while the Companion works.":chapters==0?"Find chapters using your document’s Heading 1 styles.":"Select chapters to analyse. Review and import are separate steps in PlotDirector."; public static string Chapter(bool analysing,bool analysed,bool failed=false)=>analysing?"Analysing…":analysed?"Analysed · review in PlotDirector":failed?"Could not analyse · select to retry":"Ready to analyse"; }