Phase C2 marker clarity

This commit is contained in:
Nick Beckley 2026-06-20 16:00:37 +01:00
parent 4f0c893914
commit d0939b914a

View File

@ -151,6 +151,119 @@
}
return string.Join(Environment.NewLine, lines);
}
string AssetMarkerLabel(AssetEvent assetEvent)
{
var typeName = assetEvent.AssetEventTypeName?.Trim() ?? string.Empty;
return typeName.ToLowerInvariant() switch
{
"first mentioned" => "First",
"mentioned" => "Ref",
"found" => "Find",
"lost" => "Lost",
"given" => "Give",
"taken" => "Take",
"stolen" => "Stol",
"hidden" => "Hide",
"moved" or "location changed" => "Move",
"used" => "Use",
"opened" => "Open",
"destroyed" => "X",
"revealed" => "Show",
"investigated" => "?",
"resolved" => "Done",
"state changed" => "State",
_ => string.IsNullOrWhiteSpace(typeName) ? "Asset" : typeName.Length <= 5 ? typeName : typeName[..5]
};
}
string AssetMarkerMeaning(AssetEvent assetEvent)
{
var typeName = assetEvent.AssetEventTypeName?.Trim() ?? string.Empty;
return typeName.ToLowerInvariant() switch
{
"first mentioned" => "Asset is first mentioned in this scene.",
"mentioned" => "Asset is mentioned in this scene.",
"found" => "Asset is found in this scene.",
"lost" => "Asset is lost in this scene.",
"given" => "Asset changes hands in this scene.",
"taken" => "Asset is taken in this scene.",
"stolen" => "Asset is stolen in this scene.",
"hidden" => "Asset is hidden in this scene.",
"moved" or "location changed" => "Asset changes location in this scene.",
"used" => "Asset is used in this scene.",
"opened" => "Asset is opened in this scene.",
"destroyed" => "Asset is destroyed in this scene.",
"revealed" => "Asset is revealed in this scene.",
"investigated" => "Asset is investigated in this scene.",
"resolved" => "Asset thread is resolved in this scene.",
"state changed" => "Asset state changes in this scene.",
_ => string.IsNullOrWhiteSpace(typeName) ? "Asset event occurs in this scene." : $"Asset event: {typeName}."
};
}
string AssetMarkerTooltip(AssetEvent assetEvent, Scene scene)
{
var lines = new List<string>
{
AssetMarkerMeaning(assetEvent),
$"Asset: {assetEvent.AssetName}",
$"Event: {assetEvent.EventTitle}",
$"Scene: {scene.SceneNumber:g}: {scene.SceneTitle}"
};
if (!string.IsNullOrWhiteSpace(assetEvent.ToStateName))
{
lines.Add($"State changes to: {assetEvent.ToStateName}");
}
if (!string.IsNullOrWhiteSpace(assetEvent.EventDescription))
{
lines.Add($"Summary: {assetEvent.EventDescription}");
}
return string.Join(Environment.NewLine, lines);
}
string CharacterMarkerLabel(SceneCharacter appearance)
{
var presence = appearance.PresenceTypeName?.Trim() ?? string.Empty;
return presence.ToLowerInvariant() switch
{
"present" => "In",
"arrives" => "In+",
"leaves" => "Out",
"nearby" => "Near",
"hidden" => "Hide",
"overhearing" => "Hear",
"mentioned only" => "Ref",
"background" => "Bg",
"off-screen" => "Off",
_ => "Char"
};
}
string CharacterMarkerMeaning(SceneCharacter appearance)
{
var presence = appearance.PresenceTypeName?.Trim() ?? string.Empty;
return presence.ToLowerInvariant() switch
{
"present" => "Character appears in this scene.",
"arrives" => "Character arrives in this scene.",
"leaves" => "Character leaves in this scene.",
"nearby" => "Character is nearby in this scene.",
"hidden" => "Character is hidden in this scene.",
"overhearing" => "Character overhears this scene.",
"mentioned only" => "Character is mentioned in this scene.",
"background" => "Character is in the background of this scene.",
"off-screen" => "Character is off-screen in this scene.",
_ => "Character appears in this scene."
};
}
string CharacterMarkerTooltip(SceneCharacter appearance, Scene scene)
{
var lines = new List<string>
{
CharacterMarkerMeaning(appearance),
$"Character: {appearance.CharacterName}",
$"Role: {(string.IsNullOrWhiteSpace(appearance.RoleInSceneTypeName) ? "Not set" : appearance.RoleInSceneTypeName)}",
$"Presence: {(string.IsNullOrWhiteSpace(appearance.PresenceTypeName) ? "Not set" : appearance.PresenceTypeName)}",
$"Scene: {scene.SceneNumber:g}: {scene.SceneTitle}"
};
return string.Join(Environment.NewLine, lines);
}
bool HasLeadSceneRole(CharacterLaneViewModel lane) => lane.SceneSlots
.SelectMany(slot => slot.Appearances)
.Any(appearance =>
@ -1056,6 +1169,7 @@ else
<div class="asset-lane-slot" title="Scene @realAssetScene.SceneNumber: @realAssetScene.SceneTitle">
@foreach (var assetEvent in slot?.Events ?? Enumerable.Empty<AssetEvent>())
{
var assetMarkerTooltip = AssetMarkerTooltip(assetEvent, realAssetScene);
<a class="asset-marker"
asp-controller="Timeline"
asp-action="Index"
@ -1064,8 +1178,9 @@ else
asp-route-SelectedSceneID="@realAssetScene.SceneID"
asp-route-FocusType="asset"
asp-route-FocusID="@assetEvent.StoryAssetID"
title="@assetEvent.AssetName: @assetEvent.EventTitle">
@assetEvent.MarkerText
title="@assetMarkerTooltip"
aria-label="@assetMarkerTooltip">
@AssetMarkerLabel(assetEvent)
</a>
}
</div>
@ -1129,6 +1244,7 @@ else
<div class="character-lane-slot" title="Scene @realCharacterScene.SceneNumber: @realCharacterScene.SceneTitle">
@foreach (var appearance in slot?.Appearances ?? Enumerable.Empty<SceneCharacter>())
{
var characterMarkerTooltip = CharacterMarkerTooltip(appearance, realCharacterScene);
<a class="character-marker"
asp-controller="Timeline"
asp-action="Index"
@ -1137,8 +1253,9 @@ else
asp-route-SelectedSceneID="@realCharacterScene.SceneID"
asp-route-FocusType="character"
asp-route-FocusID="@appearance.CharacterID"
title="@appearance.CharacterName: @appearance.RoleInSceneTypeName / @appearance.PresenceTypeName">
@(!string.IsNullOrWhiteSpace(appearance.PresenceTypeName) ? appearance.PresenceTypeName.Substring(0, 1) : "C")
title="@characterMarkerTooltip"
aria-label="@characterMarkerTooltip">
@CharacterMarkerLabel(appearance)
</a>
}
</div>