╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ thread.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2942 2943 const io = self.session.io orelse return; 2944 const src = self.data.repo_source orelse return; 2945 if (!try src.canModify(io, allocator, actor, event_kind, &id)) return; 2946 2947 switch (src.repo_kind) { 2948 inline else => |repo_kind| { 2949 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); 2950 defer any_repo.deinit(io, allocator); 2951 switch (any_repo) { 2952 inline else => |*repo| try evt.remove(self.session.eventHost(), .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, &id, event_kind, author), 2953 } 2954 }, 2955 } 2956 2957 const id_hex = std.fmt.bytesToHex(id, .lower); 2958 const route = ui.RoutablePage.repoEventsRoute(self.data.identity, .removed, event_kind, &id_hex, null) orelse return; 2959 try self.session.navigate(route); 2960 } 2961 2962 // return to the list. 2963 fn focusList(self: *This, index: usize, root_focus: *Focus) void { 2964 root_focus.setFocus(self.listScroll(index).getFocus().id); 2965 } 2966 2967 // cross to the header tabs above the stack. 2968 fn focusHeader(self: *This, root_focus: *Focus) void { 2969 root_focus.setFocus(self.box.children.keys()[header_index]); 2970 } 2971 2972 pub fn clearGrid(self: *This) void { 2973 self.box.clearGrid(); 2974 } 2975 2976 pub fn getGrid(self: This) ?Grid { 2977 return self.box.getGrid(); 2978 } 2979 2980 pub fn getFocus(self: *This) *Focus { 2981 return self.box.getFocus(); 2982 } 2983 2984 // for the parent's "scroll up at the top jumps to the header" check: at the 2985 // top only while the header tabs hold focus, so up from the split 2986 // crosses into the tabs first. 2987 pub fn atTop(self: *This) bool { 2988 return self.headerActive(); 2989 } 2990 }; 2991 } 2992