Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom dialogs to edit links and images #40

Open
dselman opened this issue Apr 13, 2020 · 16 comments · May be fixed by #312
Open

Custom dialogs to edit links and images #40

dselman opened this issue Apr 13, 2020 · 16 comments · May be fixed by #312

Comments

@dselman
Copy link
Contributor

dselman commented Apr 13, 2020

The toolbar allows inserting both links and images. Both would benefit from a custom dialog to insert new links or to edit existing links.

@jolanglinais
Copy link
Member

Moved to markdown-editor, relates to accordproject/markdown-editor#293

@jolanglinais
Copy link
Member

@Michael-Grover any thoughts on this?

From @dselman:

Because images are just specialized links in Markdown, perhaps we can also use for to edit images?

@Michael-Grover
Copy link

Michael-Grover commented Apr 13, 2020

accordproject/markdown-editor#293 @dselman there is a custom dialogue for links here

Because images are just specialized links in Markdown, perhaps we can also use for to edit images?

if someone wants to edit an image wouldn't they just delete it and add a new one?

@jolanglinais jolanglinais transferred this issue from accordproject/markdown-editor May 13, 2020
@jolanglinais
Copy link
Member

Relates to #29

@K-Kumar-01
Copy link
Contributor

@dselman
Keeping the perspective of the image, does it mean that when an image is clicked a popup similar to hyperlink should open up with a field to edit the image URL?

@jolanglinais
Copy link
Member

@K-Kumar-01 yes I think that's the right idea.

K-Kumar-01 added a commit to K-Kumar-01/web-components that referenced this issue Mar 21, 2021
Image modal created
Updated the insertImage function
Pass necessary props and state

Signed-off-by: k-kumar-01 <[email protected]>
@K-Kumar-01 K-Kumar-01 linked a pull request Mar 21, 2021 that will close this issue
9 tasks
@K-Kumar-01
Copy link
Contributor

@irmerk @dselman
I have created a PR for the issue. Let me know if there are any changes required.

K-Kumar-01 added a commit to K-Kumar-01/web-components that referenced this issue Mar 22, 2021
Reuse the modal positioning
Inserting image uses new modal

Signed-off-by: k-kumar-01 <[email protected]>
@jolanglinais
Copy link
Member

@Michael-Grover so my interpretation is that this might not be a good feature for images?

@Michael-Grover
Copy link

@Michael-Grover

if someone wants to edit an image wouldn't they just delete it and add a new one?

@irmerk

so my interpretation is that this might not be a good feature for images?

I'm just not clear on what the utility of this feature is. Is being able to edit the image URL the standard functionality in editors like this (built on markdown but don't let users edit the markdown directly)? It feels like adding complexity to the UI for no additional utility. @dselman since you opened this issue, what do you think?

It seems simpler to just click on an image, press backspace, then add a new one. Also, when a user uses cmv+v to paste an image, what does should the URL become in the pop up?

@dselman
Copy link
Contributor Author

dselman commented Mar 22, 2021

I guess I was influenced by the similarity between links and images in the markdown spec. I think there is some precedent for this sort of thing. E.g. in elev.io you can click on an image, select "replace" and then the "by url" button. Fairly sure I've seen it elsewhere as well, but I'll defer to you on utility/design.

I'd also love to get rid of the system prompt displayed when the user presses the "insert image" toolbar button.

@Michael-Grover
Copy link

Michael-Grover commented Mar 22, 2021

@dselman what's a situation where someone might want to change the URL of an image? I don't actually understand how someone would use the existing functionality where they have to enter a URL to add an image. Where are they getting the URL from? in editors like this, I thought that people usually upload files from their computer or paste images. I just haven't seen entering a URL as a method for adding an image in editors, so I'm having trouble envisioning how users would use the existing functionality, and how it can be improved.

@Michael-Grover
Copy link

I think having a pop up appear when clicking an image makes it harder to delete the image, use the keyboard to navigate past the image, and use the cursor to drag and drop an image to a different part of the editor.

@K-Kumar-01
Copy link
Contributor

K-Kumar-01 commented Mar 23, 2021

I think having a pop up appear when clicking an image makes it harder to delete the image, use the keyboard to navigate past the image, and use the cursor to drag and drop an image to a different part of the editor.

@Michael-Grover
I can add a delete button in the popup itself that will make it easier. However, that completely depends on whether we want to use this feature or not.
Navigating the image using the keyboard can also be fixed.
Using the cursor to drag and drop image might be tricky.

@K-Kumar-01
Copy link
Contributor

@dselman @Michael-Grover @irmerk
I also noticed that dragging and dropping images doesn't add an image to the markdown editor. So that might be a feature that we can work on?

@Michael-Grover
Copy link

Michael-Grover commented Mar 24, 2021

@dselman and I discussed pop up dialogues to edit images and decided that it's not necessary, however we should allow users who extend this component to choose what they want to happen when a user clicks on the image. I think this means having an event happen upon clicking an image, @dselman is that right? Is there any additional context you can add?

@K-Kumar-01
Copy link
Contributor

@dselman
Waiting for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants