╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │2171 }; │ │2172 │ │2173 // who a write acts as and the role they hold in its repo │ │2174 +// the thread button that changes the viewer's notifications, named by its label│ │2175 +pub const NotifyAction = enum { subscribe, mute }; │ │2176 + │ │2177 pub const Actor = struct { │ │2178 author: evt.CommitAuthor, │ │2179 // local mode has no accounts, so it has no user id │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │2302 io: ?std.Io = null, │ │2303 admin_repo: ?*rp.Repo(.xit, evt.admin_repo_opts) = null, │ │2304 users_dir: ?[]const u8 = null, │ │2305 + // the notify worker's queue, null where no worker runs │ │2306 + dirty_repos: ?*notify.DirtyRepos = null, │ │2307 // the single on-disk repo this session views, when running in local mode │ │2308 // (haxy invoked with no arguments inside a repo). null on the server paths,│ │2309 // which resolve repos from the admin db instead. │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │2484 // the logged-in user's name and email, for the views that show them │ │2485 user_name: ?[]const u8 = null, │ │2486 user_email: ?[]const u8 = null, │ │2487 + // the logged-in user's unread notifications, refreshed on each page build│ │2488 + unread_notifs: u64 = 0, │ │2489 // a failed form retained long enough to render it for correction │ │2490 form_feedback: ?FormFeedback = null, │ │2491 // a transient local event-sync error │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2592 }; │ │2593 } │ │2594 │ │2510 - // where this session's event writes go. a server session always has a users dir │ │2595 + // where this session's event writes go. a server session always has a users dir and an admin repo│ │2596 pub fn eventHost(self: *const Self) evt.Host { │ │2597 return switch (self.data.host_kind) { │ │2598 .local => .local, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │2514 - .server => .{ .server = .{ .users_dir = self.users_dir orelse unreachable } },│ │2599 + .server => .{ .server = .{ │ │2600 + .users_dir = self.users_dir orelse unreachable, │ │2601 + .dirty_repos = self.dirty_repos, │ │2602 + .admin_repo_path = (self.admin_repo orelse unreachable).core.work_path, │ │2603 + } }, │ │2604 }; │ │2605 } │ │2606 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯