╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │48 tab_ids: std.AutoArrayHashMapUnmanaged(usize, void), │ │49 tabs_id: usize, │ │50 first_group_width: usize, │ │51 + session: *ui.Session, │ │52 │ │53 pub fn init(allocator: std.mem.Allocator, data: *const Self, commit_count: ?u64, session: *ui.Session) !View { │ │54 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = .hidden, .rounded_corners = true, .direction = .horiz });│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │73 const commits_label_width = try xitui.width.displayWidth(commits_label);│ │74 var first_group_width = try data.title.width(); │ │75 │ │76 + try ui.widget.addBackButton(allocator, &title_box, session); │ │77 + │ │78 // the user's name (local mode has no user pages to link to) │ │79 if (!session.data.is_local) { │ │80 var text_buf: [evt.User.name_max_len + 1]u8 = undefined; │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │343 .tab_ids = tab_ids, │ │344 .tabs_id = tabs_id, │ │345 .first_group_width = first_group_width,│ │346 + .session = session, │ │347 }; │ │348 } │ │349 │ ╰────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │355 pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │356 self.clearGrid(); │ │357 const box = &self.scroll.child.box; │ │358 + const back_visible = self.session.back == .available; │ │359 + ui.widget.setBackButtonVisible(box, back_visible); │ │360 const tabs_child = self.tabsChild(); │ │361 const tabs_box = &tabs_child.widget.box; │ │362 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │383 // the outer box's hidden border occupies two columns. keep the title │ │384 // and tabs together if they fit; otherwise tab strip on its own row. │ │385 const content_width = if (viewport_width) |width| width -| 2 else null; │ │380 - const wrap = if (content_width) |width| self.first_group_width + tabs_width > width else false; │ │386 + const back_width: usize = if (back_visible) ui.widget.back_button_width else 0; │ │387 + const wrap = if (content_width) |width| self.first_group_width + back_width + tabs_width > width else false;│ │388 box.options.direction = if (wrap) .vert else .horiz; │ │389 tabs_child.min_size = if (wrap) .{ .width = content_width, .height = null } else null; │ │390 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯