╭ changed ───────────────────────╮ │src/ui/Repo/Issues/SubHeader.zig│ ╰────────────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │15 box: wgt.Box(ui.Widget), │ │16 tab_ids: std.AutoArrayHashMapUnmanaged(usize, void), │ │17 │ │18 - pub fn init(allocator: std.mem.Allocator, session: *ui.Session, count: usize) !View { │ │18 + // `tag` is the url-encoded tag filter ("" = unfiltered). │ │19 + pub fn init(allocator: std.mem.Allocator, session: *ui.Session, count: usize, tag: []const u8) !View { │ │20 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = .hidden, .rounded_corners = true, .direction = .horiz });│ │21 errdefer box.deinit(allocator); │ │22 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │23 var tab_ids: std.AutoArrayHashMapUnmanaged(usize, void) = .empty;│ │24 errdefer tab_ids.deinit(allocator); │ │25 + │ │26 + const aa = session.page_arena.allocator(); │ │27 │ │28 // results tab, labeled with the listing's issue count │ │29 { │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │27 - const label = try std.fmt.allocPrint(session.page_arena.allocator(), "results ({d})", .{count}); │ │30 + const label = try std.fmt.allocPrint(aa, "results ({d})", .{count}); │ │31 + var text_box = try wgt.TextBox(ui.Widget).init(allocator, label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │32 + errdefer text_box.deinit(allocator); │ │33 + text_box.getFocus().focusable = true; │ │34 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │35 + try box.children.put(allocator, text_box.getFocus().id, .{ │ │36 + .widget = .{ .text_box = text_box }, │ │37 + .rect = null, │ │38 + .min_size = .{ .width = label.len + 2, .height = null }, │ │39 + }); │ │40 + } │ │41 + │ │42 + // tags tab, labeled with the active tag filter │ │43 + { │ │44 + const label = if (tag.len == 0) "tags" else blk: { │ │45 + const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, tag)); │ │46 + break :blk try std.fmt.allocPrint(aa, "tags ({s})", .{decoded}); │ │47 + }; │ │48 var text_box = try wgt.TextBox(ui.Widget).init(allocator, label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │49 errdefer text_box.deinit(allocator); │ │50 text_box.getFocus().focusable = true; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯