yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.9k stars 324 forks source link

Feature request: Add commands to `editor/context` contribute submenu. #1358

Open peaceshi opened 9 months ago

peaceshi commented 9 months ago

Proposal

From https://github.com/mdickin/vscode-markdown-shortcuts/issues/76 . This issue has not been replied to in a month and seems like the project has been no one maintains. So, I want to add it to markdown-all-in-one.

I will make a PR later.

Other information

image

yzhang-gh commented 9 months ago

Thanks for your contribution.

However, I don't think it is a good UX design. For exporting as HTML, it requires many key strokes (ctrl shift p, p, r, i, n, t, (optional arrow keys), enter) and thus it will be convenient to have a menu item. For styling commands that is not true, it is just ctrl b/i etc. And it is even worse when you need to go into a submenu.

peaceshi commented 9 months ago

It is not that everyone is a programmer or pro. It is difficult for civilian personnel to remember the right key bind then they will check it again and again. How about just adding them to the menu instead of submenu?

yzhang-gh commented 9 months ago

How about just adding them to the menu instead of submenu?

Then there will be too many commands.

The keybindings are so widely used (just look the B and I above the GitHub comment box or other software like Word). I am not very convinced of the necessity. We can leave this open and see what other users think.

peaceshi commented 9 months ago

How about adding to the title bar? image

or like this? image

MomentDerek commented 9 months ago

I support adding it to the menu! It is useful because I like to click it directly.

LiXiaYu commented 9 months ago

How about just adding them to the menu instead of submenu?

Then there will be too many commands.

The keybindings are so widely used (just look the B and I above the GitHub comment box or other software like Word). I am not very convinced of the necessity. We can leave this open and see what other users think.

You're right, but the noble VScode supports the mouse and has multi-level menu options that can be freely switched on and off.

This is not Vim, we don't need comment box!

lhmouse commented 9 months ago

Please consider 'non-well-known' key bindings bad.

So, what are 'well-known' keybindings? For example, Ctrl-C copies the selection; okay good, we are used to it. Ctrl-Insert also copies, and sometimes it's essential such as in the terminal, where Ctrl-C would send an interrupt; so, good, too.

They're all good, until there are too many. So what does Ctrl-Shift-R do? No, nobody will bother remembering that. It does not have to exist. Please give my menus back.

N.B. The Ctrl-B combination conflicts with workbench.action.toggleSidebarVisibility, so it's already not good; but not to me, as Ctrl-B doesn't work in the terminal anyway, so I have Ctrl-Shift-B to close it.

yzhang-gh commented 9 months ago

How about adding to the title bar?

image

This looks much better to me, not only because it is more convenient than context menu, but also because it shares the same UX as other editors.

VS Code has built-in icons, or you can find them here.


N.B. The Ctrl-B combination conflicts with workbench.action.toggleSidebarVisibility, so it's already not good; but not to me, as Ctrl-B doesn't work in the terminal anyway, so I have Ctrl-Shift-B to close it.

I see. (related #89)

yzhang-gh commented 8 months ago

Just FYI, I have added an option showActionButtons to show/hide these button. This is false by default following the VS Code UX guidelines.

If you would like to check it out, you can install the latest dev build https://github.com/yzhang-gh/vscode-markdown/actions/runs/7322269176/artifacts/1134210918

I am going to release a new stable version soon if everything works well.

peaceshi commented 8 months ago

Just FYI, I have added an option showActionButtons to show/hide these button. This is false by default following the VS Code UX guidelines.

If you would like to check it out, you can install the latest dev build https://github.com/yzhang-gh/vscode-markdown/actions/runs/7322269176/artifacts/1134210918

I am going to release a new stable version soon if everything works well.

分组应该跟之前一样在同一组里,否则如果有多个需要在工具栏显示操作的插件就会被打乱顺序。而且vsc只显示前几个注册的,后面的会被放到下拉菜单里。 image image

yzhang-gh commented 8 months ago

因为我观察到之前的 1_11_2 写法并不能控制顺序,其实是按照命令的字母顺序排列的,比如 code span 会在 italic 之前。

考虑到现在的问题,那需要更了解 VS Code 这里的排序逻辑了

ulville commented 8 months ago

How do I enable this? I could not find any option called showActionButtons

yzhang-gh commented 8 months ago

Thanks for the feedback. There is a mistake and it is not shown up in the Settings GUI. You can directly put "markdown.extension.showActionButtons": true in your settings JSON. Or you can install the dev build here https://github.com/yzhang-gh/vscode-markdown/actions/runs/7541713779/artifacts/1172167689