Skip to content

Allow larger code blocks #777

@cellio

Description

@cellio

https://software.codidact.com/posts/278868 was asked a year ago and it looks like we missed it then (I couldn't find an issue for it).

The code block is sized to show about 13 lines of code before vertical scrolling is needed. This impedes reading, particularly on the "code reviews" category on Software Dev where longer code blocks are pretty normal. The community has requested showing a larger number of lines at once (suggestions in the range of 30-50 are made there).

~40 lines of code seems reasonable to people using desktop machines with large displays, but could be painful on a phone or tablet. One approach would be to show the larger block size (say, 40 lines) and add a control of some sort that collapses it down to (say) 10 lines (with an "expand" control to put it back). Another approach would be to add a resize control (the usual "drag" control in the lower right) and remember the resulting size for that user in that browser -- i.e. use that size for all future code blocks until the user flushes the cookie. (I assume that would be a cookie.)

I don't think the drag-resize without remembering the preference would be satisfying; the user would have to keep adjusting code blocks, and that seems like it would be annoying. If resize + remember is undesirable, maybe a user preference?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions