nextcloud-vue icon indicating copy to clipboard operation
nextcloud-vue copied to clipboard

Interface for Markdown support of NcRichContenteditable

Open nickvergessen opened this issue 2 years ago • 20 comments

Mock-up for Markdown support of richtext Board (13)

The popup should be shown after finishing the selection of some text (mouse button release) and should hide as soon as selecting one option. Also [ESC] should be able to close it.

Originally posted by @szaimen in https://github.com/nextcloud/spreed/issues/1027#issuecomment-1642565654

nickvergessen avatar Jul 19 '23 18:07 nickvergessen

Comments

Copied from nextcloud/spreed#1027

  • @szaimen When selecting the formatting, markdown syntax should be used to directly add characters around the marked text and adjust the look of it.

    • @nickvergessen That would be on rightclick? But that is something the vue library should handle anyway, so that when an app uses the input component it can say "yes markdown please" (like NcRichText afterwards for the posted messages already does for the post rendering)

      • @szaimen I would say it should rather be shown directly as soon as you select some text. (e.g. after the mouse click is done and text was selected)

        • @nickvergessen After a mouse select it might be okay, but I can see how keyboard users are annoyed. Like most of the time I have to fix my text selection with the keyboard because I failed with the mouse. I can see how it could be annoying then if arrow up/down are "captured" by the dropdown instead of adjusting the text selection.
  • @ShGKme It's a bit unclear to me, how "remove formatting" is supposed to work

    • @nickvergessen I guess that only would be available work, when the same style-marker (e.g. ** in the screenshot) is to the left and right of the selection. But I agree that the removing thing looks very complicated.

      • @szaimen Indeed that looks complicated. So lets for now not offer this.
  • @nickvergessen Syntax is Markdown, so it can be rendered by NcRichText. Nothing to discuss there really.

nickvergessen avatar Jul 19 '23 18:07 nickvergessen

Also when selecting text and hitting BackSpace or Delete, the text should vanish and not the special key being killed/ignored because of the Formatting option popup

nickvergessen avatar Jul 19 '23 18:07 nickvergessen

So maybe only show this if selecting text with the mouse? Not sure if we can seperate between these...

szaimen avatar Jul 19 '23 18:07 szaimen

I think that the menu upon selecting the text would be useful (yes only on mouse and tap), but I would prefer to have a buttons bar with just the icons in line, just like in Nextcloud text's top-bar. I think it would be much less obtrusive.

marcoambrosini avatar Jul 20 '23 06:07 marcoambrosini

Ref screenshot from Text: grafik

nickvergessen avatar Jul 20 '23 07:07 nickvergessen

I'd personally prefer to have a user setting show text formatting. Then, a user can switch between the context menu and the bar.

ShGKme avatar Jul 20 '23 09:07 ShGKme

Wait I don't mean the whole bar, just a few action within the context menu

marcoambrosini avatar Jul 20 '23 10:07 marcoambrosini

@marcoambrosini you mean like a horizontal list only with icons instead of the vertical list that I suggested?

szaimen avatar Jul 21 '23 08:07 szaimen

I'm not sure about icons without text. But I'd definitely remove the "Choose formatting" visual title. It seems to be obvious that it's about formating.

md

ShGKme avatar Jul 21 '23 09:07 ShGKme

@marcoambrosini you mean like a horizontal list only with icons instead of the vertical list that I suggested?

Exactly, what do you think?

marcoambrosini avatar Jul 24 '23 04:07 marcoambrosini

But I'd definitely remove the "Choose formatting" visual title. It seems to be obvious that it's about formating.

I would honestly keep it for better UX.


@marcoambrosini you mean like a horizontal list only with icons instead of the vertical list that I suggested?

Exactly, what do you think?

I tried this but for a good UX we should have some kind of labels for the buttons imho and then the vertical list also with the choose formatting looks best imho.

Here are the variants that I tried: Board (15)


So in my opinion is this still the best version: image

szaimen avatar Jul 24 '23 09:07 szaimen

Hmm I'm actually having a look at the competitors and there's to a widely adopted pattern of being able to toggle a formatting bar. What do you think about that @szaimen? It seems like a pretty good solution to me. I have some concerns regarding proposed tooltip mainly because it might in the way of text editing in terms of selecting, copying, cutting, pasting. For example if I select some text that I want to copy and paste above, but the formatting tooltip covers the area of the message where I want to insert the prompt to then paste, what do I do? How do I dismiss the formatting tooltip? Click outside? But then do I loose the selection? I likely wouldn't I suppose. I think that it adds a bit of uncertainty and friction and I would prefer to go with the established pattern.

Do I need formatting? -> I unfold it and it's there all the time. I won't ever need it? -> It never gets in my way!

I think it's a very good solution UX-wise and it's also future proof, in case we want to introduce more functionality in the future.

google chat

https://github.com/nextcloud/nextcloud-vue/assets/26852655/45926c07-4b62-454c-acf6-da0ec6e7294d

slack

https://github.com/nextcloud/nextcloud-vue/assets/26852655/ac85cf7c-44a9-4809-86fc-587f83345f59

teams

https://github.com/nextcloud/nextcloud-vue/assets/26852655/1dfca26b-7a1c-4a3a-85e5-780c7576a5fa

@ShGKme if you were previously referring to this I'm sorry, I misunderstood you. I thought you meant a setting in Talk settings.

marcoambrosini avatar Jul 25 '23 06:07 marcoambrosini

I would honestly keep it for better UX.

While usually I prefer to have a text near the icon and headers, I think in this case it is fine to keep only icons and remove any text out of tooltips.

They are very wide-known icons that are used in all text editing apps and many messengers. With a text context menu - it is a context menu, and usually they do not have additional headers when not needed.

In a horizontal menu bar, there is no space for text.

So I'd prefer to remove the header and in the menu bar - also remove the text.

(For a11y purpose, we can, of course, add hidden labels and headers.)

@ShGKme if you were previously referring to this I'm sorry, I misunderstood you. I thought you meant a setting in Talk settings.

Actually, I meant Talk settings :D Some time ago Slack had it as a global setting option.

But having a switcher in the input is definitely better 👍

For example if I select some text that I want to copy and paste above, but the formatting tooltip covers the area of the message where I want to insert the prompt to then paste, what do I do? How do I dismiss the formatting tooltip? Click outside? But then do I loose the selection? I likely wouldn't I suppose

Yep, you can dismiss the menu by dismissing the selection (with any click or arrows). If you want to past this text in another place, then you have it in the clipboard and won't lose it after dismissing the selection.

  1. Select the text
  2. Copy
  3. Dismiss selection by click / arrow / Esc
  4. Past the copied text wherever you need

A user can also still use the native context menu, like in Notion:

image

So I'd keep the context formatting menu when the bar is not shown.

ShGKme avatar Jul 25 '23 07:07 ShGKme

So I'd keep the context formatting menu when the bar is not shown

I would avoid the context formatting if we have a bar option. I might think otherwise in a text document, but in Talk the purpose of a formatting bar would be avoiding that kind friction generated by a popover blocking parts of the message I'm writing.

marcoambrosini avatar Jul 25 '23 07:07 marcoambrosini

So I'd keep the context formatting menu when the bar is not shown

I would avoid the context formatting if we have a bar option. I might think otherwise in a text document, but in Talk the purpose of a formatting bar would be avoiding that kind friction generated by a popover blocking parts of the message I'm writing.

I would agree, that would also solve the keyboard/mixed usecase where otherwise you are always bothered by a formatting bar, while you are just trying to rewrite a section of your message or something alike.

nickvergessen avatar Jul 25 '23 08:07 nickvergessen

An alternative to a formatting bar would be something like this: https://github.com/nextcloud/text/pull/4587. However the question would of course would be how good this would be discoverable for first-time users.

szaimen avatar Jul 28 '23 12:07 szaimen

And that requires picker support (e.g. not available in the talk desktop client atm). Something basic would be preferable I think.

nickvergessen avatar Jul 28 '23 14:07 nickvergessen

Here's how it could look in Talk. What do you think? Should we open a separate issue there? I think that that the tooltip could be still totally valid for documents like the in notion example above.

talk formatting

marcoambrosini avatar Aug 02 '23 09:08 marcoambrosini

Should we open a separate issue there?

So a persistent bar in Talk and a on-selection-popover in vue? Yeah should be separate tickets 👍

nickvergessen avatar Aug 02 '23 14:08 nickvergessen

I've been testing the formatting bar in Signal and I have to say it works pretty well in a chat application too. Since we're going to have that built into this component, we could test that with talk before adding a dedicated bar. If that works well we just keep it, otherwise, we create a separate issue and look into the persistent bar.

@szaimen this is much less obtrusive than the labeled version and seems to be widely adopted.

Image

Signal example:

https://github.com/nextcloud-libraries/nextcloud-vue/assets/26852655/778bd75f-bfc1-4cba-8bf4-86cbae812c8a

marcoambrosini avatar Aug 04 '23 04:08 marcoambrosini