╭ changed ────╮ │build.zig.zon│ ╰─────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 3 .version = "0.0.0", │ │ 4 .dependencies = .{ │ │ 5 .xit = .{ │ │ 6 - .url = "git+https://github.com/xit-vcs/xit#5d96c0d1215a56caf01e5e5c4a9aed6a3f157d56",│ │ 7 - .hash = "xit-0.0.0-Ub3nDPpIHQCPjOX_0kf3poH95XwG_FanenCbOX2I45Pg", │ │ 6 + .url = "git+https://github.com/xit-vcs/xit#0bb37004c8808936df2a1d4e1573d7ca5e52fff7",│ │ 7 + .hash = "xit-0.0.0-Ub3nDLJKHQAm3Vl4GDWOc0ijZmg7CbkFUIn_G74vaMzT", │ │ 8 }, │ │ 9 }, │ │10 .paths = .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1530 }, │ │1531 }; │ │1532 │ │1533 + // receive-pack patches the new tips before the branches refresh │ │1534 + try xit.patch.writePatches(opts, state, ctx.io, ctx.allocator, &.{ feature_new, docs_new }, null); │ │1535 _ = try pch.refreshBranchesInTransaction(.{ .server = .{ .users_dir = ctx.users_dir } }, opts, state, &moment, ctx.io, ctx.allocator, &updates, null, null);│ │1536 try push.writeUndo(opts, state, ctx.io, ctx.allocator, ctx.author, &updates); │ │1537 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Fork/Header.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │62 │ │63 const aa = session.page_arena.allocator(); │ │64 const fork_identity = try aa.print("{s}:{s}", .{ data.forker_name, data.name }); │ │65 - const commits_label = if (commit_count) |count| try aa.print(commits_tab_label ++ " ({d})", .{count}) else commits_tab_label;│ │65 var first_group_width = try data.title.width(); │ │66 │ │67 try ui.widget.addBackButton(allocator, &title_box, session); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │103 ui.RoutablePage.forkCommitsRoute(fork_identity, data.id, data.oid) orelse return error.RouteTooLong, │ │104 }; │ │105 const tags = [_]std.meta.Tag(ui.RoutablePage){ .fork_patch, .fork_diff, .fork_files, .fork_commits }; │ │107 - const labels = [_][]const u8{ patch_tab_label, diff_tab_label, files_tab_label, commits_label }; │ │108 - // a single commit's diff names the commit under its tab │ │106 + const labels = [_][]const u8{ patch_tab_label, diff_tab_label, files_tab_label, commits_tab_label }; │ │107 + // a single commit's diff names the commit under its tab, and commits │ │108 + // shows its count there │ │109 const bottom_labels = [_][]const u8{ "", switch (session.data.current_page) { │ │110 .fork_diff => |*d| if (d.oid.len == 0) "" else try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), d.oid.slice()),│ │111 else => "", │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │112 - }, "", "" }; │ │112 + }, "", if (commit_count) |count| try aa.print("({d})", .{count}) else "" }; │ │113 var selected_tab: ?usize = null; │ │114 │ │115 for (routes, tags, labels, bottom_labels) |route, tag, label, bottom_label| {│ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │239 { │ │240 const route = try thread.searchRoute(ui.RoutablePage.repoDiscussionsRoute(data.identity, ""), data.search);│ │241 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == 0); │ │242 - var label_buf: [64]u8 = undefined; │ │243 - const label = try thread.countLabel(&label_buf, recent_tab_label, data.recent); │ │244 - try header.addTab(allocator, label, link, 0); │ │242 + try header.addTab(allocator, recent_tab_label, try thread.countLabel(session, data.recent), link, 0); │ │243 } │ │244 │ │245 // labels tab │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │246 { │ │247 const labels_route = try thread.searchRoute(ui.RoutablePage.repoThreadLabelsRoute(.discuss, data.identity), data.search); │ │248 const labels_link = try ui.inPageTabLink(session, labels_route, page_selected and selected_index == View.viewIndex(.labels));│ │251 - try header.addTab(allocator, labels_tab_label, labels_link, View.viewIndex(.labels)); │ │249 + try header.addTab(allocator, labels_tab_label, "", labels_link, View.viewIndex(.labels)); │ │250 } │ │251 │ │252 // new-discussion tab; an edit or comment url shows its tab in this place │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │266 .remove => remove_tab_label, │ │267 else => new_tab_label, │ │268 }; │ │271 - try header.addTab(allocator, label, link, View.viewIndex(.new)); │ │269 + try header.addTab(allocator, label, "", link, View.viewIndex(.new));│ │270 } │ │271 │ │272 header.select(View.viewIndex(data.view)); │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Events.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │723 const view_labels = [_][]const u8{ active_tab_label, removed_tab_label }; │ │724 inline for ([_]ui.RoutablePage.EventsView{ .active, .removed }, view_labels, 0..) |view, view_label, i| { │ │725 const route = ui.RoutablePage.repoEventsRoute(data.identity, view, null, "", data.moment) orelse return error.RouteTooLong; │ │726 - const count = data.window(view).count; │ │727 - var label_buf: [64]u8 = undefined; │ │728 - const label = try std.fmt.bufPrint(&label_buf, "{s} ({d})", .{ view_label, count }); │ │729 - var tab = try wgt.TextBox.init(allocator, label, .{ .border = .hidden, .round_corners = true, .wrap_kind = .none }); │ │726 + const count_label = try session.page_arena.allocator().print("({d})", .{data.window(view).count}); │ │727 + var tab = try wgt.TextBox.init(allocator, view_label, .{ .border = .hidden, .round_corners = true, .wrap_kind = .none, .bottom_label = .{ .text = count_label } });│ │728 errdefer tab.deinit(allocator); │ │729 tab.getFocus().mode = .all; │ │730 const selected = std.meta.activeTag(session.data.current_page) == .repo_events and data.view == view; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │731 tab.getFocus().kind = .{ .custom = try ui.inPageTabLink(session, route, selected) }; │ │732 tab_ids[i] = tab.getFocus().id; │ │735 - try box.children.put(allocator, tab.getFocus().id, .{ .widget = .{ .text_box = tab }, .rect = null, .min_size = .{ .width = label.len + 2, .height = null } }); │ │733 + try box.children.put(allocator, tab.getFocus().id, .{ .widget = .{ .text_box = tab }, .rect = null, .min_size = .{ .width = @max(view_label.len, count_label.len) + 2, .height = null } });│ │734 } │ │735 │ │736 // pushes the sync button and status to the right │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯