╭ changed ─────────────╮ │src/ui/Repo/Events.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │646 box: wgt.Box(ui.Widget), │ │647 session: *ui.Session, │ │648 tab_ids: [2]usize, │ │649 + // the tab stays selected while the sync button has focus │ │650 + selected_tab: usize, │ │651 button_id: ?usize, │ │652 │ │653 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !Header.View {│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │686 try box.children.put(allocator, status.getFocus().id, .{ .widget = .{ .text_box = status }, .rect = null, .min_size = null, .flex = .shrink });│ │687 } │ │688 box.getFocus().child_id = tab_ids[@intFromEnum(data.view)]; │ │687 - return .{ .box = box, .session = session, .tab_ids = tab_ids, .button_id = button_id }; │ │689 + return .{ .box = box, .session = session, .tab_ids = tab_ids, .selected_tab = @intFromEnum(data.view), .button_id = button_id }; │ │690 } │ │691 │ │692 pub fn deinit(self: *Header.View, allocator: std.mem.Allocator) void { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │695 │ │696 pub fn build(self: *Header.View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │697 self.clearGrid(); │ │696 - for (self.tab_ids) |id| { │ │698 + if (self.getSelectedIndex()) |index| self.selected_tab = index; │ │699 + for (self.tab_ids, 0..) |id, index| { │ │700 const child = self.box.children.getPtr(id) orelse continue; │ │701 const tab = switch (child.widget) { │ │702 .text_box => |*text_box| text_box, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │703 else => continue, │ │704 }; │ │702 - ui.widget.markSelected(tab, self.box.getFocus().child_id == id);│ │705 + ui.widget.markSelected(tab, index == self.selected_tab); │ │706 } │ │707 try self.box.build(allocator, constraint, root_focus); │ │708 } │ ╰─────────────────────────────────────────────────────────────────────────────────────╯