╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Auth/Logout.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │127 } │ │128 │ │129 pub fn atTop(self: View) bool { │ │114 - _ = self; │ │115 - return true; │ │130 + return self.center.child.box.focus.child_id == self.center.child.box.children.keys()[ansi_index];│ │131 } │ │132 }; │ │133 + │ │134 +fn ansiLabel(session: *const ui.Session) []const u8 { │ │135 + return if (session.data.enable_ansi) "turn off ANSI art" else "turn on ANSI art"; │ │136 +} │ │137 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────╮ │src/ui/AuthTab.zig│ ╰──────────────────╯ ╭──────────────────────────────────────╮ │ 9 const Focus = xitui.focus.Focus; │ │10 │ │11 const login_tab_label = "login"; │ │12 -const logout_tab_label = "logout";│ │12 │ │13 pub const View = struct { │ │14 text_box: wgt.TextBox, │ ╰──────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │15 session: *ui.Session, │ │17 - // backs the bottom label, which borrows it │ │18 - bottom_label_buf: [ui.clipped_bottom_label_max_len]u8, │ │16 │ │17 pub fn init(allocator: std.mem.Allocator, session: *ui.Session) !View { │ │18 var text_box = try wgt.TextBox.init(allocator, login_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none });│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────╮ │22 return .{ │ │23 .text_box = text_box, │ │24 .session = session, │ │28 - .bottom_label_buf = undefined,│ │25 }; │ │26 } │ │27 │ ╰──────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │29 self.text_box.deinit(allocator); │ │30 } │ │31 │ │32 + // the logged-in user's name, or the login label │ │33 fn text(self: *const View) []const u8 { │ │37 - return if (self.session.data.user_id == null) login_tab_label else logout_tab_label; │ │34 + if (self.session.data.user_id == null) return login_tab_label; │ │35 + return self.session.data.user_name orelse unreachable; │ │36 } │ │37 │ │40 - fn bottomLabel(self: *View) []const u8 { │ │41 - if (self.session.data.user_id == null) return ""; │ │42 - const name = self.session.data.user_name orelse return ""; │ │43 - return ui.clippedBottomLabel(&self.bottom_label_buf, name) catch unreachable; │ │38 + pub fn minWidth(self: *const View) usize { │ │39 + return self.text().len + 2; │ │40 } │ │41 │ │46 - pub fn minWidth(self: *View) usize { │ │47 - return @max(self.text().len, self.bottomLabel().len) + 2; │ │48 - } │ │49 - │ │42 pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │43 try self.text_box.setContent(allocator, self.text()); │ │52 - self.text_box.options.bottom_label = self.bottomLabel(); │ │44 try self.text_box.build(allocator, constraint, root_focus); │ │45 } │ │46 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Fork.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────╮ │17 pub const Commits = @import("./Repo/Commits.zig");│ │18 pub const Diff = @import("./Repo/Diff.zig"); │ │19 pub const Patches = @import("./Repo/Patches.zig");│ │20 -pub const Settings = @import("./Settings.zig"); │ │20 pub const Auth = @import("./Auth.zig"); │ │21 pub const Quit = @import("./Quit.zig"); │ │22 │ ╰──────────────────────────────────────────────────────╯ ╭───────────────────────╮ │25 commits: Commits, │ │26 patch: Patches, │ │27 diff: Diff, │ │29 -settings: Settings,│ │28 auth: Auth, │ │29 quit: Quit, │ │30 │ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │161 .path = diff_path, │ │162 .window = try Diff.render(.xit, repo_opts, io, arena.child_allocator, aa, fork_repo, &commits_base_oid, fork_oid, diff_start, diff_path),│ │163 }, │ │166 - .settings = Settings.init(), │ │164 .auth = Auth.init(), │ │165 .quit = Quit.init(), │ │166 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │210 var new_repo = try ui.NewRepo.View.init(allocator, session, route); │ │211 errdefer new_repo.deinit(allocator); │ │212 try stack.children.put(allocator, new_repo.getFocus().id, .{ .new_repo = new_repo }); │ │216 - } │ │217 - if (session.data.user_id != null) { │ │218 - var settings = try Settings.View.init(allocator, session); │ │219 - errdefer settings.deinit(allocator); │ │220 - try stack.children.put(allocator, settings.getFocus().id, .{ .home_settings = settings });│ │213 } │ │214 if (session.data.host_kind == .server) { │ │215 var auth = try Auth.View.init(allocator, &data.auth, session); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Fork/Header.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────╮ │14 const patch_tab_label = "patch"; │ │15 const diff_tab_label = "diff"; │ │16 const files_tab_label = "files"; │ │17 -const settings_tab_label = "settings"; │ │17 const new_repo_tab_label = "new repo"; │ │18 │ │19 pub const AuthTab = @import("../AuthTab.zig");│ ╰──────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯