╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │11 │ │12 const about_tab_label = "about"; │ │13 const users_tab_label = "users"; │ │14 -const new_repo_tab_label = "new"; │ │14 +const new_tab_label = "new"; │ │15 const new_repo_tab_bottom_label = "repo"; │ │16 +const new_user_tab_bottom_label = "user"; │ │17 │ │18 pub const AuthTab = @import("./../AuthTab.zig");│ │19 │ ╰────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 94 const about_link = try ui.inPageTabLink(session, .home_about, current_tag == .home_about); │ │ 95 const users_link = try ui.inPageTabLink(session, .{ .home_users = .{} }, current_tag == .home_users);│ │ 96 const new_repo_link = try ui.inPageTabLink(session, .home_new_repo, current_tag == .home_new_repo); │ │ 97 + const new_user_link = try ui.inPageTabLink(session, .home_new_user, current_tag == .home_new_user); │ │ 98 const auth_link = try ui.inPageTabLink(session, .home_auth, current_tag == .home_auth); │ │ 99 const current_link: []const u8 = switch (current_tag) { │ │100 .home_users => users_link, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │101 .home_new_repo => new_repo_link,│ │102 + .home_new_user => new_user_link,│ │103 .home_auth => auth_link, │ │104 else => about_link, │ │105 }; │ ╰─────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │135 }); │ │136 } │ │137 │ │135 - // spacer pushes new repo and auth to the right │ │138 + // spacer pushes new repo, new user, and auth to the right│ │139 { │ │140 var spacer = try ui.widget.Spacer.init(allocator); │ │141 errdefer spacer.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │147 }); │ │148 } │ │149 │ │147 - // new repo tab. repos are created for the logged-in user. │ │150 + // new repo tab with a login, new user tab without one │ │151 if (session.data.user_id != null) { │ │149 - var text_box = try wgt.TextBox.init(allocator, new_repo_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = new_repo_tab_bottom_label });│ │152 + var text_box = try wgt.TextBox.init(allocator, new_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = new_repo_tab_bottom_label }); │ │153 errdefer text_box.deinit(allocator); │ │154 text_box.getFocus().mode = .all; │ │155 text_box.getFocus().kind = .{ .custom = new_repo_link }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │158 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │159 .widget = .{ .text_box = text_box }, │ │160 .rect = null, │ │158 - .min_size = .{ .width = @max(new_repo_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null }, │ │161 + .min_size = .{ .width = @max(new_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null }, │ │162 + }); │ │163 + } else { │ │164 + var text_box = try wgt.TextBox.init(allocator, new_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = new_user_tab_bottom_label });│ │165 + errdefer text_box.deinit(allocator); │ │166 + text_box.getFocus().mode = .all; │ │167 + text_box.getFocus().kind = .{ .custom = new_user_link }; │ │168 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │169 + if (std.mem.eql(u8, new_user_link, current_link)) selected_tab = text_box.getFocus().id; │ │170 + try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │171 + .widget = .{ .text_box = text_box }, │ │172 + .rect = null, │ │173 + .min_size = .{ .width = @max(new_tab_label.len, new_user_tab_bottom_label.len) + 2, .height = null }, │ │174 }); │ │175 } │ │176 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯