using ScadaLink.Commons.Entities.Audit; using ScadaLink.Commons.Types.Audit; namespace ScadaLink.CentralUI.Components.Pages.Audit; /// /// Code-behind for the central Audit Log page (#23 M7). Bundle B (M7-T2 + M7-T3) /// wires up AuditFilterBar and AuditResultsGrid: the page owns the /// active and re-pushes a fresh instance to the /// grid on every Apply (the grid uses reference identity as its "reload" /// trigger). Row clicks land in — Bundle C wires /// this to the drilldown drawer; for now it is a no-op seam so test stubs do /// not error. /// public partial class AuditLogPage { private AuditLogQueryFilter? _currentFilter; private AuditEvent? _selectedEvent; private bool _drawerOpen; private void HandleFilterChanged(AuditLogQueryFilter filter) { // Always reassign — the grid keys reloads on reference change, so even a // chip-for-chip identical filter must allocate a fresh instance. _currentFilter = filter; } private void HandleRowSelected(AuditEvent row) { // Bundle C: a grid row click hands us the full AuditEvent. We pin it as // the selected row and open the drilldown drawer — the drawer is fully // presentational so we do not need to refetch the row. _selectedEvent = row; _drawerOpen = true; } private void HandleDrawerClose() { // We deliberately keep _selectedEvent set so re-opening (e.g. via the // grid) shows the same row instantly without a re-render flicker. _drawerOpen = false; } }