╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │897 pub const detail_widget_name = "repo_patch_detail"; │ │898 │ │899 pub const Header = thread.Header; │ │900 + │ │901 +const open_tab_label = "open"; │ │902 +const closed_tab_label = "closed"; │ │903 +const merged_tab_label = "merged"; │ │904 +const tags_tab_label = "tags"; │ │905 +const edit_tab_label = "edit"; │ │906 +const publish_tab_label = "publish"; │ │907 +const merge_tab_label = "merge"; │ │908 +const reply_tab_label = "reply"; │ │909 +const remove_tab_label = "remove"; │ │910 +const resolve_tab_label = "resolve"; │ │911 +const new_tab_label = "new"; │ │912 +const drafts_tab_label = "drafts"; │ │913 +const conflicts_tab_label = "conflicts"; │ │914 │ │915 pub fn appendDetails(self: *const Self, allocator: std.mem.Allocator, box: *wgt.Box(ui.Widget), session: *ui.Session, entry: Entry) !void {│ │916 const aa = session.page_arena.allocator(); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1008 const page_selected = std.meta.activeTag(session.data.current_page) == .repo_patches; │ │1009 │ │1010 // a list tab per status, labeled with its listing's patch count │ │ 997 - for ([_]Status{ .open, .closed, .merged }, 0..) |status, index| { │ │1011 + const status_labels = [_][]const u8{ open_tab_label, closed_tab_label, merged_tab_label }; │ │1012 + for ([_]Status{ .open, .closed, .merged }, status_labels, 0..) |status, status_label, index| { │ │1013 const route = ui.RoutablePage.repoPatchesRoute(data.identity, status, data.tag, "") orelse return error.RouteTooLong;│ │1014 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == index); │ │1015 var label_buf: [64]u8 = undefined; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1001 - const label = try std.fmt.bufPrint(&label_buf, "{s} ({d})", .{ @tagName(status), data.window(status).count });│ │1016 + const label = try std.fmt.bufPrint(&label_buf, "{s} ({d})", .{ status_label, data.window(status).count }); │ │1017 try header.addTab(allocator, label, link, index); │ │1018 } │ │1019 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1021 { │ │1022 const tags_route = ui.RoutablePage.repoThreadTagsRoute(.patch, data.identity, data.tag) orelse return error.RouteTooLong;│ │1023 const tags_link = try ui.inPageTabLink(session, tags_route, page_selected and selected_index == View.viewIndex(.tags)); │ │1009 - const label = if (data.tag.len == 0) "tags" else blk: { │ │1024 + const label = if (data.tag.len == 0) tags_tab_label else blk: { │ │1025 const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.tag)); │ │1011 - break :blk try std.fmt.allocPrint(aa, "tags ({s})", .{decoded}); │ │1026 + break :blk try std.fmt.allocPrint(aa, tags_tab_label ++ " ({s})", .{decoded}); │ │1027 }; │ │1028 try header.addTab(allocator, label, tags_link, View.viewIndex(.tags)); │ │1029 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1042 }; │ │1043 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.new));│ │1044 const label: []const u8 = switch (data.view) { │ │1030 - .edit => "edit", │ │1031 - .publish => "publish", │ │1032 - .merge => "merge", │ │1033 - .new_comment => "reply", │ │1034 - .edit_comment => "edit", │ │1035 - .remove => "remove", │ │1036 - .resolve => "resolve", │ │1037 - else => "new", │ │1045 + .edit => edit_tab_label, │ │1046 + .publish => publish_tab_label, │ │1047 + .merge => merge_tab_label, │ │1048 + .new_comment => reply_tab_label, │ │1049 + .edit_comment => edit_tab_label, │ │1050 + .remove => remove_tab_label, │ │1051 + .resolve => resolve_tab_label, │ │1052 + else => new_tab_label, │ │1053 }; │ │1054 try header.addTab(allocator, label, link, View.viewIndex(.new)); │ │1055 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1059 const route = ui.RoutablePage.repoPatchesDraftsRoute(data.identity) orelse return error.RouteTooLong; │ │1060 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.drafts));│ │1061 var label_buf: [64]u8 = undefined; │ │1047 - const label = try std.fmt.bufPrint(&label_buf, "drafts ({d})", .{data.drafts.count}); │ │1062 + const label = try std.fmt.bufPrint(&label_buf, drafts_tab_label ++ " ({d})", .{data.drafts.count}); │ │1063 try header.addTab(allocator, label, link, View.viewIndex(.drafts)); │ │1064 } │ │1065 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1068 const route = ui.RoutablePage.repoPatchesConflictsRoute(data.identity, "") orelse return error.RouteTooLong; │ │1069 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.conflicts));│ │1070 var label_buf: [64]u8 = undefined; │ │1056 - const label = try std.fmt.bufPrint(&label_buf, "conflicts ({d})", .{data.conflicts.count}); │ │1071 + const label = try std.fmt.bufPrint(&label_buf, conflicts_tab_label ++ " ({d})", .{data.conflicts.count}); │ │1072 try header.addTab(allocator, label, link, View.viewIndex(.conflicts)); │ │1073 } │ │1074 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯