╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │855 const route = pageRoute(data, commit.oid) orelse return error.RouteTooLong; │ │856 return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{try route.toUrl(page_arena)}); │ │857 } │ │945 - const route = (switch (content) { │ │946 - .message => data.handle.location.commitMessageRoute(.object, commit.oid, data.base_oid), │ │947 - .diff => |diff| data.handle.location.commitsRoute(.object, commit.oid, commit.window.start, diff.path, data.base_oid),│ │948 - }) orelse return error.RouteTooLong; │ │858 + const route = (if (message) │ │859 + data.handle.location.commitMessageRoute(.object, commit.oid, data.base_oid) │ │860 + else │ │861 + data.handle.location.commitsRoute(.object, commit.oid, data.base_oid)) orelse return error.RouteTooLong; │ │862 const url = try route.toUrl(page_arena); │ │863 return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{url}); │ │864 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/ui/Repo/Diff.zig│ ╰────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │30 const Self = @This(); │ │31 │ │32 pub const Route = union(enum) { │ │33 - commit: struct { location: ui.RoutablePage.RepoLocation, oid: []const u8, base_oid: []const u8 = "" }, │ │33 repo: struct { identity: []const u8, ref_or_oid: ui.RoutablePage.RefOrOid, value: []const u8, base_oid: []const u8 },│ │34 patchrev: struct { identity: []const u8, id: []const u8 }, │ │36 - fork: struct { identity: []const u8, id: []const u8 }, │ │35 + // `oid` names one commit's diff against `base_oid` ("" = the whole patch) │ │36 + fork: struct { identity: []const u8, id: []const u8, oid: []const u8 = "", base_oid: []const u8 = "" }, │ │37 │ │38 pub fn page(self: Route, start: usize, path: []const u8) ?ui.RoutablePage { │ │39 return switch (self) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │40 - .commit => |c| c.location.commitsRoute(.object, c.oid, start, path, c.base_oid), │ │40 .repo => |r| ui.RoutablePage.repoDiffRoute(r.identity, r.ref_or_oid, r.value, start, path, r.base_oid),│ │41 .patchrev => |r| ui.RoutablePage.repoPatchRevDiffRoute(r.identity, r.id, start, path), │ │43 - .fork => |f| ui.RoutablePage.forkDiffRoute(f.identity, f.id, start, path), │ │42 + .fork => |f| ui.RoutablePage.forkDiffRoute(f.identity, f.id, f.oid, f.base_oid, start, path), │ │43 }; │ │44 } │ │45 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │204 }; │ │205 } │ │206 │ │208 -pub fn appendWindow(data: @This(), allocator: std.mem.Allocator, session: *ui.Session, box: *wgt.Box(ui.Widget)) !void {│ │207 +fn appendWindow(data: @This(), allocator: std.mem.Allocator, session: *ui.Session, box: *wgt.Box(ui.Widget)) !void { │ │208 if (data.path.len != 0) { │ │209 try addLink(allocator, box, data.path, ""); │ │210 try addLink(allocator, box, "← all files", try data.route.link(session.page_arena, 0, "")); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │81 const aa = session.page_arena.allocator(); │ │82 const ref_name = std.Uri.percentDecodeInPlace(try aa.dupe(u8, page.files.patchrev_id orelse data.ref_or_oid_value)); │ │83 const bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), ref_name); │ │84 - const bottom_label_width = try xitui.width.displayWidth(bottom_label); │ │84 const changes_label = switch (page.changes) { │ │85 .diff => diff_tab_label, │ │86 .commits => |c| if (c.commit_count) |count| try std.fmt.allocPrint(aa, commits_tab_label ++ " ({d})", .{count}) else commits_tab_label,│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │153 const files_link = try ui.inPageTabLink(session, files_route, current_tag == .repo_files); │ │154 const changes_route = (switch (page.changes) { │ │155 .diff => |d| d.route.page(d.window.start, d.path), │ │157 - .commits => |c| ui.RoutablePage.repoCommitsRoute(identity, data.ref_or_oid, data.ref_or_oid_value, 0, "", c.base_oid),│ │156 + .commits => |c| ui.RoutablePage.repoCommitsRoute(identity, data.ref_or_oid, data.ref_or_oid_value, c.base_oid), │ │157 }) orelse return error.RouteTooLong; │ │158 const changes_tag = std.meta.activeTag(changes_route); │ │159 const changes_link = try ui.inPageTabLink(session, changes_route, current_tag == changes_tag); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │189 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │190 .widget = .{ .text_box = text_box }, │ │191 .rect = null, │ │193 - .min_size = .{ .width = @max(files_tab_label.len, bottom_label_width) + 2, .height = null },│ │192 + .min_size = .{ .width = files_tab_label.len + 2, .height = null }, │ │193 }); │ │194 } │ │195 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │204 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │205 .widget = .{ .text_box = text_box }, │ │206 .rect = null, │ │208 - .min_size = .{ .width = @max(changes_label_width, bottom_label_width) + 2, .height = null },│ │207 + .min_size = .{ .width = changes_label_width + 2, .height = null }, │ │208 }); │ │209 } │ │210 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │321 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │322 .widget = .{ .text_box = text_box }, │ │323 .rect = null, │ │325 - .min_size = .{ .width = @max(new_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null }, │ │324 + .min_size = .{ .width = new_tab_label.len + 2, .height = null }, │ │325 }); │ │326 } else if (session.data.host_kind == .server) { │ │327 var text_box = try wgt.TextBox.init(allocator, new_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = new_user_tab_bottom_label });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │333 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │334 .widget = .{ .text_box = text_box }, │ │335 .rect = null, │ │337 - .min_size = .{ .width = @max(new_tab_label.len, new_user_tab_bottom_label.len) + 2, .height = null },│ │336 + .min_size = .{ .width = new_tab_label.len + 2, .height = null }, │ │337 }); │ │338 } │ │339 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯