feat(editor): add Open file button to canvas tab bar#1710
Open
alogotron wants to merge 1 commit into
Open
Conversation
In canvas panel mode the '+' tab button was hardcoded to create a new
Markdown file. The 'Open' option only appeared in the empty-state
screen and in the modal-mode header dropdown (via installHeaderNewMenu)
which is not mounted when the editor runs as a canvas surface.
Adds a folder_open icon button immediately before the '+' button in
the tab bar. It calls the existing runNewMenuAction('open') ->
openFileBrowser() pipeline so no logic changes are needed. Users can
now open an existing file at any time without first closing all tabs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When the Editor runs as a canvas surface (panel mode), the
+button in the tab bar is hardcoded to create a new Markdown file only:@click="$store.editor.runNewMenuAction('markdown')"The "Open" option (file browser) is only available:
installHeaderNewMenu), which requires.modal-inner/.modal-headerelements that are not present in canvas panel modeThis means once any file is open, there is no accessible UI to open a second existing file without first closing all tabs.
Fix
Adds a
folder_openicon button immediately before the+(New Markdown) button in the tab bar.It calls the existing
runNewMenuAction('open')→openFileBrowser()pipeline — no logic changes required.Result
Users can now open an existing file at any time directly from the tab bar, without closing the current file(s).
Change scope
plugins/_editor/webui/editor-panel.html