╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │239 errdefer new_repo_view.deinit(allocator); │ │240 try stack.children.put(allocator, new_repo_view.getFocus().id, .{ .new_repo = new_repo_view }); │ │241 + } else { │ │242 + const route = ui.RoutablePage{ .user_new_user = ui.RoutablePage.Array(evt.User.name_max_len).from(data.user.name) orelse return error.RouteTooLong };│ │243 + var new_user_view = try ui.NewUser.View.init(allocator, session, route); │ │244 + errdefer new_user_view.deinit(allocator); │ │245 + try stack.children.put(allocator, new_user_view.getFocus().id, .{ .new_user = new_user_view }); │ │246 } │ │247 │ │248 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────╮ │11 │ │12 const repos_tab_label = "repos"; │ │13 const forks_tab_label = "forks"; │ │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 │ ╰────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │105 const repos_link = if (current_tag == .user_repos) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}", .{data.name}); │ │106 const forks_link = if (current_tag == .user_forks) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/forks", .{data.name}); │ │107 const new_repo_link = if (current_tag == .user_new_repo) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/new-repo", .{data.name});│ │108 + const new_user_link = if (current_tag == .user_new_user) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/new-user", .{data.name});│ │109 const auth_link = if (current_tag == .user_auth) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/auth", .{data.name}); │ │110 │ │111 // the tab matching the current page is focused initially; matching by │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │112 // link (rather than position) keeps this robust to tab changes.│ │113 const selected_link: []const u8 = switch (current_page) { │ │114 .user_new_repo => new_repo_link, │ │115 + .user_new_user => new_user_link, │ │116 .user_auth => auth_link, │ │117 .user_forks => forks_link, │ │118 else => repos_link, │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │149 }); │ │150 } │ │151 │ │149 - // spacer pushes new repo and auth to the right │ │152 + // spacer pushes new repo, new user, and auth to the right│ │153 { │ │154 var spacer = try ui.widget.Spacer.init(allocator); │ │155 errdefer spacer.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │161 }); │ │162 } │ │163 │ │161 - // new repo tab. repos are created for the logged-in user. │ │164 + // new repo tab with a login, new user tab without one │ │165 if (session.data.user_id != null) { │ │163 - 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 });│ │166 + 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 }); │ │167 errdefer text_box.deinit(allocator); │ │168 text_box.getFocus().mode = .all; │ │169 text_box.getFocus().kind = .{ .custom = new_repo_link }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │172 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │173 .widget = .{ .text_box = text_box }, │ │174 .rect = null, │ │172 - .min_size = .{ .width = @max(new_repo_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null }, │ │175 + .min_size = .{ .width = @max(new_tab_label.len, new_repo_tab_bottom_label.len) + 2, .height = null }, │ │176 + }); │ │177 + } else { │ │178 + 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 });│ │179 + errdefer text_box.deinit(allocator); │ │180 + text_box.getFocus().mode = .all; │ │181 + text_box.getFocus().kind = .{ .custom = new_user_link }; │ │182 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │183 + if (std.mem.eql(u8, new_user_link, selected_link)) selected_tab = text_box.getFocus().id; │ │184 + try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │185 + .widget = .{ .text_box = text_box }, │ │186 + .rect = null, │ │187 + .min_size = .{ .width = @max(new_tab_label.len, new_user_tab_bottom_label.len) + 2, .height = null }, │ │188 }); │ │189 } │ │190 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭──────────────────────────────────────────────╮ │70 home_users: ui.Home.Users.View, │ │71 auth_tab: ui.Home.Header.AuthTab.View,│ │72 new_repo: ui.NewRepo.View, │ │73 + new_user: ui.NewUser.View, │ │74 home_auth: ui.Home.Auth.View, │ │75 auth_login: ui.Home.Auth.Login.View, │ │76 auth_logout: ui.Home.Auth.Logout.View,│ ╰──────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │115 // whether moving up should return to the page header │ │116 pub fn atTop(self: *Widget, root_focus: *Focus) bool { │ │117 return switch (self.*) { │ │117 - inline .home_about, .home_users, .user_repos, .flow_box_scroll, .new_repo, .auth_login, .auth_logout, .quit, .repo_files, .repo_commits, .diff_view, .repo_refs, .repo_issues, .repo_patches, .repo_discussions, .repo_events, .repo_undo => |*view| view.atTop(), │ │118 + inline .home_about, .home_users, .user_repos, .flow_box_scroll, .new_repo, .new_user, .auth_login, .auth_logout, .quit, .repo_files, .repo_commits, .diff_view, .repo_refs, .repo_issues, .repo_patches, .repo_discussions, .repo_events, .repo_undo => |*view| view.atTop(),│ │119 inline .home_auth, .repo_patch_detail => |*view| view.atTop(root_focus), │ │120 else => false, │ │121 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ added ───────────╮ │src/ui/NewUser.zig│ ╰──────────────────╯ ╭──────╮ │next →│ ╰──────╯