╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │858 - if (!session.data.is_local and (session.data.git_http_port != null or session.data.git_ssh_port != null)) { │ │859 - var clone_url = try ui.widget.CopyableText.initClone(allocator, session, identity); │ │860 - errdefer clone_url.deinit(allocator); │ │861 - const min_width = clone_url.minWidth(); │ │862 - box.getFocus().child_id = clone_url.getFocus().id; │ │863 - try box.children.put(allocator, clone_url.getFocus().id, .{ .widget = .{ .copyable_text = clone_url }, .rect = null, .min_size = .{ .width = min_width, .height = 3 }, .max_size = .{ .width = min_width, .height = 3 } }); │ │858 + if (!session.data.is_local) { │ │859 + if (try ui.widget.CopyableText.initClone(allocator, session, location)) |value| { │ │860 + var clone_url = value; │ │861 + errdefer clone_url.deinit(allocator); │ │862 + const min_width = clone_url.minWidth(); │ │863 + box.getFocus().child_id = clone_url.getFocus().id; │ │864 + try box.children.put(allocator, clone_url.getFocus().id, .{ .widget = .{ .copyable_text = clone_url }, .rect = null, .min_size = .{ .width = min_width, .height = 3 }, .max_size = .{ .width = min_width, .height = 3 } });│ │865 + } │ │866 } │ │867 │ │868 var spacer = try ui.widget.Spacer.init(allocator); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │18 name: []const u8, │ │19 owner_name: []const u8, │ │20 title: ui.Title, │ │21 -auth_tab: AuthTab, │ │21 // the ref/oid this page is viewing, so the files and commits tabs both link to│ │22 // it (switching tabs keeps the same ref). the value is url-encoded. │ │23 ref_or_oid: RefOrOid, │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────╮ │35 .name = name, │ │36 .owner_name = owner_name, │ │37 .title = try ui.Title.init(arena, name),│ │39 - .auth_tab = AuthTab.init(), │ │38 .ref_or_oid = ref_or_oid, │ │39 .ref_or_oid_value = ref_or_oid_value, │ │40 .issues_tag = issues_tag, │ ╰────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │45 │ │46 pub const View = struct { │ │47 scroll: wgt.Scroll(ui.Widget), │ │50 - data: *const Self, │ │48 tab_ids: std.AutoArrayHashMapUnmanaged(usize, void),│ │49 tabs_id: usize, │ │50 first_group_width: usize, │ ╰────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │335 │ │336 return .{ │ │337 .scroll = try wgt.Scroll(ui.Widget).init(allocator, .{ .box = box }, .{ .direction = .horiz, .show_bar = false, .web_native = !session.is_terminal }),│ │341 - .data = data, │ │338 .tab_ids = tab_ids, │ │339 .tabs_id = tabs_id, │ │340 .first_group_width = first_group_width, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭─────────────────────────────────────────────╮ │ 5 const xit = @import("xit"); │ │ 6 const rp = xit.repo; │ │ 7 const hash = xit.hash; │ │ 8 -const rf = xit.ref; │ │ 8 const xitui = xit.xitui; │ │ 9 const wgt = xitui.widget; │ │10 const diff3 = @import("../../diff3.zig");│ ╰─────────────────────────────────────────────╯ ╭───────────────────────────────────────╮ │42 fork_oid: []const u8 = "", │ │43 target_branch: []const u8 = "",│ │44 no_changes: bool = false, │ │45 + fork_exists: bool = false, │ │46 }; │ │47 │ │48 pub const Entry = PatchWithId; │ ╰───────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │133 │ │134 pub fn listRoute(identity: []const u8, status: Status, tag: []const u8, selected: []const u8) ?ui.RoutablePage {│ │135 return ui.RoutablePage.repoPatchesRoute(identity, status, tag, selected); │ │136 +} │ │137 + │ │138 +pub fn forkRoute(identity: []const u8, id: []const u8) ?ui.RoutablePage { │ │139 + return ui.RoutablePage.forkPatchRoute(identity, id); │ │140 } │ │141 │ │142 pub fn draftsRoute(identity: []const u8) ?ui.RoutablePage { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │307 }; │ │308 } │ │309 │ │310 +pub fn detailResult(aa: std.mem.Allocator, identity: []const u8, entry: PatchWithId) !Self { │ │311 + var result = try emptyResult(aa, identity, "", entry.id, "", 0, "", .open); │ │312 + const items = try aa.dupe(PatchWithId, &.{entry}); │ │313 + const detail_window = Window{ .items = items, .prev_id = null, .next_id = null, .count = 1 };│ │314 + if (entry.draft) { │ │315 + result.drafts = detail_window; │ │316 + result.view = .drafts; │ │317 + } else switch (entry.record.event.status) { │ │318 + .open => result.open = detail_window, │ │319 + .closed => { │ │320 + result.closed = detail_window; │ │321 + result.view = .closed; │ │322 + }, │ │323 + .merged => { │ │324 + result.merged = detail_window; │ │325 + result.view = .merged; │ │326 + }, │ │327 + } │ │328 + return result; │ │329 +} │ │330 + │ │331 // read one window per status of an opened repo's patches (filtered to `tag` │ │332 // when set), ordered by creation (newest first). the window of the patch │ │333 // `selected_id` names starts at it ("" = the beginning). a git repo reads the │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │493 } │ │494 } │ │495 const thread_comments_start = if (empty.comment_id.len == 0) comments_start else 0; │ │471 - const open_window = try thread.loadWindow(Self, repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_patch, open_set, open_root, conflict_set, empty.selected_id, thread_comments_start); │ │472 - const closed_window = try thread.loadWindow(Self, repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_patch, closed_set, closed_root, conflict_set, empty.selected_id, thread_comments_start); │ │473 - const merged_window = try thread.loadWindow(Self, repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_patch, merged_set, merged_root, conflict_set, empty.selected_id, thread_comments_start); │ │474 - const conflicts_window = try thread.loadWindow(Self, repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_patch, conflict_set, conflicts_root, conflict_set, empty.selected_id, thread_comments_start);│ │496 + var open_window = try thread.loadWindow(Self, repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_patch, open_set, open_root, conflict_set, empty.selected_id, thread_comments_start); │ │497 + var closed_window = try thread.loadWindow(Self, repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_patch, closed_set, closed_root, conflict_set, empty.selected_id, thread_comments_start); │ │498 + var merged_window = try thread.loadWindow(Self, repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_patch, merged_set, merged_root, conflict_set, empty.selected_id, thread_comments_start); │ │499 + var conflicts_window = try thread.loadWindow(Self, repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_patch, conflict_set, conflicts_root, conflict_set, empty.selected_id, thread_comments_start); │ │500 + try setForkAvailability(arena, admin_moment, &open_window); │ │501 + try setForkAvailability(arena, admin_moment, &closed_window); │ │502 + try setForkAvailability(arena, admin_moment, &merged_window); │ │503 + try setForkAvailability(arena, admin_moment, &conflicts_window); │ │504 if (view == .conflicts and conflicts_window.count > 0) resolved_view = .conflicts; │ │505 │ │506 const comment_page = if (empty.comment_id.len == 0) │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯