This repository has been archived by the owner on Apr 1, 2020. It is now read-only.
[WIP] Fix #484 - Update to use asynchronous strategy for menu window #769
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: Many of the menu options rely on there being an Oni window active - which isn't always the case in OS X.
Fix: Extract out an asynchronous strategy for fetching the current window. This is basically a
getOrCreate
- if there is an existing window, we use that, otherwise we create a new one.There is an open issue though - there are some menu options that make sense to have when there is no window open (like new file, or open file), but there are also some that only make sense in the context of a window or active editor context - like saving a file. As part of this, I'm investigating having aspects of the menu be controlled by the active editor - so in the case where a window is not active, we'd show a limited set of hardcoded options. However, I'd like to integrate this with the set of commands, and have the active editor "push up" available commands (so that even plugins could register their own commands). I think it makes sense to have the browser window be able to augment this set of commands, by exposing an
ApplicationMenu
concept on the renderer side, and hooking in the command manager to it (so as part of the metadata of a command, the menu path could also be specified..)