microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
110.24k stars 6.49k forks source link

Feature: CLI/API integration for Peek #26422

Open yaira2 opened 1 year ago

yaira2 commented 1 year ago

Description of the new feature / enhancement

Congratulations on the new Peek feature! This adds a popular functionality that until now required the use of third-party apps. Files (https://github.com/files-community/Files) already has support for QuickLook, but we'd like to add support for PowerToys Peek https://github.com/files-community/Files/issues/12432 in order to provide users with more choices.

Scenario when this would be used?

We're ready to add support for PowerToys Peek in Files whenever an API is available, in fact, we've already completed the preparation work and we're looking forward to this integration. In addition to Files, there are a couple of other third-party file managers that can also benefit from an API.

Supporting information

Feature request on the Files repo: https://github.com/files-community/Files/issues/12432

crutkas commented 1 year ago

What would you expect here. Can you explain how you’d expect to interact with peek

yaira2 commented 1 year ago

We can add/remove more interaction methods depending on the provider, but the most common interactions are Space to toggle preview (users can remap the shortcut) Arrow keys to switch between files (this interaction is only used when the preview provider doesn't have built-in support)

yaira2 commented 1 year ago

The implementation details of the API aren't very important, the main requirement is that applications can pass a file path to PowerToys and that it'll handle everything from there.

zhuxb711 commented 1 year ago

I think Named Pipe or COM interface should be the better way to achieve the function.

How the other application achieve those functions?

"Seer" use window message COPY_DATA and "Quicklook" use Named Pipe to interact with other application.

Five API is needed for a preview application:

  1. Check if Peek is available and running currently
  2. Check if Peek's window is presents
  3. Toggle Peek (Show its window if not present, or switch to new file if window is present)
  4. Switch Peek (Switch to new file if window is present, don't do anything if window is not present)
  5. Close the window of Peek (Only works if Peek's window is present)
yaira2 commented 1 year ago

We keep getting requests for this integration in Files. In the meantime I've been recommending QuickLook and SeerPro but it would be great to offer support for PowerToys Peek as well.

Likqez commented 1 year ago

Any updates on this?

pa-0 commented 6 months ago

Also just to add if this hasn't been covered, this would possibly give us a path to activating Peek windows from the Everything Search results (desktop app). Just a thought.

yaira2 commented 4 months ago

@crutkas I understand the PowerToys team was exploring different approaches for this API. Are there any updates that you can share?