╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │85 } │ │86 │ │87 { │ │91 - var auth_view = try Auth.View.init(allocator, &data.auth, session); │ │92 - errdefer auth_view.deinit(allocator); │ │93 - try stack.children.put(allocator, auth_view.getFocus().id, .{ .home_auth = auth_view });│ │88 + var user_view = try ui.UserLogout.initView(allocator, session); │ │89 + errdefer user_view.deinit(allocator); │ │90 + try stack.children.put(allocator, user_view.getFocus().id, user_view); │ │91 } │ │92 │ │93 if (session.is_terminal) { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/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 // null hides the title │ │19 title: ?ui.Title, │ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │93 const users_link = try ui.inPageTabLink(session, .{ .home_users = .{} }, current_tag == .home_users);│ │94 const new_repo_link = try ui.inPageTabLink(session, .home_new_repo, current_tag == .home_new_repo); │ │95 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); │ │96 + const user_link = try ui.inPageTabLink(session, .home_user, current_tag == .home_user); │ │97 const current_link: []const u8 = switch (current_tag) { │ │98 .home_users => users_link, │ │99 .home_new_repo => new_repo_link, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │100 .home_new_user => new_user_link,│ │103 - .home_auth => auth_link, │ │101 + .home_user => user_link, │ │102 else => about_link, │ │103 }; │ │104 var selected_tab: ?usize = null; │ ╰─────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │133 }); │ │134 } │ │135 │ │138 - // spacer pushes new repo, new user, and auth to the right│ │136 + // spacer pushes new repo, new user, and user to the right│ │137 { │ │138 var spacer = try ui.widget.Spacer.init(allocator); │ │139 errdefer spacer.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │172 }); │ │173 } │ │174 │ │177 - // auth tab (login / logout) │ │175 + // user tab │ │176 { │ │179 - var auth_tab = try AuthTab.View.init(allocator, session); │ │180 - errdefer auth_tab.deinit(allocator); │ │181 - auth_tab.text_box.getFocus().kind = .{ .custom = auth_link }; │ │182 - try tab_ids.put(allocator, auth_tab.getFocus().id, {}); │ │183 - if (std.mem.eql(u8, auth_link, current_link)) selected_tab = auth_tab.getFocus().id; │ │184 - try tabs_box.children.put(allocator, auth_tab.getFocus().id, .{ │ │185 - .widget = .{ .auth_tab = auth_tab }, │ │177 + const label = ui.UserLogout.tabLabel(session); │ │178 + var text_box = try wgt.TextBox.init(allocator, label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none });│ │179 + errdefer text_box.deinit(allocator); │ │180 + text_box.getFocus().mode = .all; │ │181 + text_box.getFocus().kind = .{ .custom = user_link }; │ │182 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │183 + if (std.mem.eql(u8, user_link, current_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 = auth_tab.minWidth(), .height = null }, │ │187 + .min_size = .{ .width = label.len + 2, .height = null }, │ │188 }); │ │189 } │ │190 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │249 for (tabs_box.children.keys(), tabs_box.children.values()) |id, *child| { │ │250 const tb: ?*wgt.TextBox = switch (child.widget) { │ │251 .text_box => |*x| x, │ │252 - .auth_tab => |*at| blk: { │ │253 - // the label tracks login state per frame, so the width must too│ │254 - child.min_size = .{ .width = at.minWidth(), .height = null }; │ │255 - break :blk &at.text_box; │ │256 - }, │ │252 else => null, │ │253 }; │ │254 if (tb) |t| ui.widget.markSelected(t, selected_tab == id); │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────╮ │24 pub const Comment = @import("./Repo/Comment.zig");│ │25 pub const Undo = @import("./Repo/Undo.zig"); │ │26 pub const Events = @import("./Repo/Events.zig"); │ │27 -pub const Auth = @import("./Auth.zig"); │ │27 pub const Quit = @import("./Quit.zig"); │ │28 │ │29 header: Header, │ ╰──────────────────────────────────────────────────────╯ ╭─────────────────────────────╮ │37 discussions: Discussions,│ │38 events: Events, │ │39 undo: ?Undo = null, │ │41 -auth: Auth, │ │40 quit: Quit, │ │41 │ │42 const Self = @This(); │ ╰─────────────────────────────╯ ╭────────────────────────────────────────╮ │360 .discussions = discussions,│ │361 .events = events, │ │362 .undo = undo_data, │ │365 - .auth = Auth.init(), │ │363 .quit = Quit.init(), │ │364 }; │ │365 } │ ╰────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯