╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │ 99 try box.children.put(allocator, text_box.getFocus().id, .{ │ │100 .widget = .{ .text_box = text_box }, │ │101 .rect = null, │ │ 98 - .min_size = .{ .width = "repos".len + 2, .height = null }, │ │102 + .min_size = .{ .width = repos_tab_label.len + 2, .height = null },│ │103 }); │ │104 } │ │105 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │106 // users tab │ │107 { │ │104 - var text_box = try wgt.TextBox.init(allocator, "users", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │108 + var text_box = try wgt.TextBox.init(allocator, users_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │109 errdefer text_box.deinit(allocator); │ │110 text_box.getFocus().mode = .all; │ │111 text_box.getFocus().kind = .{ .custom = users_link }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │114 try box.children.put(allocator, text_box.getFocus().id, .{ │ │115 .widget = .{ .text_box = text_box }, │ │116 .rect = null, │ │113 - .min_size = .{ .width = "users".len + 2, .height = null }, │ │117 + .min_size = .{ .width = users_tab_label.len + 2, .height = null },│ │118 }); │ │119 } │ │120 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │132 │ │133 // settings tab. settings are account preferences, so it needs a login. │ │134 if (session.data.user_id != null) { │ │131 - var text_box = try wgt.TextBox.init(allocator, "settings", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │135 + var text_box = try wgt.TextBox.init(allocator, settings_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │136 errdefer text_box.deinit(allocator); │ │137 text_box.getFocus().mode = .all; │ │138 text_box.getFocus().kind = .{ .custom = settings_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │141 try box.children.put(allocator, text_box.getFocus().id, .{ │ │142 .widget = .{ .text_box = text_box }, │ │143 .rect = null, │ │140 - .min_size = .{ .width = "settings".len + 2, .height = null }, │ │144 + .min_size = .{ .width = settings_tab_label.len + 2, .height = null },│ │145 }); │ │146 } │ │147 │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │263 pub const detail_widget_name = "repo_discussion_detail"; │ │264 │ │265 pub const Header = thread.Header; │ │266 + │ │267 +const recent_tab_label = "recent"; │ │268 +const tags_tab_label = "tags"; │ │269 +const edit_tab_label = "edit"; │ │270 +const reply_tab_label = "reply"; │ │271 +const remove_tab_label = "remove"; │ │272 +const new_tab_label = "new"; │ │273 │ │274 // tabs switching between the discussions page's views │ │275 pub fn initHeader(allocator: std.mem.Allocator, session: *ui.Session, data: *const Self) !Header {│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │284 const route = ui.RoutablePage.repoDiscussionsRoute(data.identity, data.tag, "") orelse return error.RouteTooLong;│ │285 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == 0); │ │286 var label_buf: [64]u8 = undefined; │ │280 - const label = try std.fmt.bufPrint(&label_buf, "recent ({d})", .{data.recent.count}); │ │287 + const label = try std.fmt.bufPrint(&label_buf, recent_tab_label ++ " ({d})", .{data.recent.count}); │ │288 try header.addTab(allocator, label, link, 0); │ │289 } │ │290 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │292 { │ │293 const tags_route = ui.RoutablePage.repoThreadTagsRoute(.discuss, data.identity, data.tag) orelse return error.RouteTooLong;│ │294 const tags_link = try ui.inPageTabLink(session, tags_route, page_selected and selected_index == View.viewIndex(.tags)); │ │288 - const label = if (data.tag.len == 0) "tags" else blk: { │ │295 + const label = if (data.tag.len == 0) tags_tab_label else blk: { │ │296 const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.tag)); │ │290 - break :blk try std.fmt.allocPrint(aa, "tags ({s})", .{decoded}); │ │297 + break :blk try std.fmt.allocPrint(aa, tags_tab_label ++ " ({s})", .{decoded}); │ │298 }; │ │299 try header.addTab(allocator, label, tags_link, View.viewIndex(.tags)); │ │300 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │310 }; │ │311 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.new));│ │312 const label: []const u8 = switch (data.view) { │ │306 - .edit => "edit", │ │307 - .new_comment => "reply", │ │308 - .edit_comment => "edit", │ │309 - .remove => "remove", │ │310 - else => "new", │ │313 + .edit => edit_tab_label, │ │314 + .new_comment => reply_tab_label, │ │315 + .edit_comment => edit_tab_label, │ │316 + .remove => remove_tab_label, │ │317 + else => new_tab_label, │ │318 }; │ │319 try header.addTab(allocator, label, link, View.viewIndex(.new)); │ │320 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Events.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────╮ │13 const Key = xitui.input.Key; │ │14 const Grid = xitui.grid.Grid; │ │15 const Focus = xitui.focus.Focus; │ │16 + │ │17 +const active_tab_label = "active"; │ │18 +const removed_tab_label = "removed";│ │19 │ │20 const page_size = 20; │ │21 │ ╰────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯