hicommonwealth / commonwealth

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

When uploading markdown, should the editor REPLACE the editor content, or INSERT based on the cursor position. #9130

Open burtonator opened 1 week ago

burtonator commented 1 week ago

Describe the bug

The editor can support markdown from two sources, drag and drop of existing files, or browsing a file and then uploading it from using a file dialog.

The problem is, what do we DO with the markdown once it's imported.

We could REPLACE the full document or INSERT at the current cursor point.

I can implement either, but we need to pick one.

Initial conditions

Environment:

Branch/Release version:

Browser:

Wallet:

Reproduction steps

Actual behavior

Expected behavior

Screenshots / Video

Reporter

Additional context

zakhap commented 1 week ago

INSERT based on the cursor position makes the most sense to me, esp. bc the user may have already began adding relevant context and is adding something below.

burtonator commented 1 week ago

Thanks @zakhap ... I'm going to add INSERT but I think you should use it for a while.. I think INSERT vs REPLACE is going to be confusing.

It might actually make sense to have INSERT for paste and then REPLACE for upload.

Either way will work though.

This issue isn't a deal breaker and it's a one-line change either way.