╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │450 try stack.children.put(allocator, undo_view.getFocus().id, .{ .repo_undo = undo_view }); │ │451 } │ │452 │ │453 - // the header only shows the new repo tab with a login │ │454 - // and the auth tab outside local mode, so keep the stack's children 1:1 with │ │455 - // the tabs by skipping the same views. │ │453 + // the header shows new repo with a login, and new user without one │ │454 + // and auth only outside local mode, so keep the stack's children │ │455 + // 1:1 with the tabs by skipping the same views. │ │456 + const identity = try std.fmt.allocPrint(session.page_arena.allocator(), "{s}/{s}", .{ data.header.owner_name, data.header.name }); │ │457 if (session.data.user_id != null) { │ │457 - const identity = try std.fmt.allocPrint(session.page_arena.allocator(), "{s}/{s}", .{ data.header.owner_name, data.header.name }); │ │458 const route = ui.RoutablePage{ .repo_new_repo = ui.RoutablePage.Array(ui.RoutablePage.repo_route_max_len).from(identity) orelse return error.RouteTooLong };│ │459 var new_repo_view = try ui.NewRepo.View.init(allocator, session, route); │ │460 errdefer new_repo_view.deinit(allocator); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │461 try stack.children.put(allocator, new_repo_view.getFocus().id, .{ .new_repo = new_repo_view }); │ │462 + } else if (session.data.host_kind == .server) { │ │463 + const route = ui.RoutablePage{ .repo_new_user = ui.RoutablePage.Array(ui.RoutablePage.repo_route_max_len).from(identity) orelse return error.RouteTooLong };│ │464 + var new_user_view = try ui.NewUser.View.init(allocator, session, route); │ │465 + errdefer new_user_view.deinit(allocator); │ │466 + try stack.children.put(allocator, new_user_view.getFocus().id, .{ .new_user = new_user_view }); │ │467 } │ │468 │ │469 if (session.data.host_kind == .server) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────╮ │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 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │231 try stack.children.put(allocator, list.getFocus().id, .{ .flow_box_scroll = list }); │ │232 } │ │233 │ │234 - // the header has no new repo tab without a login, so keep the │ │235 - // stack's children 1:1 with the tabs by skipping that view too │ │234 + // the header shows new repo with a login and new user without │ │235 + // one, so keep the stack's children 1:1 with the tabs │ │236 if (session.data.user_id != null) { │ │237 const route = ui.RoutablePage{ .user_new_repo = ui.RoutablePage.Array(evt.User.name_max_len).from(data.user.name) orelse return error.RouteTooLong };│ │238 var new_repo_view = try ui.NewRepo.View.init(allocator, session, route); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯