╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1651 } │ │1652 │ │1653 if (supports_drafts and record == null) { │ │1654 - var source = try Data.Source.init(allocator, session, if (saved_fields) |saved| saved.source_branch else "", if (saved_fields) |saved| saved.branch_source else (session.data.host_kind == .local));│ │1654 + var source = try Data.Source.init(allocator, session, if (saved_fields) |saved| saved.source_branch else "", if (saved_fields) |saved| saved.source_kind else .fork); │ │1655 errdefer source.deinit(allocator); │ │1656 try box.children.put(allocator, source.getFocus().id, .{ .widget = .{ .patch_source = source }, .rect = null, .min_size = .{ .width = null, .height = 3 } }); │ │1657 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2141 if (formWidget(form, .patch_source)) |source| { │ │2142 source.field().options.label = if (failure == .invalid_source_branch) " source branch (not found) " else if (failure == .same_branch) " source branch (same as target) " else if (failure == .unrelated_branches) " source branch (unrelated) " else " source branch "; │ │2143 const submit = formWidget(form, .submit_button) orelse return error.MissingFormField; │ │2144 - try submit.setLabel(allocator, if (source.existing) "submit patch" else "submit draft"); │ │2144 + try submit.setLabel(allocator, switch (source.selected) { │ │2145 + .fork => "submit draft", │ │2146 + .branch => "submit patch", │ │2147 + }); │ │2148 } │ │2149 (try formField(form, "target_branch")).options.label = │ │2150 if (failure == .invalid_target_branch) " target branch (invalid) " else if (self.data.view == .edit and failure == .same_branch) " target branch (same as source) " else if (self.data.view == .edit and failure == .unrelated_branches) " target branch (unrelated to source) " else if (self.data.view == .edit and failure == .invalid_source_branch) " target branch (source branch not found) " else " target branch ";│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2526 │ │2527 if (comptime supports_drafts) { │ │2528 const source = formWidget(form, .patch_source) orelse return error.MissingFormField; │ │2526 - const source_branch = if (source.existing) try source.field().text(allocator) else null; │ │2529 + const source_branch = switch (source.selected) { │ │2530 + .fork => null, │ │2531 + .branch => try source.field().text(allocator), │ │2532 + }; │ │2533 defer if (source_branch) |branch| allocator.free(branch); │ │2534 const event_id_hex = Data.create(self.data, self.session, allocator, title, tags, description, target_branch, source_branch) catch |err| {│ │2535 const failure = FeedbackFailure.fromError(err) orelse return err; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │2669 .description = try aa.dupe(u8, description), │ │2670 .target_branch = try aa.dupe(u8, target_branch), │ │2671 .source_branch = if (source) |value| try value.field().text(aa) else "",│ │2666 - .branch_source = if (source) |value| value.existing else false, │ │2672 + .source_kind = if (source) |value| value.selected else .fork, │ │2673 } else .{ │ │2674 .title = try aa.dupe(u8, title), │ │2675 .tags = try aa.dupe(u8, tags), │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯