PlotDirector/PlotLine/Services/WriterNavigation.cs

50 lines
3.9 KiB
C#

namespace PlotLine.Services;
// Route/presentation metadata only. No persisted global focus or author-data mutation.
public static class WriterNavigation
{
public static IReadOnlyList<string> Destinations { get; } = Array.AsReadOnly(new[] { "Write", "Explore", "Plan", "Review", "Reflect" });
private static readonly string[] BookSwitchActions = ["Write", "Explore", "Plan", "Review", "Reflect", "Dashboard", "Overview", "Workspaces"];
public static string BookSwitchAction(string? action) => BookSwitchActions.FirstOrDefault(x => string.Equals(x, action, StringComparison.OrdinalIgnoreCase)) ?? "Index";
public static string DestinationForAction(string? action) => action?.ToLowerInvariant() switch
{
"write" => "Write", "explore" => "Explore", "plan" => "Plan", "review" => "Review", "reflect" => "Reflect", "dashboard" => "Dashboard",
"writingplans" or "schedulesetup" or "schedulepreview" or "editwritingplan" => "Plan",
"journey" => "Reflect", "workspaces" or "overview" or "legacy" or "chapter" => "Write", _ => "Home"
};
public static string Purpose(string destination) => destination switch
{
"Write" => "Choose your focus and return to the chapter or scene you are working on.",
"Explore" => "Develop an idea, find a way forward, or look more closely at your story.",
"Plan" => "Decide what you want to work on and make room for it.",
"Review" => "Read accepted manuscript text, revisit intentions and decide what to improve.",
"Reflect" => "See recorded progress and revisit your writing journey.",
"Dashboard" => "Your plans, manuscript and recorded progress at a glance.",
_ => "Choose where you would like to begin today."
};
public static IReadOnlyList<RibbonGroup> RibbonGroups(string destination,bool investigation=false)
{
var groups = new List<RibbonGroup>
{
new("Writer", new("Home","overview","Writer","Index","writerNavigation"),
new("Write","writer","Writer","Write","writerNavigation"),
new("Explore","point","Writer","Explore","writerNavigation"),
new("Plan","calendar","Writer","Plan","writerNavigation"),
new("Review","review","Writer","Review","writerNavigation"),
new("Reflect","metrics","Writer","Reflect","writerNavigation"))
};
var context = destination switch
{
"Write" => new RibbonGroup("Current work", new("Chapters","bible","Books","Details","book"), new("Scene queues","threads","Writer","Workspaces","writerBook"), new("Writing Dashboard","metrics","Writer","Dashboard","writerBook"), new("Writing Plan","calendar","Writer","WritingPlans","writerBook")),
"Explore" => new RibbonGroup("Story exploration", investigation ? new("Guided investigation","point","WriterInvestigations","Index","writerBook") : new("Problem Solver","point","WritingProblems","Index","global"), new("Story overview","timeline","Timeline","Index","writerBook")),
"Plan" => new RibbonGroup("Writing plans", new("Writing Plan","calendar","Writer","WritingPlans","writerBook"), new("Schedule Preview","calendar","Writer","SchedulePreview","writerBook")),
"Review" => new RibbonGroup("Reading & review", new("Reading mode","bible","ManuscriptReader","Index","writerBook"), new("Writing Dashboard","metrics","Writer","Dashboard","writerBook")),
"Reflect" => new RibbonGroup("Writing history", new("Writing Journey","calendar","Writer","Journey","writerBook"), new("Reports","metrics","WritingActivity","Index","writerBook",OwnerOnly:true)),
_ => new RibbonGroup("Your writing", new RibbonCommand("Writing Dashboard","metrics","Writer","Dashboard","writerBook"))
};
groups.Add(context);
groups.Add(new("Utilities", new RibbonCommand("Display Setup","maps","Writer","DisplaySetup","writerBook")));
return groups;
}
}