focalboard icon indicating copy to clipboard operation
focalboard copied to clipboard

Adding the new blocks based editor

Open jespino opened this issue 1 year ago • 8 comments

Summary

This adds the new blocks based editor behind a feautre flag.

There are still a lot of improvements to do, but for now it supports, drag and drop, different block types (h1, h2, h3, video, attachment, images, dividers, list items, checkboxes and quotes)

To try it you have to restart your mattermost-server with the feature flag that enables it, like this: env MM_FEATUREFLAGS_BOARDSFEATUREFLAGS=newBoardsEditor make restart-server

Some pending improvements are:

  • nicer look and feel
  • better handling of arrow keys on multi line markdowns
  • more and better shortcuts
  • add a lot of testing
  • Replace with the new rich text editor (expected to be release after the mattercon)

IMPORTANT NOTE: This is a prototype behind a feature flag to keep iterating over it, don't expect the code to be perfect or something like that. This is going to be a bit unstable for now, but that is ok because is behind the feature flag.

Ticket Link

Not yet

jespino avatar Sep 10 '22 08:09 jespino

@wiggin77 Here is the new API to move things. Probably we would need to have a better "content" api, something like "Add content" with an "after" or "before" parameter would insert the block and properly possition it.

jespino avatar Sep 10 '22 08:09 jespino

@jespino whats the plan for this? Its this only an experiment or do we want to switch to the new editor? What are the requirements? What are the expected behaviors? I'm asking because this is a huge PR requiring substantial effort in reviewing and testing.

Also the CI is failing. Can we at lest get that working before review?

harshilsharma63 avatar Sep 12 '22 04:09 harshilsharma63

The intention is to end up merging it as part of the product, for now behind a feature flag. And yes, there are things to fix, like the ci, adding more tests or fixing ToDos, it is not strictly needed a detailed review for all the people in the reviewers list, i added that people to get general opinions, feel free to no review it for now. I'll fix some details today anyway.

jespino avatar Sep 12 '22 05:09 jespino

@harshilsharma63 CI is passing now, still some TODOs to fix, but if you want to can take a look, as I said, most of it is not going to hit production for now, it is just behind a feature flag, so, I would focus on the part that affects the rest of the code (outside the blocksEditor directory).

jespino avatar Sep 12 '22 16:09 jespino

/update-branch

sbishel avatar Sep 14 '22 13:09 sbishel

/update-branch

sbishel avatar Oct 19 '22 22:10 sbishel

Error trying to update the PR. Please do it manually.

mattermod avatar Oct 19 '22 22:10 mattermod

@harshilsharma63 @wiggin77 do you mind to give it a last pass to merge it into main branch? Remember, all this is behind a feature flag, so we shouldn't be too worried about this being perfect.

jespino avatar Nov 04 '22 08:11 jespino

webapp/src/components/blocksEditor/blocks/list-item/list-item.scss is an empty file that was added. Can this be deleted? Same with webapp/src/components/blocksEditor/blocks/text-dev/text.scss

wiggin77 avatar Nov 14 '22 18:11 wiggin77

webapp/src/components/blocksEditor/blocks/list-item/list-item.scss is an empty file that was added. Can this be deleted? Same with webapp/src/components/blocksEditor/blocks/text-dev/text.scss

@wiggin77 this is just a placeholder just in case we add it later. But I don't mind removing it.

jespino avatar Nov 15 '22 14:11 jespino

@wiggin77 Probably video is going to be refactored before we remove the feature flag, I don't see a problem there.

jespino avatar Nov 15 '22 14:11 jespino