Support nonresizable content-sized Lua windows without freezing restored height
New Stats migration blocker after shared capabilities merged as develop bc39fd9b9. Stats task tsk_sur784eg27 has actual XML/Lua migration locally but retained regression ScriptedStatsWindowTests.RestoredPlacementAndPinDoNotFreezeTheContentDrivenHeight fails: saved-layout restoration writes RequestedSize through always-installed Core resize policy, freezing collapsed height so opening options no longer grows the window. Stats currently94 passed/3 skipped/1 failed; do not disable/drop the failing check. NCU/Nano Programs agents remain actively implementing and are not blocked on this request. Delegate to existing Herdr lua-shared-capabilities agent. Its worktree /home/mathias/Projects/worktrees/engines-client-lua-shared-capabilities is clean on old feature commit258ea244c, whose PR2803 was squash-merged; start a NEW fix/<description> branch from fetched origin/develop, not from that obsolete feature history. Do not reset/rebase/overwrite peer dirty worktrees. Original request suggested Window.create({resizable=false}) skipping on_resize while preserving initial Lua layout, visibility/buttons and native saved placement/pin/open. Treat that as a proposed solution: trace actual persistence/layout/RequestedSize behavior and reproduce before choosing minimal generic support for nonresizable/content-height windows. Preserve default Actions and other resizable windows, native input/session authority, callback cleanup and layout safety; avoid measured-height hacks, Stats-specific native presentation relays or bypassing ownership. Read Stats task and its source/test/logs read-only. Own Core/generic native helper/test/docs changes only; do not modify Stats source/tests/CharacterInterface or other workers. Add equivalent shared regression and negative/control evidence; arrange read-only Stats integration proof with capability option when safely possible but do not change its tree. Verify relevant shared/window/persistence/Actions tests, generator and Linux AOT where practical; retain actual skips/platform limitations. Report exact integration API and patch revision. User subsequently authorized a LOCAL COMMIT of this follow-up and use of that local commit as the other window branches' base. Remote Git access is unavailable: no fetch, push, Gitea contact, PR creation or merge is authorized/performed for this publication step. Do not mark Stats unblocked or resume it until validated change is integrated in its branch. Verified implementation / publication handoff: - Fresh branch fix/client-lua-content-sized-windows from fetched origin/develop bc39fd9b94499626b1b49941ea4bb6e3448c04d8 in the existing shared worktree. Old 258ea244c feature history was not replayed/rebased. Local commit b54c7291008f41190247d48c841719cf3b727612: fix: Preserve content-sized Lua windows after layout restoration. Only the five intended source/docs/test files were committed; restored mutation guards, clean diff checks, no private metadata or generated artifacts, and clean final worktree verified. Local commit/user authorization only; no remote access or publication occurred. No broad review restarted, no peer worktree modifications or peer task/status changes. - Confirmed cause: Core always installed ui.window.on_resize; UiLayoutPersistence.ApplyTo calls ConstrainResize(layout.Size) then writes RequestedSize. The custom Stats callback only sets flexible ui.size limits, so Constrain returns the saved size; GuiLayoutEngine.Measure prefers RequestedSize over measured content. This is resize ownership, not text measurement or missing invalidation. Native persistence/layout need no change. - Exact integration API: Window.create({resizable=false,...}). Option is boolean, defaults true. False skips installing ui.window.on_resize entirely while still executing initial Lua layout and preserving frame/buttons/visibility. Default fixed-layout false uses ui.size(root,width,height), not a retained RequestedSize override. Custom content-height policy remains ui.size(window.root,280,-1), ui.size(content,269,-1), window:fit_title(280,true). Stats only needs to add resizable=false to its existing Window.create options. Do not add measured heights, adapter relays or ui.window.size to its content-height policy. Default resizable/Actions callback behavior remains unchanged. - Patch scope: Core/window.lua and Core/README.md; LuaContentSizedWindowTests.cs; UI AOT Program.cs and ContentSizedWindowAcceptance.cs. No native ABI/API/generator contract changes. - Red/control evidence: shared real-persistence/native-input regressions failed before the fix for dynamic restored height AND fixed-window edge resizing. Reinstalling resize ownership deliberately makes the dynamic regression fail again; the managed AOT acceptance probe also fails its resize-ownership check. Mutation restored before final validation. - Read-only Stats integration proof: archived own bc39fd9b9 source into ignored .dev-data/content-sized-stats-proof, copied only Stats migration source/tests/package from its worktree, and built the copy here. The exact retained RestoredPlacementAndPinDoNotFreezeTheContentDrivenHeight test fails even with the new Core when Stats lacks the opt-in. Adding only resizable=false to the COPIED Stats main.lua yields 97 passed,3 original-asset skips,0 failed across the expanded Stats/shared/Actions/window/persistence filter, including two new shared cases. Copy comparisons confirm all six copied source/test files still match peer originals; main.lua differs only by that one option. This is isolated-copy evidence, NOT integration into the peer branch; leave Stats blocked. - Final own-worktree targeted tests:62 passed,0 skipped,0 failed (LuaContentSizedWindowTests, LuaWindowComponentTests, LuaSharedCapabilitiesTests, ScriptedActionsTests, LuaActionsListTests, UiLayoutPersistenceTests, WindowResizeTests, WindowEscapeTests, UiWindowFactoryTests), warnings-as-errors. ./run-client-lua-tests.sh exits0: Release8/8, ASan/UBSan8/8, generator self-tests and scripting/shared UI NativeAOT pass, including new fixed/content-sized real-input acceptance and existing unchanged-snapshot allocation tests. git diff --check clean. - Evidence logs: ignored .dev-data/content-sized-red.log, content-sized-green.log, content-sized-stats-control.log, content-sized-stats-green.log, content-sized-mutation-resize-ownership.log, content-sized-mutation-aot-probe.log, content-sized-final.log, content-sized-aot-final.log. Only relevant targeted suites were run; no new full-client/full-graphics claim. Linux x64 container only; Windows/macOS/live rendering/remote CI unexecuted. No Stats-specific NativeAOT publish claimed. Local SHA is ready for coordinator routing under the user's explicit authorization to use it as the other window branches' base. Coordinator must preserve dirty local preparation, integrate b54c7291008f41190247d48c841719cf3b727612, add resizable=false to Stats' existing Window.create options, rerun its targeted tests, and only then resume/unblock that migration. This session made no peer branch/worktree changes. NCU/Nano Programs remain untouched. No broad review restart or unchanged expensive validation rerun for the local commit.
Checklist
3 of 3 complete- Reproduce saved-layout freezing of content height and trace Core sizing versus native persistence behavior.
- Implement generic nonresizable/content-driven window support, preserving resize defaults, lifecycle and initial layout.
- Verify shared/window/persistence/Actions regressions and applicable AOT; provide exact Stats integration instructions without editing peers.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Bug
- Priority
- High
- Task ID
tsk_e5nxxsmaea- Updated