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

Windows: Jump list misses files and folders in the recent category when opened #241

Closed
bpasero opened this issue Nov 19, 2015 · 30 comments · Fixed by javifelices/vscode#4 · May be fixed by chjkw/vscode#4
Closed

Windows: Jump list misses files and folders in the recent category when opened #241

bpasero opened this issue Nov 19, 2015 · 30 comments · Fixed by javifelices/vscode#4 · May be fixed by chjkw/vscode#4
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@bpasero
Copy link
Member

bpasero commented Nov 19, 2015

Somehow on Windows we do not show up with files and folders in the jump list. I think this is some docs what to do to make it happen: https://msdn.microsoft.com/en-us/library/windows/desktop/ee872121(v=vs.85).aspx

@bpasero bpasero self-assigned this Nov 19, 2015
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities labels Nov 19, 2015
@bpasero
Copy link
Member Author

bpasero commented Nov 23, 2015

Maybe someone can enlighten me how to tell Windows that an application can handle files/folders :)

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Nov 24, 2015
@bpasero bpasero removed their assignment Nov 25, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality workbench labels Mar 29, 2016
@bpasero bpasero changed the title Windows: Folders do not show up in right-click task bar menu Windows: Jump list misses files and folders Mar 29, 2016
@Odonno
Copy link

Odonno commented Apr 3, 2016

Does electron API method app.addRecentDocument() not working ? I tried to debug the app but didn't find how to debug other than UI thread...

@bpasero
Copy link
Member Author

bpasero commented Apr 3, 2016

It does but there is more requirements for this to work on Windows.

@Odonno
Copy link

Odonno commented Apr 3, 2016

The task jumplist seems to work (where you can ask for a new window). Why is it different ?

@bpasero
Copy link
Member Author

bpasero commented Apr 3, 2016

Yes, tasks seem to be a different concept that work without issues.

@pflannery
Copy link

It's either

  1. An issue with vscode in the registry
  2. Electron is failing at SHAddToRecentDocs. Problem with SHAddToRecentDocs is that it doesn't return a result so it's hard to determine whats going on.

or both.

@pflannery
Copy link

same issue is happening to me on atom too atom/atom#4241 (comment)

@bpasero
Copy link
Member Author

bpasero commented Apr 3, 2016

@pflannery
Copy link

@bpasero Just tried with latest Atom beta and i can get files to appear in the jump list but only using the file menu - atom/atom#4241 (comment)

@bpasero
Copy link
Member Author

bpasero commented Apr 3, 2016

VS Code switched away from using Squirrel for Windows for installation so it is well possible that Atom includes installation procedures that make it possible to show files in the jump list and VS Code's installer needs to do the same. Would still like to find out what exactly is needed.

@glen-84
Copy link

glen-84 commented May 21, 2016

Any updates on this issue?

At the moment, I have to: Right-click the taskbar icon -> select New Window* -> maximize the window -> open the folder from File > Open Recent. It could be faster =).

* or use Ctrl+Shift+N/file menu.

@bpasero
Copy link
Member Author

bpasero commented May 22, 2016

I have not been able to get any help from other Microsoft people. Why it fails remains a mystery to me.

@Leon99
Copy link

Leon99 commented Sep 9, 2016

Bringing folders to the jump list could easily be a better alternative to having several open folders in one window. At least for Windows of course. MS folks, please give this item some love.

@JustinPealing
Copy link

JustinPealing commented Sep 9, 2016

According to the documentation registering under HKCR\Applications means SHAddToRecentDocs will attempt to register applications to handle file types that it is not registered to handle, which seems like the best solution because that lets any file type appear in the recent list rather than just file types explicitly registered. I created a scratch electron app with these registry keys to try it out:

[HKEY_CLASSES_ROOT\Applications\electron-quick-start.exe]

[HKEY_CLASSES_ROOT\Applications\electron-quick-start.exe\shell]

[HKEY_CLASSES_ROOT\Applications\electron-quick-start.exe\shell\open]

[HKEY_CLASSES_ROOT\Applications\electron-quick-start.exe\shell\open\command]
@="\"E:\\Git\\apf-electron\\electron-quick-start-win32-x64\\electron-quick-start.exe\" \"%1\""

This worked as expected, but broke when used setUserTasks to add a custom task - it looks like this totally replaces the jump list and so it no longer includes the recent section. Using setJumpList instead let me define custom tasks while also keeping the recent section, so something a bit like this might fix it:

app.setJumpList([
  { type: 'recent' },
  {
    items: [
      {
        title: nls.localize('newWindow', "New Window"),
        program: process.execPath,
        arguments: '-n', // force new window
        iconPath: process.execPath,
        iconIndex: 0
      }
    ]
  }
]);

I'm struggling to build VSCode at the moment so I've not been able to check if this actually works.

@JustinPealing
Copy link

Looks like setJumpList was only introduced in v1.3.5:

electron v1.3.5

@bpasero
Copy link
Member Author

bpasero commented Sep 12, 2016

Yeah, maybe a better idea to just set our own custom jump list instead of relying on Windows to do it. Even if we update Electron this release, I would wait one release before using new API in case we have to revert.

@bpasero
Copy link
Member Author

bpasero commented Sep 16, 2016

@JustinPealing thanks for looking into this, can you clarify how your application registers differently from VS Code? Our installer is setting quite a bit of keys and I wonder how your registration differs (see https://github.com/Microsoft/vscode/blob/master/build/win32/code.iss#L74)

Btw we recently updated our instructions how to build VS Code on windows and it should work fine now: https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source

@pflannery
Copy link

I see atom has fixed the recent items issue I had. But there is another separate bug I've opened but with re-opening recent items atom/atom#12655
They are using Electron: 0.37.8

I don't see atom using the custom jump lists api

@bpasero I find that I also have to include --arch=ia32 switch as I have 64bit nodejs installed. It wont build compatible node 32bit binaries for electron otherwise

@bpasero
Copy link
Member Author

bpasero commented Sep 16, 2016

@pflannery thanks for letting us know.

@joaomoreno didn't we use to have the arch inside npm.sh at one point?

@joaomoreno
Copy link
Member

We have it in scripts\npm.bat

@JustinPealing
Copy link

@bpasero The only key my dummy app registered was under HKCR\Applications, specifically the shell\verb registration MSDN documentation here

Here is a .reg dump of the relevant key:

[HKEY_CLASSES_ROOT\Applications\electron-quick-start.exe]

[HKEY_CLASSES_ROOT\Applications\electron-quick-start.exe\shell]

[HKEY_CLASSES_ROOT\Applications\electron-quick-start.exe\shell\open]

[HKEY_CLASSES_ROOT\Applications\electron-quick-start.exe\shell\open\command]
@="\"E:\\Git\\apf-electron\\electron-quick-start-win32-x64\\electron-quick-start.exe\" \"%1\""

@bpasero bpasero modified the milestones: September 2016, Backlog Sep 17, 2016
@bpasero bpasero removed help wanted Issues identified as good community contribution opportunities upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Sep 19, 2016
@bpasero bpasero changed the title Windows: Jump list misses files and folders Windows: Jump list misses files in the recent category when opened Sep 19, 2016
@bpasero
Copy link
Member Author

bpasero commented Sep 19, 2016

@JustinPealing the root cause of this issue is that we call setUserTasks from the electron API and this seems to disable the recent category. Fix is possible by using the new setJumpList API. Still, folders will not show up, but files.

@bpasero
Copy link
Member Author

bpasero commented Sep 19, 2016

Verification: right click on the task icon on Windows and see recent files showing up. Recent files are added e.g. by right click on a file and open with Code or by using the "File > Open File" dialog.

For folders: we show them as custom tasks.

@bpasero bpasero changed the title Windows: Jump list misses files in the recent category when opened Windows: Jump list misses files and folders in the recent category when opened Sep 23, 2016
bpasero added a commit that referenced this issue Sep 23, 2016
@bpasero
Copy link
Member Author

bpasero commented Sep 23, 2016

I pushed a change to add recent folders as custom tasks to the list as I am not able to make folders show natively. This is a good workaround imho, even though it is not 100% the same as letting Windows show folders in the recent category.

@octref
Copy link
Contributor

octref commented Sep 29, 2016

add recent folders as custom tasks to the list as I am not able to make folders show natively

It's showing up in Recent Folders, not under Tasks for me (which is nicer!).

image

@octref octref added the verified Verification succeeded label Sep 29, 2016
@bpasero
Copy link
Member Author

bpasero commented Sep 30, 2016

@octref yes I decided to put folders into their own category to simulate the behaviour of the explorer where files and folders are also separate. You say this should be changed?

@octref
Copy link
Contributor

octref commented Sep 30, 2016

@bpasero

Oh I thought by this

I pushed a change to add recent folders as custom tasks

You meant the folders would show up under the category "Tasks" in the screenshot above.
But now I understand the current "Recent Folders" are actually custom tasks.

@octref
Copy link
Contributor

octref commented Sep 30, 2016

Which is of course a good change. Only thing I'd say is to change the icons to folder icons if you could.

@bpasero
Copy link
Member Author

bpasero commented Sep 30, 2016

Yes, if someone can provide me with good looking folder icons, I can add them. @bgashler1 maybe? I think the format needs to be *.ico

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
9 participants