Skip to content

fix(gui): Connect to Radio auto-fit leaves room for a horizontal scrollbar. Principle VIII. - #6540

Open
NF0T wants to merge 1 commit into
aethersdr:mainfrom
NF0T:fix/5811-connection-panel-growth
Open

NF0T wants to merge 1 commit into
aethersdr:mainfrom
NF0T:fix/5811-connection-panel-growth

Conversation

@NF0T

@NF0T NF0T commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #5811.

This fixes the last open item in #5811. The others are already resolved on main:

#5811 ask Resolved by
The three a11y announcement tests fail with got [] under offscreen Passing on main since cd4c2b68d (ten9876's re-run, 2026-09-18)
Skip visibly, not pass silently, when there is no accessibility bridge #4949: both tests print SKIP: and return 77, and tests/tests.cmake sets SKIP_RETURN_CODE 77 on both
Does CI run these tests? Answered in the issue: full-suite.yml runs them under offscreen on every push to main
connection_panel_size_test fails This PR

The failure is a real sizing bug in ConnectionPanel::preferredClientHeight(), not a flaky test. That function asks for chrome + body height but leaves out the horizontal scrollbar. When the body is wider than the window, that bar takes its height out of the viewport. The auto-fit then comes up exactly one bar short, and the dialog opens with a vertical scrollbar anyway.

On Windows this happens at the default window size. At scale 1.0 the body's minimum width is 766 px, and the 760 px panel leaves a 734 px viewport. On the Linux CI image the body is narrower than the viewport, so no horizontal bar appears and full-suite stays green. That is why only Windows and font-dependent local runs fail.

Measured offscreen on Windows (MSVC, Qt 6.12.0) at upstream/main 7864ef544, after the growth fit:

panelH=795 scrollH=728 viewportH=714 contentHint=728 hbarVis=1 hbarH=14 vbarMax=14
panelW=760 viewportW=734 contentMinW=766

vbarMax equals the horizontal bar's height, 14.

Fix. preferredClientHeight() now takes the client width fitToScreen() is about to apply. It adds the horizontal bar's height when the body's minimum width exceeds the viewport at that width. The viewport is measured with maximumViewportSize(), i.e. with no scrollbars, since that is the state the fit aims for. When the body fits horizontally, as on Linux, nothing changes.

Test. tests/connection_panel_size_test.cpp:

  • New wide-body check. It forces horizontal overflow with a harness-only minimum width, so it covers this on every platform, not only where font metrics happen to cause it. It asserts the viewport against the body's preferred height. That read misses by exactly one bar when the bar is left out. vbarMax == 0 alone does not reliably fail: the scroll range runs off the body's minimum height, and the slack between minimum and preferred can hide the bar. In the control below it caught only 1 of the 14 px.
  • Growth check, spacer arithmetic. The spacer had the same blind spot as the bug, so with the fix in it overshot by a bar and the target clamped against the 800 px offscreen screen. It now counts a showing horizontal bar.
  • Growth check, headroom. It now takes whatever headroom exists, up to the previous 40 px, and skips only below 8 px. The fix correctly makes the Windows auto-fit 14 px taller (755 → 769). That leaves 31 px, so with a fixed 40 px requirement this check would have skipped on Windows instead of running. The same fixed requirement already skips this check on main on Linux: the auto-fit there is 776 px on the 800 px offscreen screen, leaving 24 px. On Linux at Qt 6.12.0, base 7864ef544 prints [SKIP] growth proof needs headroom above the auto-fit height autoHeight=776 workAreaH=800. So the test(gui): ConnectionPanel growth-path assertion fails when scaled content fits at 660 px #4679 growth proof (auto-sized panel opens without needing to scroll, and the three checks after it) was skipping in that configuration. With this PR it runs and passes. No existing check changes its result.

Constitution principle honored

Principle VIII — Evidence Over Assertion. Every claim in this PR was measured, and the new check was run against the unfixed code. It fails there by exactly the bar height, then passes with the fix.

Test plan

  • Local build passes (Windows, MSVC 2022 toolset, Qt 6.12.0, RelWithDebInfo): AetherSDR, connection_panel_size_test, startup_autoconnect_lockout_test
  • ctest -R "^(connection_panel_size_test|startup_autoconnect_lockout_test)$": both pass, no [SKIP] lines
  • Control: the test against unfixed ConnectionPanel.cpp/.h (source change stashed, test kept):
    [FAIL] auto-sized panel opens without needing to scroll           height=781 vbarMax=14
    [ OK ] wide-body setup shows a horizontal scrollbar               hbarMax=226 panelW=760
    [FAIL] auto-fit gives the body its preferred height beside the bar viewportH=674 bodyWantsH=688
    [FAIL] auto-fit leaves room for the horizontal scrollbar          height=755 vbarMax=1 hbarH=14
    
    With the fix:
    [ OK ] auto-sized panel opens without needing to scroll           height=800 vbarMax=0
    [ OK ] wide-body setup shows a horizontal scrollbar               hbarMax=214 panelW=760
    [ OK ] auto-fit gives the body its preferred height beside the bar viewportH=688 bodyWantsH=688
    [ OK ] auto-fit leaves room for the horizontal scrollbar          height=769 vbarMax=0 hbarH=14
    
  • Linux (Debian 13, g++ 14.2, Qt 6.12.0 from the repo pin, Fusion, offscreen): run independently on a second machine.
    • This branch: exit 0, no [FAIL] and no [SKIP] lines. Wide-body check viewportH=698 bodyWantsH=698. Growth proof runs (height=800 vbarMax=0).
    • Auto-fit height unchanged: 776 on base and 776 on this branch. The body's minimum width on Linux is 561 px, narrower than the window, so no horizontal bar shows and the fix adds nothing. That is also why full-suite stayed green.
    • Control (this test, base product code): the new check fails by exactly one bar, viewportH=684 bodyWantsH=698 with hbarH=14, the same 14 px as on Windows. The plain vbarMax == 0 check passes the control on Linux, so on its own it would not catch this bug there. That is why the viewport check is the one asserted.
    • Restoring the product files gives output byte-identical to the first run.
  • Not verified in the running app on a real radio. The change is to dialog geometry only
  • Existing tests pass (CI)

Checklist

  • Commits are signed (docs/COMMIT-SIGNING.md)
  • No new flat-key AppSettings calls
  • Code is clean-room
  • No meter UI touched
  • No user-docs change: the dialog's controls and behaviour are unchanged; on Windows it now opens tall enough not to need a vertical scrollbar
  • No CHANGELOG.md entry

Out of scope, noted for whoever owns the canon dialogs. On Windows at scale 1.0, the Connect dialog's body (766 px minimum) is wider than its 760 px default window. So it opens with a horizontal scrollbar at its default size. This PR makes the height correct around that bar; whether the default width should grow is a design call I have left alone.

🤖 Generated with Claude Code


👨🏼‍💻 Co-authored by Claude Opus 5.5

…llbar. Principle VIII.

ConnectionPanel::preferredClientHeight() sized the dialog as chrome plus
the body's preferred height and left out the horizontal scrollbar. When the
body is wider than the window, that bar takes its height out of the
viewport, so the auto-fit came up exactly one bar short and the dialog
opened needing a vertical scrollbar anyway. On Windows at scale 1.0 the
body (766 px minimum) is wider than the 760 px default window, so this
happens on every open; on the Linux CI image the body fits, which is why
full-suite stayed green while connection_panel_size_test failed locally
(aethersdr#5811).

preferredClientHeight() now takes the client width fitToScreen() is about
to apply and adds the bar's height when the body's minimum width exceeds
the scrollbar-free viewport at that width. A body that fits horizontally
gets the same height as before.

Test:
- New wide-body check forces horizontal overflow with a harness-only
  minimum width, so the case is reached on every platform, and asserts the
  viewport against the body's preferred height. Against the unfixed code
  it misses by exactly one bar (674 vs 688); vbarMax alone caught only
  1 px of the 14, since the scroll range runs off the minimum height.
- The growth check's spacer counts a showing horizontal bar, and its
  headroom takes what the 800 px offscreen screen leaves, up to 40 px,
  instead of skipping on Windows once the fit is correctly 14 px taller.

Fixes aethersdr#5811.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NF0T
NF0T requested a review from a team as a code owner October 17, 2026 13:32

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.

Four tests fail deterministically on clean main locally: the a11y announcement fixture never receives focus (offscreen)

1 participant