╭ changed ─────────────╮ │src/ui/Fork/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │100 const current_tag = std.meta.activeTag(session.data.current_page); │ │101 const routes = [_]ui.RoutablePage{ │ │102 ui.RoutablePage.forkPatchRoute(fork_identity, data.id) orelse return error.RouteTooLong, │ │103 - ui.RoutablePage.forkDiffRoute(fork_identity, data.id, 0, "") orelse return error.RouteTooLong, │ │103 + ui.RoutablePage.forkDiffRoute(fork_identity, data.id, "", "", 0, "") orelse return error.RouteTooLong, │ │104 ui.RoutablePage.forkFilesRoute(fork_identity, data.id, data.oid, "", 0) orelse return error.RouteTooLong, │ │105 - ui.RoutablePage.forkCommitsRoute(fork_identity, data.id, data.oid, 0, "") orelse return error.RouteTooLong,│ │105 + ui.RoutablePage.forkCommitsRoute(fork_identity, data.id, data.oid) orelse return error.RouteTooLong, │ │106 }; │ │107 const tags = [_]std.meta.Tag(ui.RoutablePage){ .fork_patch, .fork_diff, .fork_files, .fork_commits }; │ │108 const labels = [_][]const u8{ patch_tab_label, diff_tab_label, files_tab_label, commits_label }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │109 + // a single commit's diff names the commit under its tab │ │110 + const bottom_labels = [_][]const u8{ "", switch (session.data.current_page) { │ │111 + .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()), │ │112 + else => "", │ │113 + }, "", "" }; │ │114 var selected_tab: ?usize = null; │ │115 │ │111 - for (routes, tags, labels) |route, tag, label| { │ │116 + for (routes, tags, labels, bottom_labels) |route, tag, label, bottom_label| { │ │117 const selected = current_tag == tag; │ │113 - var tab = try wgt.TextBox.init(allocator, label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none }); │ │118 + var tab = try wgt.TextBox.init(allocator, label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = bottom_label });│ │119 errdefer tab.deinit(allocator); │ │120 tab.getFocus().mode = .all; │ │121 tab.getFocus().kind = .{ .custom = try ui.inPageTabLink(session, route, selected) }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯