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:
@@ -167,6 +167,19 @@ std::string apply_test_command(const std::string& cmd, coop::UiState& ui, coop::
|
||||
window.request_screenshot(p);
|
||||
return "ok";
|
||||
}
|
||||
if (v == "uisize")
|
||||
{
|
||||
// Force a reference layout size so the UI-fit check is monitor-independent.
|
||||
coop::set_layout_reference(static_cast<float>(num(1)), static_cast<float>(num(2)));
|
||||
return "ok";
|
||||
}
|
||||
if (v == "uifit")
|
||||
{
|
||||
// Report any panel whose content overflowed its assigned size last frame.
|
||||
char buf[256];
|
||||
coop::panel_fit_report(buf, sizeof(buf));
|
||||
return buf;
|
||||
}
|
||||
if (v == "quit")
|
||||
{
|
||||
ui.request_quit = true;
|
||||
@@ -387,6 +400,8 @@ int run()
|
||||
window.request_screenshot(screenshot_path()); // captured at Present, overlay included
|
||||
}
|
||||
|
||||
coop::reset_panel_fit(); // panels record their overflow as they draw (UI-fit check)
|
||||
coop::set_layout_debug(ui.debug_details); // center split adapts to the debug verbosity
|
||||
if (show_overlay)
|
||||
{
|
||||
coop::draw_main_menu_bar(ui, stats);
|
||||
|
||||
Reference in New Issue
Block a user