╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │2601 } │ │2602 │ │2603 const id_bytes = try evt.parseEventId(entry.id); │ │2560 - const src = self.data.repo_source orelse return; │ │2604 const author = (try self.session.eventAuthor()) orelse return;│ │2605 │ │2606 switch (src.repo_kind) { │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2609 defer any_repo.deinit(io, allocator); │ │2610 switch (any_repo) { │ │2611 inline else => |*repo| if (supports_drafts) { │ │2569 - try Event.update(repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .fields = .{│ │2612 + Event.update(repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .fields = .{ │ │2613 .title = title, │ │2614 .tags = tags, │ │2615 .description = description, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2616 .target_branch = target_branch, │ │2574 - } }, author); │ │2617 + } }, author) catch |err| switch (err) { │ │2618 + error.InvalidFields => { │ │2619 + try self.rememberThreadFeedback(.invalid_target_branch, title, tags, description, target_branch);│ │2620 + return; │ │2621 + }, │ │2622 + else => |other| return other, │ │2623 + }; │ │2624 } else if (has_status) │ │2625 try Event.update(repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .fields = .{ │ │2626 .title = title, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2635 │ │2636 const route = listRoute(self.data.identity, entryStatus(entry.*), "", entry.id) orelse return; │ │2637 try self.session.navigate(route); │ │2638 + } │ │2639 + │ │2640 + fn rememberThreadFeedback(self: *This, failure: FeedbackFailure, title: []const u8, tags: []const u8, description: []const u8, target_branch: []const u8) !void {│ │2641 + const aa = self.session.arena.allocator(); │ │2642 + self.session.data.form_feedback = @unionInit(ui.Session.FormFeedback, @tagName(feedback_tag), .{ │ │2643 + .failure = failure, │ │2644 + .fields = if (comptime supports_drafts) .{ │ │2645 + .title = try aa.dupe(u8, title), │ │2646 + .tags = try aa.dupe(u8, tags), │ │2647 + .description = try aa.dupe(u8, description), │ │2648 + .target_branch = try aa.dupe(u8, target_branch), │ │2649 + } else .{ │ │2650 + .title = try aa.dupe(u8, title), │ │2651 + .tags = try aa.dupe(u8, tags), │ │2652 + .description = try aa.dupe(u8, description), │ │2653 + }, │ │2654 + }); │ │2655 } │ │2656 │ │2657 fn submitConfirmation(self: *This, allocator: std.mem.Allocator, button_index: usize) !void { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯