PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Peek from file explorer on android device

Open nfenoglio opened this issue 1 year ago • 5 comments

Microsoft PowerToys version

0.81.0

Installation method

WinGet

Running as admin

No

Area(s) with issue?

File Explorer: Thumbnail preview, Peek

Steps to reproduce

when I press the shortcut, the preview send me an error image_2024-05-27 10_37_15

✔️ Expected Behavior

the preview was open

❌ Actual Behavior

No response

Other Software

No response

nfenoglio avatar May 27 '24 08:05 nfenoglio

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar May 27 '24 08:05 github-actions[bot]

hey i wanna work on this issue ... anyone want to help because i m new on this codebase.

Agnibaan avatar May 27 '24 18:05 Agnibaan

@Agnibaan Feel free to open a PR. Your contribution is welcome. Thank you for your work on this. If you have any questions don't worry to ask them.

htcfreek avatar May 27 '24 19:05 htcfreek

@Agnibaan Feel free to open a PR. Your contribution is welcome. Thank you for your work on this. If you have any questions don't worry to ask them.

Can u give me some file reference like where should I work to address this issue?

Agnibaan avatar May 27 '24 20:05 Agnibaan

@Agnibaan Feel free to open a PR. Your contribution is welcome. Thank you for your work on this. If you have any questions don't worry to ask them.

Can u give me some file reference like where should I work to address this issue?

No, sory. Thought you know this.

@jaimecbernardo any ideas?

htcfreek avatar May 27 '24 21:05 htcfreek

@Agnibaan Feel free to open a PR. Your contribution is welcome. Thank you for your work on this. If you have any questions don't worry to ask them.

Can u give me some file reference like where should I work to address this issue?

No, sory. Thought you know this.

@jaimecbernardo any ideas?

I have the idea but I just new to this codebase so I asked to save some time for searching... it's okay let me try ...

Agnibaan avatar May 28 '24 04:05 Agnibaan

@Agnibaan Ah. Sory for the misunderstanding. Thought you expected an exact file path.

You find the Peek files here: https://github.com/microsoft/PowerToys/tree/main/src%2Fmodules%2Fpeek .

htcfreek avatar May 28 '24 04:05 htcfreek

@Agnibaan Ah. Sory for the misunderstanding. Thought you expected an exact file path.

You find the Peek files here: https://github.com/microsoft/PowerToys/tree/main/src%2Fmodules%2Fpeek .

i think there is no file handler which is handling the connected android device files for peek right? or i m missing something?

Agnibaan avatar Jun 01 '24 10:06 Agnibaan

@Agnibaan Ah. Sory for the misunderstanding. Thought you expected an exact file path.

You find the Peek files here: https://github.com/microsoft/PowerToys/tree/main/src%2Fmodules%2Fpeek .

i think there is no file handler which is handling the connected android device files for peek right? or i m missing something?

Don't know. Thought @jaimecbernardo ?

htcfreek avatar Jun 01 '24 12:06 htcfreek

@Agnibaan Ah. Sory for the misunderstanding. Thought you expected an exact file path. You find the Peek files here: https://github.com/microsoft/PowerToys/tree/main/src%2Fmodules%2Fpeek .

i think there is no file handler which is handling the connected android device files for peek right? or i m missing something?

Don't know. Thought @jaimecbernardo ?

File handlers are usually for file types. This might be something in terms of file resolution when we select it. Not sure about what specificities happen when File Explorer opens files inside of an Android file system, but maybe those are being hit. I think the best way to check what's happening might be first looking into the logs in "%localappdata\Microsoft\PowerToys\Peek" to check what errors Peek is actually reporting.

jaimecbernardo avatar Jun 03 '24 08:06 jaimecbernardo

It looks like modern Android devices tend to mount as "devices" rather than as regular drives. Explorer provides special handling for browsing these devices, but the files on their file-systems, unlike with drive-mounting, don't have regular paths that are usable for reading their contents from within Windows applications. All Peek previewers currently need usable paths for reading files.

File-Explorer add-ons don't seem to have this problem as Explorer seems to be very helpfully creating temporary copies of these files on the local file system (in the Temporary Internet Files folder, to be exact) before handing them to preview handlers.

Two potential ways we can fix this in Peek are:

  • Create a local copy of these files the way Explorer does it for File-Explorer add-ons. But we should further investigate what exactly Explorer is doing here - I'm not able to find any documentation / discussion around this.
  • Get Peek to use shell32 interop to directly read these files - the downside of this approach is that it will likely require changes to all our preview handlers.

drawbyperpetual avatar Jun 07 '24 21:06 drawbyperpetual

@Agnibaan Did you complete this work?

@htcfreek I'm happy to take this on, if Agnibaan is OK with that. I have some MTP code from another project which I could translate.

daverayment avatar Feb 15 '25 14:02 daverayment