╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │41 }; │ │42 │ │43 identity: []const u8, │ │44 -tag: []const u8, │ │44 +label: []const u8, │ │45 // the decoded query the list is filtered to, or null when unfiltered.│ │46 search: ?[]const u8 = null, │ │47 selected_id: []const u8, │ ╰──────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────╮ │51 recent: Window, │ │52 view: ui.RoutablePage.DiscussionsView,│ │53 description_page: bool = false, │ │54 -tags: []const []const u8, │ │54 +labels: []const []const u8, │ │55 repo_source: ?ui.RepoSource = null, │ │56 │ │57 const Self = @This(); │ ╰──────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │62 pub const thread_name = "discussion"; │ │63 pub const header_widget_name = "repo_discussions_header"; │ │64 │ │65 -pub fn listRoute(identity: []const u8, _: Status, tag: []const u8, selected: []const u8) ?ui.RoutablePage { │ │66 - return ui.RoutablePage.repoDiscussionsRoute(identity, tag, selected); │ │65 +pub fn listRoute(identity: []const u8, _: Status, label: []const u8, selected: []const u8) ?ui.RoutablePage {│ │66 + return ui.RoutablePage.repoDiscussionsRoute(identity, label, selected); │ │67 } │ │68 │ │69 pub fn selectedThread(self: *const Self) ?*const DiscussionWithId { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────╮ │81 pub fn emptyResult( │ │82 aa: std.mem.Allocator, │ │83 identity: []const u8, │ │84 - tag: []const u8, │ │84 + label: []const u8, │ │85 search: []const u8, │ │86 selected_id: []const u8,│ │87 comment_id: []const u8, │ ╰────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │90 ) !Self { │ │91 return .{ │ │92 .identity = try aa.dupe(u8, identity), │ │93 - .tag = try aa.dupe(u8, tag), │ │93 + .label = try aa.dupe(u8, label), │ │94 .search = if (search.len == 0) null else std.Uri.percentDecodeInPlace(try aa.dupe(u8, search)),│ │95 .selected_id = try aa.dupe(u8, selected_id), │ │96 .comment_id = try aa.dupe(u8, comment_id), │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │ 98 .recent = .empty, │ │ 99 .view = if (view == .description) .recent else view,│ │100 .description_page = view == .description, │ │101 - .tags = &.{}, │ │101 + .labels = &.{}, │ │102 }; │ │103 } │ │104 │ ╰─────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │110 io: std.Io, │ │111 admin_moment: ?evt.AdminDB.HashMap(.read_only),│ │112 identity: []const u8, │ │113 - tag: []const u8, │ │113 + label: []const u8, │ │114 search: []const u8, │ │115 selected_id: []const u8, │ │116 comment_id: []const u8, │ ╰────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │117 comments_start: usize, │ │118 view: ui.RoutablePage.DiscussionsView, │ │119 ) !Self { │ │120 - const empty = try emptyResult(arena.allocator(), identity, tag, search, selected_id, comment_id, comments_start, view); │ │120 + const empty = try emptyResult(arena.allocator(), identity, label, search, selected_id, comment_id, comments_start, view);│ │121 const aa = arena.allocator(); │ │122 const DB = evt.EventDB(repo_opts.hash); │ │123 const rooted = empty.selected_id.len != 0; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │124 - const tagged = empty.tag.len != 0; │ │125 - const strict = rooted or tagged; │ │124 + const labeled = empty.label.len != 0; │ │125 + const strict = rooted or labeled; │ │126 │ │127 const gpa = arena.child_allocator; │ │128 var event_db_maybe: ?evt.LocalEventDB(repo_opts.hash) = if (repo_kind == .git) try evt.LocalEventDB(repo_opts.hash).openReadOnly(io, gpa, repo.core.repo_dir) else null;│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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) │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯