╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │714 } │ │715 } │ │716 │ │575 - fn listInput(self: *View, key: Key, root_focus: *Focus) !void { │ │717 + fn listInput(self: *View, index: usize, key: Key, root_focus: *Focus) !void {│ │718 // up/down (and the scroll wheel) move the selection a row; page up/down │ │719 // jump a fixed amount. right/Enter cross into the detail pane. up from │ │720 // the top row crosses into the header tabs. │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │579 - if (inp.rowDelta(key, @intCast(self.listBox().children.count()))) |delta| { │ │580 - const lb = self.listBox(); │ │721 + if (inp.rowDelta(key, @intCast(self.listBox(index).children.count()))) |delta| { │ │722 + const lb = self.listBox(index); │ │723 const at_top = if (lb.getFocus().child_id) |cid| lb.children.getIndex(cid) == 0 else true;│ │724 if (delta < 0 and at_top) return self.focusHeader(root_focus); │ │583 - ui.moveRowFocus(lb, self.listScroll(), root_focus, delta); │ │725 + ui.moveRowFocus(lb, self.listScroll(index), root_focus, delta); │ │726 return; │ │727 } │ │728 switch (key) { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │587 - .enter, .arrow_right => try self.focusDetail(root_focus), │ │729 + .enter, .arrow_right => try self.focusDetail(index, root_focus),│ │730 else => {}, │ │731 } │ │732 } │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │733 │ │592 - fn detailInput(self: *View, key: Key, root_focus: *Focus) !void { │ │593 - if (self.tagsFocused()) { │ │594 - try self.tagsInput(key, root_focus); │ │734 + fn detailInput(self: *View, index: usize, key: Key, root_focus: *Focus) !void {│ │735 + if (self.tagsFocused(index)) { │ │736 + try self.tagsInput(index, key, root_focus); │ │737 } else { │ │596 - try self.descriptionInput(key, root_focus); │ │738 + try self.descriptionInput(index, key, root_focus); │ │739 } │ │740 } │ │741 │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │600 - fn descriptionInput(self: *View, key: Key, root_focus: *Focus) !void { │ │601 - const sc = self.detailScroll(); │ │742 + fn descriptionInput(self: *View, index: usize, key: Key, root_focus: *Focus) !void {│ │743 + const sc = self.detailScroll(index); │ │744 switch (key) { │ │603 - .arrow_left => return self.focusList(root_focus), │ │745 + .arrow_left => return self.focusList(index, root_focus), │ │746 // once the scroll can't move further, cross into the tags (or the │ │747 // header tabs when the issue has none). │ │748 .arrow_up => { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │750 sc.y -= 1; │ │751 sc.clampToContent(); │ │752 if (sc.y == before) { │ │611 - if (self.tagFlow() != null) try self.focusTags(root_focus) else self.focusHeader(root_focus); │ │753 + if (self.tagFlow(index) != null) try self.focusTags(index, root_focus) else self.focusHeader(root_focus);│ │754 } │ │755 return; │ │756 }, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │770 │ │771 // arrow keys move the tag selection; at the flow's edges focus crosses to │ │772 // the neighboring widgets. │ │631 - fn tagsInput(self: *View, key: Key, root_focus: *Focus) !void { │ │632 - const tf = self.tagFlow() orelse return; │ │773 + fn tagsInput(self: *View, index: usize, key: Key, root_focus: *Focus) !void {│ │774 + const tf = self.tagFlow(index) orelse return; │ │775 const cid = tf.focus.child_id orelse return; │ │776 const cur = tf.indexOfFocusId(cid) orelse return; │ │777 const count = tf.text_boxes.items.len; │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │636 - const sc = self.detailScroll(); │ │778 + const sc = self.detailScroll(index); │ │779 switch (key) { │ │638 - .arrow_left => if (cur > 0) self.focusTag(tf, root_focus, cur - 1) else try self.focusList(root_focus), │ │639 - .arrow_right => if (cur + 1 < count) self.focusTag(tf, root_focus, cur + 1), │ │640 - .arrow_up => if (tf.rowStep(cur, false)) |i| self.focusTag(tf, root_focus, i) else self.focusHeader(root_focus), │ │641 - .arrow_down => if (tf.rowStep(cur, true)) |i| self.focusTag(tf, root_focus, i) else try self.focusDescription(root_focus), │ │642 - .home => self.focusTag(tf, root_focus, 0), │ │643 - .end => self.focusTag(tf, root_focus, count - 1), │ │780 + .arrow_left => if (cur > 0) self.focusTag(index, tf, root_focus, cur - 1) else try self.focusList(index, root_focus), │ │781 + .arrow_right => if (cur + 1 < count) self.focusTag(index, tf, root_focus, cur + 1), │ │782 + .arrow_up => if (tf.rowStep(cur, false)) |i| self.focusTag(index, tf, root_focus, i) else self.focusHeader(root_focus), │ │783 + .arrow_down => if (tf.rowStep(cur, true)) |i| self.focusTag(index, tf, root_focus, i) else try self.focusDescription(index, root_focus),│ │784 + .home => self.focusTag(index, tf, root_focus, 0), │ │785 + .end => self.focusTag(index, tf, root_focus, count - 1), │ │786 .mouse => |mouse| switch (mouse.action) { │ │787 .scroll => |dir| { │ │788 sc.y += if (dir == .up) @as(isize, -1) else 1; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │796 │ │797 const tags_child_index: usize = 0; │ │798 │ │657 - fn tagFlow(self: *View) ?*ui.TagFlow { │ │658 - const inner = self.detailInner(); │ │799 + fn tagFlow(self: *View, index: usize) ?*ui.TagFlow { │ │800 + const inner = self.detailInner(index); │ │801 if (inner.children.count() == 0) return null; │ │802 return switch (inner.children.values()[tags_child_index].widget) {│ │803 .tag_flow => |*tf| tf, │ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │805 }; │ │806 } │ │807 │ │666 - fn tagsFocused(self: *View) bool { │ │667 - const inner = self.detailInner(); │ │808 + fn tagsFocused(self: *View, index: usize) bool { │ │809 + const inner = self.detailInner(index); │ │810 const cid = inner.getFocus().child_id orelse return false; │ │669 - return inner.children.getIndex(cid) == tags_child_index and self.tagFlow() != null; │ │811 + return inner.children.getIndex(cid) == tags_child_index and self.tagFlow(index) != null; │ │812 } │ │813 │ │672 - fn focusTag(self: *View, tf: *ui.TagFlow, root_focus: *Focus, index: usize) void { │ │673 - root_focus.setFocus(tf.text_boxes.items[index].getFocus().id); │ │814 + fn focusTag(self: *View, index: usize, tf: *ui.TagFlow, root_focus: *Focus, item: usize) void {│ │815 + root_focus.setFocus(tf.text_boxes.items[item].getFocus().id); │ │816 // keep the tag visible on the terminal: its rect offset by the flow's │ │817 // position in the pane. │ │676 - if (self.session.is_terminal and index < tf.rects.items.len) { │ │677 - if (self.detailInner().children.values()[tags_child_index].rect) |flow_rect| { │ │678 - var rect = tf.rects.items[index]; │ │818 + if (self.session.is_terminal and item < tf.rects.items.len) { │ │819 + if (self.detailInner(index).children.values()[tags_child_index].rect) |flow_rect| { │ │820 + var rect = tf.rects.items[item]; │ │821 rect.x += flow_rect.x; │ │822 rect.y += flow_rect.y; │ │681 - self.detailScroll().scrollToRect(rect); │ │823 + self.detailScroll(index).scrollToRect(rect); │ │824 } │ │825 } │ │826 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯