Skip to content

feat(etb): file entries under an Einsatzabschnitt and filter by it - #992

Open
DeepDiver1975 wants to merge 2 commits into
mainfrom
feat/971-etb-einsatzabschnitt
Open

DeepDiver1975 wants to merge 2 commits into
mainfrom
feat/971-etb-einsatzabschnitt

Conversation

@DeepDiver1975

@DeepDiver1975 DeepDiver1975 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ETB entries can now be filed under an Einsatzabschnitt and the ETB filtered by it.

  • Entry line: an ABSCHNITT strip with one chip per live Abschnitt and Unterabschnitt, in the Organisation's order. Nothing is chosen at first. The strip is hidden while the incident has none, and it wraps on a phone. The choice is sticky: it stays lit for the next entry, and tapping it again clears it. Radio traffic from one Abschnitt comes in runs, and the lit chip sits right above the field, so the choice is always in view. VON stays non-sticky, because a leftover sender has no such sign.
  • Edit button: the edit panel gains an ABSCHNITT picker (the shared NodeChoicePicker, including "— nicht zugeordnet —") to set, change or remove the Abschnitt. SPEICHERN writes it. When the entry's Abschnitt has since been dissolved, the picker still shows it under its stored name.
  • Quick filter: above the table header there is "Alle" plus one chip per Abschnitt. A dissolved Abschnitt that entries are still filed under stays in the list under its stored name. The filter combines with "Nur Lagemeldungen" and "Systemmeldungen ausblenden" in IsVisible.
  • Rows: a small Abschnitt badge in EINTRAG, on the wide grid and on the phone cards.
  • PDF: a small "Abschnitt Nord" line above the entry text in EtbSection. A sixth column would have squeezed every row for the few that carry one.

How it is stored

As the issue asks, the Abschnitt is stored as a value on the entry. EtbEntry gains SectionId and SectionName:

  • SectionId is what the filter matches, so a rename does not split the filter.
  • SectionName is the Incident.NodeLabel at the moment of assignment (e.g. "Süd / Tiefgarage"), so the entry still reads as it did after a rename or dissolve. A test pins this.

Domain rules:

  • Incident.AddJournalEntry takes an optional sectionId.
  • New Incident.AssignJournalEntrySection(clock, op, entryId, Guid?) sets, changes or removes the Abschnitt. It writes a System line ("ETB-Eintrag 14:00 → Süd" / "…: Abschnitt aufgehoben (vorher Nord)") and is a no-op when nothing changes.
  • Refused, with German messages: app-written entries (System and Messwerte), a Bereitstellung, a partner Einsatzleitung, a dissolved node, and an unknown id.

Versions — rebase/renumber needed

  • Migration V46: etb_entries.section_id and section_name, both nullable. Also added to SchemaGuard.ExpectedColumns.
  • Protocol 44 / floor 44:
    • AddJournalEntryCommand gets a defaulted SectionId = null, so an older client's entry is simply filed nowhere.
    • The new client-sent assignJournalEntrySection command means a host at 43 cannot deserialize it, so the floor rises too.
    • As feat(aufgaben): set the time until the reminder directly #988 did, the VersionHandshakeTests pins for 41–43 are loosened to floor ≤ protocol.

The overlapping open PRs #988, #989 and #990 all branch from main, and this PR is not stacked on any of them. Whichever lands first, this one has to be rebased afterwards:

Screenshots

Before (origin/main): no Abschnitt anywhere in the ETB.

Before: ETB on main

After: quick filter "Alle", badges on the filed rows, entry strip in the dock.

After: ETB with Abschnitt strip, quick filter and badges

After: quick filter on "Süd".

After: quick filter on Süd

After: edit panel with the Abschnitt picker, entry strip with "Nord" chosen (sticky).

After: edit panel with Abschnitt picker

Tests

  • Domain (EtbSectionAssignmentTests): add and assign rules, refused kinds, app-written entries refused, no-op, System line text, a rename or dissolve keeps the stored name, a text edit keeps the Abschnitt, closed incident, Rehydrate.
  • Persistence: V45→V46 migration, repository round trip by id and stored name; SchemaReconciliationTests green.
  • Sync:
    • command serialization, including an addJournalEntry without sectionId from an old client;
    • applier: file, move and remove; a System entry is refused;
    • snapshot round trip;
    • handshake pins;
    • a host/client round trip in WorkspaceCollaborationTests.
  • AppLogic (EtbSectionViewModelTests): strip contents, sticky choice and toggling it off, a dissolved Abschnitt leaving the strip, filter combinations with both checkboxes, a dissolved Abschnitt in the filter, edit picker set/change/remove, an assignment from elsewhere.
  • Documents: the PDF prints the stored name.
  • Acceptance (EtbSectionStripTests): strips hidden without Abschnitte, a chip files the entry and the grid shows the badge, the quick filter narrows the grid, the edit picker is shown. With RENDER_OUT set, it also writes the screenshots above.

Evidence

  • make clean ci: every assembly passed except LageBuch.Sync.Hosting.Tests, where 59 tests failed with the known local "inotify instances (128)" limit. Rerun alone with DOTNET_hostBuilder__reloadConfigOnChange=false: 264/264 passed. The follow-up test commit's new tests were also run on their own: Domain 19/19, AppLogic 19/19, WorkspaceCollaboration 20/20.

  • make format-check: clean.

  • make codeql: 0 results on lines changed since origin/main.

  • make mutate SINCE=origin/main BREAK=80 (score on changed lines):

    Project Score
    Domain 88.9 %
    Persistence 100 %
    Sync 100 %
    Documents 100 %
    AppLogic 92.1 %

    The remote session's AddJournalEntry statement carries a Stryker disable once, because only Sync.Hosting.Tests drive it, as with AddChecklist. It is covered there by a new host/client round trip.

Fixes #971

🤖 Generated with Claude Code

DeepDiver1975 and others added 2 commits November 19, 2026 13:45
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 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
…d trip

Kills the surviving mutants of the diff mutation run on the ETB view
model's Abschnitt strips and edit picker, covers a joined device filing
and moving an entry through the host, and records why the remote
session's AddJournalEntry is not mutated by the Sync project's run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8d1296a and ed50e7f.

Files selected for processing: 30

  • changelog.d/+etb-einsatzabschnitt.added.md
  • src/LageBuch.App.Shared/Views/EtbView.axaml
  • src/LageBuch.AppLogic/LocalIncidentSession.cs
  • src/LageBuch.AppLogic/ViewModels/EtbViewModel.cs
  • src/LageBuch.AppLogic/ViewModels/NodeChoices.cs
  • src/LageBuch.Documents/Sections/EtbSection.cs
  • src/LageBuch.Domain/Etb/EtbEntry.cs
  • src/LageBuch.Domain/Incident.cs
  • src/LageBuch.Persistence/IncidentRepository.cs
  • src/LageBuch.Persistence/Sqlite/Migrations.cs
  • src/LageBuch.Persistence/Sqlite/SchemaGuard.cs
  • src/LageBuch.Sync/CommandApplier.cs
  • src/LageBuch.Sync/IIncidentSession.cs
  • src/LageBuch.Sync/IncidentSnapshot.cs
  • src/LageBuch.Sync/RemoteIncidentSession.cs
  • src/LageBuch.Sync/SnapshotMapper.cs
  • src/LageBuch.Sync/SyncCommand.cs
  • src/LageBuch.Sync/SyncProtocol.cs
  • tests/LageBuch.Acceptance.Tests/EtbSectionStripTests.cs
  • tests/LageBuch.AppLogic.Tests/CoMessprotokollViewModelTests.cs
  • tests/LageBuch.AppLogic.Tests/EtbSectionViewModelTests.cs
  • tests/LageBuch.Documents.Tests/EtbSectionTests.cs
  • tests/LageBuch.Domain.Tests/EtbSectionAssignmentTests.cs
  • tests/LageBuch.Persistence.Tests/IncidentRoundTripTests.cs
  • tests/LageBuch.Persistence.Tests/MigrationsTests.cs
  • tests/LageBuch.Sync.Hosting.Tests/WorkspaceCollaborationTests.cs
  • tests/LageBuch.Sync.Tests/CommandApplierTests.cs
  • tests/LageBuch.Sync.Tests/CommandSerializationTests.cs
  • tests/LageBuch.Sync.Tests/SnapshotRoundTripTests.cs
  • tests/LageBuch.Sync.Tests/VersionHandshakeTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ETB: assign entries to an Einsatzabschnitt and filter by it

1 participant