szn

Bug 468 — Layout bounds math exceeds parent on tiny panes

468. Small-pane split totals exceed the parent rect

Severity: MEDIUM Status: ✅ FIXED Files: src/layout.zig, src/server/render.zig


Root Cause Analysis

In layout.zig:237-240 (mirrored in render.zig:370-373,394-397):

available = lw -| 1; split = ...; w1 = @max(1, split); w2 = @max(1, available -| w1);

splitPane rejects <3, but bounds math doesn’t: lw=0/1/2 → w1=1,w2=1, total 1+1+1=3 > lw, border_x = lx+w1 OOB with oversized recursive children.

Proposed Fix

Mirror the <3 handling in bounds computation (return the parent rect unsplit / clamp children so w1+1+w2 <= lw), in all three sites. Test with 0/1/2-wide layouts.