Skip to content

Extend issue context popup beyond markdown content#36908

Merged
silverwind merged 12 commits intogo-gitea:mainfrom
silverwind:refpop
Apr 23, 2026
Merged

Extend issue context popup beyond markdown content#36908
silverwind merged 12 commits intogo-gitea:mainfrom
silverwind:refpop

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Mar 16, 2026

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 <a> width so the tooltip only shows on link hover
Screenshot 2026-03-16 at 07 35 31 Screenshot 2026-03-16 at 07 35 47

This PR was written with the help of Claude Opus 4.7

Previously, the context popup only worked on links with the .ref-issue
class inside .markup containers. This meant dashboard feed links and
other issue/PR references outside rendered markdown never showed popups.

Replace the markup-scoped approach with a global delegated mouseover
listener that uses parseIssueHref to detect issue/PR links anywhere on
the page. Add response caching so hovering the same issue from different
links doesn't re-fetch. Make ContextPopup a pure display component with
clickable repo and issue title links.

Other changes:
- Fix feed title <a> stretching full width (add tw-self-start)
- Clean up Vue app on tippy destroy to prevent memory leaks
- Clear cache and retry marker on fetch errors

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 16, 2026
@silverwind silverwind changed the title Show issue/PR context popup on any issue/PR link site-wide Improve issue context popup Mar 16, 2026
silverwind and others added 2 commits March 16, 2026 07:52
Delay popup fetch by 300ms so casual mouse passes don't trigger
network requests. Extract the popup creation logic into a separate
showRefIssuePopup function for clarity.

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@bircni bircni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an Idea but what about also showing the actions state? so X or whatever to see PRs state

@wxiaoguang
Copy link
Copy Markdown
Contributor

Is it really right to show the popup everywhere?

Is it your decision or your AI's decision?

image image image

@wxiaoguang wxiaoguang marked this pull request as draft March 16, 2026 07:52
@silverwind
Copy link
Copy Markdown
Member Author

Right, on issue list it probably make no sense, project is debatable. Will investigate how GitHub does this.

@wxiaoguang
Copy link
Copy Markdown
Contributor

Please make sure the framework is designed by the correct approach:

let callers tell framework what they want, but not let framework guess what it should do for different callers.

You need to explicitly declare "the links need to show issue ref popup", but not make the popup logic try to guess and exclude.

@silverwind
Copy link
Copy Markdown
Member Author

You need to explicitly declare "the links need to show issue ref popup", but not make the popup logic try to guess and exclude.

I'd rather have an opt-out than an opt-in. Less work overall because the majority of issue links benefit from the tooltip.

@wxiaoguang
Copy link
Copy Markdown
Contributor

wxiaoguang commented Mar 17, 2026

You need to explicitly declare "the links need to show issue ref popup", but not make the popup logic try to guess and exclude.

I'd rather have an opt-out than an opt-in. Less work overall because the majority of issue links benefit from the tooltip.

Maybe you forgot how many bugs were caused by various global pollutions. You will introduce more global pollutions and more bugs.

silverwind and others added 3 commits April 23, 2026 12:44
* origin/main: (204 commits)
  fix: commit status reporting (go-gitea#37372)
  Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356)
  Fix cmd tests by mocking builtin paths (go-gitea#37369)
  chore: upgrade Go version in devcontainer image to 1.26 (go-gitea#37374)
  Fix button layout shift when collapsing file tree in editor (go-gitea#37363)
  Update `Block a user` form (go-gitea#37359)
  Remove IsValidExternalURL/IsAPIURL and use IsValidURL at call sites (go-gitea#37364)
  Add URL to `Learn more about blocking a user` (go-gitea#37355)
  fix: use TriggerEvent instead of Event in workflow runs API response for scheduled runs (go-gitea#37288)
  Add event.schedule context for schedule actions task (go-gitea#37320)
  Fix typos (go-gitea#37346)
  Fix an issue where changing an organization’s visibility caused problems when users had forked its repositories. (go-gitea#37324)
  Fail vite build on rolldown warnings via NODE_ENV=test (go-gitea#37270)
  Use modern "git update-index --cacheinfo" syntax to support more file names (go-gitea#37338)
  Fix URL related escaping for oauth2 (go-gitea#37334)
  When the requested arch rpm is missing fall back to noarch (go-gitea#37236)
  Fix `relative-time` error and improve global error handler (go-gitea#37241)
  Enhance styling in actions page (go-gitea#37323)
  fix(oauth): Error on auth sources with spaces (go-gitea#37327)
  Fix actions concurrency groups cross-branch leak (go-gitea#37311)
  ...

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>

# Conflicts:
#	web_src/js/index-domready.ts
#	web_src/js/markup/content.ts
#	web_src/js/markup/refissue.ts
Matches GitHub: no popup on listings where the same info is already rendered.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
- Drop dead webpackChunkName magic comment (now on vite)
- Use HTMLAnchorElement.pathname instead of new URL(...)
- Type the delegated handler generically, remove inner casts
- Merge .closest() skip-containers into one call
- Drop WHAT-narrating comments, keep WHY ones

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@silverwind
Copy link
Copy Markdown
Member Author

bc1cd33 adds the skip for all places where information is duplicate, consistent with GitHub.

@silverwind silverwind marked this pull request as ready for review April 23, 2026 10:45
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have been clear: if you design a global framework or approach, you should make it have clear behavior, but not guess.

Such code can not be right:

    if (link.closest('.ref-issue-popup, #issue-list, #project-board, .milestone-issue-list')) return;

You should explicitly add the class "ref-issue" to the links you need to popup, or add something like "ref-issue-container" to the container of the links, but not let the framework function know everything or keep guessing.


By the way, manually constructing links is very fragile, backend should already tell you the "repo link" or "issue link"

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 23, 2026
@silverwind
Copy link
Copy Markdown
Member Author

A opt-out is clearly better than opt-in for this. There are exactly 3 cases where popup does not make sense compared to 100+ where it does.

@silverwind silverwind requested a review from wxiaoguang April 23, 2026 11:01
@silverwind
Copy link
Copy Markdown
Member Author

I may have misread, I'll do the opt-out via attribute and check if links are already available somewhere.

Replace hardcoded selector list with data-no-ref-issue-popup attribute
on containers that should suppress the popup. Use html_url from the
backend payload instead of constructing links on the client.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Apr 23, 2026

  1. Opt-out via data-no-ref-issue-popup attribute on any parent
  2. Re-use html_url

Opt-in is a no-go for me, there are 3 self-referencing locations that don't need it vs. probably 50+ locations that do need it.

Links get the popup if they have the `ref-issue` class (markdown
autolinks already emit it) or sit inside a `data-ref-issue-container`
element. Marks `#activity-feed`, the activity/pulse main column, and
adds the class to the merged-PR commit link.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@silverwind
Copy link
Copy Markdown
Member Author

Did opt-in fb651ea, the number of locations that needed it was actually much smaller than expected.

@silverwind silverwind changed the title Improve issue context popup Extend issue context popup to activity feeds and pulse Apr 23, 2026
@silverwind silverwind changed the title Extend issue context popup to activity feeds and pulse Extend issue context popup beyond markdown content Apr 23, 2026
Comment thread web_src/js/features/ref-issue.ts Outdated
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Apr 23, 2026
silverwind and others added 3 commits April 23, 2026 14:15
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 23, 2026
@silverwind silverwind enabled auto-merge (squash) April 23, 2026 13:24
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 23, 2026
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@silverwind silverwind merged commit 12d83cb into go-gitea:main Apr 23, 2026
26 checks passed
@silverwind silverwind deleted the refpop branch April 23, 2026 13:58
@GiteaBot GiteaBot added this to the 1.27.0 milestone Apr 23, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 23, 2026
silverwind added a commit to silverwind/gitea that referenced this pull request Apr 24, 2026
* origin/main:
  Allow fast-forward-only merge when signed commits are required (go-gitea#37335)
  Introduce `ActionRunAttempt` to represent each execution of a run (go-gitea#37119)
  Move review request functions to a standalone file (go-gitea#37358)
  Fix repo init README EOL (go-gitea#37388)
  Fix org team assignee/reviewer lookups for team member permissions (go-gitea#37365)
  Remove external service dependencies in migration tests (go-gitea#36866)
  Extend issue context popup beyond markdown content (go-gitea#36908)

# Conflicts:
#	routers/api/v1/repo/action.go
#	web_src/js/components/RepoActionView.vue
silverwind added a commit to mohammad-rj/gitea that referenced this pull request Apr 24, 2026
* origin/main: (127 commits)
  Refactor pull request view (1) (go-gitea#37380)
  Improve AGENTS.md (go-gitea#37382)
  Remove dead CSS (go-gitea#37376)
  Add pr-review e2e test and speed up e2e tests (go-gitea#37345)
  Drop Fomantic tab, checkbox and form patches (go-gitea#37377)
  fix: dump with default zip type produces uncompressed zip (go-gitea#37401)
  Allow fast-forward-only merge when signed commits are required (go-gitea#37335)
  Introduce `ActionRunAttempt` to represent each execution of a run (go-gitea#37119)
  Move review request functions to a standalone file (go-gitea#37358)
  Fix repo init README EOL (go-gitea#37388)
  Fix org team assignee/reviewer lookups for team member permissions (go-gitea#37365)
  Remove external service dependencies in migration tests (go-gitea#36866)
  Extend issue context popup beyond markdown content (go-gitea#36908)
  fix: commit status reporting (go-gitea#37372)
  Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356)
  Fix cmd tests by mocking builtin paths (go-gitea#37369)
  chore: upgrade Go version in devcontainer image to 1.26 (go-gitea#37374)
  Fix button layout shift when collapsing file tree in editor (go-gitea#37363)
  Update `Block a user` form (go-gitea#37359)
  Remove IsValidExternalURL/IsAPIURL and use IsValidURL at call sites (go-gitea#37364)
  ...

# Conflicts:
#	modules/eventsource/event.go
#	tests/e2e/events.test.ts
silverwind added a commit to silverwind/gitea that referenced this pull request Apr 25, 2026
* origin/main: (51 commits)
  Fix color regressions, add `priority` color (go-gitea#37417)
  [skip ci] Updated translations via Crowdin
  Stabilize e2e logout propagation test (go-gitea#37403)
  refactor: serve site manifest via `/assets/site-manifest.json` endpoint (go-gitea#37405)
  feat(security): set X-Content-Type-Options: nosniff by default (go-gitea#37354)
  Refactor pull request view (1) (go-gitea#37380)
  Improve AGENTS.md (go-gitea#37382)
  Remove dead CSS (go-gitea#37376)
  Add pr-review e2e test and speed up e2e tests (go-gitea#37345)
  Drop Fomantic tab, checkbox and form patches (go-gitea#37377)
  fix: dump with default zip type produces uncompressed zip (go-gitea#37401)
  Allow fast-forward-only merge when signed commits are required (go-gitea#37335)
  Introduce `ActionRunAttempt` to represent each execution of a run (go-gitea#37119)
  Move review request functions to a standalone file (go-gitea#37358)
  Fix repo init README EOL (go-gitea#37388)
  Fix org team assignee/reviewer lookups for team member permissions (go-gitea#37365)
  Remove external service dependencies in migration tests (go-gitea#36866)
  Extend issue context popup beyond markdown content (go-gitea#36908)
  fix: commit status reporting (go-gitea#37372)
  Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants