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; }
}

View File

@@ -1366,6 +1366,13 @@ pre,
gap: 0.75rem;
}
.tables-inspector-actions {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-bottom: 0.85rem;
}
.tables-inspector-kicker {
margin: 0 0 0.2rem;
color: var(--ink-soft);
@@ -1703,41 +1710,10 @@ pre,
flex-wrap: wrap;
}
.critical-cell-selected-actions {
display: inline-flex;
align-items: center;
gap: 0.35rem;
margin-left: auto;
}
.tables-cell-status-indicator {
min-height: 1rem;
}
.critical-cell-action-button {
border: 1px solid rgba(127, 96, 55, 0.18);
border-radius: 999px;
padding: 0.3rem 0.7rem;
background: rgba(255, 252, 247, 0.92);
color: #5b4327;
font-size: 0.82rem;
line-height: 1.2;
}
.critical-cell-action-button.is-curation {
background: rgba(255, 242, 223, 0.95);
border-color: rgba(184, 121, 59, 0.28);
color: #8a5b21;
}
.critical-cell-action-button.is-edit {
margin-left: 0;
}
.critical-cell-action-button:hover {
background: rgba(255, 248, 236, 0.98);
}
.critical-table-grid .critical-cell {
display: flex;
flex-direction: column;