╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────╮ │121 const Self = @This(); │ │122 │ │123 pub const Event = evt.Patch; │ │124 -pub const Status = evt.Patch.Status; │ │124 +pub const Status = evt.Patch.StatusKind; │ │125 pub const ViewKind = ui.RoutablePage.PatchesView; │ │126 pub const thread_name = "patch"; │ │127 pub const header_widget_name = "repo_patches_header";│ ╰──────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │128 │ │129 +pub fn statusKind(event: Event) Status { │ │130 + return event.status.kind(); │ │131 +} │ │132 + │ │133 pub fn listRoute(identity: []const u8, status: Status, tag: []const u8, selected: []const u8) ?ui.RoutablePage {│ │134 return ui.RoutablePage.repoPatchesRoute(identity, status, tag, selected); │ │135 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────╮ │163 entry.fork_exists and │ │164 !entry.conflicted and │ │165 entry.record.event.revision != null and │ │162 - entry.record.event.status == .open and │ │166 + entry.record.event.status.kind() == .open and│ │167 !session.data.is_local and │ │168 session.data.user_id != null; │ │169 } │ ╰──────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │289 } │ │290 │ │291 // `status`'s windowed listing. │ │288 -pub fn window(self: *const Self, status: evt.Patch.Status) *const Window {│ │292 +pub fn window(self: *const Self, status: Status) *const Window { │ │293 return switch (status) { │ │294 .open => &self.open, │ │295 .closed => &self.closed, │ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │590 continue; │ │591 }; │ │592 const target_branch = revision.targetBranch() orelse continue; │ │589 - item.fork_oid = revision.source_oid; │ │593 + item.fork_oid = switch (item.record.event.status) { │ │594 + .merged => |oid| oid, │ │595 + else => revision.source_oid, │ │596 + }; │ │597 item.target_branch = target_branch; │ │591 - if (item.record.event.status == .merged) continue; │ │598 + if (item.record.event.status.kind() == .merged) continue; │ │599 const target_oid = try repo.readRef(io, .{ .kind = .head, .name = target_branch }); │ │600 item.no_changes = if (target_oid) |oid| std.mem.eql(u8, &oid, revision.source_oid) else false;│ │601 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │718 │ │719 pub fn appendDetails(self: *const Self, allocator: std.mem.Allocator, box: *wgt.Box(ui.Widget), session: *ui.Session, entry: Entry) !void {│ │720 const aa = session.page_arena.allocator(); │ │721 + const status_kind = entry.record.event.status.kind(); │ │722 var fields: [2]ui.widget.CopyableText.Choice = undefined; │ │723 var field_count: usize = 0; │ │724 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │717 - if (entry.record.event.status != .merged and entry.fork_exists and entry.target_branch.len != 0) if (session.data.git_ssh_port) |port| { │ │725 + if (status_kind != .merged and entry.fork_exists and entry.target_branch.len != 0) if (session.data.git_ssh_port) |port| { │ │726 const url = try std.fmt.allocPrint(aa, "ssh://localhost:{d}/repo/{s}/patch:{s}/branch:{s}", .{ port, self.identity, entry.id, entry.target_branch });│ │727 const push_command = try std.fmt.allocPrint(aa, "git push {s} HEAD:patch", .{url}); │ │728 const clone_name = try cloneDirectoryName(aa, entry.record.event.title); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │760 fields[field_count] = .{ │ │761 .selector = "to", │ │762 .text = entry.target_branch, │ │755 - .label = if (entry.record.event.status == .merged) " target branch this patch was merged into " else " target branch this patch will go to ",│ │756 - .bottom_label = if (entry.record.event.status == .merged) "" else " (set by the url you push to above) ", │ │763 + .label = if (status_kind == .merged) " target branch this patch was merged into " else " target branch this patch will go to ", │ │764 + .bottom_label = if (status_kind == .merged) "" else " (set by the url you push to above) ", │ │765 }; │ │766 field_count += 1; │ │767 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │808 const page_selected = std.meta.activeTag(session.data.current_page) == .repo_patches; │ │809 │ │810 // a list tab per status, labeled with its listing's patch count │ │803 - for ([_]evt.Patch.Status{ .open, .closed, .merged }, 0..) |status, index| { │ │811 + for ([_]Status{ .open, .closed, .merged }, 0..) |status, index| { │ │812 const route = ui.RoutablePage.repoPatchesRoute(data.identity, status, data.tag, "") orelse return error.RouteTooLong;│ │813 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == index); │ │814 var label_buf: [64]u8 = undefined; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯