╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 96 │ │ 97 pub fn filesRoute(self: *const Self, path: []const u8, line: usize) ?ui.RoutablePage { │ │ 98 - if (self.patchrev_id) |id| return switch (self.location) { │ │ 98 + if (self.patchrev_id) |id| return switch (self.handle.location) { │ │ 99 .repo => |identity| ui.RoutablePage.repoPatchRevFilesRoute(identity, id, path, line),│ │100 .fork => null, │ │101 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │102 - const route = self.location.filesRoute(self.ref_or_oid, self.ref_or_oid_value, path, line) orelse return null; │ │102 + const route = self.handle.location.filesRoute(self.ref_or_oid, self.ref_or_oid_value, path, line) orelse return null;│ │103 return route.withFind(self.find orelse return route); │ │104 } │ │105 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │114 repo: *rp.Repo(repo_kind, repo_opts), │ │115 io: std.Io, │ │116 gpa: std.mem.Allocator, │ │117 - location: ui.RoutablePage.RepoLocation, │ │117 + handle: ui.RepoHandle, │ │118 requested_ref_or_oid: ?ui.RoutablePage.RefOrOid,│ │119 requested_value: []const u8, │ │120 path: []const u8, │ ╰─────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │129 // bad url (NotFound -> 404); the default-branch path falls through to empty. │ │130 const resolved = (try ui.ResolvedRefOrOid(repo_kind, repo_opts).init(repo, io, aa, requested_ref_or_oid, requested_value)) orelse {│ │131 if (requested_ref_or_oid != null or term != null) return error.NotFound; │ │132 - return emptyResult(aa, location, .branch, requested_value, path); │ │132 + return emptyResult(aa, handle, .branch, requested_value, path); │ │133 }; │ │134 │ │135 // read just the viewed directory of that tree or commit. building the │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │136 // read-only state mirrors what repo.status does internally, but for an │ │137 // arbitrary commit rather than HEAD. a path that doesn't exist in the tree │ │138 // is a bad url (404). │ │139 - var moment = repo.core.latestMoment() catch return emptyResult(aa, location, resolved.ref_or_oid, resolved.value, path);│ │139 + var moment = repo.core.latestMoment() catch return emptyResult(aa, handle, resolved.ref_or_oid, resolved.value, path); │ │140 const state = rp.Repo(repo_kind, repo_opts).State(.read_only){ .core = &repo.core, .extra = .{ .moment = &moment } }; │ │141 │ │142 var entries: std.ArrayList(Entry) = .empty; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────╮ │169 }; │ │170 } │ │171 return .{ │ │172 - .location = try location.dupe(aa), │ │172 + .handle = try handle.dupe(aa), │ │173 .ref_or_oid = resolved.ref_or_oid, │ │174 .ref_or_oid_value = resolved.value,│ │175 .dir = "", │ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │184 │ │185 var tree_dir = tr.TreeDir(repo_kind, repo_opts).init(state, io, gpa, &resolved.oid, path) catch |err| switch (err) {│ │186 error.TreeEntryNotFound => return error.NotFound, │ │187 - else => return emptyResult(aa, location, resolved.ref_or_oid, resolved.value, path), │ │187 + else => return emptyResult(aa, handle, resolved.ref_or_oid, resolved.value, path), │ │188 }; │ │189 defer tree_dir.deinit(); │ │190 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────╮ │227 } │ │228 │ │229 return .{ │ │230 - .location = try location.dupe(aa), │ │230 + .handle = try handle.dupe(aa), │ │231 .ref_or_oid = resolved.ref_or_oid, │ │232 .ref_or_oid_value = resolved.value,│ │233 .dir = try aa.dupe(u8, dir), │ ╰────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │319 } │ │320 │ │321 // an empty listing pinned to a ref, for the wasm / no-repo / unresolved paths. │ │322 -pub fn emptyResult(aa: std.mem.Allocator, location: ui.RoutablePage.RepoLocation, ref_or_oid: ui.RoutablePage.RefOrOid, ref_or_oid_value: []const u8, dir: []const u8) !Self {│ │322 +pub fn emptyResult(aa: std.mem.Allocator, handle: ui.RepoHandle, ref_or_oid: ui.RoutablePage.RefOrOid, ref_or_oid_value: []const u8, dir: []const u8) !Self { │ │323 return .{ │ │324 - .location = try location.dupe(aa), │ │324 + .handle = try handle.dupe(aa), │ │325 .ref_or_oid = ref_or_oid, │ │326 .ref_or_oid_value = try aa.dupe(u8, ref_or_oid_value), │ │327 .dir = try aa.dupe(u8, dir), │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │358 │ │359 // the search box and the clone url at the top. local mode has neither. │ │360 if (session.data.host_kind == .server) { │ │361 - var header_view = try ui.widget.SearchHeader.init(allocator, session, data.location, " find file ", "find", data.find, data.find_available); │ │361 + var header_view = try ui.widget.SearchHeader.init(allocator, session, data.handle, " find file ", "find", data.find, data.find_available); │ │362 errdefer header_view.deinit(allocator); │ │363 // a row taller than the header, leaving a blank line beneath it │ │364 try outer.children.put(allocator, header_view.getFocus().id, .{ .widget = .{ .search_header = header_view }, .rect = null, .min_size = .{ .width = null, .height = 4 } });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯