╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │137 return empty; │ │138 }; │ │139 │ │140 - const set_maybe: ?DB.SortedSet(.read_only) = if (tagged) blk: { │ │141 - const tags_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, evt.Discussion.tag_to_id_set_key)) orelse return error.NotFound; │ │142 - const tag_sets = try DB.SortedMap(.read_only).init(tags_cursor); │ │143 - const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, empty.tag)); │ │144 - const cursor = try tag_sets.getCursor(decoded) orelse return error.NotFound; │ │140 + const set_maybe: ?DB.SortedSet(.read_only) = if (labeled) blk: { │ │141 + const labels_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, evt.Discussion.label_to_id_set_key)) orelse return error.NotFound;│ │142 + const label_sets = try DB.SortedMap(.read_only).init(labels_cursor); │ │143 + const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, empty.label)); │ │144 + const cursor = try label_sets.getCursor(decoded) orelse return error.NotFound; │ │145 break :blk try DB.SortedSet(.read_only).init(cursor); │ │146 } else if (try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, evt.Discussion.active_id_set_key))) |cursor| │ │147 try DB.SortedSet(.read_only).init(cursor) │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯