From 793dc2072210b155bc4df5ea9f1d106caf5efe8d Mon Sep 17 00:00:00 2001 From: narcolepticinsomniac Date: Sun, 4 Aug 2019 13:09:50 -0400 Subject: [PATCH] linter and compact layout improvements (#749) * linter and compact layout improvements Closes #748 While investigating the best way to fix linter scrolling, when I double-checked the compact layout, an old bug I meant to fix a long time ago was immediately apparent. Basically, the linter adds/removes errors as you type, causing the editor to bounce up and down, making it practically unusable. This PR fixes scrolling, and also collapses options and the linter in the compact layout, but always shows the collapsed linter so you're aware of the error count without the content jumping. It also collapses options in the non-compact layout if the viewport is too short to accommodate them, factoring in the min-height of the linter. All automatic collapsing factors in whether a linter is active so they can adjust accordingly, and disables the setting of collapsed state prefs, since we're deciding the pref anyway, and this allows for re-expanding on resize based on the previous pref. It's quite possible I failed to account for certain scenarios, so try to break it. Also think it's problematic for the linter to not always be visible if enabled, so I hooked up a 40px fixed header on scroll with just the linter in it for the compact layout. A few other little details are included. I removed redundant line and column numbers spelled out at the end of lint messages to prevent horizontal overflow. I noticed that the expand/collapse prefs do not toggle correctly when clicking directly on the details-marker arrow. Simplest solution was covering them with the `h2` (we may wanna hook up the manager as well). Also, unrelated, but I switched to opacity to hide resizing sectioned editors, because `visibility: hidden;` breaks editor auto-focus. If either of you guys wanna fix any bugs, or improve any code, feel free to just commit to this PR directly. * linter and compact layout improvements * linter and compact layout improvements * No usercss scroll listener and delay header check * Some code tweaks --- edit.html | 6 ++- edit/edit.css | 94 ++++++++++++++++++++++++++++--------------- edit/edit.js | 79 +++++++++++++++++++++++++++++++----- edit/linter-report.js | 4 +- js/dom.js | 4 +- 5 files changed, 139 insertions(+), 48 deletions(-) diff --git a/edit.html b/edit.html index ffa7be9a..72a2c45c 100644 --- a/edit.html +++ b/edit.html @@ -429,7 +429,7 @@ -