╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭─────────────────────────────╮ │34 forks: []const ForkItem, │ │35 forks_start: usize, │ │36 forks_next_start: ?usize,│ │38 -auth: Auth, │ │37 quit: Quit, │ │38 │ │39 const Self = @This(); │ ╰─────────────────────────────╯ ╭──────────────────────────────────────────────────╮ │169 .forks = forks.items, │ │170 .forks_start = forks_start, │ │171 .forks_next_start = forks_next_start,│ │174 - .auth = Auth.init(), │ │172 .quit = Quit.init(), │ │173 }; │ │174 } │ ╰──────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │183 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .round_corners = true, .direction = .vert });│ │184 errdefer box.deinit(allocator); │ │185 │ │189 - // build the header first so we can grab the repos-tab id for the auth │ │186 + // build the header first so we can grab the repos-tab id for the user │ │187 // view (it focuses there after login). │ │188 { │ │189 var header_view = try Header.View.init(allocator, &data.header, session); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │244 } │ │245 │ │246 { │ │250 - var auth_view = try Auth.View.init(allocator, &data.auth, session); │ │251 - errdefer auth_view.deinit(allocator); │ │252 - try stack.children.put(allocator, auth_view.getFocus().id, .{ .home_auth = auth_view });│ │247 + var user_view = try ui.UserLogout.initView(allocator, session); │ │248 + errdefer user_view.deinit(allocator); │ │249 + try stack.children.put(allocator, user_view.getFocus().id, user_view); │ │250 } │ │251 │ │252 if (session.is_terminal) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────╮ │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");│ │17 │ │18 name: []const u8, │ │19 title: ui.Title, │ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │91 │ │92 // every tab link is user-scoped so selecting one stays on this page — │ │93 // switching its stack and updating the url — instead of navigating to │ │96 - // the global new repo or auth pages. the "ai:" prefix makes each an │ │94 + // the global new repo or user pages. the "ai:" prefix makes each an │ │95 // in-page anchor: crossPageLink ignores it so a wasm click just switches│ │96 // tabs (the page already holds every tab's content), while the href is │ │97 // still followed with js off. allocated in the page arena so the focus │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │104 const forks_link = if (current_tag == .user_forks) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/forks", .{data.name}); │ │105 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});│ │106 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}); │ │107 + const user_link = if (current_tag == .user_user) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/user", .{data.name}); │ │108 │ │109 // the tab matching the current page is focused initially; matching by │ │110 // link (rather than position) keeps this robust to tab changes. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────╮ │111 const selected_link: []const u8 = switch (current_page) {│ │112 .user_new_repo => new_repo_link, │ │113 .user_new_user => new_user_link, │ │116 - .user_auth => auth_link, │ │114 + .user_user => user_link, │ │115 .user_forks => forks_link, │ │116 else => repos_link, │ │117 }; │ ╰──────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │147 }); │ │148 } │ │149 │ │152 - // spacer pushes new repo, new user, and auth to the right│ │150 + // spacer pushes new repo, new user, and user to the right│ │151 { │ │152 var spacer = try ui.widget.Spacer.init(allocator); │ │153 errdefer spacer.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │186 }); │ │187 } │ │188 │ │191 - // auth tab (login / logout). AuthTab defaults to the global ai:/auth │ │192 - // link; repoint its instance at this user's auth route so it stays local. │ │189 + // user tab │ │190 { │ │194 - var auth_tab = try AuthTab.View.init(allocator, session); │ │195 - errdefer auth_tab.deinit(allocator); │ │196 - auth_tab.text_box.getFocus().kind = .{ .custom = auth_link }; │ │197 - try tab_ids.put(allocator, auth_tab.getFocus().id, {}); │ │198 - if (std.mem.eql(u8, auth_link, selected_link)) selected_tab = auth_tab.getFocus().id; │ │199 - try tabs_box.children.put(allocator, auth_tab.getFocus().id, .{ │ │200 - .widget = .{ .auth_tab = auth_tab }, │ │191 + const label = ui.UserLogout.tabLabel(session); │ │192 + var text_box = try wgt.TextBox.init(allocator, label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none });│ │193 + errdefer text_box.deinit(allocator); │ │194 + text_box.getFocus().mode = .all; │ │195 + text_box.getFocus().kind = .{ .custom = user_link }; │ │196 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │197 + if (std.mem.eql(u8, user_link, selected_link)) selected_tab = text_box.getFocus().id; │ │198 + try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │199 + .widget = .{ .text_box = text_box }, │ │200 .rect = null, │ │202 - .min_size = .{ .width = auth_tab.minWidth(), .height = null }, │ │201 + .min_size = .{ .width = label.len + 2, .height = null }, │ │202 }); │ │203 } │ │204 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯