hicommonwealth / commonwealth

A platform for decentralized communities
https://commonwealth.im
GNU General Public License v3.0
67 stars 44 forks source link

Need feedback for some UI issues for the markdown editor. #9041

Open burtonator opened 2 months ago

burtonator commented 2 months ago

Describe the bug

I just sent in a PR for v0 of the markdown editor which raised some issues regarding UI.

Heading selector?

What do we do about the block selector? The designs have H1, H2, H3 but we have headings up to H6.

In the design we don't have a way to reset the heading. So if you go from P to H1 there's no way to go back. Maybe hit the H1 again?

Also, there are up to 6 headings. H1... H6. We wouldn't support H4-H6 with these designs.

If we go with this design it will take me like 1-3 hours of work to use this style of buttons. I don't feel strongly about it unless something else comes up that I didn't forsee.

image

Here is the block type selector with MDXEditor

CleanShot 2024-08-28 at 12 11 31@2x

Raw markdown mode

Do we want the RAW markdown mode (probably on desktop only)? This will help with pasting raw markdown data.

I didn't realize that MDXEditor supported a 'raw' markdown mode.

You have to click this button:

image

Then the UI changes to work with the raw markdown text:

image

Conditional toolbar.

MDXEditor supports a conditional toolbar. So if you start editing 'code' it will change the toolbar since none of the options of the markdown formatting are possible with source code.

image

I think we should enable this feature. Otherwise, it will be confusing to the user if they try to use the toolbar.

Drag Indicators

When the user is dragging a file on top of the editor to upload their own markdown, I just grey out the editor until they drop the file.

We'll need a better UI for this. I just need the UI as I already implemented the drop handling.

Upload Indicators

With upload indicators (when uploading an image) I do the same thing as the drag indicators.

We might want to have a progress indicator here while this is happening.

Right now there's no UI for it so we need to agree on a UI.

Initial conditions

Environment:

Branch/Release version:

Browser:

Wallet:

Reproduction steps

Actual behavior

Expected behavior

Screenshots / Video

Reporter

Additional context

dillchen commented 2 months ago

Decisions

  1. Heading selector
  1. Resetting Heading Selector
  1. Raw markdown mode
  1. Conditional toolbar.
  1. Drag / Drop Handling
  1. Upload Indicators

With upload indicators (when uploading an image) I do the same thing as the drag indicators.

burtonator commented 2 months ago

@dillchen Thanks! I'm going to implement these changes in v2 of the editor then work towards putting it behind a feature toggle.