╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │18 const patches_tab_label = "patches"; │ │19 const discuss_tab_label = "discuss"; │ │20 const events_tab_label = "events"; │ │21 -const new_repo_tab_label = "new"; │ │21 +const new_tab_label = "new"; │ │22 const new_repo_tab_bottom_label = "repo"; │ │23 +const new_user_tab_bottom_label = "user"; │ │24 │ │25 pub const AuthTab = @import("./../AuthTab.zig");│ │26 │ ╰────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │170 const events_link = try ui.inPageTabLink(session, events_route, current_tag == .repo_events); │ │171 const new_repo_route = ui.RoutablePage{ .repo_new_repo = Array.from(identity) orelse return error.RouteTooLong };│ │172 const new_repo_link = try ui.inPageTabLink(session, new_repo_route, current_tag == .repo_new_repo); │ │173 + const new_user_route = ui.RoutablePage{ .repo_new_user = Array.from(identity) orelse return error.RouteTooLong };│ │174 + const new_user_link = try ui.inPageTabLink(session, new_user_route, current_tag == .repo_new_user); │ │175 const auth_route = ui.RoutablePage{ .repo_auth = Array.from(identity) orelse return error.RouteTooLong }; │ │176 const auth_link = try ui.inPageTabLink(session, auth_route, current_tag == .repo_auth); │ │177 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │299 }); │ │300 } │ │301 │ │299 - // spacer pushes new repo and auth to the right │ │302 + // spacer pushes new repo, new user, and auth to the right│ │303 { │ │304 var spacer = try ui.widget.Spacer.init(allocator); │ │305 errdefer spacer.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │311 }); │ │312 } │ │313 │ │311 - // new repo tab. repos are created for the logged-in user. │ │314 + // new repo tab with a login, new user tab without one outside local mode │ │315 if (session.data.user_id != null) { │ │313 - 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 });│ │316 + 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 }); │ │317 errdefer text_box.deinit(allocator); │ │318 text_box.getFocus().mode = .all; │ │319 text_box.getFocus().kind = .{ .custom = new_repo_link }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │322 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │323 .widget = .{ .text_box = text_box }, │ │324 .rect = null, │ │322 - .min_size = .{ .width = @max(new_repo_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null }, │ │325 + .min_size = .{ .width = @max(new_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null }, │ │326 + }); │ │327 + } else if (session.data.host_kind == .server) { │ │328 + 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 });│ │329 + errdefer text_box.deinit(allocator); │ │330 + text_box.getFocus().mode = .all; │ │331 + text_box.getFocus().kind = .{ .custom = new_user_link }; │ │332 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │333 + if (current_tag == .repo_new_user) selected_tab = text_box.getFocus().id; │ │334 + try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │335 + .widget = .{ .text_box = text_box }, │ │336 + .rect = null, │ │337 + .min_size = .{ .width = @max(new_tab_label.len, new_user_tab_bottom_label.len) + 2, .height = null }, │ │338 }); │ │339 } │ │340 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯