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

@@ -498,6 +498,19 @@ Non-obvious things that cost time and constrain the design:
estimate as explicitly *low-confidence* (shown red). The operator can also re-measure
or override the format via a per-stream `AudioRingHeader` op channel; the host rebuilds
its render client when `format_generation` bumps, so it takes effect live.
- **Panels must *fit* their assigned size at max info -- measure it, don't eyeball it.** The
overlay opens panels at fixed sizes that scale with the monitor, so with Debug details on a
dense panel can overflow and scroll content out of view. `ui_fit_test` drives the real
Controllers + Audio panels headlessly (null-backend ImGui: build the atlas with
`GetTexDataAsRGBA32`, set a non-null `TexID`, `Render()` needs no GPU) at reference
resolutions and asserts each window's `ScrollMax` is 0 -- read it on the *2nd+* frame, since
ImGui computes `ScrollMax` in `Begin()` from the *previous* frame's content size. Two fixes
fell out: the center column was too narrow (horizontal overflow -> widen it, merge the
Controllers poll/round-trip tables), and a *static* height split can't serve both modes, so
it's now **Debug-details-aware** (debug on -> Controllers/Audio get the height for their
tables; off -> Video's perf graphs are the tall content, since Video's height is
mirroring-driven, not debug-driven). The host's `uisize`/`uifit` harness commands check the
same thing against the live overlay.
- **Drive the ImGui overlay for tests through an IPC harness, not synthetic input.**
`PostMessage`-d mouse clicks don't reliably reach ImGui widgets, and key/coordinate
simulation is brittle. A tiny debug-only command channel (`-DCOOP_TEST_HARNESS`, file-