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

Auto hides tree view on startup #472

Closed
MrBlaise opened this issue Dec 29, 2016 · 14 comments
Closed

Auto hides tree view on startup #472

MrBlaise opened this issue Dec 29, 2016 · 14 comments
Assignees
Labels
bug Confirmed defect in package logic, deprecation notices, and PRs which fix them. consumers Issues related to monkey-patching of core packages prior to Atom consuming the new icon-service.

Comments

@MrBlaise
Copy link

I've updated to the latest file-icons (2.0.1) and strangely my tree view is hidden on startup.
I've disabled every package and it works, if I enable file-icons it will be hidden again. Very annoying since I use tree view all the time.

@Alhadis Alhadis self-assigned this Dec 29, 2016
@Alhadis
Copy link
Member

Alhadis commented Dec 29, 2016

On it.

@Alhadis Alhadis added the bug Confirmed defect in package logic, deprecation notices, and PRs which fix them. label Dec 29, 2016
@MrBlaise
Copy link
Author

Thanks for the quick response :) The latest version that works correctly is 1.7.25.

@Alhadis
Copy link
Member

Alhadis commented Dec 29, 2016

Could you please tell me your tree-view settings? :)

You can copy the current settings by running this in devtools:

copy(atom.config.get("tree-view"));

@MrBlaise
Copy link
Author

MrBlaise commented Dec 29, 2016

Sure, here it is.

{
  "hideIgnoredNames": true,
  "hideVcsIgnoredFiles": true,
  "squashDirectoryNames": false,
  "showOnRightSide": false,
  "sortFoldersBeforeFiles": true,
  "autoReveal": false,
  "focusOnReveal": true,
  "alwaysOpenExisting": false
}

@Alhadis
Copy link
Member

Alhadis commented Dec 29, 2016

Köszi! I'll look into this soon. =)

@Alhadis
Copy link
Member

Alhadis commented Dec 29, 2016

Okay, I still have no idea why this is happening, but this seems to do the trick:

diff --git a/lib/consumers/tree-view.js b/lib/consumers/tree-view.js
index 543970e..e144d5f 100644
--- a/lib/consumers/tree-view.js
+++ b/lib/consumers/tree-view.js
@@ -18,7 +18,18 @@ class TreeView{
 		this.disposables.add(
 			atom.packages.onDidActivatePackage(_=> this.checkPanes()),
 			atom.packages.onDidDeactivatePackage(_=> this.checkPanes()),
-			atom.packages.onDidActivateInitialPackages(_=> this.checkPanes()),
+			atom.packages.onDidActivateInitialPackages(() => {
+				
+				// [#472] HACK: Show the tree-view if it's not visible at startup.
+				const state = atom.packages.packageStates["tree-view"];
+				if((!state || state.attached) && !this.visible){
+					const workspace = atom.views.getView(atom.workspace);
+					setImmediate(() => atom.commands.dispatch(workspace, "tree-view:show"));
+					console.log("Fixed!");
+				}
+				
+				this.checkPanes();
+			}),
 			
 			this.onDidAttach(_=> {
 				this.entryElements = this.element[0].getElementsByClassName("entry");

Could you please test this to see if it works? :) The file to edit is lib/consumers/tree-view.js in the installed package's directory.

@Alhadis
Copy link
Member

Alhadis commented Dec 29, 2016

Actually, it looks like I'll be pushing out another patch release soon enough, so you'll be able to confirm then if this works or not. =)

@Alhadis
Copy link
Member

Alhadis commented Dec 29, 2016

@MrBlaise I've cut another patch... please let me know if you're still experiencing this, okay? Thank you!

@MrBlaise
Copy link
Author

@Alhadis Sadly the problem isn't fixed for me :/
I've tried it out on windows 10 and it works (it worked with 2.0.1 as well). But on Ubuntu 16.04 the problem is still present.

@Alhadis
Copy link
Member

Alhadis commented Dec 29, 2016

I have no way to test Ubuntu. :( I'm guessing it's an OS-specific matter...

I'll try and look into it later, but right now, Nuclide is top priority.

@Alhadis
Copy link
Member

Alhadis commented Jan 1, 2017

@MrBlaise I've submitted a PR to Atom's tree-view that proposes a more integrated solution (which I know they'll reject, since they'd probably want to keep their core code "pure").

Try cloning my branch locally and linking it with apm link (remember to run apm install in the cloned directory, too). See if that fixes this issue. =)

@MrBlaise
Copy link
Author

MrBlaise commented Jan 1, 2017

@Alhadis I was just going to do what you suggested, when I saw you released another patch 2.0.3 I've updated to that and now the tree view appears properly. I don't know what changed but it seems like it solved my problem as well :)

@Alhadis
Copy link
Member

Alhadis commented Jan 1, 2017

HAHA, I axed usage of Atom's default icon API. It was just dead weight. Didn't expect it would actually solve any issues... what does that tell ya, eh?

@MrBlaise
Copy link
Author

MrBlaise commented Jan 1, 2017

Yes I saw your PR to the atom repo regarding this API, I'm interested in their response :) Keep up the good work and thanks for this amazing package.

@Alhadis Alhadis added the consumers Issues related to monkey-patching of core packages prior to Atom consuming the new icon-service. label Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed defect in package logic, deprecation notices, and PRs which fix them. consumers Issues related to monkey-patching of core packages prior to Atom consuming the new icon-service.
Projects
None yet
Development

No branches or pull requests

2 participants