╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1055 switch (key) { │ │1056 .arrow_left => try self.focusList(index, root_focus), │ │1057 .arrow_up => self.focusToolRow(index, root_focus), │ │1058 + .arrow_down => if (self.authorPresent(index)) self.focusAuthor(index, root_focus) else try self.focusDescription(index, root_focus), │ │1059 + .mouse => |mouse| switch (mouse.action) { │ │1060 + .scroll => |dir| { │ │1061 + sc.y += if (dir == .up) @as(isize, -1) else 1; │ │1062 + sc.clampToContent(); │ │1063 + }, │ │1064 + else => {}, │ │1065 + }, │ │1066 + else => {}, │ │1067 + } │ │1068 + } │ │1069 + │ │1070 + // the author box's a: link (when it has one) is followed by the host on │ │1071 + // enter / a click; arrows cross to the neighboring widgets. │ │1072 + fn authorInput(self: *View, index: usize, key: Key, root_focus: *Focus) !void { │ │1073 + const sc = self.detailScroll(index); │ │1074 + switch (key) { │ │1075 + .arrow_left => try self.focusList(index, root_focus), │ │1076 + .arrow_up => self.focusTitle(index, root_focus), │ │1077 .arrow_down => if (self.tagFlow(index) != null) try self.focusTags(index, root_focus) else try self.focusDescription(index, root_focus),│ │1078 .mouse => |mouse| switch (mouse.action) { │ │1079 .scroll => |dir| { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1097 sc.y -= 1; │ │1098 sc.clampToContent(); │ │1099 if (sc.y == before) { │ │1061 - if (self.tagFlow(index) != null) try self.focusTags(index, root_focus) else self.focusTitle(index, root_focus);│ │1100 + if (self.tagFlow(index) != null) │ │1101 + try self.focusTags(index, root_focus) │ │1102 + else if (self.authorPresent(index)) │ │1103 + self.focusAuthor(index, root_focus) │ │1104 + else │ │1105 + self.focusTitle(index, root_focus); │ │1106 } │ │1107 return; │ │1108 }, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1311 switch (key) { │ │1312 .arrow_left => if (cur > 0) self.focusTag(index, tf, root_focus, cur - 1) else try self.focusList(index, root_focus), │ │1313 .arrow_right => if (cur + 1 < count) self.focusTag(index, tf, root_focus, cur + 1), │ │1270 - .arrow_up => if (tf.rowStep(cur, false)) |i| self.focusTag(index, tf, root_focus, i) else self.focusTitle(index, root_focus), │ │1314 + .arrow_up => if (tf.rowStep(cur, false)) |i| self.focusTag(index, tf, root_focus, i) else self.focusAuthor(index, root_focus), │ │1315 .arrow_down => if (tf.rowStep(cur, true)) |i| self.focusTag(index, tf, root_focus, i) else try self.focusDescription(index, root_focus),│ │1316 .home => self.focusTag(index, tf, root_focus, 0), │ │1317 .end => self.focusTag(index, tf, root_focus, count - 1), │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │1329 const button_in_row_index: usize = 1; │ │1330 const edit_in_row_index: usize = 2; │ │1331 const title_child_index: usize = 0; │ │1288 - const tags_child_index: usize = 1; │ │1332 + const tags_child_index: usize = 2; │ │1333 │ │1334 fn tagFlow(self: *View, index: usize) ?*ui.TagFlow {│ │1335 const inner = self.detailInner(index); │ ╰──────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │1377 const inner = self.detailInner(index); │ │1378 const cid = inner.getFocus().child_id orelse return false; │ │1379 return inner.children.getIndex(cid) == title_child_index; │ │1380 + } │ │1381 + │ │1382 + fn authorPresent(self: *View, index: usize) bool { │ │1383 + return self.author_id[index] != null; │ │1384 } │ │1385 │ │1386 + fn authorFocused(self: *View, index: usize) bool { │ │1387 + const inner = self.detailInner(index); │ │1388 + const cid = inner.getFocus().child_id orelse return false; │ │1389 + return cid == self.author_id[index]; │ │1390 + } │ │1391 + │ │1392 + // the author sits right under the title at the top of the pane, so │ │1393 + // focusing it scrolls there. │ │1394 + fn focusAuthor(self: *View, index: usize, root_focus: *Focus) void { │ │1395 + const id = self.author_id[index] orelse return; │ │1396 + root_focus.setFocus(id); │ │1397 + self.detailScroll(index).y = 0; │ │1398 + } │ │1399 + │ │1400 // the title sits at the top of the pane, so focusing it scrolls there.│ │1401 fn focusTitle(self: *View, index: usize, root_focus: *Focus) void { │ │1402 const inner = self.detailInner(index); │ ╰─────────────────────────────────────────────────────────────────────────────────╯