╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │145 │ │157 -// what the server hands to the client (and what main_wasm parses on _start). │ │158 -// keeps Page free of any per-request session state. │ │159 -pub const Snapshot = struct { │ │160 - page: Page, │ │161 - session: Session.Data = .{}, │ │162 -}; │ │163 - │ │146 pub fn run(io: std.Io, allocator: std.mem.Allocator, page: *const Page, session: *Session) !void {│ │147 var root = try initRoot(allocator, page, session); │ │148 defer root.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭───────────────────────────────────╮ │1 const std = @import("std"); │ │2 const ui = @import("../ui.zig");│ │3 const xit = @import("xit"); │ │4 -const rp = xit.repo; │ │4 const xitui = xit.xitui; │ │5 const wgt = xitui.widget; │ │6 const layout = xitui.layout; │ ╰───────────────────────────────────╯ ╭──────────────────────────────────────────────────╮ │ 7 const inp = xitui.input; │ │ 8 const Grid = xitui.grid.Grid; │ │ 9 const Focus = xitui.focus.Focus; │ │10 +const evt = @import("../event.zig"); │ │11 │ │12 pub const Users = @import("./Home/Users.zig");│ │13 pub const Repos = @import("./Home/Repos.zig");│ ╰──────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │24 const Self = @This(); │ │25 │ │26 pub fn init( │ │27 - comptime repo_opts: rp.RepoOpts(.xit), │ │27 arena: *std.heap.ArenaAllocator, │ │29 - haxy_moment: rp.Repo(.xit, repo_opts).DB.HashMap(.read_only),│ │28 + haxy_moment: evt.AdminDB.HashMap(.read_only), │ │29 ) !Self { │ │30 return .{ │ │31 .header = try Header.init(arena), │ ╰─────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────╮ │33 - .users = try Users.init(repo_opts, arena, haxy_moment),│ │34 - .repos = try Repos.init(repo_opts, arena, haxy_moment),│ │32 + .users = try Users.init(arena, haxy_moment), │ │33 + .repos = try Repos.init(arena, haxy_moment), │ │34 .ansi = Ansi.init(), │ │35 .auth = Auth.init(), │ │36 }; │ ╰───────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────────╮ │src/ui/Home/Auth/Login.zig│ ╰──────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │15 │ │16 const wasm = builtin.target.cpu.arch == .wasm32; │ │17 │ │18 -const repo_opts = ui.canonical_repo_opts; │ │19 -const DB = ui.DB; │ │20 - │ │18 const Self = @This(); │ │19 │ │20 // classifies a failed /login attempt; null in session.data.login_failure means│ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │231 return; │ │232 }; │ │233 │ │237 - const result = try evt.User.verifyCredentials(DB, repo_opts.hash, haxy_moment, self.session.arena, username, password); │ │234 + const result = try evt.User.verifyCredentials(evt.AdminDB, evt.admin_repo_opts.hash, haxy_moment, self.session.arena, username, password);│ │235 switch (result) { │ │236 .unknown_user => { │ │237 self.session.data.login_failure = .unknown_user; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Home/Repos.zig│ ╰─────────────────────╯ ╭──────────────────────────────────────────╮ │2 const evt = @import("../../event.zig");│ │3 const ui = @import("../../ui.zig"); │ │4 const xit = @import("xit"); │ │5 -const rp = xit.repo; │ │5 const hash = xit.hash; │ │6 const xitui = xit.xitui; │ │7 const wgt = xitui.widget; │ ╰──────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │15 const Self = @This(); │ │16 │ │17 pub fn init( │ │19 - comptime repo_opts: rp.RepoOpts(.xit), │ │18 arena: *std.heap.ArenaAllocator, │ │21 - haxy_moment: rp.Repo(.xit, repo_opts).DB.HashMap(.read_only),│ │19 + haxy_moment: evt.AdminDB.HashMap(.read_only), │ │20 ) !Self { │ │23 - const DB = rp.Repo(.xit, repo_opts).DB; │ │21 + const DB = evt.AdminDB; │ │22 │ │23 var repos: std.ArrayList(evt.Repo) = .empty; │ │24 │ ╰─────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │27 - const event_id_to_repo_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, "event-id->repo")) orelse return error.NotFound; │ │25 + const event_id_to_repo_cursor = try haxy_moment.getCursor(hash.hashInt(evt.admin_repo_opts.hash, "event-id->repo")) orelse return error.NotFound;│ │26 const event_id_to_repo = try DB.HashMap(.read_only).init(event_id_to_repo_cursor); │ │27 │ │28 var repos_iter = try event_id_to_repo.iterator(); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯