M1: UI-fit instrumentation + headless ui_fit_test + first overflow fixes

Add panel overflow instrumentation (record_panel_fit reading ImGui ScrollMax),
a forced layout-reference + debug-aware center split, and host harness commands
(uisize/uifit). New headless ui_fit_test drives the real Controllers + Audio
panels at reference resolutions with Debug details on and asserts no panel
overflows its assigned size; the Audio panel gains a demo mode so its richest
content renders without a live mirror.

Fixes from the measured overflow: widen the center column (was too narrow ->
horizontal overflow), merge the Controllers poll/round-trip tables and fold the
trigger line into the slot line, and make the center height split
Debug-details-aware (Video's height is mirroring-driven, not debug-driven, so a
static split can't serve both modes). Controllers + Audio now fit at 1920x1080
with max info. Video/Injection/Log fit is finalized at the end via the live
uifit harness (M1 stays open until then).

15/15 ctest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 11:14:31 +02:00
parent fc43355db2
commit cf7e0c783a
11 changed files with 409 additions and 62 deletions

View File

@@ -176,6 +176,28 @@ target_link_libraries(opengl_hook_test PRIVATE
add_test(NAME opengl_hook_test COMMAND opengl_hook_test)
# Headless UI-fit check (M1): drives the real Controllers + Audio panels at reference
# resolutions with Debug details on and the richest content, and asserts no panel overflows
# its assigned size. Pure ImGui layout (no GPU / window). The Audio panel renders in its
# demo mode so the full content path shows without a live audio device.
add_executable(ui_fit_test
ui_fit_test.cpp
${CMAKE_SOURCE_DIR}/host/src/audio_panel.cpp
${CMAKE_SOURCE_DIR}/host/src/controllers_panel.cpp
${CMAKE_SOURCE_DIR}/host/src/audio/audio_loopback.cpp
${CMAKE_SOURCE_DIR}/host/src/audio/process_loopback_capture.cpp
${CMAKE_SOURCE_DIR}/host/src/audio/audio_overrides.cpp
${CMAKE_SOURCE_DIR}/host/src/ui/app_chrome.cpp)
target_include_directories(ui_fit_test PRIVATE ${CMAKE_SOURCE_DIR}/host/src)
# process_loopback_capture (pulled in via AudioMirror) needs the Win10 20H1 headers.
target_compile_definitions(ui_fit_test PRIVATE NTDDI_VERSION=0x0A00000B)
target_link_libraries(ui_fit_test PRIVATE coop_common imgui ole32 mmdevapi)
add_test(NAME ui_fit_test COMMAND ui_fit_test)
# Keep the bin/<config>/ root deployable: stage every test exe under tests/. coop_tone
# (the audio_loopback_test fixture) is staged there too, next to its consumer, so the
# test's "coop_tone.exe alongside me" lookup keeps working.
@@ -193,4 +215,5 @@ coop_output_subdir(tests
present_hook_test
dx12_present_hook_test
opengl_hook_test
mock_game_test)
mock_game_test
ui_fit_test)