Skip to content

CO-Messung: UG usually have different layouts than OG/EG #265

Closed

Description

@DeepDiver1975

as of today UGs have the same structure (number of units) as the EG/OG. This does not match the reality.

in reality there are much more smaller units in an OG and can be wildly laid out.
Each unit mush have a free text field to define the identity of a UG unit (number, name of owner ...)

This requires creative thinking on how to implement this.

Maybe a simple list per UG with id -> ppm + key + status

Activity

  1. DeepDiver1975 commented on Sep 7, 2026

    @DeepDiver1975
    ContributorAuthor

    @claude analyse and come up with options we have from an UX/UI perspective - be blunt

  2. claude commented on Sep 7, 2026

    @claude

    Claude finished @DeepDiver1975's task in 2m 29s —— View job


    UX/UI analysis: UG layouts vs. EG/OG in CO-Messprotokoll

    How it works today (and why UG breaks it)

    CoMessprotokollView is a strict matrix: one shared row of column headers (ApartmentColumns), and one row per floor (MatrixRows), UG through OG, all sharing those same columns. The uniformity comes from a single field, Building.ApartmentsPerFloor (src/LageBuch.Domain/CoMeasurement/Building.cs:16), applied to every floor when the grid is built (CoMessprotokollViewModel.cs:257-274). There is no per-floor unit count and no per-floor labels — SetApartmentLabel only takes a Building + apartment number, not a floor (CoMessprotokollViewModel.cs:296, Incident.cs:878-1040).

    Blunt read: the column header is already a lie for ordinary floors, UG just makes it obvious. "Column 3" is not an identity, it's an array index. Renaming column 3 to "Müller" relabels apartment 3 on every floor of the building, EG through the top OG, not just the one you're looking at. Regular buildings get away with this because floors genuinely tend to stack 1:1 (Whg. 3 really is above Whg. 3). Basements never stack that way — Kellerabteile, Technikräume, Garagen, Hausanschlussraum don't correspond 1:1 to the flats above them, there are usually more small units than apartments, and they need free-text identity (owner name / Kellerabteil number), not a shared column index. The issue is really exposing a modeling bug that was always there, not a UG-specific quirk.

    Options

    A. Bolt a free-form list onto UG floors only (the issue's own suggestion — id / ppm / key / status), keep the matrix for EG/OG.
    Cheapest to build: reuse Dwelling as-is, just render UG floor rows as cards instead of grid cells. But it puts two different interaction models on one screen — a spatial grid above meaning "this cell is a specific place," and a plain list below meaning "these are arbitrary entries with no positional meaning." Users have to switch mental models mid-scroll, and the add/remove affordance for list rows won't look anything like the fixed grid controls above it. It reads exactly like what it is: a patch, not a fix. Ships fast, looks bolted-on forever.

    B. Fix the model: make unit count and unit labels per-floor everywhere, keep one visual language.
    ApartmentsPerFloor becomes a per-floor override (default inherited, overridable per FloorOrdinal, same pattern already used for FloorDescriptions, Building.cs:18); ApartmentLabels becomes keyed by (FloorOrdinal, ApartmentNumber) instead of apartment number alone. Visually nothing changes — still the same colored tiles, same glyph/ppm/key layout — a UG row just renders fewer (or more) tiles, each with its own free-text label instead of a shared header cell. Drop the shared header row entirely (it's semantically bankrupt once column counts diverge, and today it's the only place Label is actually rendered — the tile itself never shows it, CoMessprotokollViewModel.cs:65-74 vs the XAML tile at CoMessprotokollView.axaml:242-260 — so put the label on the tile itself while you're in there, header or not).

    This is real work, not a coat of paint: Incident.AddCoBuilding/UpdateCoBuildingStructure (Incident.cs:878-931) eagerly materializes one Dwelling per (floor, apartment) off the single count and needs a per-floor count instead; the sync DTO (IncidentSnapshot.cs:143) and SQLite schema (Migrations.cs) both encode the building-wide ApartmentsPerFloor/label shape and need a migration. But it's bounded — Dwelling itself already keys on (BuildingId, FloorOrdinal, ApartmentNumber), so nothing about the storage shape has to change, only how the count/labels are declared. And "columns line up vertically across floors" was never real information once floor layouts genuinely differ — you lose nothing by admitting that.

    C. Replace the matrix everywhere with a free-form per-floor list.
    Rejected. This throws away the one thing the grid is actually good for — glance-and-color-block search-progress across a whole regular building — to fix a case the issue itself says is the exception (EG/OG "usually" match). Don't redesign the common case around the edge case.

    D. A real floor-plan editor (irregular room shapes, drawn layout).
    Rejected, harder than either A or B, and it's the wrong tool: this is a door-to-door search/CO tracker used under time pressure, not CAD. Nobody is going to draw a floor plan mid-incident.

    Recommendation

    Do B. A is a real option only if there's a hard deadline this week and B can follow later — but be aware A is user-visible debt the moment it ships (two UI languages on one screen), and every UG floor built under A will need re-entry once B lands since it's a different shape. If schedule allows it, skip A and go straight to B — it's more files touched, not more design risk, and it fixes a labeling bug that already exists on ordinary floors today.

    Not implementing either option here — this was requested as analysis, not a change. Happy to scope out B in more detail (data model diff, migration shape, view changes) if you want to move on it.

  3. DeepDiver1975 commented on Sep 7, 2026

    @DeepDiver1975
    ContributorAuthor

    @claude implement A and B in two dedicated PRs

  4. claude commented on Sep 7, 2026

    @claude

    Claude finished @DeepDiver1975's task in 37m 42s —— View job • claude/issue-265-20260907-2107 • Create PR ➔


    Done

    • Gather context: re-read CoMessprotokollView/ViewModel, Building, Incident, Dwelling, sync DTO/commands, SQLite persistence, CoMessprotokollSection (PDF)
    • PR A — bolt-on free-form list for UG floors (id/ppm/key/status), matrix kept for EG/OG
    • PR B — per-floor unit counts + per-floor free-text labels, shared header row dropped, label shown on tile
    • Build/test both (full solution test suite green on each: Domain, AppLogic, Sync, Persistence, Documents, Acceptance/render tests, incl. new tests for both options and a SQLite migration test for pre-CO-Messung: UG usually have different layouts than OG/EG #265 label data)
    • Push and post PR links

    PR A — free-form UG unit list

    Reuses Dwelling as-is per the earlier analysis. UG floors (FloorOrdinal < 0) render as a variable-length card list instead of the fixed EG/OG grid, with add/remove per unit (Incident.AddUndergroundUnit/RemoveUndergroundUnit, independent of ApartmentsPerFloor). The editor sidebar's free-text field doubles as a unit's identity for UG. Also fixed a related bug along the way: CoMeasurementLabels.DwellingLocation no longer lets a custom OG column label leak onto a same-numbered UG unit, and the PDF export now lists UG units individually so ones beyond ApartmentsPerFloor aren't silently dropped from the printed protocol.

    PR B — per-floor counts and labels everywhere

    The deeper fix: every floor (EG/OG and UG alike) now owns its own Wohnungen count (Building.ApartmentCounts, per-floor override of the default ApartmentsPerFloor) and its own unit labels (ApartmentLabels now keyed by floor+apartment, not apartment number alone). Incident.SetApartmentCount grows/trims one floor's Dwellings without touching any other floor. The shared apartment-column header is gone entirely — each tile shows its own label (editable via the sidebar), and each floor row gets its own count control. PDF export now lists each floor's units individually since column counts vary per floor. SQLite gains an apartment_counts column (schema V20); a pre-#265 apartment_labels payload (keyed by apartment number alone) is migrated to apply across every floor that existed when it was saved, so existing custom labels survive the upgrade.

    Create a PR

    Caveats worth knowing before merging either

    • One branch, two stacked-then-unstacked commits. This sandbox only lets me git add/commit/push-to-the-branch-already-assigned-to-this-run — creating a second branch was blocked (requires interactive approval I can't grant here). So both options live as commits on claude/issue-265-20260907-2107: commit 4c2e98a is Option A, then d1e2a90 reverts it back to a clean baseline, then 8dc52b6 is Option B. Each "Create a PR" link above points at the right commit SHA so each PR's Files changed tab shows exactly one option's diff — but PR B's Commits tab will show 3 commits (add A, revert A, add B) instead of a clean single-commit history, since GitHub can't hide the intermediate ones. Content is correct either way; history is just not tidy. If that's not acceptable, the cleanest fix is to open a real second branch yourself (e.g. git branch option-b 8dc52b6 && git push) and I'm happy to help squash from there.
    • Commits are unsigned. AGENTS.md's documented workaround (git commit with the sandbox disabled) didn't produce a gpgsig here either — verified with git cat-file commit HEAD. Something about this environment's signing setup didn't come through; flagging so it doesn't look overlooked.
    • No screenshots attached. AGENTS.md asks for before/after PNGs via gh --attach, but this flow doesn't have gh PR-creation/attach access (only push), and most non-git shell commands in this sandbox required approval I couldn't grant non-interactively. I did verify both UIs render correctly via the existing headless Skia acceptance-test harness (new passing tests: CoMessprotokoll_UndergroundList_RendersFreeFormUnits for A, CoMessprotokoll_PerFloorApartmentCount_RendersIndependently for B) — that's real rendering verification, just not a PNG in this comment.
    • A and B are alternatives, not additive — per the original analysis, shipping both would be contradictory (they solve the same problem differently). Pick one; I'd lean toward B per the earlier recommendation, but A is the cheaper/faster option if there's schedule pressure.
  5. DeepDiver1975 commented on Sep 8, 2026

    @DeepDiver1975
    ContributorAuthor

    fixed in #268

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions