╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │740 return self.box.getFocus(); │ │741 } │ │742 │ │743 - // for the parent's "scroll up at the top jumps to the header" check. inside │ │744 - // the detail pane up-arrow stays in the pane (scrolling); when the list holds │ │745 - // focus, report its selection directly so up-arrow at the top row ascends. │ │743 + // for the parent's "up at the top jumps to the header" check: report 0 │ │744 + // whenever up would otherwise do nothing here. │ │745 pub fn getSelectedIndex(self: *View) ?usize { │ │747 - if (self.detailActive()) return 1; │ │746 + if (self.detailActive()) { │ │747 + if (self.detailOuter().getFocus().child_id == self.navBox().getFocus().id) return 0;│ │748 + if (self.navBox().children.count() == 0 and │ │749 + (!self.session.is_terminal or self.detailScroll().y == 0)) return 0; │ │750 + return 1; │ │751 + } │ │752 const lb = self.listBox(); │ │753 const cid = lb.getFocus().child_id orelse return null; │ │754 return lb.children.getIndex(cid); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯