╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Branches.zig ─────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
232 const users_dir = self.session.users_dir orelse return; 233 const actor = (try self.session.authorize(self.data.identity, .owner, null)) orelse return; 234 if (try perform(io, allocator, users_dir, actor, self.data.identity, action, branch)) |failure| { 235 self.session.data.form_feedback = .{ .repo_branches = .{ .failure = failure, .name = try self.session.arena.allocator().dupe(u8, branch) } }; 236 return; 237 } 238 try self.session.navigate(ui.RoutablePage.repoBranchesRoute(self.data.identity) orelse return error.RouteTooLong); 239 } 240 241 pub fn clearGrid(self: *View) void { 242 self.scroll.clearGrid(); 243 } 244 245 pub fn getGrid(self: View) ?Grid { 246 return self.scroll.getGrid(); 247 } 248 249 pub fn getFocus(self: *View) *Focus { 250 return self.scroll.getFocus(); 251 } 252 253 // up leaves the view from the explanatory text 254 pub fn atTop(self: *View) bool { 255 return self.contentBox().getFocus().child_id == self.aboutBox().getFocus().id; 256 } 257 }; 258