╭ changed ────────╮ │src/serve_ssh.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────╮ │3 const rp = xit.repo; │ │4 const xitui = xit.xitui; │ │5 const StreamTerminal = xitui.stream_terminal.StreamTerminal;│ │6 -const Grid = xitui.grid.Grid; │ │6 const Size = xitui.layout.Size; │ │7 const ui = @import("./ui.zig"); │ │8 const ssh = @import("./serve_ssh_protocol.zig"); │ ╰───────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │220 }; │ │221 var terminal_maybe: ?StreamTerminal = try StreamTerminal.init(allocator, &session_writer.interface, terminal_size);│ │222 defer if (terminal_maybe) |*terminal| terminal.deinit(); │ │224 - │ │225 - var last_size = Size{ .width = 0, .height = 0 }; │ │226 - var last_grid = try Grid.init(allocator, last_size); │ │227 - defer last_grid.deinit(); │ │223 │ │224 // initial render — user sees the page immediately │ │230 - try nav.root.build(allocator, .{ │ │231 - .min_size = .{ .width = null, .height = null }, │ │232 - .max_size = .{ .width = last_size.width, .height = last_size.height }, │ │233 - }, nav.root.getFocus()); │ │234 - if (terminal_maybe) |*terminal| _ = try terminal.render(&nav.root, &last_grid, &last_size); │ │225 + if (terminal_maybe) |*terminal| _ = try terminal.render(&nav.root); │ │226 │ │227 // event loop. nextEvent blocks until something interesting arrives; │ │228 // for each event, rebuild the widget tree and re-render so the user │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │253 defer allocator.free(payload); │ │254 if (std.mem.indexOfAny(u8, payload, "\r\n") == null) continue; │ │255 terminal_maybe = try StreamTerminal.init(allocator, &session_writer.interface, terminal_size);│ │265 - last_size = .{ .width = 0, .height = 0 }; │ │256 }, │ │257 .resize => |sz| { │ │258 terminal_size = .{ .width = sz.width_cells, .height = sz.height_cells }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │290 │ │291 try nav.root.build(allocator, .{ │ │292 .min_size = .{ .width = null, .height = null }, │ │303 - .max_size = .{ .width = last_size.width, .height = last_size.height }, │ │293 + .max_size = .{ .width = terminal_size.width, .height = terminal_size.height }, │ │294 }, nav.root.getFocus()); │ │305 - if (terminal_maybe) |*terminal| _ = try terminal.render(&nav.root, &last_grid, &last_size);│ │295 + if (terminal_maybe) |*terminal| _ = try terminal.render(&nav.root); │ │296 } │ │297 } │ │298 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯