zed icon indicating copy to clipboard operation
zed copied to clipboard

right-click on Zed icon to bring up recent folders/files

Open xyzqm opened this issue 2 years ago • 3 comments

Check for existing issues

  • [X] Completed

Describe the feature

VSCode has something like the following appear when you right-click the icon: image Is zed planning to support something similar? I'm happy to work on a PR for this if I can get a few pointers on where to look :)

If applicable, add mockups / screenshots to help present your vision of the feature

No response

xyzqm avatar Feb 26 '24 01:02 xyzqm

Can I get any pointers on which files might be relevant for this feature? I'm not quite sure where to get started in this huge codebase 😅

xyzqm avatar Mar 01 '24 07:03 xyzqm

Here are some relatively vague pointers:

  • we would need some macOs platform API for such feature, I presume. I have no knowledge of how it's implemented, but here's an example of file drag and drop handlers: https://github.com/zed-industries/zed/blob/541c2a6757b4389a2b9f7c3e2b1b7cb94149451c/crates/gpui/src/platform/mac/window.rs#L287-L298 which you can use to create something similar for that other discovered thing.

  • that drag and drop thing in the example also deals with paths https://github.com/zed-industries/zed/blob/541c2a6757b4389a2b9f7c3e2b1b7cb94149451c/crates/gpui/src/platform/mac/window.rs#L1809 and those are unicode strings, so nothing special has to be on Zed side

  • on the other side, Zed has the recent projects modal that fetches them from the DB: https://github.com/zed-industries/zed/blob/541c2a6757b4389a2b9f7c3e2b1b7cb94149451c/crates/recent_projects/src/recent_projects.rs#L44-L55

That mac/window.rs code is relatively low-level and I have no clue how db is even supposed to get there, so some way of passing the recent projects data has to be found.

Maybe, there's a way to defer that new mac API registration and we can add a method on the low-level window to call later, from gpui?

SomeoneToIgnore avatar Mar 01 '24 10:03 SomeoneToIgnore

Thanks for the info! By the way, is there a list of the main packages zed uses/links to their documentation somewhere? I feel like it would be helpful to put them somewhere in the README so new prospective contributors know where to start :)

edit: ah nevermind, I missed the bottom of Contributing.md 😓

xyzqm avatar Mar 02 '24 07:03 xyzqm

By the way, can I be assigned to this issue? I think I have a rough idea of how to implement this, but the code may need some ironing out later on ;)

xyzqm avatar Mar 06 '24 07:03 xyzqm