Skip to content

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

Merged
DeepDiver1975 merged 4 commits into
mainfrom
feat/971-etb-einsatzabschnitt
Nov 24, 2026
Merged

DeepDiver1975 merged 4 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 dropdown in the row of fields, between AN and EINTRAG, with the same header and chevron as VON and AN. It is the same NodeChoicePicker as the edit panel: "— nicht zugeordnet —" plus every live Abschnitt and Unterabschnitt, in the Organisation's order. "nicht zugeordnet" is chosen at first, and the dropdown is hidden while the incident has no Abschnitt. The choice is sticky: it stays for the next entry, and picking "nicht zugeordnet" clears it. Radio traffic from one Abschnitt comes in runs, and the closed dropdown names the Abschnitt in force right beside 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

Rebased onto main, which took V46 and protocol 44 for the raster Kartenebenen (#993) and protocol 45 for the numbered CSA-Trupp (#996); this PR is renumbered above them.

  • Migration V47: etb_entries.section_id and section_name, both nullable. Also added to SchemaGuard.ExpectedColumns.
  • Protocol 46 / floor 46:
    • 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 45 cannot deserialize it, so the floor rises too.
    • The VersionHandshakeTests pins for 44 and 45 are loosened to "at least", and a new pin holds 46/46.

Screenshots

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

Before: ETB on main

After: quick filter "Alle", badges on the filed rows.

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. Before the dropdown, the entry line still had a chip strip, visible here with "Nord" chosen.

After: edit panel with Abschnitt picker

After: the Abschnitt dropdown between AN and EINTRAG, with "Nord" chosen (sticky).

After: Abschnitt dropdown in the entry line

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: V46→V47 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): entry dropdown contents, sticky choice and clearing it with "nicht zugeordnet", a dissolved Abschnitt leaving the dropdown, 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, the entry dropdown 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

After the rebase onto c4d4a1fd and the dropdown commits:

  • make clean ci: all 9 test assemblies passed (7,547 tests), 0 warnings.
  • make format-check: clean.
  • make codeql: 0 results.

Fixes #971

🤖 Generated with Claude Code

@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 5 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 c4d4a1f and 23dd5b9.

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

@DeepDiver1975

DeepDiver1975 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Entry line: the Abschnitt is now picked from a dropdown, the same picker as the edit panel.

Before: chip strip in the entry line.

Before: chip strip

After: dropdown with "Nord" chosen.

After: Abschnitt dropdown in the entry line

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

DeepDiver1975 and others added 4 commits November 24, 2026 22:11
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 <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>
…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 <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>
The entry line filed a new ETB entry through a strip of chips, one per
Abschnitt. It now uses the same NodeChoicePicker as the edit panel:
"nicht zugeordnet" plus every live Abschnitt and Unterabschnitt, the
closed picker naming the one in force. The choice stays sticky; picking
"nicht zugeordnet" replaces the second tap that used to clear it. The
quick filter above the grid keeps its chips.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>
The entry line's Abschnitt picker sat on a line of its own above the
fields. It is now a field in the dock's row, after AN and before
EINTRAG, with the same header and chevron as VON and AN and their
width; on a phone it fills the line like the others.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>
@DeepDiver1975
DeepDiver1975 force-pushed the feat/971-etb-einsatzabschnitt branch from e33259f to 23dd5b9 Compare November 24, 2026 21:21
@DeepDiver1975

DeepDiver1975 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

The Abschnitt dropdown now sits in the row of fields, between AN and EINTRAG, with the same header and chevron as VON and AN.

Before: on its own line above the fields.

Before: dropdown above the fields

After:

After: dropdown between AN and EINTRAG

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@DeepDiver1975
DeepDiver1975 merged commit 11b85a7 into main Nov 24, 2026
18 checks passed
@DeepDiver1975
DeepDiver1975 deleted the feat/971-etb-einsatzabschnitt branch November 24, 2026 21:37
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