Merge p16-w1-cms-grid-cleanup into dev (CMS grid cell layout fixes + per-track waveform regenerate buttons)

This commit is contained in:
daniel-c-harvey
2026-06-17 15:15:35 -04:00
3 changed files with 57 additions and 42 deletions
@@ -128,36 +128,38 @@ else
<MudTd DataLabel="#">@track.TrackNumber</MudTd> <MudTd DataLabel="#">@track.TrackNumber</MudTd>
<MudTd DataLabel="Track Name">@track.TrackName</MudTd> <MudTd DataLabel="Track Name">@track.TrackName</MudTd>
<MudTd DataLabel="Profile"> <MudTd DataLabel="Profile">
@if (HasProfile(track.EntryKey)) <MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
{ @if (HasProfile(track.EntryKey))
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Color="Color.Success" Size="Size.Small" /> {
} <MudTooltip Text="Profile generated">
else <MudIcon Icon="@Icons.Material.Filled.CheckCircle" Color="Color.Success" Size="Size.Small" />
{ </MudTooltip>
<MudTooltip Text="Generate profile"> }
<MudTooltip Text="@(HasProfile(track.EntryKey) ? "Regenerate profile" : "Generate profile")">
<MudIconButton Icon="@Icons.Material.Filled.GraphicEq" <MudIconButton Icon="@Icons.Material.Filled.GraphicEq"
Size="Size.Small" Size="Size.Small"
Color="Color.Secondary" Color="Color.Secondary"
Disabled="@_generating.Contains(track.EntryKey)" Disabled="@_generating.Contains(track.EntryKey)"
OnClick="@(() => GenerateProfileAsync(track))" /> OnClick="@(() => GenerateProfileAsync(track))" />
</MudTooltip> </MudTooltip>
} </MudStack>
</MudTd> </MudTd>
<MudTd DataLabel="High-res"> <MudTd DataLabel="High-res">
@if (HasHighRes(track.EntryKey)) <MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
{ @if (HasHighRes(track.EntryKey))
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Color="Color.Success" Size="Size.Small" /> {
} <MudTooltip Text="High-res datum generated">
else <MudIcon Icon="@Icons.Material.Filled.CheckCircle" Color="Color.Success" Size="Size.Small" />
{ </MudTooltip>
<MudTooltip Text="Generate high-res datum"> }
<MudTooltip Text="@(HasHighRes(track.EntryKey) ? "Regenerate high-res datum" : "Generate high-res datum")">
<MudIconButton Icon="@Icons.Material.Filled.Waves" <MudIconButton Icon="@Icons.Material.Filled.Waves"
Size="Size.Small" Size="Size.Small"
Color="Color.Secondary" Color="Color.Secondary"
Disabled="@_generatingHighRes.Contains(track.EntryKey)" Disabled="@_generatingHighRes.Contains(track.EntryKey)"
OnClick="@(() => GenerateHighResAsync(track))" /> OnClick="@(() => GenerateHighResAsync(track))" />
</MudTooltip> </MudTooltip>
} </MudStack>
</MudTd> </MudTd>
@* Per-track info tooltip (restored from the retired CmsTrackGrid's @* Per-track info tooltip (restored from the retired CmsTrackGrid's
.cms-track-info monospace block): EntryKey + OriginalFileName. *@ .cms-track-info monospace block): EntryKey + OriginalFileName. *@
@@ -94,33 +94,35 @@ else
@{ var row = RowFor(release); } @{ var row = RowFor(release); }
@if (row is not null) @if (row is not null)
{ {
@if (row.HasWaveform) <MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
{ @if (row.HasWaveform)
<MudTooltip Text="Waveform generated">
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Color="Color.Success" Size="Size.Small" />
</MudTooltip>
}
else
{
<MudTooltip Text="No waveform — incomplete">
<MudIcon Icon="@Icons.Material.Filled.Cancel" Color="Color.Warning" Size="Size.Small" />
</MudTooltip>
}
<MudButton Variant="Variant.Outlined"
Size="Size.Small"
StartIcon="@Icons.Material.Filled.GraphicEq"
Disabled="@row.IsGenerating"
OnClick="@(() => GenerateWaveformAsync(row))">
@if (row.IsGenerating)
{ {
<MudProgressCircular Class="mr-2" Size="Size.Small" Indeterminate="true" /> <MudTooltip Text="Waveform generated">
<span>Generating…</span> <MudIcon Icon="@Icons.Material.Filled.CheckCircle" Color="Color.Success" Size="Size.Small" />
</MudTooltip>
} }
else else
{ {
<span>@(row.HasWaveform ? "Regenerate" : "Generate")</span> <MudTooltip Text="No waveform — incomplete">
<MudIcon Icon="@Icons.Material.Filled.Cancel" Color="Color.Warning" Size="Size.Small" />
</MudTooltip>
} }
</MudButton> <MudButton Variant="Variant.Outlined"
Size="Size.Small"
StartIcon="@Icons.Material.Filled.GraphicEq"
Disabled="@row.IsGenerating"
OnClick="@(() => GenerateWaveformAsync(row))">
@if (row.IsGenerating)
{
<MudProgressCircular Class="mr-2" Size="Size.Small" Indeterminate="true" />
<span>Generating…</span>
}
else
{
<span>@(row.HasWaveform ? "Regenerate" : "Generate")</span>
}
</MudButton>
</MudStack>
} }
</text>; </text>;
@@ -85,13 +85,16 @@ else
protected override void OnInitialized() protected override void OnInitialized()
{ {
_specialColumns = new[] { new SpecialActionColumn("Hero", HeroCell) }; _specialColumns = new[]
{
new SpecialActionColumn("Hero", HeroThumbCell),
new SpecialActionColumn("", HeroButtonCell),
};
base.OnInitialized(); base.OnInitialized();
} }
// Per-row cell for the dedicated "Hero" column: thumbnail preview plus set/replace upload button with // Per-row cell for the "Hero" thumbnail column: just the image preview div.
// progress. Recovers the typed SessionRow via RowFor; skips rendering for a release not on the page. private RenderFragment<ReleaseDto> HeroThumbCell => release =>@<text>
private RenderFragment<ReleaseDto> HeroCell => release =>@<text>
@{ var row = RowFor(release); } @{ var row = RowFor(release); }
@if (row is not null) @if (row is not null)
{ {
@@ -103,6 +106,14 @@ else
{ {
<div class="cms-album-thumb cms-album-thumb--fallback"></div> <div class="cms-album-thumb cms-album-thumb--fallback"></div>
} }
}
</text>;
// Per-row cell for the "Hero Image" upload button column: set/replace upload button with progress.
private RenderFragment<ReleaseDto> HeroButtonCell => release =>@<text>
@{ var row = RowFor(release); }
@if (row is not null)
{
<MudFileUpload T="IBrowserFile" <MudFileUpload T="IBrowserFile"
Accept="image/*" Accept="image/*"
FilesChanged="@(file => UploadHeroAsync(row, file))" FilesChanged="@(file => UploadHeroAsync(row, file))"