Show critical curation state in the editor and tables
This commit is contained in:
@@ -32,6 +32,15 @@
|
||||
<span> · Variant <strong>@Model.GroupLabel</strong></span>
|
||||
}
|
||||
</p>
|
||||
<div class="critical-editor-status-row">
|
||||
<span class="critical-editor-curation-badge @(Model.IsCurated ? "is-curated" : "needs-curation")">
|
||||
@(Model.IsCurated ? "Curated" : "Needs Curation")
|
||||
</span>
|
||||
@if (Model.SourcePageNumber is not null)
|
||||
{
|
||||
<span class="chip">Source page @Model.SourcePageNumber</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -67,6 +76,47 @@
|
||||
<p class="error-text critical-editor-error">@SaveErrorMessage</p>
|
||||
}
|
||||
|
||||
<section class="critical-editor-source-grid">
|
||||
<div class="critical-editor-card critical-editor-status-card">
|
||||
<div class="critical-editor-section-header">
|
||||
<div>
|
||||
<h4>Curation State</h4>
|
||||
<p class="muted">Curated cells are protected from importer content overwrites until you unmark them.</p>
|
||||
</div>
|
||||
</div>
|
||||
<label class="critical-editor-curation-toggle">
|
||||
<InputCheckbox @bind-Value="Model.IsCurated" />
|
||||
<span>Mark this result curated</span>
|
||||
</label>
|
||||
<p class="muted critical-editor-inline-copy">
|
||||
@(Model.IsCurated
|
||||
? "This result will keep its current text, branches, and effects on later imports."
|
||||
: "This result will be refreshed from the importer on later imports.")
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="critical-editor-card critical-editor-source-card">
|
||||
<div class="critical-editor-section-header">
|
||||
<div>
|
||||
<h4>Source Cell</h4>
|
||||
<p class="muted">Use the importer crop as a visual reference while curating the result.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(Model.SourceImageUrl))
|
||||
{
|
||||
<img
|
||||
class="critical-editor-source-image"
|
||||
src="@Model.SourceImageUrl"
|
||||
alt="@BuildSourceImageAltText(Model)" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="muted critical-editor-inline-copy">No source image is available for this cell yet.</p>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="critical-editor-section">
|
||||
<div class="critical-editor-section-header">
|
||||
<div>
|
||||
@@ -692,6 +742,23 @@
|
||||
? "This is the result that will be saved."
|
||||
: "This is the edited card before the last re-parse.";
|
||||
|
||||
private static string BuildSourceImageAltText(CriticalCellEditorModel model)
|
||||
{
|
||||
var segments = new List<string>
|
||||
{
|
||||
model.TableName,
|
||||
$"roll band {model.RollBand}",
|
||||
$"column {model.ColumnLabel}"
|
||||
};
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(model.GroupLabel))
|
||||
{
|
||||
segments.Add($"variant {model.GroupLabel}");
|
||||
}
|
||||
|
||||
return string.Join(", ", segments);
|
||||
}
|
||||
|
||||
private static IReadOnlyList<CriticalEffectLookupResponse> BuildPreviewEffects(CriticalCellEditorModel model) =>
|
||||
model.Effects
|
||||
.Select(CreatePreviewEffect)
|
||||
|
||||
Reference in New Issue
Block a user