Move tables actions into inspector

This commit is contained in:
2026-03-21 15:18:42 +01:00
parent 662640e5bd
commit fb6e5a4e86
7 changed files with 59 additions and 69 deletions

View File

@@ -79,9 +79,7 @@
RollJumpValue="rollJumpValue"
DensityMode="densityMode"
SelectedCell="selectedCell"
OnSelectCell="SelectCell"
OnOpenCuration="OpenCellCurationAsync"
OnOpenEditor="OpenCellEditorAsync" />
OnSelectCell="SelectCell" />
@if (isLegendOpen)
{
@@ -94,12 +92,19 @@
@if (tableDetail is not null)
{
<aside class="tables-reference-inspector-shell">
<TablesInspector SelectedCellDetail="SelectedCellDetail" />
<TablesInspector
SelectedCellDetail="SelectedCellDetail"
OnEdit="OpenSelectedCellEditorAsync"
OnCurate="OpenSelectedCellCurationAsync" />
</aside>
}
</div>
<TablesInspectorSheet SelectedCellDetail="SelectedCellDetail" OnClose="ClearSelectedCell" />
<TablesInspectorSheet
SelectedCellDetail="SelectedCellDetail"
OnClose="ClearSelectedCell"
OnEdit="OpenSelectedCellEditorAsync"
OnCurate="OpenSelectedCellCurationAsync" />
}
</section>
@@ -716,6 +721,16 @@
return Task.CompletedTask;
}
private Task OpenSelectedCellEditorAsync() =>
selectedCell is null
? Task.CompletedTask
: OpenCellEditorAsync(selectedCell.ResultId);
private Task OpenSelectedCellCurationAsync() =>
selectedCell is null
? Task.CompletedTask
: OpenCellCurationAsync(selectedCell.ResultId);
private Task ToggleLegend()
{
isLegendOpen = !isLegendOpen;

View File

@@ -51,28 +51,7 @@
@if (isSelectedCell)
{
<div class="critical-cell-selected-actions">
@if (!cell.IsCurated)
{
<button
type="button"
class="critical-cell-action-button is-curation"
title="Open the curation preview for this cell."
@onclick:stopPropagation="true"
@onclick="() => OnOpenCuration.InvokeAsync(cell.ResultId)">
Curate
</button>
}
<button
type="button"
class="critical-cell-action-button is-edit"
title="Open the full editor for this cell."
@onclick:stopPropagation="true"
@onclick="() => OnOpenEditor.InvokeAsync(cell.ResultId)">
Edit
</button>
</div>
<StatusChip Tone="accent">Selected</StatusChip>
}
</div>
@@ -101,8 +80,6 @@
</div>
</div>
<TablesLegend LegendEntries="@(Detail.Legend ?? Array.Empty<CriticalTableLegendEntry>())" />
@code {
private readonly Dictionary<(string RollBand, string? GroupKey, string ColumnKey), CriticalTableCellDetail> cellIndex = new();
private readonly List<(string? GroupKey, string ColumnKey, string ColumnLabel)> displayColumns = new();
@@ -134,12 +111,6 @@
[Parameter]
public EventCallback<TablesCellSelection> OnSelectCell { get; set; }
[Parameter]
public EventCallback<int> OnOpenCuration { get; set; }
[Parameter]
public EventCallback<int> OnOpenEditor { get; set; }
protected override void OnParametersSet()
{
cellIndex.Clear();

View File

@@ -1,8 +1,14 @@
<aside class="tables-inspector" aria-label="Selected result inspector">
<TablesInspectorContent SelectedCellDetail="SelectedCellDetail" />
<TablesInspectorContent SelectedCellDetail="SelectedCellDetail" OnEdit="OnEdit" OnCurate="OnCurate" />
</aside>
@code {
[Parameter]
public CriticalTableCellDetail? SelectedCellDetail { get; set; }
[Parameter]
public EventCallback OnEdit { get; set; }
[Parameter]
public EventCallback OnCurate { get; set; }
}

View File

@@ -35,6 +35,14 @@ else
</InspectorSection>
<InspectorSection Title="Result" Description="The selected critical result stays readable while you browse the grid.">
<div class="tables-inspector-actions">
@if (!cell.IsCurated)
{
<button type="button" class="btn btn-secondary" @onclick="OnCurate">Open curation</button>
}
<button type="button" class="btn btn-primary" @onclick="OnEdit">Open editor</button>
</div>
<CompactCriticalCell
Description="@(cell.Description ?? string.Empty)"
Effects="@(cell.Effects ?? Array.Empty<CriticalEffectLookupResponse>())"
@@ -45,4 +53,10 @@ else
@code {
[Parameter]
public CriticalTableCellDetail? SelectedCellDetail { get; set; }
[Parameter]
public EventCallback OnEdit { get; set; }
[Parameter]
public EventCallback OnCurate { get; set; }
}

View File

@@ -14,7 +14,7 @@
</header>
<div class="tables-inspector-sheet-body">
<TablesInspectorContent SelectedCellDetail="SelectedCellDetail" />
<TablesInspectorContent SelectedCellDetail="SelectedCellDetail" OnEdit="OnEdit" OnCurate="OnCurate" />
</div>
</section>
</div>
@@ -26,4 +26,10 @@
[Parameter]
public EventCallback OnClose { get; set; }
[Parameter]
public EventCallback OnEdit { get; set; }
[Parameter]
public EventCallback OnCurate { get; set; }
}