From be88c1d068a4c384c5db348238ac78704b6f73e9 Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Fri, 6 Nov 2026 10:45:53 +0000 Subject: [PATCH] Show missing floor mappings explicitly in the Context workspace --- PlotLine/Views/Writing/_WritingContextPlace.cshtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PlotLine/Views/Writing/_WritingContextPlace.cshtml b/PlotLine/Views/Writing/_WritingContextPlace.cshtml index 5c2d6829..5c063fa9 100644 --- a/PlotLine/Views/Writing/_WritingContextPlace.cshtml +++ b/PlotLine/Views/Writing/_WritingContextPlace.cshtml @@ -2,9 +2,9 @@ @{ var scene = Model.Context!.Scene!; var floorPlan = Model.FloorPlan; + // Only an explicit scene/occupancy mapping identifies a floor. var floorId = scene.InitialFloorPlanFloorID - ?? floorPlan?.OccupancyScenes.FirstOrDefault(x => x.SceneID == scene.SceneID)?.InitialFloorPlanFloorID - ?? floorPlan?.Floors.OrderBy(x => x.SortOrder).FirstOrDefault()?.FloorPlanFloorID; + ?? floorPlan?.OccupancyScenes.FirstOrDefault(x => x.SceneID == scene.SceneID)?.InitialFloorPlanFloorID; var floor = floorPlan?.Floors.FirstOrDefault(x => x.FloorPlanFloorID == floorId); var blocks = floor is null ? [] : floorPlan!.Blocks.Where(x => x.FloorPlanFloorID == floor.FloorPlanFloorID).ToList(); var tokens = floor is null ? [] : floorPlan!.OccupancyTokens.Where(x => x.SceneID == scene.SceneID && x.FloorPlanFloorID == floor.FloorPlanFloorID).ToList(); @@ -30,7 +30,7 @@ } else if (floor is null || !blocks.Any()) { -

No placed rooms are available for this floor.

+

@(floor is null?"No saved floor mapping for this scene. Open the linked floor plan to choose a floor.":"No placed rooms are available for this floor.")

} else {