Rework resizing of the problem editor.#2954
Conversation
781ede6 to
99c79ed
Compare
99c79ed to
413d809
Compare
somiaj
left a comment
There was a problem hiding this comment.
Works and looks good. Just some thoughts.
Should the double click and modifier information about adjusting resize behavior be added to the page help?
I felt the dark grey highlight when hovering over the resize bars a git strong, would a lighter grey highlight more in line with other greys on the page be reasonable here?
413d809 to
96e8adf
Compare
|
I made the hover color a little lighter, and added comments in the help about resizing. |
|
On a Mac, I need to use the Now that I look, I'm confused by the Mac alternative column in the help. There are mentions to |
96e8adf to
34fa5ff
Compare
|
The keymaps were taken from what was documented for Codemirror 6 at the time this was written. That may have changed or there was a mistake at that time. Currently they show: Ctrl-Shift-[ (Cmd-Alt-[ on macOS): foldCode I noticed our help shows |
|
It seems that |
The code and rendering panels are now not only vertically resizable, but are horizontally resizable when the window with is at or above the large breakpoint (992 pixels). Furthermore, resizing does not work with the native browser resize via the css `resize` property. Instead it is controlled with JavaScript. The resize grips (which are much more visible now) can be also be focused with the keyboard and when focused the arrow keys can be used to resize the code and render panels. Note that if `Ctrl` is pressed with an arrow key a 1 pixel resize occurs, and if `Alt` is pressed with an arrow key a 50 pixel resize occurs. Without a modifier key the arrow keys perform a 20 pixel resize. In addition, the dimensions are saved to local storage and persist when the page reloads. Unfortunately there will be some flickering of content as the resize occurs after the page loads. Note that the css `resize` property is actually not supported in all browsers, so this actually makes resizing work for those browsers as well. The browsers that do not support the css `resize` property include Firefox for Android, and Safari on IOS. Yeah, those are for mobile devices, and who edits problems on a mobile device? In any case, this makes the resize grips more evident. The native resize grip is rather small in the lower right corner of the CodeMirror editor panel, and many probably don't even know it is there. Note that the code panel has a minmimum width of 400 pixels, and the rendering panel a minimum width of 300 pixels. This works out so that when the window size is 992 pixels the two panels can't really be resized much or at all (when the site navigation menu width of 250 pixels is taken into account) depending on the browser. But at larger window widths resizing can be done. I thought about making it so that the resizing could go all the way to the right and the rendering panel be resized to a width of 0, but decided against it. If that were done, then the rendering would still be occuring even though you can't see it, and that doesn't seem good. I think that this should at least alleviate the request(s) to hide the rendering panel (which I don't think is really a good idea).
34fa5ff to
5fe7dc9
Compare
|
I suspect that the reason for the |
|
It is odd that you need to use |
|
I changed the keybindings in the help. Perhaps these are more accurate? |
The code and rendering panels are now not only vertically resizable, but are horizontally resizable when the window with is at or above the large breakpoint (992 pixels).
Furthermore, resizing does not work with the native browser resize via the css
resizeproperty. Instead it is controlled with JavaScript. The resize grips (which are much more visible now) can be also be focused with the keyboard and when focused the arrow keys can be used to resize the code and render panels. Note that ifCtrlis pressed with an arrow key a 1 pixel resize occurs, and ifAltis pressed with an arrow key a 50 pixel resize occurs. Without a modifier key the arrow keys perform a 20 pixel resize.In addition, the dimensions are saved to local storage and persist when the page reloads. Unfortunately there will be some flickering of content as the resize occurs after the page loads.
Note that the css
resizeproperty is actually not supported in all browsers, so this actually makes resizing work for those browsers as well. The browsers that do not support the cssresizeproperty include Firefox for Android, and Safari on IOS. Yeah, those are for mobile devices, and who edits problems on a mobile device? In any case, this makes the resize grips more evident. The native resize grip is rather small in the lower right corner of the CodeMirror editor panel, and many probably don't even know it is there.Note that the code panel has a minmimum width of 400 pixels, and the rendering panel a minimum width of 300 pixels. This works out so that when the window size is 992 pixels the two panels can't really be resized much or at all (when the site navigation menu width of 250 pixels is taken into account) depending on the browser. But at larger window widths resizing can be done.
I thought about making it so that the resizing could go all the way to the right and the rendering panel be resized to a width of 0, but decided against it. If that were done, then the rendering would still be occuring even though you can't see it, and that doesn't seem good. I think that this should at least alleviate the request(s) to hide the rendering panel (which I don't think is really a good idea).