╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │884 }; │ │885 │ │886 // the "a:" navigation link for the commits page walking from commit `oid` within │ │887 -// `data.location`, windowing the selected commit's diff from hunk `start`, filtered │ │887 +// `data.handle.location`, windowing the selected commit's diff from hunk `start`, filtered │ │888 // to `path` ("" = every file). │ │889 fn commitsLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, oid: []const u8, start: usize, path: []const u8) ![]const u8 {│ │890 - const route = data.location.commitsRoute(.object, oid, start, path, data.base_oid) orelse return error.RouteTooLong; │ │890 + const route = data.handle.location.commitsRoute(.object, oid, start, path, data.base_oid) orelse return error.RouteTooLong; │ │891 const url = try route.toUrl(page_arena); │ │892 return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{url}); │ │893 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │896 // its query) and moves `from` along, so the search box survives paging. a fork │ │897 // or an object view roots the page at the commit itself. │ │898 fn pageRoute(data: *const Self, oid: []const u8) ?ui.RoutablePage { │ │899 - if (data.location != .repo or data.ref_or_oid == .object) { │ │900 - return data.location.commitsRoute(.object, oid, 0, "", data.base_oid); │ │899 + if (data.handle.location != .repo or data.ref_or_oid == .object) { │ │900 + return data.handle.location.commitsRoute(.object, oid, 0, "", data.base_oid); │ │901 } │ │902 - const route = data.location.commitsRoute(data.ref_or_oid, data.ref_or_oid_value, 0, "", data.base_oid) orelse return null; │ │902 + const route = data.handle.location.commitsRoute(data.ref_or_oid, data.ref_or_oid_value, 0, "", data.base_oid) orelse return null;│ │903 const paged = route.withFrom(oid) orelse return null; │ │904 return paged.withSearch(data.search orelse return paged); │ │905 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │928 return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{try route.toUrl(page_arena)}); │ │929 } │ │930 const route = (switch (content) { │ │931 - .message => data.location.commitMessageRoute(.object, commit.oid, data.base_oid), │ │932 - .diff => |diff| data.location.commitsRoute(.object, commit.oid, commit.window.start, diff.path, data.base_oid), │ │931 + .message => data.handle.location.commitMessageRoute(.object, commit.oid, data.base_oid), │ │932 + .diff => |diff| data.handle.location.commitsRoute(.object, commit.oid, commit.window.start, diff.path, data.base_oid),│ │933 }) orelse return error.RouteTooLong; │ │934 const url = try route.toUrl(page_arena); │ │935 return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{url}); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │937 │ │938 // the "a:" link to the page showing `oid`'s message on its own. │ │939 fn messageLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, oid: []const u8) ![]const u8 { │ │940 - const route = data.location.commitMessageRoute(.object, oid, data.base_oid) orelse return error.RouteTooLong; │ │940 + const route = data.handle.location.commitMessageRoute(.object, oid, data.base_oid) orelse return error.RouteTooLong;│ │941 const url = try route.toUrl(page_arena); │ │942 return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{url}); │ │943 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭──────────────────────────────────────────────────────╮ │48 comment_id: []const u8, │ │49 comments_start: usize, │ │50 comment_page: ?Comment.Permalink = null, │ │51 -// whether the viewer may reply to comments │ │52 -can_reply: bool = false, │ │51 +// who the page is built for, null when logged out│ │52 +viewer: ?ui.Viewer = null, │ │53 recent: Window, │ │54 view: ui.RoutablePage.DiscussionsView, │ │55 description_page: bool = false, │ ╰──────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │118 comment_id: []const u8, │ │119 comments_start: usize, │ │120 view: ui.RoutablePage.DiscussionsView, │ │121 - viewer: ?Comment.Viewer, │ │121 + viewer: ?ui.Viewer, │ │122 ) !Self { │ │123 const empty = try emptyResult(arena.allocator(), identity, label, search, selected_id, comment_id, comments_start, view);│ │124 const aa = arena.allocator(); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │197 .comment_id = empty.comment_id, │ │198 .comments_start = comments_start, │ │199 .comment_page = comment_page, │ │200 - .can_reply = viewer != null, │ │200 + .viewer = viewer, │ │201 .recent = loaded_window, │ │202 .view = empty.view, │ │203 .description_page = empty.description_page,│ ╰────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │49 loaded: bool = false, │ │50 }; │ │51 │ │52 -// where links and clone commands for this repository are rooted. │ │53 -location: ui.RoutablePage.RepoLocation, │ │52 +// where links and clone commands for this repository are rooted, and who views it.│ │53 +handle: ui.RepoHandle, │ │54 // the resolved ref this listing is read at (the default branch when the route │ │55 // didn't name one), so the view's directory links stay pinned to it. │ │56 ref_or_oid: ui.RoutablePage.RefOrOid, │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────╮ │81 repo: *rp.Repo(repo_kind, repo_opts), │ │82 io: std.Io, │ │83 gpa: std.mem.Allocator, │ │84 - location: ui.RoutablePage.RepoLocation,│ │84 + handle: ui.RepoHandle, │ │85 id_hex: []const u8, │ │86 path: []const u8, │ │87 line: usize, │ ╰───────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │89 const id = evt.parseEventId(id_hex) catch return error.NotFound; │ │90 const record = (try evt.readFromRepo(evt.PatchRev, repo_kind, repo_opts, io, gpa, arena, repo, &id)) orelse return error.NotFound;│ │91 if (record.removed) return error.NotFound; │ │92 - var data = try init(repo_kind, repo_opts, arena, repo, io, gpa, location, .object, record.head_tree_oid, path, line, ""); │ │92 + var data = try init(repo_kind, repo_opts, arena, repo, io, gpa, handle, .object, record.head_tree_oid, path, line, ""); │ │93 data.patchrev_id = try arena.allocator().dupe(u8, id_hex); │ │94 return data; │ │95 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯