╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │2079 try self.session.navigate(route); │ │2080 } │ │2081 │ │2047 - // commit a reply and navigate to its permalink. this is the terminal path; │ │2048 - // the web posts the form to its /comment route. │ │2082 + // commit a new or edited comment and navigate to its permalink. this is the│ │2083 + // terminal path; the web posts the form to its comment route. │ │2084 fn submitComment(self: *View, allocator: std.mem.Allocator) !void { │ │2085 if (comptime wasm) return; │ │2086 const io = self.session.io orelse return; │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2100 break :blk parent; │ │2101 }; │ │2102 var event_id_hex: [evt.event_id_size * 2]u8 = undefined; │ │2103 + const editing = self.data.view == .edit_comment; │ │2104 switch (src.repo_kind) { │ │2105 inline else => |repo_kind| { │ │2106 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, .{ .path = src.path });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2107 defer any_repo.deinit(io, allocator); │ │2108 switch (any_repo) { │ │2073 - inline else => |*repo| event_id_hex = try evt.Comment.create(repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id, &parent_id, body, author_email),│ │2109 + inline else => |*repo| if (editing) { │ │2110 + var comment_id: [evt.event_id_size]u8 = undefined; │ │2111 + _ = std.fmt.hexToBytes(&comment_id, self.data.comment_id) catch return; │ │2112 + try evt.Comment.update(repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id, &comment_id, body, author_email); │ │2113 + event_id_hex = std.fmt.bytesToHex(comment_id, .lower); │ │2114 + } else { │ │2115 + event_id_hex = try evt.Comment.create(repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id, &parent_id, body, author_email); │ │2116 + }, │ │2117 } │ │2118 }, │ │2119 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2520 const route = switch (data.view) { │ │2521 .edit => ui.RoutablePage.repoIssuesEditRoute(data.identity, data.selected_id) orelse return error.RouteTooLong, │ │2522 .new_comment => ui.RoutablePage.repoCommentNewRoute(data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong, │ │2523 + .edit_comment => ui.RoutablePage.repoCommentEditRoute(data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong,│ │2524 .resolve => ui.RoutablePage.repoIssuesResolveRoute(data.identity, data.selected_id, data.theirs_picks) orelse return error.RouteTooLong, │ │2525 else => ui.RoutablePage.repoIssuesNewRoute(data.identity) orelse return error.RouteTooLong, │ │2526 }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │2528 const label: []const u8 = switch (data.view) {│ │2529 .edit => "edit", │ │2530 .new_comment => "reply", │ │2531 + .edit_comment => "edit", │ │2532 .resolve => "resolve", │ │2533 else => "new", │ │2534 }; │ ╰────────────────────────────────────────────────────────────────╯