╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │51 }; │ │52 }, │ │53 .repo => switch (route) { │ │54 - .repo_files, .repo_commits, .repo_refs, .repo_issues, .repo_comments, .repo_settings, .repo_auth => .{ .repo = try Repo.init(arena, session, route) },│ │54 + .repo_files, .repo_commits, .repo_refs, .repo_issues, .repo_settings, .repo_auth => .{ .repo = try Repo.init(arena, session, route) }, │ │55 else => return error.UnexpectedRoute, │ │56 }, │ │57 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │101 view: IssuesView = .open, │ │102 // the selected issue's comment window (0 = the first window). │ │103 comments_start: usize = 0, │ │104 + // the comment shown in the detail pane (empty = the issue thread).│ │105 + comment: Array(evt.event_id_size * 2) = .{}, │ │106 }, │ │105 - repo_comments: struct { │ │106 - name: Array(repo_route_max_len), │ │107 - thread: Array(evt.event_id_size * 2), │ │108 - selected: Array(evt.event_id_size * 2), │ │109 - start: usize = 0, │ │110 - }, │ │107 repo_settings: Array(repo_route_max_len), │ │108 repo_auth: Array(repo_route_max_len), │ │109 │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │361 // build a comment permalink route at one of its immediate-reply windows. │ │362 pub fn repoCommentsRoute(identity: []const u8, thread: []const u8, selected: []const u8, start: usize) ?RoutablePage {│ │363 if (thread.len == 0 or selected.len == 0) return null; │ │368 - return .{ .repo_comments = .{ │ │369 - .name = Array(repo_route_max_len).from(identity) orelse return null, │ │370 - .thread = Array(evt.event_id_size * 2).from(thread) orelse return null, │ │371 - .selected = Array(evt.event_id_size * 2).from(selected) orelse return null, │ │372 - .start = start, │ │373 - } }; │ │364 + var route = repoIssueCommentsRoute(identity, thread, start) orelse return null; │ │365 + route.repo_issues.comment = Array(evt.event_id_size * 2).from(selected) orelse return null; │ │366 + return route; │ │367 } │ │368 │ │369 // build a `.repo_issues` route showing tags view, keeping the url-encoded │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │516 try std.fmt.allocPrint(arena.allocator(), "{s}/issues/conflicts", .{prefix}) │ │517 else │ │518 try std.fmt.allocPrint(arena.allocator(), "{s}/issues/" ++ start_seg ++ "{s}/conflicts", .{ prefix, i.selected.slice() }); │ │519 + if (i.comment.len != 0) break :blk if (i.comments_start == 0) │ │520 + try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ issue_seg ++ "{s}/" ++ comment_seg ++ "{s}", .{ prefix, i.selected.slice(), i.comment.slice() }) │ │521 + else │ │522 + try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ issue_seg ++ "{s}/" ++ comment_seg ++ "{s}/" ++ start_seg ++ "{d}", .{ prefix, i.selected.slice(), i.comment.slice(), i.comments_start });│ │523 if (i.selected.len != 0) break :blk if (i.comments_start == 0) │ │524 try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ issue_seg ++ "{s}", .{ prefix, i.selected.slice() }) │ │525 else │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │529 else │ │530 try std.fmt.allocPrint(arena.allocator(), "{s}/issues/{s}/" ++ tag_filter_seg ++ "{s}", .{ prefix, @tagName(i.view), i.tag.slice() }); │ │531 }, │ │535 - .repo_comments => |c| blk: { │ │536 - const prefix = try repoUrlPrefix(arena, c.name.slice()); │ │537 - break :blk if (c.start == 0) │ │538 - try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ issue_seg ++ "{s}/" ++ comment_seg ++ "{s}", .{ prefix, c.thread.slice(), c.selected.slice() }) │ │539 - else │ │540 - try std.fmt.allocPrint(arena.allocator(), "{s}/" ++ issue_seg ++ "{s}/" ++ comment_seg ++ "{s}/" ++ start_seg ++ "{d}", .{ prefix, c.thread.slice(), c.selected.slice(), c.start });│ │541 - }, │ │532 .repo_settings => |name| try std.fmt.allocPrint(arena.allocator(), "{s}/settings", .{try repoUrlPrefix(arena, name.slice())}), │ │533 .repo_auth => |name| try std.fmt.allocPrint(arena.allocator(), "{s}/auth", .{try repoUrlPrefix(arena, name.slice())}), │ │534 }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │591 pub fn fullHeight(self: RoutablePage) bool { │ │592 return switch (self) { │ │593 .repo_issues => |i| i.view == .resolve,│ │604 - .repo_comments => true, │ │594 else => false, │ │595 }; │ │596 } │ ╰────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────╮ │603 .repo_commits => |*c| c.name.slice(), │ │604 .repo_refs => |*r| r.name.slice(), │ │605 .repo_issues => |*i| i.name.slice(), │ │617 - .repo_comments => |*c| c.name.slice(), │ │606 .repo_settings, .repo_auth => |*name| name.slice(),│ │607 else => null, │ │608 }; │ ╰────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │627 return switch (self) { │ │628 .home_users, .home_repos, .home_settings, .home_auth => .home, │ │629 .user_repos, .user_settings, .user_auth => .user, │ │642 - .repo_files, .repo_commits, .repo_refs, .repo_issues, .repo_comments, .repo_settings, .repo_auth => .repo,│ │630 + .repo_files, .repo_commits, .repo_refs, .repo_issues, .repo_settings, .repo_auth => .repo, │ │631 }; │ │632 } │ │633 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │758 std.mem.eql(u8, a_i.selected.slice(), b.repo_issues.selected.slice()) and │ │759 std.mem.eql(u8, a_i.theirs.slice(), b.repo_issues.theirs.slice()) and │ │760 a_i.view == b.repo_issues.view and │ │773 - a_i.comments_start == b.repo_issues.comments_start, │ │774 - .repo_comments => |a_c| std.mem.eql(u8, a_c.name.slice(), b.repo_comments.name.slice()) and│ │775 - std.mem.eql(u8, a_c.thread.slice(), b.repo_comments.thread.slice()) and │ │776 - std.mem.eql(u8, a_c.selected.slice(), b.repo_comments.selected.slice()) and │ │777 - a_c.start == b.repo_comments.start, │ │761 + a_i.comments_start == b.repo_issues.comments_start and │ │762 + std.mem.eql(u8, a_i.comment.slice(), b.repo_issues.comment.slice()), │ │763 .repo_settings => |a_name| std.mem.eql(u8, a_name.slice(), b.repo_settings.slice()), │ │764 .repo_auth => |a_name| std.mem.eql(u8, a_name.slice(), b.repo_auth.slice()), │ │765 else => true, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────╮ │1476 repo_commits: Repo.Commits.View, │ │1477 repo_refs: Repo.Refs.View, │ │1478 repo_issues: Repo.Issues.View, │ │1494 - repo_comments: Repo.Comments.View, │ │1495 - repo_comment: Repo.Comments.Item, │ │1479 + repo_comment: Repo.Comment.Item, │ │1480 home_users: Home.Users.View, │ │1481 home_repos: Home.Repos.View, │ │1482 auth_tab: Home.Header.AuthTab.View,│ ╰─────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯