Skip to content

fix(forces,roles): show a status the Stammdaten lost, normalise Funktionen - #355

Merged
DeepDiver1975 merged 1 commit into
mainfrom
feat/status-role-catalogue-hint
Sep 16, 2026
Merged

DeepDiver1975 merged 1 commit into
mainfrom
feat/status-role-catalogue-hint

Conversation

@DeepDiver1975

@DeepDiver1975 DeepDiver1975 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The #302 item asked to validate ForceUnit.Status and RoleAssignment.Role against the
Stammdaten. Reading the views showed the Kräfte half cannot happen as described: both Status
inputs are ComboBoxes bound to StatusOptions (ForcesView.axaml:112 and :215), so they are
already a closed set and can never produce an off-catalogue value.

Probing it surfaced the real defect instead. With Stammdaten
[Alarmiert, Auf Anfahrt, Bereitstellungsraum, Im Einsatz] and a unit whose status is
"Einsatzbereit am Standort" — from an older Einsatz, an imported file, or a joined client on
different master data — the harness reported:

row.Status='Einsatzbereit am Standort' contains=False
combo sel='' box='' n=4

The cell has nothing to select, so it renders blank and the recorded status is invisible in the
grid. It is not written back as null, so this is a display failure rather than data loss — but
the status silently disappears from the Kräfteübersicht.

Funktion is genuinely free text (an AutoCompleteBox — ad-hoc and überörtliche roles must stay
enterable), so it gets the treatment the item described: normalise to the Stammdaten spelling on a
case/whitespace match, and hint without blocking when it is unknown.

Nothing is ever rejected. An Einsatz in progress must not be blocked by a missing Stammdaten row.

Screenshots

Kräfte — "FF Aich" holds the status Einsatzbereit am Standort, which the Stammdaten no longer list:

Before

After

Funktionen — an unknown Funktion is still assignable, now with a hint:

Funktionen hint

Changes

  • New StammdatenCatalogue helper (Normalize, IsUnknown, Including) with the layering
    rationale and a pointer to Should an incident carry the Stammdaten it was created under? #337
  • ForceRow carries the unit's own status in its StatusOptions when the catalogue lost it.
    Including compares ordinally and exactly, unlike Normalize — a picker matches its
    selection by equality, so a value differing only in case would render blank just the same
  • RolesViewModel.AddRole adopts the Stammdaten spelling; new IsNewRoleUnknown drives an amber
    hint in the dock, same idiom as ForcesView's DuplicateHint
  • Tests: 11 for the helper, 4 for RolesViewModel, 2 for ForcesViewModel, and 3 acceptance tests
    asserting what the Status cell actually displays — that is the level the bug lives at. The two
    bug-specific acceptance tests were confirmed to fail against main and pass with the fix; the
    third (a configured status renders unchanged) passes both ways as a control
  • Changelog entries under Fixed

Follow-up

This removes the symptom. The cause is that master data is global (masterdata.db) while the
values describing it live in the incident file, so an incident opened later is rendered through
today's catalogues. Whether an incident should carry its own Stammdaten snapshot is #337, filed
with the evidence — including that checklist templates already are snapshotted into the incident
(checklist_items), and that a joined client already takes the host's set over the wire.

This fix stays useful either way: a joined client on mismatched Stammdaten and a file imported from
another Feuerwehr both hit the same path.

Checklist

  • Commits follow Conventional Commits and are DCO signed off (git commit -s)
  • dotnet build and dotnet test pass locally (make ci, all eight projects)
  • UI changes include before/after screenshots
  • No real master data / personnel data committed (screenshots use the anonymized fixture)

Part of #302.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YavFrkz1GFaMNXbHQKsMyf

…ionen

The #302 item asked to validate ForceUnit.Status and RoleAssignment.Role
against the Stammdaten. Reading the views showed the Kräfte half cannot
happen as described: both Status inputs are ComboBoxes bound to
StatusOptions, so they are already a closed set and can never produce an
off-catalogue value.

Probing it surfaced the real defect instead. A status recorded in the
incident but missing from today's Stammdaten -- an older Einsatz, an
imported file, a joined client on different master data -- leaves the cell
with nothing to select, so it renders blank and the recorded status is
invisible. The value is not written back as null, so this is a display
failure, not data loss. That row's options now carry the unit's own status
so it shows and stays selectable.

Funktion is genuinely free text (an AutoCompleteBox: ad-hoc and
überörtliche roles must stay enterable), so it gets the planned treatment:
a Funktion matching the Stammdaten apart from case or spacing is recorded
with the Stammdaten spelling, and an unknown one is assigned as typed with
a non-blocking hint. Nothing is ever rejected -- an Einsatz in progress
must not be blocked by a missing Stammdaten row.

Whether an incident should carry its own Stammdaten snapshot instead, which
would remove this class of drift at the root, is issue #337.

Part of #302.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YavFrkz1GFaMNXbHQKsMyf
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 force-pushed the feat/status-role-catalogue-hint branch from b3b35e9 to cd69784 Compare September 15, 2026 23:06

@DeepDiver1975 DeepDiver1975 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcoapp recheck

@DeepDiver1975
DeepDiver1975 merged commit 6a71c64 into main Sep 16, 2026
5 checks passed
@DeepDiver1975
DeepDiver1975 deleted the feat/status-role-catalogue-hint branch September 16, 2026 20:36
DeepDiver1975 added a commit that referenced this pull request Sep 20, 2026
The changelog rule was never actually written down. AGENTS.md and
CONTRIBUTING.md said "add a changelog entry as its own file", which does not
say how many, and #431 arrived with seven fragments — one per commit,
describing a single feature layer by layer, plus an unrelated build fix.

State the rule in both places and in the PR template: exactly one entry per
pull request, describing what the change does for the reader rather than the
layers it was built in. A PR carrying an unrelated fix folds it into the same
entry; if the two cannot share an entry they are two pull requests.

Then make the existing fragments follow it. Seven merged pull requests had
contributed more than one entry, 22 files between them, now 7 — #313, #310,
#355, #390, #395, #411 and #431. The prose is rewritten rather than
concatenated, but nothing a reader would act on is dropped: schema versions,
migrated JSON keys, file-format compatibility, what changes on first open and
what stays untouched all survive, as do the ticket references. The remaining
27 fragments were already one-per-PR and are untouched.

`towncrier build --draft` renders 34 entries across Added, Changed, Fixed and
Security.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant