Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
436 stars 128 forks source link

[Feature] Add shortcut keys to theme dev #4830

Open EvilGenius13 opened 1 week ago

EvilGenius13 commented 1 week ago

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

WHY are these changes introduced?

Fixes https://github.com/Shopify/cli/issues/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:

Checklist

github-actions[bot] commented 1 week ago

Coverage report

St.:grey_question:
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 c9b76d3c441e87641099ca0034addeeb1b934d34