╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │85 .repo_files => |f| f.line, │ │86 else => 0, │ │87 }; │ │88 - // the hunk the commits view's selected commit's diff window starts at. │ │89 - const commits_start = switch (route) { │ │90 - .repo_commits => |c| c.start, │ │91 - else => 0, │ │88 + // what the commits view's pane shows for the commit it walks from: a diff │ │89 + // window (with the file it's filtered to) or that commit's message. │ │90 + const commits_content: ui.RoutablePage.RepoCommitsRoute.Content = switch (route) {│ │91 + .repo_commits => |c| c.content, │ │92 + else => .{ .diff = .{} }, │ │93 }; │ │93 - // the file the commits view's diff pane is filtered to ("" = every file). │ │94 - const commits_path = switch (route) { │ │95 - .repo_commits => |c| c.path.slice(), │ │96 - else => "", │ │94 + const commits_start = switch (commits_content) { │ │95 + .diff => |d| d.start, │ │96 + .message => 0, │ │97 }; │ │98 // the refs tab windows one column at a time: `refs_from` (a url-encoded │ │99 // ref name) roots `refs_kind`'s column, the other stays at its first window. │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │176 if (session.local != null) try evt.consume(repo_kind, opened.self_repo_opts, io, gpa, opened, evt.events_ref); │ │177 break :blk .{ │ │178 try Files.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, requested_ref_or_oid, requested_ref_value, files_dir, files_line), │ │179 - try Commits.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, requested_ref_or_oid, requested_ref_value, commits_start, commits_path),│ │179 + try Commits.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, requested_ref_or_oid, requested_ref_value, commits_content), │ │180 try Refs.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, refs_kind, refs_from), │ │181 try Issues.init(repo_kind, opened.self_repo_opts, arena, opened, io, repo_identity.identity, issues_tag, issues_selected, issues_view), │ │182 }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │188 const aa = arena.allocator(); │ │189 break :blk .{ │ │190 try Files.emptyResult(aa, repo_identity.identity, requested_ref_or_oid orelse .branch, requested_ref_value, files_dir), │ │191 - try Commits.emptyResult(aa, repo_identity.identity, requested_ref_or_oid orelse .branch, requested_ref_value, commits_path), │ │191 + try Commits.emptyResult(aa, repo_identity.identity, requested_ref_or_oid orelse .branch, requested_ref_value, commits_content),│ │192 try Refs.emptyResult(arena, repo_identity.identity, refs_kind, refs_from), │ │193 try Issues.emptyResult(aa, repo_identity.identity, issues_tag, issues_selected, issues_view), │ │194 }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │204 // directory route drops it. │ │205 const files_route_line = if (files.selected_file != null) files_line else 0; │ │206 const route_name = (ui.RoutablePage.repoFilesRoute(repo_identity.identity, files.ref_or_oid, files.ref_or_oid_value, files_path, files_route_line) orelse return error.NotFound).repo_files; │ │207 - const commits_route_name = (ui.RoutablePage.repoCommitsRoute(repo_identity.identity, commits.ref_or_oid, commits.ref_or_oid_value, commits_start, commits.path) orelse return error.NotFound).repo_commits;│ │207 + // the message page mirrors its own url, not the log's │ │208 + const commits_route = switch (commits.content) { │ │209 + .message => ui.RoutablePage.repoCommitMessageRoute(repo_identity.identity, commits.ref_or_oid, commits.ref_or_oid_value), │ │210 + .diff => |d| ui.RoutablePage.repoCommitsRoute(repo_identity.identity, commits.ref_or_oid, commits.ref_or_oid_value, commits_start, d.path), │ │211 + }; │ │212 + const commits_route_name = (commits_route orelse return error.NotFound).repo_commits; │ │213 │ │214 return .{ │ │215 // files and commits resolve the same ref, so either's serves the header, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯