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

[Feature] Add shortcut keys to theme dev #4830

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EvilGenius13
Copy link
Contributor

Do you suffer from long logs? Do you accidentally close your browser window and have to scroll all the way up in your terminal to find the theme dev links? Look no further than the addition of shortcut keys!

Feedback before official PR

  • Are there any issues with the way I implemented the shortcut keys / listener
  • I added documentation for each shortcut using the renderLinks method but I don't particularly like the way it looks. EX:
    The render in the terminal normally looks like Customize your theme at the theme editor but is now Customize your theme at the theme editor - shortcut key "e"
  • Any general feedback on this is welcome

WHY are these changes introduced?

Fixes #4713

With the amount of logs theme dev generates, it can be difficult to find the original store links such as previewing your theme, or opening the theme editor. Having shortcut keys is a simple way to open the links without needing to physically click on them in the terminal.

WHAT is this pull request doing?

Add shortcut keys to the theme dev command
We look for keypresses, specifically:
t - opens the theme locally
e - opens the theme editor
p - opens the share preview
we also look for ctrl + c to exit the process

How to test your changes?

Pull down the branch
Build the branch
Run the theme dev command
Try out the shortcut keys. Click some links, save some files, and see that it does not affect anything else running, ctrl+c out to confirm you can exit the same as before.

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

This commit adds shortcut keys to the theme dev CLI service. The keys are as follows:
e - open theme editor
t - preview your theme locally
p - preview your theme (share)
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
71.78% (+0.01% 🔼)
8459/11784
🟡 Branches
68.24% (+0.02% 🔼)
4104/6014
🟡 Functions 71.31% 2220/3113
🟡 Lines
72.25% (+0.01% 🔼)
8000/11073

Test suite run success

1917 tests passing in 870 suites.

Report generated by 🧪jest coverage report action from c9b76d3

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.

[Feature]: Shopify Theme Dev Shortcuts
1 participant