qpixel icon indicating copy to clipboard operation
qpixel copied to clipboard

Allow larger code blocks

Open cellio opened this issue 3 years ago • 3 comments

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?

cellio avatar Mar 01 '22 03:03 cellio

Oh, I did create an issue for it at the time -- and it got migrated to the co-design repo: https://github.com/codidact/co-design/issues/43 . I thought I remembered writing that up, but I didn't think to look there.

It sounds like a quick fix would be to change the hard-coded number in co-design (and then qpixel needs to pick up the change). Let's at least do that, and then we can decide if we want to do anything more complex.

cellio avatar Mar 23 '22 02:03 cellio

We've got a fix in codidact/co-design#66 ready to go.

After co-design is shipped with the new value (i.e. PR above is merged and new NPM release made), we just have to bump version in stylesheet lines: app/views/layouts/_head.html.erb and also, for version consistency reasons, app/views/layouts/mailer.html.erb and app/views/layouts/devise_mailer.html.erb).

With the version bump in QPixel being made, the next deploy will close out this issue.

sau226 avatar Apr 13 '22 05:04 sau226

The fix has been merged on the co-design side. We need to finish getting it over to qpixel.

cellio avatar Apr 17 '22 02:04 cellio

What's the status of this? What needs to happen to get the change over to qpixel?

MoshiKoi avatar Aug 30 '22 00:08 MoshiKoi

We've got a fix in codidact/co-design#66 ready to go.

After co-design is shipped with the new value (i.e. PR above is merged and new NPM release made), we just have to bump version in stylesheet lines: app/views/layouts/_head.html.erb and also, for version consistency reasons, app/views/layouts/mailer.html.erb and app/views/layouts/devise_mailer.html.erb).

With the version bump in QPixel being made, the next deploy will close out this issue.

Somewhere along the way between this comment and now, someone's bumped the version numbers in those files to 0.12.5. I've just fixed the previous bugs, published and released 0.12.5, so this is now closed with the next deploy.

ArtOfCode- avatar Sep 12 '22 18:09 ArtOfCode-

I just pulled develop and tested this locally and I'm seeing the larger code blocks, yay!

cellio avatar Sep 13 '22 23:09 cellio