go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.45k stars 5.52k forks source link

WISH: Sticky issue titles #10675

Open HenrikBengtsson opened 4 years ago

HenrikBengtsson commented 4 years ago

Description

I'd like to propose an option for having issue titles be sticky when scrolling in the browser so that it is possible to always see what the title of the issue is regardless how far down you the comments you scroll. See below screenshots for behavior. This idea probably apply to other areas too, e.g. 'Pull requests'.

Screenshots

gitea_sticky_1 gitea_sticky_2

Proof-of-Concept Patch

I've implemented an ad-hoc patch myself that be in use for 3-4 months now. It is particularly useful in screen-share meetings where the moderator goes through issues and audience have no control of the interface. Using sticky issue titles avoid the question "What issue is this again?". The patch I apply for each Gitea update is:

--- view_title.tmpl 2020-03-08 14:07:39.647415337 -0700
+++ new_view_title.tmpl     2020-03-08 13:38:17.576454430 -0700
@@ -1,4 +1,4 @@
-<div class="sixteen wide column title">
+<div class="sixteen wide column title" style="position: -webkit-sticky; position: sticky; top: -10px; z-index: 10; background-color: white;">
        <div class="ui grid">
                <h1 class="twelve wide column">
                        <span class="index">#{{.Issue.Index}}</span> <span id="issue-title" class="has-emoji">{{.Issue.Title}}</span>
@@ -16,6 +16,8 @@
                        </div>
                {{end}}
        </div>
+</div>
+<div class="sixteen wide column title">
        {{if .HasMerged}}
                <div class="ui purple large label"><i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls.merged"}}</div>
        {{else if .Issue.IsClosed}}
HenrikBengtsson commented 4 years ago

Fixed: I posted a patch/diff toward the wrong code base so it looked much bigger - tI've updated the patch/diff - it's really a small update

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

HenrikBengtsson commented 4 years ago

unstale[human]

lunny commented 4 years ago

@HenrikBengtsson Could you send a PR to gitea?

HenrikBengtsson commented 4 years ago

@lunny, would the diff in my top post suffice? I'm not familiar with the Gitea template framework, so it's a bit of a good-enough hack.

jolheiser commented 4 years ago

@HenrikBengtsson I think we would run into issues with the dark theme (e.g. white background style), as well we would want it to be optional and probably controlled by a class rather than inline styling if possible.

silverwind commented 4 years ago

I'd oppose this. It is one of the annoyances of GH that I don't like and which I disable with userstyles.

Issue title is not important enought not warrant taking away screen estate. It's duplicating with the browser tab title and easily visible when opening the issue, which ought to be enough.

HenrikBengtsson commented 4 years ago

I'd oppose this. ... Issue title is not important enought not warrant taking away screen estate.

Maybe it could be an optional feature?

So, the background for this feature request is to improve the Gitea experience during group meetings (in person or online) going through issues in the issue tracker. You have one person controlling the Gitea interface who share/project their screen. Since that person is in control, they also know exactly which issue they are currently on. In contrast, everyone else tends to get lost in which issue is currently discussed. This happens because the transition to the next issue is often too quick, or people tend to keep chatting with attention elsewhere when moving to the next issue. The issue title provides everyone with minimal, necessary info to catch up without having to ask the host to scroll back up to show the title and so on. We have used "stick issue titles" for 6+ months now and it helped us a lot.

silverwind commented 4 years ago

Yeah sticky headers are certainly something to consider having a option for. Some people like them, some don't and they can be very distracting, especially on small screens.

I guess we need to introduce a "UI Options" section, can probably be localStorage-backed only.

HenrikBengtsson commented 4 years ago

Your and my "use case" made me realize that this type of feature then might belong to whoever is currently browsing Gitea, rather than the repos owner or Gitea admin. (I deploy my hack throughout Gitea at each update)

silverwind commented 4 years ago

I'd make it a browser-specific option (e.g. localStorage does that). I guess you could sticky that header with a simple Userstyle too, so no need to touch server code.

HenrikBengtsson commented 4 years ago

Not really an option for us - too many people, computes, and browsers hosting - it's hard enough to get people to use issue trackers in the first place :p