╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Threads.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2196 return cid == self.description_id[index]; 2197 } 2198 2199 // return to the tool row's last-focused button (the header when the 2200 // description page shows no row). 2201 fn focusToolRow(self: *This, index: usize, root_focus: *Focus) void { 2202 const cid = self.toolRow(index).getFocus().child_id orelse return self.focusHeader(root_focus); 2203 root_focus.setFocus(cid); 2204 } 2205 2206 // enter the detail pane. an empty pane (no issues) can't be entered. 2207 fn focusDetail(self: *This, index: usize, root_focus: *Focus) !void { 2208 if (self.detailInner(index).children.count() == 0) return; 2209 root_focus.setFocus(self.detailOuter(index).getFocus().id); 2210 } 2211 2212 // return to the list. 2213 fn focusList(self: *This, index: usize, root_focus: *Focus) !void { 2214 root_focus.setFocus(self.listScroll(index).getFocus().id); 2215 } 2216 2217 // cross to the header tabs above the stack. 2218 fn focusHeader(self: *This, root_focus: *Focus) void { 2219 root_focus.setFocus(self.box.children.keys()[header_index]); 2220 } 2221 2222 pub fn clearGrid(self: *This) void { 2223 self.box.clearGrid(); 2224 } 2225 2226 pub fn getGrid(self: This) ?Grid { 2227 return self.box.getGrid(); 2228 } 2229 2230 pub fn getFocus(self: *This) *Focus { 2231 return self.box.getFocus(); 2232 } 2233 2234 // for the parent's "scroll up at the top jumps to the header" check: at the 2235 // top only while the header tabs hold focus, so up from the split 2236 // crosses into the tabs first. 2237 pub fn getSelectedIndex(self: *This) ?usize { 2238 return if (self.headerActive()) 0 else 1; 2239 } 2240 }; 2241 } 2242