Skip to content
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

Polish code editor and fix iPhone issue #22021

Merged
merged 5 commits into from
May 21, 2020

Conversation

jasmussen
Copy link
Contributor

@jasmussen jasmussen commented May 1, 2020

This is an alternative to #21950. But it takes a different approach. The other PR was intended to fix an observed performance issue in Safari, but I haven't been able to fully reproduce it. Originally it felt like the auto-sizing textarea was the cause of the issue, but I'm not sure that's actually the case.

Additionally, removing the auto-sizing textarea has some compounding effects on the structure and layout. Immediately, it means the textarea has to be full-height, and scroll itself. That means the layout of the page should be flexed instead. It also means the still-autosizing title block needs a max-height. And then I discovered there were some issues with Mobile Safari and some of the JS we wrote to improve the visual aspects.

All of the issues above are fixed and addressed in #21950. However I still think this branch is the better one.

  • It keeps the autosizing textarea, which means the same container as before scrolls.
  • It fixes the iPhone jittering issue with the same fix as before.
  • It contains the same (and a few more) visual and code quality fixes to the general files.

It seems worth comparing the two branches side by side, not only to get a feel for the changes, but to note any perceived Safari performance issues in either.

This branch goes a little further in that it also polishes the visuals a bit more:

  • Non bold title font
  • Not quite as wide max-width
  • Fixed position top toolbar that scrolls with you down the page
  • Relaxed line height and input field paddings

Screens:

Screenshot 2020-05-01 at 11 51 39

Screenshot 2020-05-01 at 11 53 07

@jasmussen jasmussen self-assigned this May 1, 2020
@jasmussen jasmussen added [Feature] Code Editor Handling the code view of the editing experience [Type] Code Quality Issues or PRs that relate to code quality labels May 1, 2020
@github-actions
Copy link

github-actions bot commented May 1, 2020

Size Change: +69 B (0%)

Total Size: 1.11 MB

Filename Size Change
build/block-editor/style-rtl.css 10.8 kB -1 B
build/block-library/editor-rtl.css 7.22 kB +1 B
build/block-library/editor.css 7.22 kB +1 B
build/block-library/theme-rtl.css 684 B +1 B
build/block-library/theme.css 686 B +1 B
build/edit-post/index.js 302 kB +9 B (0%)
build/edit-post/style-rtl.css 12.2 kB +27 B (0%)
build/edit-post/style.css 12.2 kB +28 B (0%)
build/editor/style-rtl.css 5.07 kB +1 B
build/editor/style.css 5.08 kB +1 B
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.02 kB 0 B
build/annotations/index.js 3.62 kB 0 B
build/api-fetch/index.js 3.39 kB 0 B
build/autop/index.js 2.83 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/index.js 6.93 kB 0 B
build/block-directory/style-rtl.css 790 B 0 B
build/block-directory/style.css 791 B 0 B
build/block-editor/index.js 105 kB 0 B
build/block-editor/style.css 10.8 kB 0 B
build/block-library/index.js 119 kB 0 B
build/block-library/style-rtl.css 7.48 kB 0 B
build/block-library/style.css 7.48 kB 0 B
build/block-serialization-default-parser/index.js 1.88 kB 0 B
build/block-serialization-spec-parser/index.js 3.1 kB 0 B
build/blocks/index.js 48.1 kB 0 B
build/components/index.js 182 kB 0 B
build/components/style-rtl.css 17.1 kB 0 B
build/components/style.css 17.1 kB 0 B
build/compose/index.js 6.68 kB 0 B
build/core-data/index.js 11.4 kB 0 B
build/data-controls/index.js 1.29 kB 0 B
build/data/index.js 8.42 kB 0 B
build/date/index.js 5.47 kB 0 B
build/deprecated/index.js 772 B 0 B
build/dom-ready/index.js 568 B 0 B
build/dom/index.js 3.11 kB 0 B
build/edit-navigation/index.js 6.6 kB 0 B
build/edit-navigation/style-rtl.css 857 B 0 B
build/edit-navigation/style.css 856 B 0 B
build/edit-site/index.js 12.8 kB 0 B
build/edit-site/style-rtl.css 5.22 kB 0 B
build/edit-site/style.css 5.22 kB 0 B
build/edit-widgets/index.js 7.73 kB 0 B
build/edit-widgets/style-rtl.css 4.59 kB 0 B
build/edit-widgets/style.css 4.59 kB 0 B
build/editor/editor-styles-rtl.css 425 B 0 B
build/editor/editor-styles.css 428 B 0 B
build/editor/index.js 44.3 kB 0 B
build/element/index.js 4.65 kB 0 B
build/escape-html/index.js 733 B 0 B
build/format-library/index.js 7.64 kB 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/hooks/index.js 2.13 kB 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.56 kB 0 B
build/is-shallow-equal/index.js 711 B 0 B
build/keyboard-shortcuts/index.js 2.51 kB 0 B
build/keycodes/index.js 1.94 kB 0 B
build/list-reusable-blocks/index.js 3.13 kB 0 B
build/list-reusable-blocks/style-rtl.css 226 B 0 B
build/list-reusable-blocks/style.css 226 B 0 B
build/media-utils/index.js 5.29 kB 0 B
build/notices/index.js 1.79 kB 0 B
build/nux/index.js 3.4 kB 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 0 B
build/plugins/index.js 2.56 kB 0 B
build/primitives/index.js 1.5 kB 0 B
build/priority-queue/index.js 789 B 0 B
build/redux-routine/index.js 2.85 kB 0 B
build/rich-text/index.js 14.8 kB 0 B
build/server-side-render/index.js 2.68 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.28 kB 0 B
build/url/index.js 4.02 kB 0 B
build/viewport/index.js 1.84 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.17 kB 0 B

compressed-size-action

@draganescu
Copy link
Contributor

This branch when switched to, for me at least, has very subtle differences from master. In the simulator and on the iPhone they're about the same. How can I encounter the poor perf situation on master?

@jasmussen
Copy link
Contributor Author

THANK YOU for testing and reviewing!

for me at least, has very subtle differences from master.

There are some visual changes to polish the code editor, and there's some JS that was written for the visual editor that breaks the code editor, that I've conditioned out. Both of these benefit the experience overall, and deserve their own thoughts if you have any. On "breaking the code editor", quite simply you shoudl be able to type a bunch of text in the simulator, this doesn't work on master virtually at all.

How can I encounter the poor perf situation on master?

The truth is, I never encountered this myself. When I worked on the previous version of this branch, I thought that things were faster when the textfield was not "autosized" — but upon further examination this doesn't seem to be the case. So performance wise, and since I can't really reproduce, that aspect of this branch should technically be unchanged from master.

@mapk
Copy link
Contributor

mapk commented May 13, 2020

Thanks for working on these changes, @jasmussen! I don't have any feedback on the iPhone issue, but I did catch this:

Screen Shot 2020-05-13 at 4 46 29 PM

The way the editor content drops behind the white bar can use some more work. I see why it does this when I made the screen size smaller. Those two text elements end up overlapping the editor. All the more reason I'd like to see those move somewhere else.

But I like the approach of incremental changes and I'd love to see these PRs continue. So maybe we can try adjusting the opacity of that white just a bit (ie. rgba(255, 255, 255, 0.9))? It allows a visual indicator of what's happening and still provides enough background for those two text elements.

opacity

@jasmussen
Copy link
Contributor Author

Good call, Mark, and thank you for reviewing!

The reason for the white is to work when you scroll, of course, and the reason for not having a bottom border is to try and reduce those overall — it feels like for every border we remove, we ligthen the weight a little bit.

So your suggestion feels like a good path forward:

Screenshot 2020-05-14 at 10 50 36

@jasmussen
Copy link
Contributor Author

If thinks look good, @mapk, I would appreciate a thumbs up!

@youknowriad
Copy link
Contributor

Capture d’écran 2020-05-19 à 11 52 35 AM

I think I'm having the double scrollbar issue in both visual and code editor modes in this PR.

@jasmussen
Copy link
Contributor Author

Golly, I specifically created this one to avoid that. Let me take another look.

@jasmussen jasmussen force-pushed the try/full-height-code-editor-v2 branch from 240d879 to ace94b9 Compare May 19, 2020 13:08
@jasmussen
Copy link
Contributor Author

Do you have steps to reproduce? I can't get the same state when I test. Safari?

@youknowriad
Copy link
Contributor

Yes, safari :) and it doesn't happen until I focus the textarea (or classic editor)

@jasmussen
Copy link
Contributor Author

jasmussen commented May 20, 2020

I still can't reproduce:

safari

Note that if you normally browse with auto-hiding scrollbars, and then turned them on to test, you need to restart the browser for their behavior to be accurate.

Edit: just to be clear, the double scrollbar is supposed to be there in non-fullscreen mode when the left sidebar navigation has to scroll.

@youknowriad
Copy link
Contributor

Actually, I see now that I reproduce on master too, so it seems unrelated with this PR.

@jasmussen
Copy link
Contributor Author

If it's good to go, I could use a 👍 👍 :)

@jasmussen jasmussen merged commit 08f2f65 into master May 21, 2020
@jasmussen jasmussen deleted the try/full-height-code-editor-v2 branch May 21, 2020 09:51
@github-actions github-actions bot added this to the Gutenberg 8.2 milestone May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Code Editor Handling the code view of the editing experience [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants