Skip to content

feat(editor): add Open file button to canvas tab bar#1710

Open
alogotron wants to merge 1 commit into
agent0ai:mainfrom
alogotron:feat/editor-open-button-in-tab-bar
Open

feat(editor): add Open file button to canvas tab bar#1710
alogotron wants to merge 1 commit into
agent0ai:mainfrom
alogotron:feat/editor-open-button-in-tab-bar

Conversation

@alogotron

Copy link
Copy Markdown

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:

  • In the empty state screen (no files open)
  • In the modal-mode header dropdown (installHeaderNewMenu), which requires .modal-inner / .modal-header elements that are not present in canvas panel mode

This 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_open icon button immediately before the + (New Markdown) button in the tab bar.

It calls the existing runNewMenuAction('open')openFileBrowser() pipeline — no logic changes required.

<button type="button" class="editor-new-tab"
  title="Open file" aria-label="Open file"
  @click="$store.editor.runNewMenuAction('open')">
  <span class="material-symbols-outlined">folder_open</span>
</button>

Result

Users can now open an existing file at any time directly from the tab bar, without closing the current file(s).

Change scope

  • 1 file changed: plugins/_editor/webui/editor-panel.html
  • +10 lines — one new button element
  • No logic, store, API, or style changes

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant