╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ ui.zig ───────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
3390 try root.build(allocator, .{ 3391 .min_size = .{ .width = null, .height = 40 }, 3392 .max_size = .{ .width = 100, .height = null }, 3393 }, root.getFocus()); 3394 3395 return root; 3396 } 3397 3398 // native and server-side sessions choose from the embedded collection. WASM 3399 // keeps the art serialized by the server instead. 3400 fn chooseAnsiArtForNavigation(session: *Session) void { 3401 if (comptime ansi_art.art.len == 0) return; 3402 if (session.data.current_page == .not_found) { 3403 session.data.ansi_art = ansi_art.not_found; 3404 return; 3405 } 3406 const io = session.io orelse return; 3407 var random: usize = undefined; 3408 io.random(std.mem.asBytes(&random)); 3409 session.data.ansi_art = ansi_art.art[random % ansi_art.art.len]; 3410 } 3411