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

markdown preview: allow opening images in a new editor #184553

Open
MeghanKulkarni opened this issue Jun 7, 2023 · 17 comments · May be fixed by #234649
Open

markdown preview: allow opening images in a new editor #184553

MeghanKulkarni opened this issue Jun 7, 2023 · 17 comments · May be fixed by #234649
Assignees
Labels
feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities markdown Markdown support issues
Milestone

Comments

@MeghanKulkarni
Copy link
Contributor

Images opened in the markdown preview could have a context menu that includes 'Open Image' that opens the image in a new editor.

@MeghanKulkarni MeghanKulkarni changed the title markdown preview: allow opening images in a new editor #173876 markdown preview: allow opening images in a new editor Jun 7, 2023
@mjbvz mjbvz added the markdown Markdown support issues label Jun 19, 2023
@MeghanKulkarni MeghanKulkarni removed their assignment Aug 18, 2023
@mjbvz mjbvz added help wanted Issues identified as good community contribution opportunities feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors labels Nov 20, 2023
@vscodenpa vscodenpa added this to the Backlog Candidates milestone Nov 20, 2023
@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@mjbvz mjbvz modified the milestones: Backlog Candidates, Backlog Jan 10, 2024
@A7Lavinraj
Copy link

A7Lavinraj commented Jan 11, 2024

what do you mean by open in new editor, did you mean open in new vscode tab?

@flyyuan
Copy link

flyyuan commented Feb 22, 2024

Hey, I would like to work on this issue .. @mjbvz

@Gobinath-B
Copy link

@mjbvz can i work on this

@mjbvz
Copy link
Collaborator

mjbvz commented Mar 18, 2024

Yes, since this is a smaller feature feel free to start working and submit a PR when it's ready or you need some early feedback/pointers

@Gobinath-B
Copy link

Gobinath-B commented Mar 22, 2024

@mjbvz i working in this issue done all the ui things.

case 'openImage': {
			const img = document.getElementById(data.id);
			if (img instanceof HTMLImageElement) {
				openImage(img);
			}
			return;
		}

now i have to write the openImage function but i can find any inbuilt methods or vscode api to open image in new tab. can you help me @mjbvz

async function openImage(image: HTMLImageElement) {

}

@MSViswanth
Copy link

@Gobinath-B can I work on this with you?

@Gobinath-B
Copy link

Yeah sure. For now I added open image button next to copy image. Only thing I have to do is write a function using vscode api or call a existing open image function to give functionality to the button

@MSViswanth
Copy link

I managed to call the open image function, but currently it doesn't do anything. I have been looking for open in new tab functionality.

@Gobinath-B
Copy link

Can you share the location of image opening functionality

@MSViswanth
Copy link

MSViswanth commented Mar 23, 2024

The function that you made openImage is not called automatically. The command needs to be called first and then the openImage function is called through the command. I got till that part. I'm still looking for how to implement it so that it opens a new tab in the preview column or maybe a third column beside the preview. And the current implementation for preview as far as I can see only supports one preview for one markdown file. So we'll have to invoke the open functionality separately from the current implementation of preview.

@MSViswanth
Copy link

We can use WebView.
I managed to create a new editor tab like how preview shows up currently, but I don't know how to pass the image source to the WebView panel because it's being called on the markdown file, not the image. I posted the changes to my branch MSViswanth/vscode/md-img-new-tab.

@MSViswanth
Copy link

MSViswanth commented Mar 27, 2024

Hi @mjbvz, I have a working implementation for images present in the current workspace folder. I need some help dealing with cases where there is no workspace folder present. Do I just make a new pull request?

@Gobinath-B
Copy link

@MSViswanth , I working on this issue first. I'm worried that your action wasting both of our time. Feel free to find another issue to work. If you are comfortable to help me on this issue ,I'm appreciate that. But working on the same issue either waste your time or my time.

@MSViswanth
Copy link

@Gobinath-B Well, alright.

I would have liked you to merge my changes instead of just copying them.
I'm not comfortable with helping you on this.
Good luck.

@Gobinath-B
Copy link

Thanks @MSViswanth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities markdown Markdown support issues
Projects
None yet
7 participants