╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1271 try addToolButton(allocator, row, "publish", "submit"); │ │1272 } │ │1273 if (self.session.data.user_id != null) { │ │1274 - const route = ui.RoutablePage.repoThreadRemoveRoute(kind, self.data.identity, entry.id, "") orelse return error.RouteTooLong; │ │1275 - try addToolButton(allocator, row, "✕", try std.fmt.allocPrint(pa, "a:{s}", .{try route.toUrl(self.session.page_arena)})); │ │1274 + const edit_route = ui.RoutablePage.repoThreadEditRoute(kind, self.data.identity, entry.id) orelse return error.RouteTooLong; │ │1275 + try addToolButton(allocator, row, "edit", try std.fmt.allocPrint(pa, "a:{s}", .{try edit_route.toUrl(self.session.page_arena)})); │ │1276 + const remove_route = ui.RoutablePage.repoThreadRemoveRoute(kind, self.data.identity, entry.id, "") orelse return error.RouteTooLong;│ │1277 + try addToolButton(allocator, row, "✕", try std.fmt.allocPrint(pa, "a:{s}", .{try remove_route.toUrl(self.session.page_arena)})); │ │1278 } │ │1279 if (row.children.count() > first_in_row_index) │ │1280 row.getFocus().child_id = row.children.keys()[first_in_row_index]; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │2280 fn submitEditedThread(self: *This, allocator: std.mem.Allocator) !void { │ │2281 if (comptime wasm) return; │ │2282 const io = self.session.io orelse return; │ │2281 - const src = self.data.repo_source orelse return; │ │2283 const entry = self.data.selectedThread() orelse return; │ │2283 - const author = (try self.session.eventAuthor()) orelse return; │ │2284 │ │2285 const form = self.threadForm() orelse return; │ │2286 const title_input = &form.children.values()[title_field_index].widget.text_input;│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2296 │ │2297 if (!Event.fieldsValid(title, tags)) return; │ │2298 │ │2299 + if (comptime supports_drafts) { │ │2300 + if (entryDraft(entry.*)) { │ │2301 + try self.data.editDraft(self.session, allocator, entry.id, title, tags, description); │ │2302 + const route = listRoute(self.data.identity, entryStatus(entry.*), "", entry.id) orelse return;│ │2303 + try self.session.navigate(route); │ │2304 + return; │ │2305 + } │ │2306 + } │ │2307 + │ │2308 const id_bytes = try evt.parseEventId(entry.id); │ │2309 + const src = self.data.repo_source orelse return; │ │2310 + const author = (try self.session.eventAuthor()) orelse return; │ │2311 │ │2312 switch (src.repo_kind) { │ │2313 inline else => |repo_kind| { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯