╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2651 .tags = tags, │ │2652 .description = description, │ │2653 .target_branch = target_branch, │ │2642 - } }, author) catch |err| switch (err) { │ │2643 - error.InvalidFields => { │ │2644 - try self.rememberThreadFeedback(.invalid_target_branch, title, tags, description, target_branch); │ │2645 - return; │ │2646 - }, │ │2647 - else => |other| return other, │ │2654 + } }, author) catch |err| { │ │2655 + const failure = FeedbackFailure.fromError(err) orelse return err; │ │2656 + try self.rememberThreadFeedback(failure, title, tags, description, target_branch); │ │2657 + return; │ │2658 }; │ │2659 } else if (has_status) │ │2660 try Event.update(self.session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .fields = .{│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2674 │ │2675 fn rememberThreadFeedback(self: *This, failure: FeedbackFailure, title: []const u8, tags: []const u8, description: []const u8, target_branch: []const u8) !void {│ │2676 const aa = self.session.arena.allocator(); │ │2677 + const source = if (supports_drafts) blk: { │ │2678 + const form = self.threadForm() orelse break :blk null; │ │2679 + break :blk switch (form.children.values()[source_field_index].widget) { │ │2680 + .patch_source => |*value| value, │ │2681 + else => null, │ │2682 + }; │ │2683 + } else null; │ │2684 self.session.data.form_feedback = @unionInit(ui.Session.FormFeedback, @tagName(feedback_tag), .{ │ │2685 .failure = failure, │ │2686 .fields = if (comptime supports_drafts) .{ │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │2688 .tags = try aa.dupe(u8, tags), │ │2689 .description = try aa.dupe(u8, description), │ │2690 .target_branch = try aa.dupe(u8, target_branch), │ │2691 + .source_branch = if (source) |value| try value.field().text(aa) else "",│ │2692 + .branch_source = if (source) |value| value.existing else false, │ │2693 } else .{ │ │2694 .title = try aa.dupe(u8, title), │ │2695 .tags = try aa.dupe(u8, tags), │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯