╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │670 const page_url = try route.toUrl(session.page_arena); │ │671 const action = try std.fmt.allocPrint(session.page_arena.allocator(), "form:{s}/comment", .{page_url[0 .. page_url.len - "/new".len]}); │ │672 const parent_route = if (data.comment_page) |page| │ │673 - ui.RoutablePage.repoCommentsRoute(data.identity, data.selected_id, page.selected.id, 0) │ │673 + ui.RoutablePage.repoCommentsRoute(data.identity, data.selected_id, &page.selected.id, 0) │ │674 else │ │675 ui.RoutablePage.repoIssueCommentsRoute(data.identity, data.selected_id, 0); │ │676 var form = try initCommentForm(allocator, session, action, if (data.comment_page) |page| page.selected.author else if (data.selectedIssue()) |entry| entry.author else .unknown, parent_route orelse return error.RouteTooLong);│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1246 (if (self.data.description_page) │ │1247 ui.RoutablePage.repoIssuesDescriptionRoute(self.data.identity, self.data.selected_id) │ │1248 else if (self.data.comment_page) |page| │ │1249 - ui.RoutablePage.repoCommentsRoute(self.data.identity, self.data.selected_id, page.selected.id, page.replies.start) │ │1249 + ui.RoutablePage.repoCommentsRoute(self.data.identity, self.data.selected_id, &page.selected.id, page.replies.start)│ │1250 else │ │1251 ui.RoutablePage.repoIssueCommentsRoute(self.data.identity, self.data.selected_id, self.data.comments_start)) │ │1252 else if (index == tags_view_index) │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1272 ui.RoutablePage.repoIssuesDescriptionRoute(self.data.identity, entry.id) │ │1273 else if (self.data.comment_page) |page| │ │1274 if (std.mem.eql(u8, entry.id, self.data.selected_id)) │ │1275 - ui.RoutablePage.repoCommentsRoute(self.data.identity, entry.id, page.selected.id, page.replies.start) │ │1275 + ui.RoutablePage.repoCommentsRoute(self.data.identity, entry.id, &page.selected.id, page.replies.start)│ │1276 else │ │1277 ui.RoutablePage.repoIssueCommentsRoute(self.data.identity, entry.id, 0) │ │1278 else if (std.mem.eql(u8, entry.id, self.data.selected_id)) │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1446 try Comment.appendComment(allocator, inner, self.session, self.data.identity, page.selected); │ │1447 try Comment.appendCount(allocator, inner, page.replies.count, "reply", "replies", self.session.page_arena.allocator()); │ │1448 for (page.replies.comments) |comment| try Comment.appendComment(allocator, inner, self.session, self.data.identity, comment); │ │1449 - try Comment.appendWindowNav(allocator, inner, self.session, self.data.identity, page.thread_id, page.selected.id, page.replies); │ │1449 + try Comment.appendWindowNav(allocator, inner, self.session, self.data.identity, &page.selected.comment.event.thread_id, &page.selected.id, page.replies);│ │1450 │ │1451 var spacer = try ui.Spacer.init(allocator); │ │1452 errdefer spacer.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │1715 return; │ │1716 }, │ │1717 .arrow_down => { │ │1718 - if (self.moveDetailFocus(index, root_focus, true)) return; │ │1718 + if (self.moveCommentVertical(index, root_focus, true)) return;│ │1719 const before = sc.y; │ │1720 sc.y += 1; │ │1721 sc.clampToContent(); │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │1722 - if (sc.y == before) _ = self.moveDetailFocus(index, root_focus, true); │ │1722 + if (sc.y == before) _ = self.moveCommentVertical(index, root_focus, true);│ │1723 return; │ │1724 }, │ │1725 .page_up => sc.y -= 10, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │1840 root_focus.setFocus(row.children.keys()[target]); │ │1841 if (child.rect) |rect| self.detailScroll(index).scrollToRect(rect); │ │1842 return true; │ │1843 - } │ │1844 - │ │1845 - fn moveDetailFocus(self: *View, index: usize, root_focus: *Focus, down: bool) bool {│ │1846 - return self.moveCommentVertical(index, root_focus, down); │ │1843 } │ │1844 │ │1845 // up/down (and tab/shift+tab) move between a form's fields; up from the │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │2056 defer allocator.free(body); │ │2057 if (!evt.Comment.fieldsValid(body)) return; │ │2058 │ │2063 - var id_bytes: [evt.event_id_size]u8 = undefined; │ │2064 - io.random(&id_bytes); │ │2065 - const event_id_hex = std.fmt.bytesToHex(id_bytes, .lower); │ │2059 var thread_id: [evt.event_id_size * 2]u8 = undefined; │ │2060 @memcpy(&thread_id, self.data.selected_id); │ │2061 const parent_id = if (self.data.comment_id.len == 0) thread_id else blk: {│ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2062 var parent: [evt.event_id_size * 2]u8 = undefined; │ │2063 @memcpy(&parent, self.data.comment_id); │ │2064 break :blk parent; │ │2072 - }; │ │2073 - const event = evt.EventWithId{ │ │2074 - .id = event_id_hex, │ │2075 - .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()), │ │2076 - .author_email = author_email, │ │2077 - .event = .{ .comment = .{ │ │2078 - .thread_id = thread_id, │ │2079 - .parent_id = parent_id, │ │2080 - .body = body, │ │2081 - } }, │ │2065 }; │ │2083 - │ │2066 + var event_id_hex: [evt.event_id_size * 2]u8 = undefined; │ │2067 switch (src.repo_kind) { │ │2068 inline else => |repo_kind| { │ │2069 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, .{ .path = src.path });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2070 defer any_repo.deinit(io, allocator); │ │2071 switch (any_repo) { │ │2089 - inline else => |*repo| try evt.consume(repo_kind, repo.self_repo_opts, io, allocator, repo, evt.events_ref, &.{event}), │ │2072 + inline else => |*repo| event_id_hex = try evt.Comment.create(repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id, &parent_id, body, author_email),│ │2073 } │ │2074 }, │ │2075 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯