╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ thread.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
3270 const route = draftsRoute(self.data.identity) orelse return; 3271 try self.session.navigate(route); 3272 return; 3273 } 3274 } 3275 3276 const io = self.session.io orelse return; 3277 const src = self.data.repo_source orelse return; 3278 if (!try src.canModify(io, allocator, actor, event_kind, &id)) return; 3279 const thread_id = evt.parseEventId(self.data.selected_id) catch return; 3280 3281 switch (src.repo_kind) { 3282 inline else => |repo_kind| { 3283 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); 3284 defer any_repo.deinit(io, allocator); 3285 switch (any_repo) { 3286 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), 3287 } 3288 }, 3289 } 3290 3291 const id_hex = std.fmt.bytesToHex(id, .lower); 3292 const route = ui.RoutablePage.repoEventsRoute(self.data.identity, .removed, event_kind, &id_hex, null) orelse return; 3293 try self.session.navigate(route); 3294 } 3295 3296 // enter the detail pane, landing on the way back to the list when it shows 3297 fn focusDetail(self: *This, index: usize, root_focus: *Focus) void { 3298 if (widget.listBackId(self.detailFrame(index)) != null) return widget.focusListBack(self.detailFrame(index), root_focus); 3299 _ = self.detail(index).focusFirst(root_focus); 3300 } 3301 3302 // return to the list. 3303 fn focusList(self: *This, index: usize, root_focus: *Focus) void { 3304 root_focus.setFocus(self.listScroll(index).getFocus().id); 3305 } 3306 3307 // cross to the header tabs above the stack. 3308 fn focusHeader(self: *This, root_focus: *Focus) void { 3309 root_focus.setFocus(self.box.children.keys()[header_index]); 3310 } 3311 3312 pub fn clearGrid(self: *This) void { 3313 self.box.clearGrid(); 3314 } 3315 3316 pub fn getGrid(self: This) ?Grid { 3317 return self.box.getGrid(); 3318 } 3319 3320 pub fn getFocus(self: *This) *Focus { 3321 return self.box.getFocus(); 3322 } 3323 3324 // for the parent's "scroll up at the top jumps to the header" check: at the 3325 // top only while the header tabs hold focus, so up from the split 3326 // crosses into the tabs first. 3327 pub fn atTop(self: *This) bool { 3328 return self.headerActive(); 3329 } 3330 }; 3331 } 3332