On a touch screen a nerd-stats tooltip showed only through the browser faking hover, unreliably, and couldn't be scrolled. Where the pointer can't hover (AppStatusService.CanHover), a tap on a NerdTip now opens its rows in a sheet from the bottom; the trigger is focusable, says it opens a dialog, and is at least 44px on touch. A closed tooltip takes no room any more (daisyUI only made it transparent, and one past a card's edge made a phone's feed scroll sideways), and on touch it never shows. The rows are a component of their own (NerdRows), at 12px on phones. A card's More menu has a Details entry on phones that gathers the post's, its author's, its place's or CDN's and its counts' rows in one sheet. A picture's tip doesn't open on a tap, the picture does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
@inherits LocalizableComponentBase
|
|
|
|
@* A block of nerd stats: a monospace list of label/value rows under its heading, rows with no value left out; in a
|
|
NerdTip's tooltip, in the sheet a tap opens on a touch screen, and in a card's Details on a phone. *@
|
|
<div class="nerd-stats flex flex-col gap-1 text-left font-mono text-[11px] max-md:text-xs leading-tight max-w-80">
|
|
@if (Heading is { Length: > 0 })
|
|
{
|
|
<p class="font-bold opacity-80">@Heading</p>
|
|
}
|
|
<dl class="grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5">
|
|
@foreach (var row in Rows.Where(row => !string.IsNullOrEmpty(row.Value)))
|
|
{
|
|
<dt class="opacity-60 whitespace-nowrap">@row.Label</dt>
|
|
<dd class="break-all">@row.Value</dd>
|
|
}
|
|
</dl>
|
|
@if (Pending)
|
|
{
|
|
<p class="opacity-60">@Localizer["loading"]…</p>
|
|
}
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter] public string Heading { get; set; }
|
|
[Parameter] public IEnumerable<NerdRow> Rows { get; set; } = [];
|
|
/// <summary>Shown under the rows while the stats being read on demand arrive.</summary>
|
|
[Parameter] public bool Pending { get; set; }
|
|
|
|
protected override void OnInitialized() => IsLoading = false;
|
|
}
|