╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │230 │ │231 // tabs switching between the discussions page's views │ │232 pub fn initHeader(allocator: std.mem.Allocator, session: *ui.Session, data: *const Self) !Header {│ │230 - var header = try Header.init(allocator, session, data.search, null); │ │233 + var header = try Header.init(allocator, session, data.search, " search "); │ │234 errdefer header.deinit(allocator); │ │235 const selected_index = View.viewIndex(data.view); │ │236 const page_selected = std.meta.activeTag(session.data.current_page) == .repo_discussions; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │237 │ │238 // recent discussions │ │239 { │ │237 - const route = try thread.searchRoute(ui.RoutablePage.repoDiscussionsRoute(data.identity, data.label, ""), data.search);│ │240 + const route = try thread.searchRoute(ui.RoutablePage.repoDiscussionsRoute(data.identity, ""), data.search); │ │241 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == 0); │ │242 var label_buf: [64]u8 = undefined; │ │243 const label = try thread.countLabel(&label_buf, recent_tab_label, data.recent); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │246 │ │247 // labels tab │ │248 { │ │246 - const labels_route = try thread.searchRoute(ui.RoutablePage.repoThreadLabelsRoute(.discuss, data.identity, data.label), data.search);│ │249 + const labels_route = try thread.searchRoute(ui.RoutablePage.repoThreadLabelsRoute(.discuss, data.identity), data.search); │ │250 const labels_link = try ui.inPageTabLink(session, labels_route, page_selected and selected_index == View.viewIndex(.labels)); │ │251 try header.addTab(allocator, labels_tab_label, labels_link, View.viewIndex(.labels)); │ │252 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ 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 -// each thread tab's label filter, url-encoded ("" = unfiltered), so the tab │ │35 -// links back to the filtered list and shows the label beneath it. │ │36 -discussions_label: []const u8, │ │37 -issues_label: []const u8, │ │38 -patches_label: []const u8, │ │34 +// each thread tab's decoded search (null = none), so the tab links back to the│ │35 +// searched list │ │36 +discussions_search: ?[]const u8, │ │37 +issues_search: ?[]const u8, │ │38 +patches_search: ?[]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, discussions_label: []const u8, issues_label: []const u8, patches_label: []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, discussions_search: ?[]const u8, issues_search: ?[]const u8, patches_search: ?[]const u8) !Self {│ │43 return .{ │ │44 .name = name, │ │45 .owner_name = owner_name, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │46 .title = try ui.Title.init(arena, name, .scanlines),│ │47 .ref_or_oid = ref_or_oid, │ │48 .ref_or_oid_value = ref_or_oid_value, │ │49 - .discussions_label = discussions_label, │ │50 - .issues_label = issues_label, │ │51 - .patches_label = patches_label, │ │49 + .discussions_search = discussions_search, │ │50 + .issues_search = issues_search, │ │51 + .patches_search = patches_search, │ │52 }; │ │53 } │ │54 │ ╰────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │79 const aa = session.page_arena.allocator(); │ │80 const ref_name = std.Uri.percentDecodeInPlace(try aa.dupe(u8, page.files.patchrev_id orelse data.ref_or_oid_value)); │ │81 const bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), ref_name); │ │82 - const discussions_bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.discussions_label)));│ │83 - const issues_bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.issues_label))); │ │84 - const patches_bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.patches_label))); │ │82 const changes_label = switch (page.changes) { │ │83 .diff => diff_tab_label, │ │84 .commits => |c| if (c.commit_count) |count| try aa.print(commits_tab_label ++ " ({d})", .{count}) else commits_tab_label, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │158 const changes_link = try ui.inPageTabLink(session, changes_route, current_tag == changes_tag); │ │159 const refs_route = ui.RoutablePage.repoRefsRoute(identity, .branch, "") orelse return error.RouteTooLong; │ │160 const refs_link = try ui.inPageTabLink(session, refs_route, current_tag == .repo_refs); │ │164 - const discussions_route = ui.RoutablePage.repoDiscussionsRoute(identity, data.discussions_label, "") orelse return error.RouteTooLong; │ │161 + const discussions_route = try ui.widget.thread.searchRoute(ui.RoutablePage.repoDiscussionsRoute(identity, ""), data.discussions_search);│ │162 const discussions_link = try ui.inPageTabLink(session, discussions_route, current_tag == .repo_discussions); │ │166 - const issues_route = ui.RoutablePage.repoIssuesRoute(identity, .open, data.issues_label, "") orelse return error.RouteTooLong; │ │163 + const issues_route = try ui.widget.thread.searchRoute(ui.RoutablePage.repoIssuesRoute(identity, .open, ""), data.issues_search); │ │164 const issues_link = try ui.inPageTabLink(session, issues_route, current_tag == .repo_issues); │ │168 - const patches_route = ui.RoutablePage.repoPatchesRoute(identity, .open, data.patches_label, "") orelse return error.RouteTooLong; │ │165 + const patches_route = try ui.widget.thread.searchRoute(ui.RoutablePage.repoPatchesRoute(identity, .open, ""), data.patches_search); │ │166 const patches_link = try ui.inPageTabLink(session, patches_route, current_tag == .repo_patches); │ │167 const events_route = ui.RoutablePage.repoEventsRoute(identity, .active, null, "", null) orelse return error.RouteTooLong; │ │168 const events_link = try ui.inPageTabLink(session, events_route, current_tag == .repo_events); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │224 │ │225 // discuss tab, unless it is off │ │226 if (page.repo.event.discuss_role != null) { │ │230 - var text_box = try wgt.TextBox.init(allocator, discuss_tab_label, .{ .border = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = .{ .text = discussions_bottom_label } });│ │227 + var text_box = try wgt.TextBox.init(allocator, discuss_tab_label, .{ .border = .single, .round_corners = true, .wrap_kind = .none }); │ │228 errdefer text_box.deinit(allocator); │ │229 text_box.getFocus().mode = .all; │ │230 text_box.getFocus().kind = .{ .custom = discussions_link }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │239 │ │240 // issues tab, unless it is off │ │241 if (page.repo.event.issue_role != null) { │ │245 - var text_box = try wgt.TextBox.init(allocator, issues_tab_label, .{ .border = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = .{ .text = issues_bottom_label } });│ │242 + var text_box = try wgt.TextBox.init(allocator, issues_tab_label, .{ .border = .single, .round_corners = true, .wrap_kind = .none }); │ │243 errdefer text_box.deinit(allocator); │ │244 text_box.getFocus().mode = .all; │ │245 text_box.getFocus().kind = .{ .custom = issues_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯