╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ thread.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2738 if (!try src.canModify(io, allocator, actor, event_kind, &id)) return; 2739 2740 switch (src.repo_kind) { 2741 inline else => |repo_kind| { 2742 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); 2743 defer any_repo.deinit(io, allocator); 2744 switch (any_repo) { 2745 inline else => |*repo| try evt.remove(self.session.data.host_kind, .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, &id, event_kind, author), 2746 } 2747 }, 2748 } 2749 2750 const id_hex = std.fmt.bytesToHex(id, .lower); 2751 const route = ui.RoutablePage.repoEventsRoute(self.data.identity, .removed, event_kind, &id_hex) orelse return; 2752 try self.session.navigate(route); 2753 } 2754 2755 // return to the list. 2756 fn focusList(self: *This, index: usize, root_focus: *Focus) void { 2757 root_focus.setFocus(self.listScroll(index).getFocus().id); 2758 } 2759 2760 // cross to the header tabs above the stack. 2761 fn focusHeader(self: *This, root_focus: *Focus) void { 2762 root_focus.setFocus(self.box.children.keys()[header_index]); 2763 } 2764 2765 pub fn clearGrid(self: *This) void { 2766 self.box.clearGrid(); 2767 } 2768 2769 pub fn getGrid(self: This) ?Grid { 2770 return self.box.getGrid(); 2771 } 2772 2773 pub fn getFocus(self: *This) *Focus { 2774 return self.box.getFocus(); 2775 } 2776 2777 // for the parent's "scroll up at the top jumps to the header" check: at the 2778 // top only while the header tabs hold focus, so up from the split 2779 // crosses into the tabs first. 2780 pub fn atTop(self: *This) bool { 2781 return self.headerActive(); 2782 } 2783 }; 2784 } 2785