From a52481a3884447f94aad2d97e0407112c818a32d Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Thu, 3 Sep 2026 01:37:35 -0400 Subject: Link blobs to their history and back Nothing in a commits payload says whether the path it lists is a file or a directory: currentBlobPath, despite the name, is only the path filter, and is set for a directory just the same. GitHub's own UI cannot tell either, and points its browse button at /blob// so that the redirect resolves a file to its blob. We do the same, and the blob route already turns that redirect into one of our own tree URLs. Breadcrumbs now stay in the view they were clicked from, so walking up from a history lands in the history of each parent directory rather than in its listing. The last crumb remains the page you are already on. A path with no commits now says so rather than rendering an empty page. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01R7pRKdmTvNDgT4ZXrwkbH8 --- views/commits.eta | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'views/commits.eta') diff --git a/views/commits.eta b/views/commits.eta index 5cf0beb..c29693d 100644 --- a/views/commits.eta +++ b/views/commits.eta @@ -2,6 +2,12 @@ <%~ include("./_nav.eta", {...it, view: "commits"}) %> +<% const pathSuffix = it.path && it.path !== "/" ? "/" + it.path : "" %> + +<% if (it.commitGroups.length === 0) { %> +
No commits found.
+<% } %> + <% for (const group of it.commitGroups) { %>

<%= group.title %>

<% for (const commit of group.commits) { %> @@ -19,6 +25,8 @@
<%= commit.oid.substring(0, 7) %> + <% /* Like GitHub, blindly link to blob and redirect for trees */ %> + Browse
<% } %> -- cgit v1.3.1