╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │12 const about_tab_label = "about"; │ │13 const users_tab_label = "users"; │ │14 const settings_tab_label = "settings"; │ │15 +const new_repo_tab_label = "new repo"; │ │16 │ │17 pub const AuthTab = @import("./../AuthTab.zig");│ │18 │ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │93 const about_link = try ui.inPageTabLink(session, .home_about, current_tag == .home_about); │ │94 const users_link = try ui.inPageTabLink(session, .{ .home_users = .{} }, current_tag == .home_users);│ │95 const settings_link = try ui.inPageTabLink(session, .home_settings, current_tag == .home_settings); │ │96 + const new_repo_link = try ui.inPageTabLink(session, .home_new_repo, current_tag == .home_new_repo); │ │97 const auth_link = try ui.inPageTabLink(session, .home_auth, current_tag == .home_auth); │ │98 const current_link: []const u8 = switch (current_tag) { │ │99 .home_users => users_link, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │100 .home_settings => settings_link,│ │101 + .home_new_repo => new_repo_link,│ │102 .home_auth => auth_link, │ │103 else => about_link, │ │104 }; │ ╰─────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────╮ │134 }); │ │135 } │ │136 │ │134 - // spacer pushes settings + auth to the right │ │137 + // spacer pushes settings, new repo and auth to the right│ │138 { │ │139 var spacer = try ui.widget.Spacer.init(allocator); │ │140 errdefer spacer.deinit(allocator); │ ╰──────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │143 .rect = null, │ │144 .min_size = null, │ │145 .flex = .grow, │ │146 + }); │ │147 + } │ │148 + │ │149 + // new repo tab. repos are created for the logged-in user. │ │150 + if (session.data.user_id != null) { │ │151 + var text_box = try wgt.TextBox.init(allocator, new_repo_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none });│ │152 + errdefer text_box.deinit(allocator); │ │153 + text_box.getFocus().mode = .all; │ │154 + text_box.getFocus().kind = .{ .custom = new_repo_link }; │ │155 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │156 + if (std.mem.eql(u8, new_repo_link, current_link)) selected_tab = text_box.getFocus().id; │ │157 + try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │158 + .widget = .{ .text_box = text_box }, │ │159 + .rect = null, │ │160 + .min_size = .{ .width = new_repo_tab_label.len + 2, .height = null }, │ │161 }); │ │162 } │ │163 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯