╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────╮ │src/ui/CloneUrl.zig│ ╰───────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │152 const aa = self.session.arena.allocator(); │ │125 - const id = self.urlInput().getFocus().id; │ │126 - try self.session.text_inputs.put(aa, id, self.urlInput()); │ │127 - try self.session.input_values.put(aa, id, self.protocols[self.selected].url); │ │153 + const id = self.textInput().getFocus().id; │ │154 + try self.session.text_inputs.put(aa, id, self.textInput()); │ │155 + try self.session.input_values.put(aa, id, self.protocols[self.selected].text);│ │156 } │ │157 } │ │158 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │168 for (0..self.protocol_count) |i| { │ │169 if (inp.leftClickOn(root_focus, self.protocolLabel(i).getFocus().id, mouse)) break :blk i; │ │170 } │ │143 - if (self.session.is_terminal and !mouse.ctrl and inp.leftClickOn(root_focus, self.urlInput().getFocus().id, mouse)) │ │171 + if (self.session.is_terminal and !mouse.ctrl and inp.leftClickOn(root_focus, self.textInput().getFocus().id, mouse))│ │172 self.session.host_request = .{ .show_copyable_text = self.protocols[self.selected].copyable_text }; │ │173 return; │ │174 }, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │175 else => return, │ │176 }; │ │177 self.selected = next; │ │150 - try self.urlInput().setContent(allocator, self.protocols[next].url); │ │178 + try self.textInput().setContent(allocator, self.protocols[next].text); │ │179 } │ │180 │ │153 - fn urlInput(self: *View) *wgt.TextInput(ui.Widget) { │ │181 + fn textInput(self: *View) *wgt.TextInput(ui.Widget) { │ │182 return &self.box.children.values()[self.protocol_count].widget.text_input;│ │183 } │ │184 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────╮ │16 pub const Commits = @import("./Repo/Commits.zig"); │ │17 pub const Refs = @import("./Repo/Refs.zig"); │ │18 pub const Issues = @import("./Repo/Issues.zig"); │ │19 +pub const Patches = @import("./Repo/Patches.zig"); │ │20 pub const Discussions = @import("./Repo/Discussions.zig");│ │21 pub const Comment = @import("./Repo/Comment.zig"); │ │22 pub const Events = @import("./Repo/Events.zig"); │ ╰──────────────────────────────────────────────────────────────╯ ╭─────────────────────────────╮ │32 commits: Commits, │ │33 refs: Refs, │ │34 issues: Issues, │ │35 +patches: Patches, │ │36 discussions: Discussions,│ │37 events: Events, │ │38 settings: Settings, │ ╰─────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │130 const issues_comments_start: usize = switch (route) { │ │131 .repo_issues => |i| i.comments_start, │ │132 else => 0, │ │133 + }; │ │134 + const patches_tag: []const u8 = switch (route) { │ │135 + .repo_patches => |*p| p.tag.slice(), │ │136 + else => "", │ │137 + }; │ │138 + const patches_selected: []const u8 = switch (route) { │ │139 + .repo_patches => |*p| p.selected.slice(), │ │140 + else => "", │ │141 + }; │ │142 + const patches_comment: []const u8 = switch (route) { │ │143 + .repo_patches => |*p| p.comment.slice(), │ │144 + else => "", │ │145 + }; │ │146 + const patches_theirs: []const u8 = switch (route) { │ │147 + .repo_patches => |*p| p.theirs.slice(), │ │148 + else => "", │ │149 + }; │ │150 + const patches_view: ui.RoutablePage.PatchesView = switch (route) {│ │151 + .repo_patches => |p| p.view, │ │152 + else => .open, │ │153 }; │ │154 + const patches_comments_start: usize = switch (route) { │ │155 + .repo_patches => |p| p.comments_start, │ │156 + else => 0, │ │157 + }; │ │158 const discussions_tag: []const u8 = switch (route) { │ │159 .repo_discussions => |*t| t.tag.slice(), │ │160 else => "", │ ╰───────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │192 // the repo and owner-name metadata the header shows. local mode already│ │193 // knows all three; the server paths resolve them from the admin db. │ │194 var source: ?ui.RepoSource = null; │ │195 + var repo_id_maybe: ?[evt.event_id_size]u8 = null; │ │196 var repo: evt.Repo.Record = undefined; │ │197 var owner_name: []const u8 = undefined; │ │198 if (session.local) |local| { │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │209 const haxy_moment = session.haxy_moment orelse return error.NoMoment; │ │210 const found = (try evt.Repo.readByOwnerAndName(DB, hash_kind, haxy_moment, arena, repo_identity.owner, repo_identity.name)) orelse return error.NotFound;│ │211 repo = found.repo; │ │212 + repo_id_maybe = found.event_id; │ │213 │ │214 // resolve the creating user so the header can show their name to the left │ │215 // of the repo title. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │231 // route named none), so they end up viewing the same one and either's │ │232 // resolved ref can canonicalize the tab mirror urls below. no filesystem │ │233 // (wasm), nowhere to look, or a failed open: empty tabs. │ │206 - const files, const commits, const refs, var issues, var discussions, const events = blk: { │ │234 + const files, const commits, const refs, var issues, var patches, var discussions, const events = blk: {│ │235 read: { │ │236 const io = session.io orelse break :read; │ │237 const src = source orelse break :read; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │249 try Commits.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, session.haxy_moment, repo_identity.identity, requested_ref_or_oid, requested_ref_value, commits_content), │ │250 try Refs.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, refs_kind, refs_from), │ │251 try Issues.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, issues_tag, issues_selected, issues_comment, issues_comments_start, issues_theirs, issues_view), │ │252 + try Patches.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, session, repo_id_maybe, repo_identity.identity, patches_tag, patches_selected, patches_comment, patches_comments_start, patches_theirs, patches_view),│ │253 try Discussions.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, discussions_tag, discussions_selected, discussions_comment, discussions_comments_start, discussions_view), │ │254 try Events.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, events_view, events_kind, events_selected, session.local != null, session.data.sync_failure), │ │255 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯