╭ changed ──────────────╮ │src/ui/Repo/Threads.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │588 var form = try initCommentForm(allocator, session, action, parent_author, parent_route orelse return error.RouteTooLong, initial_body);│ │589 errdefer form.deinit(allocator); │ │590 try stack.children.put(allocator, form.getFocus().id, .{ .box = form }); │ │617 - } else if (has_conflicts and data.view == .resolve) { │ │591 + } else if (supports_conflicts and data.view == .resolve) { │ │592 // on the web the page grows to the form's height and the │ │593 // browser scrolls it; the terminal scrolls the form itself │ │594 var form_widget: ui.Widget = blk: { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │622 try stack.children.put(allocator, message.getFocus().id, .{ .unauthorized = message });│ │623 } │ │624 │ │651 - if (has_drafts) { │ │625 + if (supports_drafts) { │ │626 var split = try initSplit(allocator, session, data, null, true); │ │627 errdefer split.deinit(allocator); │ │628 try stack.children.put(allocator, split.getFocus().id, .{ .box = split }); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │631 // the conflicts split; its tab exists only when the repo has │ │632 // conflicts, so skip the child too to keep the stack 1:1 with the │ │633 // tabs. │ │660 - if (has_conflicts and data.conflicts.count > 0) { │ │634 + if (supports_conflicts and data.conflicts.count > 0) { │ │635 var split = try initSplit(allocator, session, data, null, false); │ │636 errdefer split.deinit(allocator); │ │637 try stack.children.put(allocator, split.getFocus().id, .{ .box = split });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │660 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .horiz }); │ │661 errdefer box.deinit(allocator); │ │662 │ │689 - const win = if (status_maybe) |status| data.window(status) else if (drafts and has_drafts) &data.drafts else if (has_conflicts) &data.conflicts else unreachable; │ │663 + const win = if (status_maybe) |status| data.window(status) else if (drafts and supports_drafts) &data.drafts else if (supports_conflicts) &data.conflicts else unreachable;│ │664 │ │665 // the thread list (one focusable row per title), plus a "next" link that │ │666 // reloads the page rooted at the following thread. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │762 try box.children.put(allocator, description.getFocus().id, .{ .widget = .{ .text_input = description }, .rect = null, .min_size = null });│ │763 } │ │764 │ │791 - try addSubmitButtonLabeled(allocator, &box, if (kind == .patch and record == null) "submit draft" else "submit"); │ │765 + try addSubmitButtonLabeled(allocator, &box, if (supports_drafts and record == null) "submit draft" else "submit"); │ │766 │ │767 box.getFocus().child_id = box.children.keys()[title_field_index]; │ │768 return box; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │860 try addLabel(allocator, &box, "tags conflict:"); │ │861 try addFieldConflict(allocator, &box, session, data, "tags", fc); │ │862 } │ │889 - if (comptime kind == .patch) { │ │863 + if (comptime @hasField(Data.Conflict, "status")) { │ │864 if (conflict.status) |*fc| { │ │865 try addLabel(allocator, &box, "status conflict:"); │ │866 try addAtomicConflict(allocator, &box, session, data, "status", fc);│ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │867 } │ │868 + } │ │869 + if (comptime @hasField(Data.Conflict, "revision")) { │ │870 if (conflict.revision) |*fc| { │ │871 try addLabel(allocator, &box, "revision conflict:"); │ │872 try addAtomicConflict(allocator, &box, session, data, "revision", fc);│ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1069 try row.children.put(allocator, button.getFocus().id, .{ .widget = .{ .text_box = button }, .rect = null, .min_size = .{ .width = try xitui.width.displayWidth(label) + 2, .height = null } }); │ │1070 } │ │1071 │ │1096 - fn addDetailGap(allocator: std.mem.Allocator, box: *wgt.Box(ui.Widget)) !void { │ │1097 - var spacer = try ui.Spacer.init(allocator); │ │1098 - errdefer spacer.deinit(allocator); │ │1099 - try box.children.put(allocator, spacer.getFocus().id, .{ .widget = .{ .spacer = spacer }, .rect = null, .min_size = .{ .width = null, .height = 1 }, .max_size = .{ .width = null, .height = 1 } });│ │1100 - } │ │1101 - │ │1072 pub fn deinit(self: *This, allocator: std.mem.Allocator) void { │ │1073 self.box.deinit(allocator); │ │1074 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1075 │ │1076 fn header(self: *This) *HeaderType { │ │1107 - return switch (kind) { │ │1108 - .issue => &self.box.children.values()[header_index].widget.repo_issues_header, │ │1109 - .patch => &self.box.children.values()[header_index].widget.repo_patches_header, │ │1110 - .discuss => &self.box.children.values()[header_index].widget.repo_discussions_header,│ │1111 - else => @compileError("unsupported thread event kind"), │ │1112 - }; │ │1077 + return &@field(self.box.children.values()[header_index].widget, Data.header_widget_name);│ │1078 } │ │1079 │ │1080 fn viewStack(self: *This) *wgt.Stack(ui.Widget) { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1149 } │ │1150 │ │1151 fn window(self: *This, index: usize) *const Window { │ │1187 - if (has_conflicts and index == conflict_view_index) return &self.data.conflicts; │ │1188 - if (has_drafts and index == drafts_view_index) return &self.data.drafts; │ │1152 + if (supports_conflicts and index == conflict_view_index) return &self.data.conflicts;│ │1153 + if (supports_drafts and index == drafts_view_index) return &self.data.drafts; │ │1154 return self.data.window(splitStatus(index)); │ │1155 } │ │1156 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯