╭ changed ────────╮ │src/main_wasm.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │23 var page: ?ui.Page = null; │ │24 var session: ui.Session = .{}; │ │25 │ │26 -fn start(json: []const u8, max_width: u32) !void { │ │26 +fn start(json: []const u8, min_height: u32, max_width: u32) !void {│ │27 if (page_arena) |*a| a.deinit(); │ │28 page_arena = std.heap.ArenaAllocator.init(allocator); │ │29 │ ╰───────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │46 if (root) |*old_root| old_root.deinit(allocator); │ │47 root = next_root; │ │48 │ │49 - try tick(max_width); │ │49 + try tick(min_height, max_width); │ │50 } │ │51 │ │52 -fn tick(max_width: u32) !void { │ │52 +fn tick(min_height: u32, max_width: u32) !void { │ │53 const root_ptr = if (root) |*root_value| root_value else return error.NotStarted;│ │54 try root_ptr.build(allocator, .{ │ │55 - .min_size = .{ .width = null, .height = null }, │ │56 - // height is null so the TUI grows to fit all its content; the browser │ │57 - // page handles vertical scrolling. │ │55 + // min_height lets the TUI fill the viewport when its content is │ │56 + // short; max height stays null so taller content extends downward │ │57 + // and the browser scrolls. │ │58 + .min_size = .{ .width = null, .height = min_height }, │ │59 .max_size = .{ .width = max_width, .height = null }, │ │60 }, root_ptr.getFocus()); │ │61 try updateHtml(); │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │100 return slice.ptr; │ │101 } │ │102 │ │102 -export fn _start(json_ptr: [*]u8, json_len: u32, max_width: u32) void { │ │103 +export fn _start(json_ptr: [*]u8, json_len: u32, min_height: u32, max_width: u32) void {│ │104 const json = json_ptr[0..json_len]; │ │105 defer allocator.free(json); │ │105 - start(json, max_width) catch |err| { │ │106 + start(json, min_height, max_width) catch |err| { │ │107 var buf: [256]u8 = undefined; │ │108 const str = std.fmt.bufPrint(&buf, "start: {}", .{err}) catch unreachable; │ │109 consoleLog(str); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │110 }; │ │111 } │ │112 │ │112 -export fn _tick(max_width: u32) bool { │ │113 - tick(max_width) catch |err| { │ │113 +export fn _tick(min_height: u32, max_width: u32) bool { │ │114 + tick(min_height, max_width) catch |err| { │ │115 var buf: [256]u8 = undefined; │ │116 const str = std.fmt.bufPrint(&buf, "tick: {}", .{err}) catch unreachable;│ │117 consoleLog(str); │ ╰──────────────────────────────────────────────────────────────────────────────────────╯