╭ changed ────╮ │build.zig.zon│ ╰─────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 3 .version = "0.0.0", │ │ 4 .dependencies = .{ │ │ 5 .xit = .{ │ │ 6 - .url = "git+https://github.com/xit-vcs/xit#0c5a95224e9d4bfa7e20e550275488a4552ec55c",│ │ 7 - .hash = "xit-0.0.0-Ub3nDJidTwGuB3J0t43BwWoanz_v7loibGwLobkFw13Y", │ │ 6 + .url = "git+https://github.com/xit-vcs/xit#0b6eca3512b68ecf5288736f2ee78cbc120b9d76",│ │ 7 + .hash = "xit-0.0.0-Ub3nDEPFTwFvMuZzHUUDGMW32_P4fOFo90QpiwBNnUAe", │ │ 8 }, │ │ 9 }, │ │10 .paths = .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │310 self.clearGrid(); │ │311 const children = &self.scroll.child.box.children; │ │312 for (children.keys(), children.values()) |id, *item| { │ │313 - item.widget.text_box.options.border_style = if (self.getFocus().child_id == id) │ │314 - (if (root_focus.grandchild_id == id) .double else .single) │ │315 - else │ │316 - .hidden; │ │313 + item.widget.text_box.options.border_style = if (self.getFocus().child_id == id) .single else .hidden;│ │314 } │ │315 try self.scroll.build(allocator, constraint, root_focus); │ │316 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────────╮ │src/ui/Home/Auth/Login.zig│ ╰──────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │77 button.getFocus().focusable = true; │ │78 // the renderer distinguishes plain clickables from buttons that│ │79 // should POST to a server route by this kind. │ │80 - button.getFocus().kind = .submit_button; │ │80 + button.getFocus().kind = .{ .custom = "submit" }; │ │81 nav_ids[button_index] = button.getFocus().id; │ │82 try box.children.put(allocator, button.getFocus().id, .{ │ │83 .widget = .{ .text_box = button }, │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │104 pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │105 const box = &self.center.child.box; │ │106 │ │107 - const button = &box.children.values()[button_index].widget.text_box; │ │108 - button.options.border_style = if (root_focus.grandchild_id == self.nav_ids[button_index]) │ │109 - .double │ │110 - else │ │111 - .single; │ │112 - │ │107 const failure = self.session.data.login_failure; │ │108 │ │109 const username_input = &box.children.values()[username_index].widget.text_input; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │220 const username_input = &box.children.values()[username_index].widget.text_input; │ │221 const password_input = &box.children.values()[password_index].widget.text_input; │ │222 │ │229 - var username_buf: [256]u8 = undefined; │ │230 - const username = joinCodepoints(&username_buf, username_input.content.items) orelse {│ │231 - self.session.data.login_failure = .unknown_user; │ │232 - return; │ │233 - }; │ │223 + const username = try username_input.text(allocator); │ │224 + defer allocator.free(username); │ │225 │ │235 - var password_buf: [256]u8 = undefined; │ │236 - const password = joinCodepoints(&password_buf, password_input.content.items) orelse {│ │237 - self.session.data.login_failure = .wrong_password; │ │238 - return; │ │239 - }; │ │226 + const password = try password_input.text(allocator); │ │227 + defer allocator.free(password); │ │228 │ │229 const haxy_moment = self.session.haxy_moment orelse { │ │230 // no DB context (e.g. wasm/web rendering path); treat as unknown. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │261 } │ │262 }; │ │263 │ │276 -// joins a list of utf-8 codepoint slices (as TextInput stores them) into a│ │277 -// flat buffer. returns null if the joined bytes don't fit. │ │278 -fn joinCodepoints(buf: []u8, codepoints: []const []const u8) ?[]const u8 { │ │279 - var len: usize = 0; │ │280 - for (codepoints) |cp| { │ │281 - if (len + cp.len > buf.len) return null; │ │282 - @memcpy(buf[len..][0..cp.len], cp); │ │283 - len += cp.len; │ │284 - } │ │285 - return buf[0..len]; │ │286 -} │ │287 - │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────────╮ │src/ui/Home/Auth/Logout.zig│ ╰───────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │47 button.getFocus().focusable = true; │ │48 // the renderer distinguishes plain clickables from buttons that│ │49 // should POST to a server route by this kind. │ │50 - button.getFocus().kind = .submit_button; │ │50 + button.getFocus().kind = .{ .custom = "submit" }; │ │51 button_id = button.getFocus().id; │ │52 try box.children.put(allocator, button.getFocus().id, .{ │ │53 .widget = .{ .text_box = button }, │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │72 } │ │73 │ │74 pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │75 - const box = &self.center.child.box; │ │76 - const button = &box.children.values()[button_index].widget.text_box; │ │77 - button.options.border_style = if (root_focus.grandchild_id == self.button_id) │ │78 - .double │ │79 - else │ │80 - .single; │ │75 try self.center.build(allocator, constraint, root_focus); │ │76 } │ │77 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 95 else => null, │ │ 96 }; │ │ 97 if (tb) |t| { │ │ 98 - t.options.border_style = if (self.getFocus().child_id == id) │ │ 99 - (if (root_focus.grandchild_id == id) .double else .single) │ │100 - else │ │101 - .hidden; │ │ 98 + t.options.border_style = if (self.getFocus().child_id == id) .single else .hidden;│ │ 99 } │ │100 } │ │101 try self.box.build(allocator, constraint, root_focus); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │439 .ti = @fieldParentPtr("focus", child.focus),│ │440 }); │ │441 }, │ │442 - .submit_button => { │ │443 - submit = .{ │ │444 - .focus_id = entry.key_ptr.*, │ │445 - .x = child.rect.x, │ │446 - .y = child.rect.y, │ │447 - .width = child.rect.size.width, │ │448 - .height = child.rect.size.height, │ │449 - }; │ │442 + .custom => |custom| { │ │443 + if (std.mem.eql(u8, "submit", custom)) { │ │444 + submit = .{ │ │445 + .focus_id = entry.key_ptr.*, │ │446 + .x = child.rect.x, │ │447 + .y = child.rect.y, │ │448 + .width = child.rect.size.width, │ │449 + .height = child.rect.size.height, │ │450 + }; │ │451 + } │ │452 }, │ │453 else => {}, │ │454 } │ ╰─────────────────────────────────────────────────────────────────────╯