The options of the right-click pop-up window
Describe the bug In the Split View mode, when right-clicking in the editor area and the view area respectively, the options of the context menu that pops up are inconsistent.
To Reproduce Steps to reproduce the behavior:
- Switch to Split View mode
- Right-click in the editor area
- Observe the right-click menu options
- Right-click in the view area
- Compare the options of the two popped-up menus
Expected behavior In the Split View mode, the right-click menus of the editor area and the view area should remain consistent.
Screenshots
Device
- OS: win 10 pro
- Version: 22h2
- App Version : 2.6.4
Additional context This situation may occur in a Chinese environment. Other languages may also appear, such as English.
the context menu in the editor is built into Monaco and thus different than whats implemented in the viewer. ill look into synchronizing the Monaco editor language with the app itself for i18n and adding relevant options for consistency
Given Alec's note that the editor menu is Monaco's built-in context menu while the viewer menu is implemented by Markpad, this may be better tracked as an enhancement rather than a functional bug.
A practical scope could be: synchronize Monaco's UI language with the app language, and add the most relevant viewer-side actions for consistency. Full one-to-one parity may not be possible or desirable because Monaco exposes editor-specific commands that do not apply to the rendered preview.
Had a look at this against current master and I don't think it's worth doing any more — closing, with the reasoning in case anyone disagrees.
What has changed since this was filed. The note above is right that the editor's menu was Monaco's built-in one, and that was the whole reason the two lists could not be reconciled. That is no longer true: #207 replaced it with a menu Markpad draws itself, because Monaco's Paste reads the clipboard through the webview and cannot work here. So the i18n half of the scope proposed above is already done — the editor's entries are translated along with the rest of the app.
What the difference actually is now. On master:
| editor | viewer |
|---|---|
| Cut / Copy / Paste | Open in New Tab, Copy Reference, Save Image As — each only when the click landed on that kind of element |
| Command Palette (F1) | Copy (with a selection), Select All |
| Change All Occurrences (⌘F2) | Open File Location, Edit |
| Close File |
Most of that is the two panes genuinely differing, and that part should stay: Cut and Paste need somewhere to type, the two Monaco entries need Monaco, and every viewer-only entry needs a rendered element to have been right-clicked — a link, a heading, an image. Identical lists were never the right target.
What is left is three entries that are about the document rather than the pane — Select All, Open File Location, Close File. Adding those to the editor's menu is a few lines, and I had it working locally.
Why I am not opening that PR. All three are already reachable: ⌘A, ⌘W, and the title bar. So the gain is discoverability of things that are not hard to find, and the cost is making the editor's context menu half again as long, for everyone, permanently. That trade did not look worth it once the diff was in front of me.
If the inconsistency is still a papercut in practice — particularly if there is an action you reach for in the editor and cannot find — say so and this can be reopened. The code side is small; it is the menu length I did not want to spend on a cosmetic difference.