Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

"Restart in Safe Mode" #5078

Closed
njx opened this issue Sep 5, 2013 · 23 comments
Closed

"Restart in Safe Mode" #5078

njx opened this issue Sep 5, 2013 · 23 comments

Comments

@njx
Copy link
Contributor

njx commented Sep 5, 2013

I was thinking that it might be easy to add a menu item, "Debug > Restart in Safe Mode", that would reload Brackets with a URL parameter that tells Brackets not to load any non-default extensions. Might be useful for people who are having issues with Brackets to quickly determine whether it's really a Brackets issue or an extension issue, and it's easier than having them temporarily delete or move aside individual extensions. (Of course, once they've figured out that it is an extension issue, they'd still have to narrow it down, but it would be a quick way to know that the priority isn't as high for us to track it down.)

@ghost ghost assigned njx Sep 5, 2013
@bchintx
Copy link
Contributor

bchintx commented Sep 6, 2013

I like the idea, but could we pick a different name for this feature? Restarting in "Safe Mode" implies something completely different to a Windows user (ie. rebooting Windows into a new session with limited device drivers, startup services, etc), and this menu item might lead to confusion when a user first it.

@njx
Copy link
Contributor Author

njx commented Sep 6, 2013

Sure, we could be more specific ("Restart Without Extensions") -- I thought "Safe Mode" was a reasonable analogy, but it's probably not exactly the same since we would reopen the same project, keep all their prefs, etc.

@bchintx
Copy link
Contributor

bchintx commented Sep 6, 2013

"Restart Without Extensions" makes a lot of sense. Thanks!

@peterflynn
Copy link
Member

What do Chrome and/or Firefox call their equivalent modes (no plugins, no extensions)? Following their naming lead might make sense to web developers...

@lkcampbell
Copy link
Contributor

Firefox calls it Safe Mode. Chrome doesn't have this mode but the "tips and tricks" pages that simulate the action allude to Firefox's Safe Mode moniker as well.

Either sounds fine to me but I think "Restart Without Extensions" is more precise.

@lkcampbell
Copy link
Contributor

@njx, I'm going to take a shot at this one. I have been wanting this functionality for quite a while.

@redmunds
Copy link
Contributor

My concern is how does Brackets indicate that it is running in this "mode"? A user could leave brackets open for long enough to forget that they're in this mode.

Can an Extension be installed, updated, or removed in this mode? Seems like this should be disallowed, and Extension Manager should indicate this somehow. Are any other features affected?

Does shutdown/restart get Brackets out of this mode? If not, then how?

@lkcampbell
Copy link
Contributor

@redmunds, how about disabling the Extension Manager menu item and pulling the icon from the toolbar? If the user can't get to Extension Manager, all of those scenarios should be addressed and that would give two UI indications as well.

Yes, I would expect shutdown/restart to be the only way to get out of the mode.

@lkcampbell
Copy link
Contributor

Minor point, but since I am reusing the Reload Brackets functionality to create this new functionality, should we call it Reload Without Extensions? The main window never actually closes and restarts.

@redmunds
Copy link
Contributor

how about disabling the Extension Manager menu item and pulling the icon from the toolbar?

That's a good start. But have you ever stared at a disabled menu item and have no idea why it's disabled? Yeah, me too.

since I am reusing the Reload Brackets functionality to create this new functionality, should we call it Reload Without Extensions?

Sounds good. Might even want to say "Reload Without User Extensions" since default extensions should still be loaded.

@lkcampbell
Copy link
Contributor

I can remove the menu item instead of disabling it.

The thing is, though, the common scenario for using this tool has a pretty short lifespan. I typically discover a bug, move all of my extensions to the disabled folder, try to reproduce the bug, post the bug report, then move all of my extensions right back again. I spend very little time in Brackets without my extensions if I can help it.

Actually, my bigger current problem is the menu items that are added by the extensions are sticking around on the reload. I'm going to look into how to revert back to a default menu setting tomorrow.

@redmunds
Copy link
Contributor

I can remove the menu item instead of disabling it.

That doesn't solve the issue for me -- instead I'd be staring at the menu wondering where my favorite command went :) Disabling it is OK.

@lkcampbell
Copy link
Contributor

Issue #5210 makes extension menu clean up more difficult. It needs to be addressed before this functionality can be finished.

@lkcampbell
Copy link
Contributor

Assigning to myself since I am working on a fix.

@peterflynn
Copy link
Member

@lkcampbell Actually there's an even bigger issue here: extensions themselves may add menu items, and restarting via a reload will leave them there. To fix that properly I think we really need to implement https://trello.com/c/7eOfSdya/950-reload-brackets-safely-without-breaking-menu-bar.

As a side effect, that should also mean we wouldn't need to use removeMenu() to hide the Extension Manager menu item. (I think removeMenu() is still valuable for other uses cases -- e.g. extensions that want to replace a default menu item with their own version -- so no reason to stop PR #5217 or anything). But I also agree with Randy that hiding the menu item is confusing. I'd suggest we either disable it, or leave it enabled but show an explanatory error message when it's clicked.

@peterflynn
Copy link
Member

CC @gruehle & @JeffryBooher because of the native menu bar question/issue. (Actually -- does the dark shell fix the above user story already?)

@lkcampbell
Copy link
Contributor

@peterflynn, I'm not using removeMenu() to remove the Extension Manager menu item, I'm using it to remove the entire menu bar. That's why I need the getAllMenus() method as well, to iterate through all menus and remove them all. The Extension Manager menu item I just decided to disable. Easier than removing it.

My solution is to remove the entire menu bar just before reloading the Brackets window in "Without User Extensions" mode, essentially a clean slate menu bar. Then, on reload, the default menu code and the default extension code repopulates the menu bar again, effectively filtering out all user extension menu changes.

@JeffryBooher
Copy link
Contributor

@peterflynn I don't think the dark shell changes will fix the menu bar story and, if it does happen to fix part of the menu story, it would only be fixed on Windows.

@lkcampbell
Copy link
Contributor

@njx, final pull request to add this feature is submitted.

@lkcampbell
Copy link
Contributor

Update: after discussing the latest PR with @njx, there are still some other issues that need to be addressed before this feature can be added to Brackets.

  1. Mac menu dividers are disappearing and not coming back
  2. UrlParams has a bug and needs remove() and isEmpty() methods, and a unit test file.
  3. addIndicator() needs to be fixed (issue StatusBar.addIndicator() doesn't actually add the indicator #5682) so we can add a UI indicator in the status bar.

When these three issues are addressed, I will submit a new, clean PR for this feature.

@lkcampbell
Copy link
Contributor

Update:

  1. Disappearing Mac menu dividers: issue Cannot remove menu dividers on Mac #6300 posted and assigned to @redmunds.
  2. UrlParams bugs: Pull request Fix UrlParams parsing when URL has no parameters. Add remove() and isEmpty() methods. #6246 submitted.
  3. StatusBar.addIndicator() bug: Pull request Fixed status bar so it can add indicators to itself again #6304 submitted.

When these three issues are addressed, I will submit a new, clean PR for this feature.

@redmunds
Copy link
Contributor

redmunds commented Jan 4, 2014

FBNC back to @njx

@njx
Copy link
Contributor Author

njx commented Jan 9, 2014

Very cool - seems to work as expected. Thanks for sticking with this @lkcampbell! Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants