-
Notifications
You must be signed in to change notification settings - Fork 14
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
Make it easier to switch locales during development or QA testing #1316
Comments
Implemented in the commits. The docs for
@pixelzoom can you please review?
|
This is very nice. I especially like that I can run with a couple of locale, like
I don't see any problems.
I think I'd rather have a flag that's separate from |
I moved it out of Back to @pixelzoom, please close if all is well. Also, do we need a PSA or phetmarks checkbox for this? |
Looking good. Yes, ...
I also keep forgetting to run with |
How about also adding this to phetmarks for 'studio' mode? I'm doing most of my work in Studio these days, and it would be nice not to have to manually add the query parameters, or resort to changing |
Also want to point out that I keep typing |
In the commits, we renamed the query string and pass it through to all phet-io wrappers. However, not all phet-io wrappers forward their key events to sims (including studio), so this doesn't work at the moment. I tried: Index: js/studio-main.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/studio-main.ts b/js/studio-main.ts
--- a/js/studio-main.ts (revision 4bcb311e0d032d6be28a6b3ba30e6b49a3918c4c)
+++ b/js/studio-main.ts (date 1661878825971)
@@ -89,6 +89,7 @@
*/
phetioClient.launchSim( {
passThroughQueryParameters: true,
+ forwardZoomKeyboardEventsToSim: true,
queryString: 'phetioEmitAPIBaseline&phetioCreateArchetypes&phetioEmitHighFrequencyEvents=false&phetioEmitStates=true&phetioEmitStatesInterval=60',
onPhetioInitialized: function( phetioEngineElements: PhetioElementCreatedData[] ) { But then you cannot use ctrl +/- to zoom in and out on the studio frame. @zepumph and/or @jessegreenberg can you please advise? |
@zepumph said we can forward the key commands if the query parameter is on. See keyboardEventForwarding. |
For the exact same code snippet decontextualized, see https://stackoverflow.com/questions/45457271/forward-a-keydown-event-from-the-parent-window-to-an-iframe-that-contains-reveal |
Assigning to myself because I see some trouble in global event listeners. |
Ok. Committed above. In general I think it is nicer to have a single place where all global keyboard listeners are added (globalKeyStateTracker). This feels a bit more prudent to me. |
Thanks, it seems like it is working well. I also added an adapter that initializes it in phet-io wrappers when you have |
I believe I got everything set. It works in the state wrapper now, and could work in multi, or the unsupported mirror inputs and input-record-and-playback if we just added that function. Doesn't matter too much to me. Please review and fee free to close. |
Again, I need to prevent default so that ctrl + u doesn't open the source of the page in chrome. |
ctrl + shift + i is a very important shortcut for me (to open the dev tools) in chrome. So I made sure that we didn't have any other modifier keys presetn in addition to having ctrl. |
The changes look great, thanks! Closing. |
During phetsims/circuit-construction-kit-common#960 and related to phetsims/natural-selection#319 (comment) and #1302, during development we would like a better way to switch languages to test. It is difficult to show the preferences dialog to switch, or to run with studio to find the localeProperty in the tree.
Instead, let's add a query parameter that adds a keyboard shortcut to cycle through languages. I have a nice prototype I'll commit momentarily.
Notifying @pixelzoom and @zepumph and @jonathanolson since they have been working in this area.
The text was updated successfully, but these errors were encountered: