Skip to content

fix(desktop): add a context menu to the sidebar root folder - #4754

Merged
Jocs merged 1 commit into
developfrom
fix/1239-root-folder-context-menu
Jun 26, 2026
Merged

Jocs merged 1 commit into
developfrom
fix/1239-root-folder-context-menu

Conversation

@Jocs

@Jocs Jocs commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Right-clicking the root project folder title in the sidebar did nothing, so there was no way to create a file or directory at the project root. The only workaround was right-clicking a file that already lived directly at the root (which set the active item so New File/New Directory resolved to the root dir).

Sub-folders already wire contextmenu → set active item → open the sidebar context menu (treeFolder.vue). This applies the same pattern to the root folder title: on right-click it sets the active item to the project tree and opens the context menu.

Verification

  • lint + typecheck + build:unpack clean (the change is a 1:1 mirror of the proven per-subfolder handler).
  • Behavioral check is manual in the running app (the menu is a native Electron context menu; there is no e2e harness to open a project folder and the popup can't be asserted in Playwright): right-click the root folder → context menu appears → New File / New Directory create at the project root.

Fixes #1239

The root project folder title had no contextmenu handler, so right-
clicking it did nothing — there was no way to create a file or directory
at the project root (the only workaround was right-clicking a file that
already lived at the root). Wire the root title to set the active item to
the project tree and open the sidebar context menu, mirroring the
existing per-subfolder handler in treeFolder.vue.

Fixes #1239

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Build artifacts for PR #4754:

Run: https://github.com/marktext/marktext/actions/runs/28259849205

Artifact Size Link
marktext-windows-arm64 275.6 MB Download
marktext-linux 627.4 MB Download
marktext-windows-x64 283.8 MB Download
marktext-macos-x64 293.0 MB Download
marktext-macos-arm64 282.7 MB Download

@Jocs
Jocs merged commit d782b1a into develop Jun 26, 2026
10 checks passed
@Jocs
Jocs deleted the fix/1239-root-folder-context-menu branch June 26, 2026 19:28
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.

New subfolder at root folder

1 participant