╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │37 pub const UserKeys = @import("./ui/UserKeys.zig"); │ │38 pub const UserNotifications = @import("./ui/UserNotifications.zig");│ │39 pub const UserLogin = @import("./ui/UserLogin.zig"); │ │40 +pub const Delete = @import("./ui/Delete.zig"); │ │41 pub const widget = @import("./ui/widget.zig"); │ │42 pub const Widget = widget.Widget; │ │43 │ ╰────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │102 }; │ │103 }, │ │104 .repo => switch (route) { │ │104 - .repo_files, .repo_commits, .repo_diff, .repo_refs, .repo_issues, .repo_patches, .repo_discussions, .repo_events, .repo_undo, .repo_settings, .repo_members, .repo_branches, .repo_repo_new, .repo_user_new, .repo_user => .{ .repo = try Repo.init(arena, session, route) }, │ │105 + .repo_files, .repo_commits, .repo_diff, .repo_refs, .repo_issues, .repo_patches, .repo_discussions, .repo_events, .repo_undo, .repo_settings, .repo_members, .repo_branches, .repo_delete, .repo_repo_new, .repo_user_new, .repo_user => .{ .repo = try Repo.init(arena, session, route) },│ │106 else => return error.UnexpectedRoute, │ │107 }, │ │108 .fork => switch (route) { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │108 - .fork_patch, .fork_diff, .fork_files, .fork_commits, .fork_repo_new, .fork_user_new, .fork_user => .{ .fork = try Fork.init(arena, session, route) }, │ │109 + .fork_patch, .fork_diff, .fork_files, .fork_commits, .fork_delete, .fork_repo_new, .fork_user_new, .fork_user => .{ .fork = try Fork.init(arena, session, route) },│ │110 else => return error.UnexpectedRoute, │ │111 }, │ │112 .not_found => .not_found, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │195 repo_settings: Array(repo_route_max_len), │ │196 repo_members: RepoMembersRoute, │ │197 repo_branches: RepoBranchesRoute, │ │198 + repo_delete: Array(repo_route_max_len), │ │199 repo_user: struct { name: Array(repo_route_max_len), tab: UserTab = .{} },│ │200 fork_patch: ForkRoute, │ │201 fork_diff: ForkDiffRoute, │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────╮ │202 fork_files: ForkFilesRoute, │ │203 fork_commits: ForkCommitsRoute, │ │204 + fork_delete: ForkRoute, │ │205 fork_repo_new: ForkRoute, │ │206 fork_user_new: ForkRoute, │ │207 fork_user: struct { fork: ForkRoute, tab: UserTab = .{} },│ ╰───────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │219 │ │220 pub const EventsView = enum { active, removed }; │ │221 │ │219 - pub const UserView = enum { notifications, settings, keys }; │ │222 + pub const UserView = enum { notifications, settings, keys, delete };│ │223 │ │224 // the user tab's sub tab and the notifications window it shows │ │225 pub const UserTab = struct { │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │467 return .{ .repo_branches = .{ .name = Array(repo_identity_max_len).from(identity) orelse return null } }; │ │468 } │ │469 │ │470 + pub fn repoDeleteRoute(identity: []const u8) ?RoutablePage { │ │471 + return .{ .repo_delete = Array(repo_route_max_len).from(identity) orelse return null }; │ │472 + } │ │473 + │ │474 pub fn repoUndoRoute(identity: []const u8, index: ?u64) ?RoutablePage { │ │475 return .{ .repo_undo = .{ .name = Array(repo_identity_max_len).from(identity) orelse return null, .index = index } };│ │476 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │627 .oid = Array(ref_route_max_len).from(oid) orelse return null, │ │628 .message = true, │ │629 } }; │ │630 + } │ │631 + │ │632 + pub fn forkDeleteRoute(identity: []const u8, id: []const u8) ?RoutablePage { │ │633 + return .{ .fork_delete = initForkRoute(identity, id) orelse return null };│ │634 } │ │635 │ │636 pub fn forkRepoNewRoute(identity: []const u8, id: []const u8) ?RoutablePage { │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1298 if (b.branch.len != 0) try out.writer.print("/" ++ branch_seg ++ "{s}", .{b.branch.slice()}); │ │1299 break :blk out.written(); │ │1300 }, │ │1301 + .repo_delete => |name| try arena.allocator().print("{s}/repo/delete", .{try repoUrlPrefix(arena, name.slice())}),│ │1302 .repo_user => |u| try userTabUrl(arena, try repoUrlPrefix(arena, u.name.slice()), u.tab), │ │1303 .fork_patch => |f| try arena.allocator().print("/{s}+{s}", .{ f.name.slice(), f.id.slice() }), │ │1304 .fork_diff => |d| blk: { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1325 if (c.message) try out.writer.print("/" ++ message_seg, .{}); │ │1326 break :blk out.written(); │ │1327 }, │ │1328 + .fork_delete => |f| try arena.allocator().print("/{s}+{s}/delete", .{ f.name.slice(), f.id.slice() }), │ │1329 .fork_repo_new => |f| try arena.allocator().print("/{s}+{s}/repo/new", .{ f.name.slice(), f.id.slice() }), │ │1330 .fork_user_new => |f| try arena.allocator().print("/{s}+{s}/user/new", .{ f.name.slice(), f.id.slice() }), │ │1331 .fork_user => |u| try userTabUrl(arena, try arena.allocator().print("/{s}+{s}", .{ u.fork.name.slice(), u.fork.id.slice() }), u.tab),│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯