╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Threads.zig│ ╰───────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │549 │ │550 // the tabs at the top. │ │551 { │ │196 - var hdr = try Header.init(allocator, session, data); │ │552 + var hdr = try Data.initHeader(allocator, session, data); │ │553 errdefer hdr.deinit(allocator); │ │554 switch (kind) { │ │555 .issue => try outer.children.put(allocator, hdr.getFocus().id, .{ .widget = .{ .repo_issues_header = hdr }, .rect = null, .min_size = null }),│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │556 + .patch => try outer.children.put(allocator, hdr.getFocus().id, .{ .widget = .{ .repo_patches_header = hdr }, .rect = null, .min_size = null }), │ │557 .discuss => try outer.children.put(allocator, hdr.getFocus().id, .{ .widget = .{ .repo_discussions_header = hdr }, .rect = null, .min_size = null }),│ │558 else => @compileError("unsupported thread event kind"), │ │559 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │569 const stack = &outer.children.values()[stack_index].widget.stack; │ │570 │ │571 inline for (@typeInfo(Status).@"enum".fields) |field| { │ │215 - var split = try initSplit(allocator, session, data, @enumFromInt(field.value)); │ │572 + var split = try initSplit(allocator, session, data, @enumFromInt(field.value), false);│ │573 errdefer split.deinit(allocator); │ │574 try stack.children.put(allocator, split.getFocus().id, .{ .box = split }); │ │575 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │674 var message = try ui.Unauthorized.View.init(allocator); │ │675 errdefer message.deinit(allocator); │ │676 try stack.children.put(allocator, message.getFocus().id, .{ .unauthorized = message });│ │677 + } │ │678 + │ │679 + if (has_drafts) { │ │680 + var split = try initSplit(allocator, session, data, null, true); │ │681 + errdefer split.deinit(allocator); │ │682 + try stack.children.put(allocator, split.getFocus().id, .{ .box = split }); │ │683 } │ │684 │ │685 // the conflicts split; its tab exists only when the repo has │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │686 // conflicts, so skip the child too to keep the stack 1:1 with the │ │687 // tabs. │ │688 if (has_conflicts and data.conflicts.count > 0) { │ │326 - var split = try initSplit(allocator, session, data, null); │ │689 + var split = try initSplit(allocator, session, data, null, false); │ │690 errdefer split.deinit(allocator); │ │691 try stack.children.put(allocator, split.getFocus().id, .{ .box = split });│ │692 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────╮ │704 .detailed_index = @splat(null), │ │705 .description_id = @splat(null), │ │706 .author_id = @splat(null), │ │344 - .status_button_id = @splat(null), │ │707 + .primary_button_id = @splat(null),│ │708 }; │ │709 } │ │710 │ ╰───────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │711 // the master-detail split showing `status`'s window, or the conflicts │ │712 // window when null. │ │350 - fn initSplit(allocator: std.mem.Allocator, session: *ui.Session, data: *const Self, status_maybe: ?Status) !wgt.Box(ui.Widget) { │ │713 + fn initSplit(allocator: std.mem.Allocator, session: *ui.Session, data: *const Self, status_maybe: ?Status, drafts: bool) !wgt.Box(ui.Widget) {│ │714 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .horiz }); │ │715 errdefer box.deinit(allocator); │ │716 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │354 - const win = if (status_maybe) |status| data.window(status) else if (has_conflicts) &data.conflicts else unreachable; │ │717 + 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;│ │718 │ │719 // the issue list (one focusable row per title), plus a "next" link that │ │720 // reloads the page rooted at the following issue. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │723 var list_box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .vert, .stretch = true }); │ │724 errdefer list_box.deinit(allocator); │ │725 if (win.prev_id) |prev| │ │363 - try addRow(allocator, &list_box, "← previous", "", try windowLink(session.page_arena, data, status_maybe, prev)); │ │726 + try addRow(allocator, &list_box, "← previous", "", try windowLink(session.page_arena, data, status_maybe, drafts, prev));│ │727 for (win.items) |entry| { │ │728 // conflicts take precedence over the comment count │ │729 const label: []const u8 = if (entryConflicted(entry) and status_maybe != null) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │735 try addRow(allocator, &list_box, entry.record.event.title, label, try rowLink(session.page_arena, data.identity, entry.id));│ │736 } │ │737 if (win.next_id) |next| │ │375 - try addRow(allocator, &list_box, "next →", "", try windowLink(session.page_arena, data, status_maybe, next)); │ │738 + try addRow(allocator, &list_box, "next →", "", try windowLink(session.page_arena, data, status_maybe, drafts, next)); │ │739 // select the window's first issue (past a leading "previous" │ │740 // row) so its description shows on load. │ │741 if (win.items.len > 0) │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯