╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │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 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │263 for (tabs_box.children.keys(), tabs_box.children.values()) |id, *child| { │ │264 const tb: ?*wgt.TextBox = switch (child.widget) { │ │265 .text_box => |*x| x, │ │267 - .auth_tab => |*at| blk: { │ │268 - // the label tracks login state per frame, so the width must too│ │269 - child.min_size = .{ .width = at.minWidth(), .height = null }; │ │270 - break :blk &at.text_box; │ │271 - }, │ │266 else => null, │ │267 }; │ │268 if (tb) |t| ui.widget.markSelected(t, selected_tab == id); │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯