@($"[{entry.Number}] ")
@if (this.IsMissing(entry))
{
@* A link would only fail. The warning next to the entry says why: *@
@entry.Title
}
else if (entry.Document is { } pagedDocument && entry.Location is { } location)
{
@* Each page the AI read is a link of its own, which opens the document there. The
name would only open it at one of them, so it is no link. *@
@($"{entry.Name} ({location.Prefix}")
@for (var rangeIndex = 0; rangeIndex < location.Ranges.Count; rangeIndex++)
{
var pageRange = location.Ranges[rangeIndex];
if (rangeIndex > 0)
{
@PassageLocation.RANGE_SEPARATOR
}
@pageRange
}
@($"{location.Suffix})")
}
else if (entry.Document is { } document)
{
@* Inline rather than the usual inline block: a long title, e.g., one naming many
parts, then wraps like text right after its number instead of moving below it. *@
@entry.Title
}
else if (entry.HasNoLink)
{
@* Nothing opens a mail by its address yet, nor what only a data source knows, so a link would lead nowhere. *@
@entry.Title
}
else
{
@entry.Title
}
@* The passages come last, so their button lines up at the right edge also where a
source has no file to show. The tooltips open to the left, where there is room
for them; above a button at the edge, they would be pushed around and cover the
row above. They show on hover only: the focus comes back to the button when the
dialog closes, or the file manager does, and a tooltip shown on focus would then
stay until the user clicks somewhere else. The title opens the file or the page,
so the actions only copy and find it; a mail gets none, see FileActions. *@
@if (entry.Passages.Count > 0)
{
}
}