╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │11 │ │12 const repos_tab_label = "repos"; │ │13 const forks_tab_label = "forks"; │ │14 -const settings_tab_label = "settings"; │ │14 const new_repo_tab_label = "new repo"; │ │15 │ │16 pub const AuthTab = @import("./../AuthTab.zig");│ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │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 │ │95 - // the global settings or auth pages. the "ai:" prefix makes each an │ │94 + // the global new repo or auth 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 │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │102 const current_link = try std.fmt.allocPrint(aa, "ai:{s}", .{try current_page.toUrl(session.page_arena)}); │ │103 const repos_link = if (current_tag == .user_repos) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}", .{data.name}); │ │104 const forks_link = if (current_tag == .user_forks) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/forks", .{data.name}); │ │106 - const settings_link = if (current_tag == .user_settings) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/settings", .{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 auth_link = if (current_tag == .user_auth) current_link else try std.fmt.allocPrint(aa, "ai:/user/{s}/auth", .{data.name}); │ │107 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │108 // the tab matching the current page is focused initially; matching by│ │109 // link (rather than position) keeps this robust to tab changes. │ │110 const selected_link: []const u8 = switch (current_page) { │ │113 - .user_settings => settings_link, │ │111 .user_new_repo => new_repo_link, │ │112 .user_auth => auth_link, │ │113 .user_forks => forks_link, │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────╮ │145 }); │ │146 } │ │147 │ │151 - // spacer pushes settings, new repo and auth to the right│ │148 + // spacer pushes new repo and auth to the right │ │149 { │ │150 var spacer = try ui.widget.Spacer.init(allocator); │ │151 errdefer spacer.deinit(allocator); │ ╰──────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │169 .widget = .{ .text_box = text_box }, │ │170 .rect = null, │ │171 .min_size = .{ .width = new_repo_tab_label.len + 2, .height = null }, │ │175 - }); │ │176 - } │ │177 - │ │178 - // settings tab. settings are account preferences, so it needs a login. │ │179 - if (session.data.user_id != null) { │ │180 - var text_box = try wgt.TextBox.init(allocator, settings_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none });│ │181 - errdefer text_box.deinit(allocator); │ │182 - text_box.getFocus().mode = .all; │ │183 - text_box.getFocus().kind = .{ .custom = settings_link }; │ │184 - try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │185 - if (std.mem.eql(u8, settings_link, selected_link)) selected_tab = text_box.getFocus().id; │ │186 - try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │187 - .widget = .{ .text_box = text_box }, │ │188 - .rect = null, │ │189 - .min_size = .{ .width = settings_tab_label.len + 2, .height = null }, │ │172 }); │ │173 } │ │174 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯