Refactor and enhance SenderPage grid and UI behavior

Refactored the `DxGrid` component in `SenderPage.razor` to improve readability, maintainability, and user experience. Added new grid properties like `HighlightRowOnHover` and `DetailExpandButtonDisplayMode`. Simplified and reorganized column and template structures.

Enhanced detail row behavior to handle row expansion and collapse more intuitively. Updated receiver and history displays with progress bars, badges, and improved styling.

Performed code cleanup by removing redundant blocks, consolidating logic, and eliminating unused variables. Refactored `ThemeService.LoadFromServerAsync` for better readability.

Made minor adjustments to the `CreateEnvelopeWizardPopup` configuration and improved general UI elements for better alignment, spacing, and styling.
This commit is contained in:
2026-11-11 14:07:19 +01:00
parent 26d41d9178
commit 47c4f33dfc

View File

@@ -243,7 +243,9 @@
CustomizeElement="OnCustomizeElement"
LayoutAutoLoading="OnGridLayoutAutoLoading"
LayoutAutoSaving="OnGridLayoutAutoSaving"
AutoCollapseDetailRow=true>
HighlightRowOnHover="true"
AutoCollapseDetailRow=true
DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto">
<Columns>
<DxGridDataColumn FieldName="Id" Caption="ID"
DisplayFormat="0"
@@ -316,6 +318,12 @@
<h6 style="font-weight: 600; color: #374151; margin-bottom: 0.75rem;">@L("Receiver", "Empfänger")</h6>
@{
var envelope = detailContext.DataItem as EnvelopeDto;
if(envelope is not null && _grid is not null)
{
_grid.SelectDataItem(envelope);
// _grid!.SelectedDataItem = envelope!;
}
if (envelope?.EnvelopeReceivers?.Any() == true)
{
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
@@ -1080,13 +1088,19 @@
var clicked = e.Grid.GetDataItem(e.VisibleIndex) as EnvelopeDto;
if (clicked == null) return;
if (_selectedEnvelope?.Id == clicked.Id)
if (e.Grid.IsDetailRowExpanded(e.VisibleIndex))
{
// Same row clicked again → deselect
// Already expanded → collapse and deselect
e.Grid.CollapseDetailRow(e.VisibleIndex);
_selectedEnvelope = null;
e.Grid.DeselectDataItem(clicked);
}
// Different row: @bind-SelectedDataItem already updated _selectedEnvelope
else
{
// Collapsed → expand and select
e.Grid.SelectDataItem(clicked);
e.Grid.ExpandDetailRow(e.VisibleIndex);
}
}
// Double-click: select the row and open preview popup