From 27a3e035657a8dcf3230fb916bcf479addaba4ec Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Wed, 28 Jan 2026 14:48:36 +0200 Subject: [PATCH] appview/{repo,pages}: show most recent commit in blob view Signed-off-by: Anirudh Oppiliappan --- appview/pages/pages.go | 12 ++++--- appview/pages/templates/repo/blob.html | 49 ++++++++++++++++++++++++++ appview/repo/blob.go | 27 ++++++++++++++ 3 files changed, 83 insertions(+), 5 deletions(-) diff --git a/appview/pages/pages.go b/appview/pages/pages.go index ce43444d..d41ceaa0 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -855,11 +855,13 @@ func (p *Pages) RepoArtifactFragment(w io.Writer, params RepoArtifactParams) err } type RepoBlobParams struct { - LoggedInUser *oauth.MultiAccountUser - RepoInfo repoinfo.RepoInfo - Active string - BreadCrumbs [][]string - BlobView models.BlobView + LoggedInUser *oauth.MultiAccountUser + RepoInfo repoinfo.RepoInfo + Active string + BreadCrumbs [][]string + BlobView models.BlobView + EmailToDid map[string]string + LastCommitInfo *types.LastCommitInfo *tangled.RepoBlob_Output } diff --git a/appview/pages/templates/repo/blob.html b/appview/pages/templates/repo/blob.html index 178f0828..62edd4f0 100644 --- a/appview/pages/templates/repo/blob.html +++ b/appview/pages/templates/repo/blob.html @@ -12,6 +12,55 @@ {{ define "repoContent" }} {{ $linkstyle := "no-underline hover:underline" }} + + {{ if .LastCommitInfo }} +
+
+ {{ $messageParts := splitN .LastCommitInfo.Message "\n\n" 2 }} +
+ + {{ index $messageParts 0 }} + + {{ if gt (len $messageParts) 1 }} + + {{ end }} +
+ {{ if gt (len $messageParts) 1 }} + + {{ end }} +
+
+ {{ if .LastCommit.Author }} + {{ $authorDid := index .EmailToDid .LastCommit.Author.Email }} + + {{ if $authorDid }} + {{ template "user/fragments/picHandleLink" $authorDid }} + {{ else }} + {{ placeholderAvatar "tiny" }} + {{ .LastCommit.Author.Name }} + {{ end }} + + + {{ end }} + {{ template "repo/fragments/time" .LastCommitInfo.When }} + + + + {{ slice .LastCommitInfo.Hash.String 0 8 }} + + +
+
+ {{ end }} +