╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │174 else │ │175 try Comment.init(repo_opts.hash, arena, admin_moment, haxy_moment, empty.selected_id, empty.comment_id, comments_start);│ │176 │ │177 - var tag_names: std.ArrayList([]const u8) = .empty; │ │178 - if (try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, evt.Discussion.tag_to_id_set_key))) |tags_cursor| { │ │179 - const tag_sets = try DB.SortedMap(.read_only).init(tags_cursor); │ │180 - var tag_iter = try tag_sets.iterator(); │ │181 - while (try tag_iter.next()) |entry_cursor| { │ │182 - if (tag_names.items.len == max_tags) break; │ │177 + var label_names: std.ArrayList([]const u8) = .empty; │ │178 + if (try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, evt.Discussion.label_to_id_set_key))) |labels_cursor| { │ │179 + const label_sets = try DB.SortedMap(.read_only).init(labels_cursor); │ │180 + var label_iter = try label_sets.iterator(); │ │181 + while (try label_iter.next()) |entry_cursor| { │ │182 + if (label_names.items.len == max_labels) break; │ │183 var entry = entry_cursor; │ │184 const pair = try entry.readKeyValuePair(); │ │185 - try tag_names.append(aa, try pair.key_cursor.readBytesAlloc(aa, null)); │ │185 + try label_names.append(aa, try pair.key_cursor.readBytesAlloc(aa, null)); │ │186 } │ │187 } │ │188 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────╮ │189 return .{ │ │190 .identity = empty.identity, │ │191 - .tag = empty.tag, │ │191 + .label = empty.label, │ │192 .search = empty.search, │ │193 .selected_id = empty.selected_id,│ │194 .comment_id = empty.comment_id, │ ╰──────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │197 .recent = loaded_window, │ │198 .view = empty.view, │ │199 .description_page = empty.description_page,│ │200 - .tags = tag_names.items, │ │200 + .labels = label_names.items, │ │201 }; │ │202 } │ │203 │ ╰────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────╮ │208 pub const Header = thread.Header; │ │209 │ │210 const recent_tab_label = "recent";│ │211 -const tags_tab_label = "tags"; │ │211 +const labels_tab_label = "labels";│ │212 const edit_tab_label = "edit"; │ │213 const reply_tab_label = "reply"; │ │214 const remove_tab_label = "remove";│ ╰───────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │224 │ │225 // recent discussions │ │226 { │ │227 - const route = try thread.searchRoute(ui.RoutablePage.repoDiscussionsRoute(data.identity, data.tag, ""), data.search); │ │227 + const route = try thread.searchRoute(ui.RoutablePage.repoDiscussionsRoute(data.identity, data.label, ""), data.search);│ │228 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == 0); │ │229 var label_buf: [64]u8 = undefined; │ │230 const label = try thread.countLabel(&label_buf, recent_tab_label, data.recent); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │231 try header.addTab(allocator, label, link, 0); │ │232 } │ │233 │ │234 - // tags tab, labeled with the active tag filter │ │234 + // labels tab, showing the active label filter │ │235 { │ │236 - const tags_route = try thread.searchRoute(ui.RoutablePage.repoThreadTagsRoute(.discuss, data.identity, data.tag), data.search); │ │237 - const tags_link = try ui.inPageTabLink(session, tags_route, page_selected and selected_index == View.viewIndex(.tags)); │ │238 - const label = if (data.tag.len == 0) tags_tab_label else blk: { │ │239 - const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.tag)); │ │240 - break :blk try std.fmt.allocPrint(aa, tags_tab_label ++ " ({s})", .{decoded}); │ │236 + const labels_route = try thread.searchRoute(ui.RoutablePage.repoThreadLabelsRoute(.discuss, data.identity, data.label), data.search);│ │237 + const labels_link = try ui.inPageTabLink(session, labels_route, page_selected and selected_index == View.viewIndex(.labels)); │ │238 + const label = if (data.label.len == 0) labels_tab_label else blk: { │ │239 + const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.label)); │ │240 + break :blk try std.fmt.allocPrint(aa, labels_tab_label ++ " ({s})", .{decoded}); │ │241 }; │ │242 - try header.addTab(allocator, label, tags_link, View.viewIndex(.tags)); │ │242 + try header.addTab(allocator, label, labels_link, View.viewIndex(.labels)); │ │243 } │ │244 │ │245 // new-discussion tab; an edit or comment url shows its tab in this place │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │31 // the ref/oid this page is viewing; the value is url-encoded │ │32 ref_or_oid: RefOrOid, │ │33 ref_or_oid_value: []const u8, │ │34 -// the issues tab's tag filter, url-encoded ("" = unfiltered), so the tab links │ │34 +// the issues tab's label filter, url-encoded ("" = unfiltered), so the tab links│ │35 // back to the filtered list. │ │36 -issues_tag: []const u8, │ │37 -patches_tag: []const u8, │ │38 -discussions_tag: []const u8, │ │36 +issues_label: []const u8, │ │37 +patches_label: []const u8, │ │38 +discussions_label: []const u8, │ │39 │ │40 const Self = @This(); │ │41 │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │42 -pub fn init(arena: *std.heap.ArenaAllocator, name: []const u8, owner_name: []const u8, ref_or_oid: RefOrOid, ref_or_oid_value: []const u8, issues_tag: []const u8, patches_tag: []const u8, discussions_tag: []const u8) !Self { │ │42 +pub fn init(arena: *std.heap.ArenaAllocator, name: []const u8, owner_name: []const u8, ref_or_oid: RefOrOid, ref_or_oid_value: []const u8, issues_label: []const u8, patches_label: []const u8, discussions_label: []const u8) !Self {│ │43 return .{ │ │44 .name = name, │ │45 .owner_name = owner_name, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────╮ │46 .title = try ui.Title.init(arena, name),│ │47 .ref_or_oid = ref_or_oid, │ │48 .ref_or_oid_value = ref_or_oid_value, │ │49 - .issues_tag = issues_tag, │ │50 - .patches_tag = patches_tag, │ │51 - .discussions_tag = discussions_tag, │ │49 + .issues_label = issues_label, │ │50 + .patches_label = patches_label, │ │51 + .discussions_label = discussions_label, │ │52 }; │ │53 } │ │54 │ ╰────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │157 const changes_link = try ui.inPageTabLink(session, changes_route, current_tag == changes_tag); │ │158 const refs_route = ui.RoutablePage.repoRefsRoute(identity, .branch, "") orelse return error.RouteTooLong; │ │159 const refs_link = try ui.inPageTabLink(session, refs_route, current_tag == .repo_refs); │ │160 - const issues_route = ui.RoutablePage.repoIssuesRoute(identity, .open, data.issues_tag, "") orelse return error.RouteTooLong; │ │160 + const issues_route = ui.RoutablePage.repoIssuesRoute(identity, .open, data.issues_label, "") orelse return error.RouteTooLong; │ │161 const issues_link = try ui.inPageTabLink(session, issues_route, current_tag == .repo_issues); │ │162 - const patches_route = ui.RoutablePage.repoPatchesRoute(identity, .open, data.patches_tag, "") orelse return error.RouteTooLong; │ │162 + const patches_route = ui.RoutablePage.repoPatchesRoute(identity, .open, data.patches_label, "") orelse return error.RouteTooLong; │ │163 const patches_link = try ui.inPageTabLink(session, patches_route, current_tag == .repo_patches); │ │164 - const discussions_route = ui.RoutablePage.repoDiscussionsRoute(identity, data.discussions_tag, "") orelse return error.RouteTooLong; │ │164 + const discussions_route = ui.RoutablePage.repoDiscussionsRoute(identity, data.discussions_label, "") orelse return error.RouteTooLong;│ │165 const discussions_link = try ui.inPageTabLink(session, discussions_route, current_tag == .repo_discussions); │ │166 const events_route = ui.RoutablePage.repoEventsRoute(identity, .active, null, "", null) orelse return error.RouteTooLong; │ │167 const events_link = try ui.inPageTabLink(session, events_route, current_tag == .repo_events); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯