From 12d83cbfa3ca5f9eb4cd7baf654da23e828861ad Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 23 Apr 2026 15:58:31 +0200 Subject: [PATCH] Extend issue context popup beyond markdown content (#36908) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the issue context popup beyond markdown. Any link rendered with the `ref-issue` class now gets the popup, which covers commit titles and issue titles everywhere they appear (repo home, commits list, blame, branches, graph, PR commits, issue/PR pages, compare, …). For surfaces that synthesize links without markdown autolinking (dashboard activity feed, pulse page, commit merged-PR line), opt in by adding `data-ref-issue-container` on a parent (or `ref-issue` on the link). - Use `html_url` from the backend payload instead of synthesizing links client-side - Fetch outside the component, stateless, with a per-URL cache - Small hover delay so passing over a link doesn't fire a request - Drop the loading state (shifted layout) - Make both links in the tooltip work; prevent nested tooltips - Fix feed title `` width so the tooltip only shows on link hover Co-authored-by: Claude (Opus 4.6) --- templates/repo/activity.tmpl | 2 +- .../repo/commit_load_branches_and_tags.tmpl | 2 +- templates/user/dashboard/feeds.tmpl | 4 +- web_src/js/components/ContextPopup.vue | 47 +++--------- web_src/js/features/ref-issue.ts | 75 +++++++++++++++++++ web_src/js/index.ts | 2 + web_src/js/markup/content.ts | 2 - web_src/js/markup/refissue.ts | 42 ----------- web_src/js/types.ts | 2 + 9 files changed, 95 insertions(+), 83 deletions(-) create mode 100644 web_src/js/features/ref-issue.ts delete mode 100644 web_src/js/markup/refissue.ts diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index a19fb662616..a9883b3a4fd 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -5,7 +5,7 @@
{{template "repo/navbar" .}}
-
+
{{if .PageIsPulse}}{{template "repo/pulse" .}}{{end}} {{if .PageIsContributors}}{{template "repo/contributors" .}}{{end}} {{if .PageIsCodeFrequency}}{{template "repo/code_frequency" .}}{{end}} diff --git a/templates/repo/commit_load_branches_and_tags.tmpl b/templates/repo/commit_load_branches_and_tags.tmpl index 162d805a29e..18576f871fb 100644 --- a/templates/repo/commit_load_branches_and_tags.tmpl +++ b/templates/repo/commit_load_branches_and_tags.tmpl @@ -1,7 +1,7 @@ {{if not .PageIsWiki}}
{{if .MergedPRIssueNumber}} - {{$prLink := HTMLFormat `#%d` $.RepoLink $.MergedPRIssueNumber $.MergedPRIssueNumber}} + {{$prLink := HTMLFormat `#%d` $.RepoLink $.MergedPRIssueNumber $.MergedPRIssueNumber}}
{{ctx.Locale.Tr "repo.commit.merged_in_pr" $prLink}}
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index de93e6a6f0d..99f7f91bfdb 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -1,4 +1,4 @@ -
+
{{range .Feeds}}
@@ -107,7 +107,7 @@ {{else if .GetOpType.InActions "create_pull_request"}} {{index .GetIssueInfos 1 | ctx.RenderUtils.RenderIssueSimpleTitle}} {{else if .GetOpType.InActions "comment_issue" "approve_pull_request" "reject_pull_request" "comment_pull"}} - {{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderIssueSimpleTitle}} + {{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderIssueSimpleTitle}} {{$comment := index .GetIssueInfos 1}} {{if $comment}}
{{ctx.RenderUtils.MarkdownToHtml $comment}}
diff --git a/web_src/js/components/ContextPopup.vue b/web_src/js/components/ContextPopup.vue index 12911aad404..38e83d2c1f7 100644 --- a/web_src/js/components/ContextPopup.vue +++ b/web_src/js/components/ContextPopup.vue @@ -1,63 +1,40 @@