╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │165 │ │166 pub const IssuesView = enum { open, closed, tags, new, edit, description, new_comment, edit_comment, remove, conflicts, resolve }; │ │167 │ │168 - pub const PatchesView = enum { open, closed, merged, tags, new, drafts, edit, description, new_comment, edit_comment, remove, conflicts, resolve }; │ │168 + pub const PatchesView = enum { open, closed, merged, tags, new, drafts, edit, publish, description, new_comment, edit_comment, remove, conflicts, resolve };│ │169 │ │170 pub const DiscussionsView = enum { recent, tags, new, edit, description, new_comment, edit_comment, remove }; │ │171 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │570 .name = Array(repo_route_max_len).from(identity) orelse return null, │ │571 .view = .drafts, │ │572 } }; │ │573 + } │ │574 + │ │575 + pub fn repoPatchPublishRoute(identity: []const u8, selected: []const u8) ?RoutablePage { │ │576 + if (selected.len == 0) return null; │ │577 + var route = repoPatchesRoute(identity, .open, "", selected) orelse return null; │ │578 + switch (route) { │ │579 + .repo_patches => |*patch| patch.view = .publish, │ │580 + else => unreachable, │ │581 + } │ │582 + return route; │ │583 } │ │584 │ │585 pub fn repoDiscussionsRoute(identity: []const u8, tag: []const u8, selected: []const u8) ?RoutablePage {│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │883 .repo_patches => |p| blk: { │ │884 const prefix = try repoUrlPrefix(arena, p.name.slice()); │ │885 if (p.view == .edit) break :blk try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ patch_seg ++ "{s}/edit", .{ prefix, p.selected.slice() }); │ │886 + if (p.view == .publish) break :blk try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ patch_seg ++ "{s}/publish", .{ prefix, p.selected.slice() }); │ │887 if (p.view == .description) break :blk try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ patch_seg ++ "{s}/description", .{ prefix, p.selected.slice() });│ │888 if (p.view == .resolve) break :blk if (p.theirs.len == 0) │ │889 try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ patch_seg ++ "{s}/resolve", .{ prefix, p.selected.slice() }) │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1227 if (word) |tail| { │ │1228 if (std.mem.eql(u8, tail, "new")) return if (params.only(&.{})) repoThreadCommentNewRoute(.patch, pair, patch_id, "") else null; │ │1229 if (std.mem.eql(u8, tail, "edit")) return if (params.only(&.{})) repoThreadEditRoute(.patch, pair, patch_id) else null; │ │1230 + if (std.mem.eql(u8, tail, "publish")) return if (params.only(&.{})) repoPatchPublishRoute(pair, patch_id) else null; │ │1231 if (std.mem.eql(u8, tail, "remove")) return if (params.only(&.{})) repoThreadRemoveRoute(.patch, pair, patch_id, "") else null; │ │1232 if (std.mem.eql(u8, tail, "description")) return if (params.only(&.{})) repoThreadDescriptionRoute(.patch, pair, patch_id) else null;│ │1233 if (std.mem.eql(u8, tail, "resolve")) { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯