From 502b8cedef4febda3cad34d957d376c8adc8236c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Thu, 19 Nov 2026 13:45:22 +0100 Subject: [PATCH 1/4] feat(etb): file entries under an Einsatzabschnitt and filter by it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An ETB entry can now be assigned to a live Abschnitt or Unterabschnitt: from a sticky chip strip in the entry line, or from an Abschnitt picker in the edit panel that also changes or removes it. A quick filter above the table shows one Abschnitt at a time and combines with "Nur Lagemeldungen" and "Systemmeldungen ausblenden". Filed rows carry a badge in the grid and the phone cards, and the PDF prints the Abschnitt above the entry text. The entry stores the Abschnitt by id (for the filter) and by the label it had when filed (for display), so it reads the same after a rename or a dissolve. App-written entries, Bereitstellungen, partner Einsatzleitungen and dissolved nodes are refused; every change writes a System line. Migration V46 adds etb_entries.section_id/section_name. A client may now send assignJournalEntrySection and addJournalEntry carries an optional sectionId, so ProtocolVersion and MinimumProtocolVersion rise to 44. Fixes #971 Co-Authored-By: Claude Opus 5.5 Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> --- changelog.d/+etb-einsatzabschnitt.added.md | 1 + src/LageBuch.App.Shared/Views/EtbView.axaml | 85 ++++++ src/LageBuch.AppLogic/LocalIncidentSession.cs | 7 +- .../ViewModels/EtbViewModel.cs | 246 ++++++++++++++- .../ViewModels/NodeChoices.cs | 19 ++ src/LageBuch.Documents/Sections/EtbSection.cs | 8 + src/LageBuch.Domain/Etb/EtbEntry.cs | 27 +- src/LageBuch.Domain/Incident.cs | 78 ++++- .../IncidentRepository.cs | 10 +- src/LageBuch.Persistence/Sqlite/Migrations.cs | 19 +- .../Sqlite/SchemaGuard.cs | 2 + src/LageBuch.Sync/CommandApplier.cs | 5 +- src/LageBuch.Sync/IIncidentSession.cs | 5 +- src/LageBuch.Sync/IncidentSnapshot.cs | 4 +- src/LageBuch.Sync/RemoteIncidentSession.cs | 7 +- src/LageBuch.Sync/SnapshotMapper.cs | 8 +- src/LageBuch.Sync/SyncCommand.cs | 7 +- src/LageBuch.Sync/SyncProtocol.cs | 10 +- .../EtbSectionStripTests.cs | 167 +++++++++++ .../CoMessprotokollViewModelTests.cs | 6 +- .../EtbSectionViewModelTests.cs | 281 ++++++++++++++++++ .../EtbSectionTests.cs | 19 ++ .../EtbSectionAssignmentTests.cs | 241 +++++++++++++++ .../IncidentRoundTripTests.cs | 25 ++ .../MigrationsTests.cs | 32 ++ .../CommandApplierTests.cs | 47 +++ .../CommandSerializationTests.cs | 28 ++ .../SnapshotRoundTripTests.cs | 19 ++ .../VersionHandshakeTests.cs | 17 +- 29 files changed, 1399 insertions(+), 31 deletions(-) create mode 100644 changelog.d/+etb-einsatzabschnitt.added.md create mode 100644 tests/LageBuch.Acceptance.Tests/EtbSectionStripTests.cs create mode 100644 tests/LageBuch.AppLogic.Tests/EtbSectionViewModelTests.cs create mode 100644 tests/LageBuch.Domain.Tests/EtbSectionAssignmentTests.cs diff --git a/changelog.d/+etb-einsatzabschnitt.added.md b/changelog.d/+etb-einsatzabschnitt.added.md new file mode 100644 index 000000000..c68c50357 --- /dev/null +++ b/changelog.d/+etb-einsatzabschnitt.added.md @@ -0,0 +1 @@ +ETB entries can be filed under an Einsatzabschnitt from the entry line or the edit panel, carry the Abschnitt as a badge in the grid and in the PDF, and a quick filter above the table shows one Abschnitt at a time (#971). diff --git a/src/LageBuch.App.Shared/Views/EtbView.axaml b/src/LageBuch.App.Shared/Views/EtbView.axaml index 3ce574ffe..25ec08c3e 100644 --- a/src/LageBuch.App.Shared/Views/EtbView.axaml +++ b/src/LageBuch.App.Shared/Views/EtbView.axaml @@ -37,6 +37,37 @@ + + + + + + @@ -119,6 +150,28 @@ IsChecked="{Binding HideSystemEntries}" /> + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - + + + diff --git a/tests/LageBuch.Acceptance.Tests/EtbSectionStripTests.cs b/tests/LageBuch.Acceptance.Tests/EtbSectionStripTests.cs index 96f09969a..0e449431b 100644 --- a/tests/LageBuch.Acceptance.Tests/EtbSectionStripTests.cs +++ b/tests/LageBuch.Acceptance.Tests/EtbSectionStripTests.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using Avalonia.Controls; +using Avalonia.Controls.Primitives; using Avalonia.Headless; using Avalonia.Headless.XUnit; using Avalonia.Threading; @@ -15,7 +16,7 @@ namespace LageBuch.Acceptance.Tests; -// #971: the ETB's Einsatzabschnitt picker in the entry line, the quick filter above the grid and +// #971: the ETB's Einsatzabschnitt picker among the dock's fields, the quick filter above the grid and // the Abschnitt badge on a filed row. With RENDER_OUT set it also writes the PR screenshots. public class EtbSectionStripTests { @@ -60,6 +61,9 @@ private static T Named(Window window, string name) private static List