From 73cb06db386ca4885e6466ab7a22e603b7ac801e Mon Sep 17 00:00:00 2001 From: Lewis Date: Mon, 23 Mar 2026 11:03:18 +0200 Subject: [PATCH] appview/pages: PR mark-as-reviewed btn Lewis: May this revision serve well! --- .../pages/templates/repo/fragments/diff.html | 146 +++++++++++++++++- appview/pages/templates/repo/pulls/pull.html | 3 + types/diff.go | 7 +- 3 files changed, 149 insertions(+), 7 deletions(-) diff --git a/appview/pages/templates/repo/fragments/diff.html b/appview/pages/templates/repo/fragments/diff.html index bafbce9c..ecc77798 100644 --- a/appview/pages/templates/repo/fragments/diff.html +++ b/appview/pages/templates/repo/fragments/diff.html @@ -14,6 +14,7 @@ {{ template "fragments/resizable" }} {{ template "activeFileHighlight" }} {{ template "fragments/line-quote-button" }} + {{ template "reviewState" }} {{ end }} @@ -37,7 +38,7 @@ {{ $stat := $diff.Stats }} {{ $count := len $diff.ChangedFiles }} {{ template "repo/fragments/diffStatPill" $stat }} - + {{ if $root }} {{ if $root.IsInterdiff }} @@ -178,6 +179,21 @@ {{ end }} + @@ -305,3 +321,131 @@ })(); {{ end }} + +{{ define "reviewState" }} + +{{ end }} diff --git a/appview/pages/templates/repo/pulls/pull.html b/appview/pages/templates/repo/pulls/pull.html index cd209239..b7d4a63b 100644 --- a/appview/pages/templates/repo/pulls/pull.html +++ b/appview/pages/templates/repo/pulls/pull.html @@ -100,6 +100,9 @@ {{ define "contentAfter" }} + {{ if .IsInterdiff }} + + {{ end }} {{ template "repo/fragments/diff" (list .Diff .DiffOpts $) }} {{ end }} diff --git a/types/diff.go b/types/diff.go index 513ec2fc..5204581b 100644 --- a/types/diff.go +++ b/types/diff.go @@ -84,12 +84,7 @@ func (d NiceDiff) ChangedFiles() []DiffFileRenderer { func (d NiceDiff) FileTree() *filetree.FileTreeNode { fs := make([]string, len(d.Diff)) for i, s := range d.Diff { - n := s.Names() - if n.New == "" { - fs[i] = n.Old - } else { - fs[i] = n.New - } + fs[i] = s.Id() } return filetree.FileTree(fs) } -- 2.51.2