╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Fork/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │123 }); │ │124 } │ │125 │ │125 - // spacer pushes new repo and auth to the right. │ │126 + // spacer pushes new repo, new user, and auth to the right.│ │127 { │ │128 var spacer = try ui.widget.Spacer.init(allocator); │ │129 errdefer spacer.deinit(allocator); │ ╰────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │132 │ │133 const new_repo_route = ui.RoutablePage.forkNewRepoRoute(fork_identity, data.id) orelse return error.RouteTooLong;│ │134 const new_repo_link = try ui.inPageTabLink(session, new_repo_route, current_tag == .fork_new_repo); │ │135 + const new_user_route = ui.RoutablePage.forkNewUserRoute(fork_identity, data.id) orelse return error.RouteTooLong;│ │136 + const new_user_link = try ui.inPageTabLink(session, new_user_route, current_tag == .fork_new_user); │ │137 const auth_route = ui.RoutablePage.forkAuthRoute(fork_identity, data.id) orelse return error.RouteTooLong; │ │138 const auth_link = try ui.inPageTabLink(session, auth_route, current_tag == .fork_auth); │ │139 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │137 - // repos are created for the logged-in user. │ │140 + // new repo tab with a login, new user tab without one outside local mode │ │141 if (session.data.user_id != null) { │ │139 - var new_repo = 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 });│ │142 + var new_repo = try wgt.TextBox.init(allocator, new_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = new_repo_tab_bottom_label }); │ │143 errdefer new_repo.deinit(allocator); │ │144 new_repo.getFocus().mode = .all; │ │145 new_repo.getFocus().kind = .{ .custom = new_repo_link }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │146 try tab_ids.put(allocator, new_repo.getFocus().id, {}); │ │147 if (current_tag == .fork_new_repo) selected_tab = new_repo.getFocus().id; │ │145 - try tabs_box.children.put(allocator, new_repo.getFocus().id, .{ .widget = .{ .text_box = new_repo }, .rect = null, .min_size = .{ .width = @max(new_repo_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null } });│ │148 + try tabs_box.children.put(allocator, new_repo.getFocus().id, .{ .widget = .{ .text_box = new_repo }, .rect = null, .min_size = .{ .width = @max(new_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null } }); │ │149 + } else if (session.data.host_kind == .server) { │ │150 + var new_user = try wgt.TextBox.init(allocator, new_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = new_user_tab_bottom_label }); │ │151 + errdefer new_user.deinit(allocator); │ │152 + new_user.getFocus().mode = .all; │ │153 + new_user.getFocus().kind = .{ .custom = new_user_link }; │ │154 + try tab_ids.put(allocator, new_user.getFocus().id, {}); │ │155 + if (current_tag == .fork_new_user) selected_tab = new_user.getFocus().id; │ │156 + try tabs_box.children.put(allocator, new_user.getFocus().id, .{ .widget = .{ .text_box = new_user }, .rect = null, .min_size = .{ .width = @max(new_tab_label.len, new_user_tab_bottom_label.len) + 2, .height = null } }); │ │157 } │ │158 │ │159 // keep authentication within the fork page. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │75 try stack.children.put(allocator, users_view.getFocus().id, .{ .home_users = users_view });│ │76 } │ │77 │ │78 - // the header has no new repo tab without a login, so keep the │ │79 - // stack's children 1:1 with the tabs by skipping that view too │ │78 + // the header shows new repo with a login and new user without │ │79 + // one, so keep the stack's children 1:1 with the tabs │ │80 if (session.data.user_id != null) { │ │81 var new_repo_view = try ui.NewRepo.View.init(allocator, session, .home_new_repo); │ │82 errdefer new_repo_view.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │83 try stack.children.put(allocator, new_repo_view.getFocus().id, .{ .new_repo = new_repo_view });│ │84 + } else { │ │85 + var new_user_view = try ui.NewUser.View.init(allocator, session, .home_new_user); │ │86 + errdefer new_user_view.deinit(allocator); │ │87 + try stack.children.put(allocator, new_user_view.getFocus().id, .{ .new_user = new_user_view });│ │88 } │ │89 │ │90 { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────╮ │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); │ ╰───────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯