╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ thread.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
3337 inline else => |repo_kind| { 3338 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); 3339 defer any_repo.deinit(io, allocator); 3340 switch (any_repo) { 3341 inline else => |*repo| try evt.removeInThread(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, kind, &thread_id, event_kind, &id, author), 3342 } 3343 }, 3344 } 3345 3346 const id_hex = std.fmt.bytesToHex(id, .lower); 3347 const route = ui.RoutablePage.repoEventsRoute(self.data.identity, .removed, event_kind, &id_hex, null) orelse return; 3348 try self.session.navigate(route); 3349 } 3350 3351 // enter the detail pane, landing on the way back to the list when it shows 3352 fn focusDetail(self: *This, index: usize, root_focus: *Focus) void { 3353 if (widget.listBackId(self.detailFrame(index)) != null) return widget.focusListBack(self.detailFrame(index), root_focus); 3354 _ = self.detail(index).focusFirst(root_focus); 3355 } 3356 3357 // return to the list. 3358 fn focusList(self: *This, index: usize, root_focus: *Focus) void { 3359 root_focus.setFocus(self.listScroll(index).getFocus().id); 3360 } 3361 3362 // cross to the header tabs above the stack. 3363 fn focusHeader(self: *This, root_focus: *Focus) void { 3364 root_focus.setFocus(self.box.children.keys()[header_index]); 3365 } 3366 3367 pub fn clearGrid(self: *This) void { 3368 self.box.clearGrid(); 3369 } 3370 3371 pub fn getGrid(self: This) ?Grid { 3372 return self.box.getGrid(); 3373 } 3374 3375 pub fn getFocus(self: *This) *Focus { 3376 return self.box.getFocus(); 3377 } 3378 3379 // for the parent's "scroll up at the top jumps to the header" check: at the 3380 // top only while the header tabs hold focus, so up from the split 3381 // crosses into the tabs first. 3382 pub fn atTop(self: *This) bool { 3383 return self.headerActive(); 3384 } 3385 }; 3386 } 3387