Improve handling of issue/MR links in lists
Resources
PM @victorwu
Final design
https://gitlab.com/gitlab-org/gitlab-ce/issues/17942#note_16569045
Description including problem, use cases, benefits, and/or goals
We often use lists in one issue to refer to several issues/MRs elsewhere. A good example is https://gitlab.com/gitlab-org/gitlab-ce/issues/17686. It's great to be able to include full links and shortcuts and have them automatically turned into nice output like "#12839 (closed)". However, I find myself then copying the title of the issue back into the list manually, which seems like a waste, and sometimes results in confusion when issues get renamed.
I'd like to see the full title of the issue/MR automatically included in the list, rather than just the issue/MR number. I know we can't do this universally since people refer to issues inside of other prose and substituting the title would be jarring. But there are some circumstances, which we can easily detect, where the full title would be appropriate.
Proposal
When someone puts in a full link or shortcut (#
or !
followed by a number) in a list without any surrounding text, use the full issue/MR title. When issues are closed, the item should be automatically marked as checked, if used in a checklist.
* #12839
* #17638
* https://gitlab.com/gitlab-org/gitlab-ce/issues/17649
Should be rendered as:
- Sometimes the builds for next stages are not created properly
- visiting CI Graphs on a repo without CI throws 500 error
- Merge not happening despite successful build
* [ ] #12839
* [ ] #17638
* [ ] https://gitlab.com/gitlab-org/gitlab-ce/issues/17649
Should be rendered as:
-
Sometimes the builds for next stages are not created properly -
visiting CI Graphs on a repo without CI throws 500 error -
Merge not happening despite successful build
Links / references
Trello does this very well. It renders the full title of linked cards after page load so it doesn't slow down rendering (too much). But Trello also replaces the link everywhere, regardless of placement in surrounding text.
If we support #17774 (moved), we should recognize @ mentions and not count it as "surrounding text".
This works well with #17907 (closed) since a common pattern with Trello boards is to have an "epic" or project overview issue that links to several other task-level issues.
Notes
I originally thought it would be good to show the text with strikethrough when an issue is closed, but it doesn't actually look good, and we already have the checklist mechanism to indicate completion or not, so why not leave it up to the author to choose to indicate closed-ness. Note this contradicts a discussion elsewhere about striking through issue numbers when they are closed. I think that's OK because striking through just the issue numbers (rather than the text) feels appropriate.
Also note that I am not including the issue number in the rendering at all. I'm following Trello's lead