╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │692 } │ │693 │ │694 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void {│ │695 + // scrolling crosses the sub header boundary the same way arrows do │ │696 + const direction = inp.vertDirection(key); │ │697 if (self.headerActive()) { │ │696 - if (key == .arrow_down) { │ │698 + if (direction == .down) { │ │699 root_focus.setFocus(self.contentBox().getFocus().id); │ │700 return; │ │701 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │705 }; │ │706 return self.header().input(allocator, key, root_focus); │ │707 } │ │706 - if (key == .arrow_up and self.contentAtTop() and self.header().focusHeader(root_focus)) return;│ │708 + if (direction == .up and self.contentAtTop() and self.header().focusHeader(root_focus)) return;│ │709 if (self.diffActive()) { │ │710 if (key == .arrow_left and self.diffScroll().x == 0) { │ │711 self.focusList(root_focus); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Events.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │540 } │ │541 │ │542 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │543 + // scrolling crosses the sub header boundary the same way arrows do │ │544 + const direction = inp.vertDirection(key); │ │545 if (self.headerActive()) { │ │544 - if (key == .arrow_down) root_focus.setFocus(self.content().getFocus().id) else try self.header().input(allocator, key, root_focus);│ │546 + if (direction == .down) root_focus.setFocus(self.content().getFocus().id) else try self.header().input(allocator, key, root_focus);│ │547 return; │ │548 } │ │547 - if (key == .arrow_up and self.contentAtTop()) { │ │549 + if (direction == .up and self.contentAtTop()) { │ │550 self.header().focusCurrent(root_focus); │ │551 return; │ │552 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │698 } │ │699 │ │700 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void {│ │701 + // scrolling crosses the sub header boundary the same way arrows do │ │702 + const direction = inp.vertDirection(key); │ │703 if (self.headerActive()) { │ │702 - if (key == .arrow_down) { │ │704 + if (direction == .down) { │ │705 root_focus.setFocus(self.contentBox().getFocus().id); │ │706 return; │ │707 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │711 }; │ │712 return self.header().input(allocator, key, root_focus); │ │713 } │ │712 - if (key == .arrow_up and self.contentAtTop() and self.header().focusHeader(root_focus)) return;│ │714 + if (direction == .up and self.contentAtTop() and self.header().focusHeader(root_focus)) return;│ │715 if (self.detailActive()) { │ │716 try self.detailInput(key, root_focus); │ │717 } else { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/ui/Repo/Undo.zig│ ╰────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │391 } │ │392 │ │393 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │394 - // the sub header sits above whichever content the route selects │ │394 + // the sub header sits above whichever content the route selects. │ │395 + // scrolling crosses the boundary the same way the arrow keys do │ │396 + const direction = inp.vertDirection(key); │ │397 if (self.headerActive()) { │ │396 - if (key == .arrow_down) root_focus.setFocus(self.box.children.values()[content_index].widget.getFocus().id);│ │398 + if (direction == .down) root_focus.setFocus(self.box.children.values()[content_index].widget.getFocus().id);│ │399 return; │ │400 } │ │401 if (self.data.clear) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │400 - if (key == .arrow_up) root_focus.setFocus(self.headerBox().getFocus().id) else try self.clearInput(key, root_focus);│ │402 + if (direction == .up) root_focus.setFocus(self.headerBox().getFocus().id) else try self.clearInput(key, root_focus);│ │403 return; │ │404 } │ │403 - if (key == .arrow_up and self.contentAtTop()) { │ │405 + if (direction == .up and self.contentAtTop()) { │ │406 root_focus.setFocus(self.headerBox().getFocus().id); │ │407 return; │ │408 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯