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

Add debug items to View menu #48189

Merged
merged 2 commits into from
Dec 10, 2020
Merged

Add debug items to View menu #48189

merged 2 commits into from
Dec 10, 2020

Conversation

nsakaimbo
Copy link
Contributor

@nsakaimbo nsakaimbo commented Dec 9, 2020

Description

This PR adds the following debug/developer items to the View menu:

  • Reload
  • Force Reload (ignore cache)
  • Toggle Developer Tools

Enabling these items is triggered by the setting the environment variable WP_DESKTOP_DEBUG.

mac-debug-menu

To Test/Use

Start the application in the terminal using the command WP_DESKTOP_DEBUG=1 open path/to/WordPress.com.app and verify the debug menu items appear in the View menu.

@nsakaimbo nsakaimbo added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 9, 2020
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Base automatically changed from desktop/zoom-zoom to trunk December 10, 2020 00:46
Copy link
Member

@codebykat codebykat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that debug-menu.js predates this PR, but fwiw there's a defined Electron role for Dev Tools (toggleDevTools).

https://www.electronjs.org/docs/api/menu-item

We're not using it on the Simplenote side because I had to remove the shortcut due to a conflict.

Approving as the code looks good anyhow (I did not build the app)

@nsakaimbo
Copy link
Contributor Author

there's a defined Electron role for Dev Tools (toggleDevTools)

Huh - TIL. I went ahead and amended the debug menu to use the default roles provided by Electron (0b55329). Tested and confirmed they appear to work as expected (e.g. Chrome DevTools are opened against the currently active window, without having to code this up manually). Also force reload is pretty handy (which ignores the existing cache).

@nsakaimbo nsakaimbo changed the title Add debug items to Desktop View menu Feature: add debug items to View menu Dec 10, 2020
@nsakaimbo nsakaimbo changed the title Feature: add debug items to View menu Add debug items to View menu Dec 10, 2020
@nsakaimbo nsakaimbo merged commit e6530f9 into trunk Dec 10, 2020
@nsakaimbo nsakaimbo deleted the desktop/debug-menu branch December 10, 2020 21:55
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants