╭ changed ──╮ │src/lib.zig│ ╰───────────╯ ╭────────────────────────────────────────────╮ │2 pub const main = @import("./main.zig"); │ │3 pub const event = @import("./event.zig");│ │4 pub const serve = @import("./serve.zig");│ │5 -pub const page = @import("./page.zig"); │ │5 pub const ui = @import("./ui.zig"); │ │6 │ ╰────────────────────────────────────────────╯ ╭ changed ────────╮ │src/main_wasm.zig│ ╰─────────────────╯ ╭──────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const ui = @import("./ui.zig"); │ │3 -const pg = @import("./page.zig"); │ │3 +const web = @import("./web.zig"); │ │4 const xitui = @import("xit").xitui;│ │5 const inp = xitui.input; │ │6 │ ╰──────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │10 │ │11 fn updateHtml() !void { │ │12 const root_ptr = if (root) |*root_value| root_value else return error.NotStarted;│ │13 - const html = try ui.generateHtml(allocator, root_ptr); │ │13 + const html = try web.generateHtml(allocator, root_ptr); │ │14 defer allocator.free(html); │ │15 setHtml(html); │ │16 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │18 // the page is allocated into this arena via parseFromSliceLeaky. it has │ │19 // to outlive `root`, because `root` holds slices into the parsed strings.│ │20 var page_arena: ?std.heap.ArenaAllocator = null; │ │21 -var page: ?pg.Page = null; │ │21 +var page: ?ui.Page = null; │ │22 │ │23 fn start(json: []const u8, max_width: u32) !void { │ │24 if (page_arena) |*a| a.deinit(); │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │26 │ │27 // alloc_always so the parsed strings live entirely inside the arena │ │28 // and don't borrow from the caller's json buffer. │ │29 - page = try std.json.parseFromSliceLeaky(pg.Page, (page_arena orelse unreachable).allocator(), json, .{│ │29 + page = try std.json.parseFromSliceLeaky(ui.Page, (page_arena orelse unreachable).allocator(), json, .{│ │30 .allocate = .alloc_always, │ │31 }); │ │32 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ removed ───╮ │src/page.zig│ ╰────────────╯ ╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────╮ │ 8 const evt = hx.event; │ │ 9 const xit = hx.xit; │ │10 const rp = xit.repo; │ │11 -const Page = hx.page.Page; │ │11 +const ui = hx.ui; │ │12 │ │13 pub fn main() !void { │ │14 var gpa: std.heap.DebugAllocator(.{}) = .init;│ ╰──────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │39 defer page_arena.deinit(); │ │40 │ │41 // create the admin repo and build the Page from it │ │42 - const page: Page = blk: { │ │42 + const page: ui.Page = blk: { │ │43 const work_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "server", "admin" });│ │44 defer allocator.free(work_path); │ │45 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │184 // consume events into the database │ │185 try evt.consume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" });│ │186 │ │187 - break :blk .{ .user_repo = try .init(repo_opts, &page_arena, &repo) }; │ │187 + break :blk .{ .users_and_repos = try .init(repo_opts, &page_arena, &repo) }; │ │188 }; │ │189 │ │190 // start the server │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────╮ │200 const Runnable = struct { │ │201 io: std.Io, │ │202 allocator: std.mem.Allocator, │ │203 - page: *const Page, │ │203 + page: *const ui.Page, │ │204 │ │205 pub fn run(self: @This()) !void {│ │206 // launch the TUI │ ╰──────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯