Extend issue context popup beyond markdown content#36908
Extend issue context popup beyond markdown content#36908silverwind merged 12 commits intogo-gitea:mainfrom
Conversation
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>
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>
bircni
left a comment
There was a problem hiding this comment.
Just an Idea but what about also showing the actions state? so X or whatever to see PRs state
|
Right, on issue list it probably make no sense, project is debatable. Will investigate how GitHub does this. |
|
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. |
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. |
* 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>
|
bc1cd33 adds the skip for all places where information is duplicate, consistent with GitHub. |
There was a problem hiding this comment.
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"
|
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. |
|
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>
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>
|
Did opt-in fb651ea, the number of locations that needed it was actually much smaller than expected. |
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>
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
* 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
* 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
* 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) ...



Extend the issue context popup beyond markdown. Any link rendered with the
ref-issueclass 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 addingdata-ref-issue-containeron a parent (orref-issueon the link).html_urlfrom the backend payload instead of synthesizing links client-side<a>width so the tooltip only shows on link hoverThis PR was written with the help of Claude Opus 4.7