╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │603 return root_focus.grandchild_id == id; │ │604 } │ │605 │ │606 - // keep the diff scroll within its content, using the last build's grids. │ │606 + // keep the diff scroll within its content, using the last build's grids. the │ │607 + // scroll bar's reserved column/row isn't part of the content viewport, so │ │608 + // exclude it (as scrollToRect does) or the last column/row stays unreachable.│ │609 fn clampDiffScroll(self: *View) void { │ │610 const sc = self.diffScroll(); │ │611 const vp = sc.grid orelse return; │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │612 const content = sc.child.box.grid orelse return; │ │611 - const max_y: isize = if (content.size.height > vp.size.height) @intCast(content.size.height - vp.size.height) else 0;│ │612 - const max_x: isize = if (content.size.width > vp.size.width) @intCast(content.size.width - vp.size.width) else 0; │ │613 + const view_w = vp.size.width - sc.bar_w; │ │614 + const view_h = vp.size.height - sc.bar_h; │ │615 + const max_y: isize = if (content.size.height > view_h) @intCast(content.size.height - view_h) else 0; │ │616 + const max_x: isize = if (content.size.width > view_w) @intCast(content.size.width - view_w) else 0; │ │617 sc.y = std.math.clamp(sc.y, 0, max_y); │ │618 sc.x = std.math.clamp(sc.x, 0, max_x); │ │619 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯