╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1155 return false; │ │1156 } │ │1157 │ │1158 - fn focusChild(self: *This, child_index: usize, last: bool, root_focus: *Focus) void { │ │1158 + // focus child `child_index`, its last part when `last`, entered from above │ │1159 + // when `down` │ │1160 + fn focusChild(self: *This, child_index: usize, last: bool, down: bool, root_focus: *Focus) void {│ │1161 const inner_box = self.inner(); │ │1162 const child = &inner_box.children.values()[child_index]; │ │1163 var target = inner_box.children.keys()[child_index]; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1179 root_focus.setFocus(target); │ │1180 }, │ │1181 else => root_focus.setFocus(target), │ │1180 - } │ │1181 - const detail_scroll = &self.scroll; │ │1182 - if (detail_scroll.grid) |viewport| { │ │1183 - const viewport_height = viewport.size.height - detail_scroll.bar_h; │ │1184 - if (rect.size.height > viewport_height) { │ │1185 - const bottom_aligned = rect.y + @as(isize, @intCast(rect.size.height - viewport_height));│ │1186 - detail_scroll.y = std.math.clamp(detail_scroll.y, rect.y, bottom_aligned); │ │1187 - detail_scroll.clampToContent(); │ │1188 - return; │ │1189 - } │ │1182 } │ │1191 - detail_scroll.scrollToRect(rect); │ │1183 + widget.scrollToEnteredRow(&self.scroll, rect, down); │ │1184 } │ │1185 │ │1186 fn moveVertical(self: *This, root_focus: *Focus, down: bool) bool { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │1192 if (inner_box.children.values()[current].widget == .repo_comment) { │ │1193 const comment = &inner_box.children.values()[current].widget.repo_comment;│ │1194 if (down and !comment.bodyFocused()) { │ │1203 - self.focusChild(current, true, root_focus); │ │1195 + self.focusChild(current, true, true, root_focus); │ │1196 return true; │ │1197 } │ │1198 if (!down and comment.bodyFocused()) { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │1207 - self.focusChild(current, false, root_focus); │ │1199 + self.focusChild(current, false, false, root_focus);│ │1200 return true; │ │1201 } │ │1202 } │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │1211 next -= 1; │ │1212 } │ │1213 if (!self.childFocusable(next)) continue; │ │1222 - self.focusChild(next, !down, root_focus); │ │1214 + self.focusChild(next, !down, down, root_focus);│ │1215 return true; │ │1216 } │ │1217 } │ ╰─────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │1304 else => if (!self.childFocusable(child_index)) continue, │ │1305 } │ │1306 if (root_focus) |focus| │ │1315 - self.focusChild(child_index, false, focus) │ │1307 + self.focusChild(child_index, false, true, focus) │ │1308 else │ │1309 inner_box.getFocus().child_id = inner_box.children.keys()[child_index];│ │1310 return true; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯