-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make large code blocks and quotes scrollable #22260
Conversation
Imho this is very opinionated and personally I would not want that. That should be at least made as switchable option in top of markdown file (similarly how we have for diff, SVG files etc) |
I'm not opposed to that, however that would not help the issue of large code blocks in issue/PR comments breaking up the reading flow; there is no similar settings for how comments are displayed. I'd think this would be a good candidate for a user appearance setting, but there isn't currently any section which seems appropriate to put it under. (currently "Select default theme", "Language", and "Hidden comment types") |
I would probably be ok if that would be only in comments but this will affect also markdown files |
I like it in the editor preview but not in the real file. |
This commit introduces a max-height to both blockquote and preformatted elements along with automatic scroll behavior so that large blocks do not interrupt the visual flow of an issue thread. When nested within a details or another blockquote element, the max-height is unset as the parent element already has some control of the resulting height. (max-height applied by this commit for blockquotes, and collapsible contents for details)
I've pushed an update which should apply only to comments (ie. posts on issues and pull requests) and not to markdown files or to rendered READMEs |
Codecov Report
@@ Coverage Diff @@
## main #22260 +/- ##
=======================================
Coverage ? 47.83%
=======================================
Files ? 1043
Lines ? 142355
Branches ? 0
=======================================
Hits ? 68092
Misses ? 66103
Partials ? 8160 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I have a feeling this should either be made an option or be delegated completely to a user style. It should be trivial to have this added via Stylus for example. It works for Refined GitHub because users can toggle every feature, but we don't really have the infrastructure yet in the Gitea UI to easily add such toggleable features (the prefs need to be stored server-side per-user). |
Hey, I wanted to follow up on this. What direction would the team like to see this taken? I'm happy to make further changes if this feature is something that's wanted in some capacity (behind an option toggle, or just added as a |
Consensus seems to be that it's unwanted. Userstyle contrib isn't really something anyone would maintain, so the only way to get this is a default-off per-user option. Adding an option blocked by us not having a proper UI for users where settings such as this one could be introduced. So if you also want to work on such an option UI, I could see a chance for it. |
I appreciate the follow-up. I don't presently have a development environment ready to commit to that work (and am likely lacking the skills to achieve such a feature anyway) so I have to pass on that. I'll close this PR since it doesn't have a path forward. |
You could always add this as custom CSS to your instance, or use a user style. |
This commit introduces a max-height to both blockquote and preformatted elements along with automatic scroll behavior so that large blocks do not interrupt the visual flow of an issue thread. When nested within a details or another blockquote element, the max-height is unset as the parent element already has some control of the resulting height. (max-height applied by this commit for blockquotes, and collapsible contents for details)
This change is inspired by a similar change implemented in Refined Github years ago (the feature's current styles exist in a self-contained file today) which I've used and enjoyed for some time, and felt would be appreciated in Gitea as well. I chose
405px
as the max-height value as it appears to result in the last line of text being partially cut off by the bottom of the container, helping to make clear visually that there is more text to be read upon scrolling.<pre>
<blockquote>