Skip to content

fix(ui): make the module tab strip a scrollable single column - #171

Closed
DeepDiver1975 wants to merge 1 commit into
fix/wasserfoerderung-karte-zoomfrom
fix/module-tab-strip-small-screen
Closed

fix(ui): make the module tab strip a scrollable single column#171
DeepDiver1975 wants to merge 1 commit into
fix/wasserfoerderung-karte-zoomfrom
fix/module-tab-strip-small-screen

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Collaborator

Summary

Reported live, with a screenshot on a "relative small screen": the left module tab strip
(AUFBAU, ETB, ..., WASSERFÖRDERUNG, ABBAU) became unusable — WASSERFÖRDERUNG rendered directly
beside AUFBAU, ABBAU beside ETB, both crammed and unreadable.

Root cause: TabControl's TabStripPlacement="Left" (the "dispatch sidebar" rail in
Theme/Styles.axaml) relied on Avalonia's default items panel for that placement — a
vertically-oriented WrapPanel. Once the rail ran out of height for all 11 fixed-MinHeight-50
TabItems, it wrapped into a second column starting back at the top, exactly matching the
screenshot.

Forcing a single-column panel alone wasn't sufficient — confirmed via a headless test that
Avalonia's default template has no ScrollViewer around PART_ItemsPresenter at all, so
without wrapping, the last tabs would simply be clipped off the bottom edge with no way to reach
them (the same class of dead-end as the earlier Wasserförderung map zoom/pan bug fixed in #170,
just in the navigation rail this time).

Fix

Replaced TabControl's template with a small purpose-built one — this app only ever uses
TabStripPlacement="Left", so there's no need to handle other placements generically: a
single-column ItemsPresenter wrapped in its own ScrollViewer, laid out beside the content
host, instead of patching around Avalonia's default template's WrapPanel.

Verification

  • New ModuleTabStripLayoutTests.Tabs_stay_in_a_single_column_top_to_bottom_on_a_short_window:
    confirmed red before the fix (reproduced the exact Y-position jump backward that causes the
    visual overlap), green after — all tabs stay in one column (monotonically increasing Y), and
    the last tab (ABBAU) is reachable by scrolling the rail into view at a window height that
    genuinely needs it.
  • Full dotnet test LageBuch.sln: 948 tests passing, 1 pre-existing skip. This retemplates a
    control used throughout the whole app's navigation, so the full suite (extensively exercising
    tab switching) is the relevant regression check here, not just the new test.

Screenshot

Please paste /tmp/lagebuch-shots/module-tab-strip-small-screen-fixed.png into the PR body — I
can't upload images directly. It shows the rail scrolled to its bottom at a genuinely short
window: ATEMSCHUTZ through ABBAU all render single-column and legible, with a visible scrollbar
on the rail itself.

Checklist

  • Commits follow Conventional Commits and are DCO signed off (git commit -s)
  • dotnet build and dotnet test pass locally (948 tests, 1 pre-existing skip)
  • UI changes include before/after screenshots
  • No real master data / personnel data committed (screenshot uses fictional data)

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

https://claude.ai/code/session_01UwN31QccH98YV9eEc2bue2

Root cause (systematic-debugging, reported live with a screenshot on a
"relative small screen"): TabControl's TabStripPlacement="Left" (the
"dispatch sidebar" rail — Theme/Styles.axaml) used Avalonia's default
items panel, a vertically-oriented WrapPanel. Once the rail ran out of
height for all 11 fixed-MinHeight-50 TabItems, it wrapped into a second
column starting back at the top — WASSERFÖRDERUNG rendered directly
beside AUFBAU, ABBAU beside ETB, exactly as reported.

Forcing a single-column StackPanel alone wasn't enough: confirmed via a
headless test that Avalonia's default template has no ScrollViewer
around PART_ItemsPresenter at all, so without wrapping the last tabs
would have simply been clipped off the bottom edge with no way to reach
them — the same class of bug as the earlier Wasserförderung map
zoom/pan dead-end, just in the navigation rail instead.

Fix: replace TabControl's template with a small purpose-built one (this
app only ever uses TabStripPlacement="Left", so no need to handle other
placements) — a single-column ItemsPresenter wrapped in its own
ScrollViewer beside the content host, instead of patching Avalonia's
default template.

Verified headlessly: at a window short enough that the rail genuinely
needs it, all tabs stay in one column (monotonically increasing Y) and
the last tab (ABBAU) is reachable by scrolling the rail into view.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UwN31QccH98YV9eEc2bue2
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975

Copy link
Copy Markdown
Collaborator Author

Closing as redundant: this branch stacks on feat/wasserfoerderung-plan-a (#152), which forked from main before #151 merged — so this independently rediscovered and re-fixed the exact same left-rail wrapping bug #151 already solved on main (wrapping PART_ItemsPresenter in an unbounded-height ScrollViewer instead of replacing the WrapPanel). #151's fix is the one that should stand; this one is being dropped rather than reconciled. The whole Wasserförderung stack (#152#164#169#170 ← this) is being rebased onto current main to pick up #151 and everything else merged since.

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