8000 Clickable links in pull request (and issue) titles by jpraet · Pull Request #13695 · go-gitea/gitea · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Clickable links in pull request (and issue) titles #13695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to o 8000 ur terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 3, 2020

Conversation

jpraet
Copy link
Member
@jpraet jpraet commented Nov 24, 2020

Fixes #13658

  • Whereas the ticket only mentioned pull requests, in gitea pull requests share the same templates with issues.
    So this change change applies to both pull request and issue titles.
  • I reused the existing RenderCommitMessage(Link) logic. Ofcourse this means it is not clear from the method name now that those methods are also used for rendering Issue titles. Is that a problem? I could rename those methods to a more generic RenderTitle(Link) if that's preferred?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 24, 2020
@mrsdizzie
Copy link
Member

I don't really like this change for the issues/pulls list page because we currently use the title as the only link to the issue itself and having that end up being any number of links depending on the title seems annoying (I do dislike that this happens at certain spots for commits too, but in lots of cases anybody can create an issue title where as commits are at least restricted to code owners).

It also opens up some minor abuse/ui issues as you can just make the title of issues something like "https://spam.com" and then the only place you can go from the list is to that outside site when clicking on the title (though I'm not sure titles really should/need to render Web links here).

Similar if people happen to use really basic titles like "#100" etc... it could break the existing issues list. Since its not something you can turn off at all I'd rather it not mess with the current links on the issues list and avoid all issues above (as on Github).

Changing it on the issue/pull page itself seems more OK as it doesn't have those same problems.

@jpraet
Copy link
Member Author
jpraet commented Nov 24, 2020

You make some good points. What about only generating clickable links for issue references then, instead of also including all other different link types currently supported in the commit message rendering?

The "really basic title" problem you highlighted is currently also problematic for commit messages. If you use "#100" as commit message, then on the commit page the link points to the issue instead of to the commit.

@silverwind
Copy link
Member

If GitHub is any model, the only place where they do this link-in-link stuff is in commit titles (which we possibly already do?).

@mrsdizzie
Copy link
Member

I still think it is bad UI here to have the only way to get to specific issues/pulls be through clicking on the title in the list and then to let other links be in that same title (or even to be able to replace the link all together) depending on where you click. Commits at least have separate unmodified sha links and different interface/views.

Github doesn't do this because they don't modify the title in any way (which is my personal preferences for titles, they are special and should not be altered ever).

GItlab will render links and references in a issue title, but won't render those on the issue list page, just on the individual issue page (https://gitlab.com/mrsdizzie/wikitest/-/issues) for the same reasons listed here. The list page still only links to the specific issue regardless of what the title is, which is what I think would be best here as well if we're going to modify issue titles in any way.

In general I see these postProcessors as a convenience -- they turn plain text that wasn't doing anything into something more helpful. In the case of the issues/pulls list its taking an existing link that is doing something and messing with it in a pretty opinionated way that isn't optional. I'd rather eliminate all of the issues mentioned then be able to use a section of the title for one issue in a list to get to a 2nd issue while breaking the model of "title = link to issue".

It should be enough of a shortcut to have it in the title on the issue view for the case where it also isn't referenced in the content of the issue/pr.

reuses the existing logic to render clickable links in commit messages
@jpraet jpraet force-pushed the 13658-clickable-links-in-pr-titles branch from ee32f54 to 2550784 Compare November 25, 2020 19:42
@jpraet
Copy link
Member Author
jpraet commented Nov 25, 2020

Ok, I have removed the link and reference rendering again for the issue / pull list views.

@mrsdizzie

This comment has been minimized.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 27, 2020
@zeripath zeripath added the topic/ui Change the appearance of the Gitea UI label Nov 27, 2020
@zeripath zeripath added this to the 1.14.0 milestone Nov 27, 2020
@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 Nov 27, 2020
@6543
Copy link
Member
6543 commented Nov 29, 2020

pleace resolve conflict :)

@codecov-io
Copy link

Codecov Report

Merging #13695 (2cf8c45) into master (e00a355) will increase coverage by 0.03%.
The diff coverage is 82.35%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13695      +/-   ##
==========================================
+ Coverage   42.22%   42.26%   +0.03%     
==========================================
  Files         699      699              
  Lines       76957    76974      +17     
==========================================
+ Hits        32498    32530      +32     
+ Misses      39098    39083      -15     
  Partials     5361     5361              
Impacted Files Coverage Δ
modules/templates/helper.go 47.76% <50.00%> (+0.02%) ⬆️
modules/markup/html.go 78.79% <100.00%> (+0.44%) ⬆️
modules/process/manager.go 72.50% <0.00%> (-2.50%) ⬇️
modules/log/file.go 73.60% <0.00%> (-1.61%) ⬇️
routers/api/v1/repo/pull.go 25.45% <0.00%> (+0.60%) ⬆️
routers/repo/view.go 38.11% <0.00%> (+0.64%) ⬆️
modules/log/event.go 59.90% <0.00%> (+0.94%) ⬆️
modules/queue/workerpool.go 60.00% <0.00%> (+1.22%) ⬆️
models/unit.go 49.31% <0.00%> (+2.73%) ⬆️
modules/queue/manager.go 65.08% <0.00%> (+2.95%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e00a355...2cf8c45. Read the comment docs.

@6543
Copy link
Member
6543 commented Dec 3, 2020

@jpraet pleace "Update Branch"

Sorry, something went wrong.

@6543
Copy link
Member
6543 commented Dec 3, 2020

🚀

@6543 6543 merged commit 056b8f5 into go-gitea:master Dec 3, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render issue references in pull request titles as clickable links
7 participants
0