-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Improved panel management - prevent resizing panels larger than available space #3943
Conversation
- PanelManager provides APIs to create panels below the editor area. JSLint and Find in Files now use these APIs. - Move editor-holder ht calculations from EditorManager to PanelManager - EditorManager listens to PanelManager for resize notifications. PanelManager listens for window resize (moved from EditorManager) and for Resizer events on all bottom panels. The old EditorManager.resizeEditor() API is still used for edge cases such as status & search bar show/hide, extensions that add fixed top panels, and extensions that don't use Resizer APIs to hide/show panels. - Since PanelManager is listening, Resizer no longer pings EditorManager directly about show/hide/resize. Resizer emits events to notify PanelManager about any panels it may have missed (legacy extensions that add panels via Resizer instead of PanelManager). - Add max-size support to Resizer in anticipation of PanelManager helping to fix bug #2015.
…ment * origin/master: Safe file delete. Style textarea like input. Install jasmine-node as needed by the jasmine-node task. Add check for no "functions" returned (as requested by code review). bumped pathmatch color down a notch based on peterflynn's feedback Change how QuickEdit helper function is passed from CodeHints to QuickEdit: Made .quicksearch-pathmatch darker so that it's visible Remove fallback for missing helper function (just fail if it's missing). It should never be missing. Fixes for comments on push'ed code: Tweaks to make some test cases pass. Use tern jump-to-definition search for QuickEdit.
…panels resize or overall available `.content` height changes (window resize). Change resizer min/max limits to operate in terms of panel outer height.
src/editor/EditorManager.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I was on the fence about: it might be cleaner to move this line into PanelManager.triggerEditorResize(). That way PanelManager owns the editor-holder height entirely, so that when "editorAreaResize" is fired the editor area has indeed already been resized. And then EditorManager is just listening for that to refresh editors, nothing more...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this into PanelManager.triggerEditorResize() sounds like a good idea. Did you try it? If everything seems to work, I'm inclined to take that change. If things don't work, there should be a FUTURE comment added to move it (and make it work :-) )
|
Reviewing |
|
Notes on backwards compatibility:
I tested a number of extensions to verify this:
|
src/search/FindInFiles.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSDoc for createBottomPanel() says the id param should be in package format. Should this be "search.results"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix. I'll add a brackets. prefix too, to avoid collisions in case extension authors ignore the advice and use generic, short names.
|
Initial review complete. |
createMockEditor() calls EditorManager.setEditorHolder() to inject mock DOM. * Cleanup: move responsibility for setting editor-holder height from EditorManager into PanelManager (cleaner division of labor).
document, so JS code hints unit tests can share SpecRunnerUtils' mock-Editor creation code instead of duplicating it.
|
Looks good! Merging. |
Improved panel management - prevent resizing panels larger than available space
Fixes another part #2015 by maintaining panel max resize limits based on currently available slack space (i.e. space used by the editor area). This fixes part 1 of the 4-part list of issues there -- when dragging a panel to fill the whole UI, you can't overshoot and send the status bar (or other panels) sliding off the bottom of the window. And it gives us a clean foundation to build the remaining fixes on.
This also enables a cleaner fix to #3371 -- see pull #3931 which is based on this branch.
Here's what's changed:
and Find in Files now use these APIs. (Find in Files panel UI is now moved out of main-view.html into a template).
listens for window resize (moved from EditorManager) and for Resizer events
on all bottom panels. The old EditorManager.resizeEditor() API is still used
for edge cases such as status & search bar show/hide, extensions that add
fixed top panels, and extensions that don't use Resizer APIs to hide/show
panels.
directly about show/hide/resize. (This would let us use Resizer as a generic splitter widget in other parts of the UI if needed).
Resizer instead of PanelManager).