-
Notifications
You must be signed in to change notification settings - Fork 3
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
Instrument PatternStringProperty and DerivedProperty for strings that need to be autoselectable in Studio. #235
Comments
Not that we also need to address DerivedProperty. As soon as I started working on this, I hit a PhET-iO design issue that we have not discussed. This sim has derived static strings, like these in DomainChartNode.ts: const DEFAULT_X_SPACE_LABEL_PROPERTY = new PatternStringProperty( FourierMakingWavesStrings.symbolUnitsStringProperty, {
symbol: FMWSymbols.xStringProperty,
units: FourierMakingWavesStrings.units.metersStringProperty
}, { tandem: Tandem.OPT_OUT } );
const DEFAULT_X_TIME_LABEL_PROPERTY = new PatternStringProperty( FourierMakingWavesStrings.symbolUnitsStringProperty, {
symbol: FMWSymbols.tStringProperty,
units: FourierMakingWavesStrings.units.millisecondsStringProperty
}, { tandem: Tandem.OPT_OUT } ); Because they are static, they don't belong under any specific view element in the Studio tree. Like the string in FourierMakingWavesStrings.ts, they are used for multiple elements. So where should they live in the Studio tree? Should they be under This situation is not unique to this sim, and should be standardized. @arouinfar @zepumph @samreid opinions? |
@arouinfar and I discussed this. We're going to try putting global instances of
This will put them in the same part of the tree as generated (translated) string Properties, but differentiate them by grouping them under Again, what we do here will become the convention for all sims. So please weigh in if you have objections or other ideas. |
…covery in Studio via Option key, #235
I'm at a point where I think @arouinfar should have a look at the Studio tree, then we should discuss. Please:
Notes about naming conventions that I used:
|
I commented in https://github.com/phetsims/studio/issues/305#issuecomment-1581539777, but worth repeating here:
|
Are there some cases where these won't technically be derived? Perhaps a symbol or something that we would still want to instrument, though it isn't translatable? Would it be acceptable to put something like |
I'm not entirely clear on what you're asking or suggesting here. There are definitely strings (typically symbols) that are not translatable, have no associated string Property, and therefore will not be autoselectable. For example, these in FMWSymbols.ts: infinityMarkup: MathSymbolFont.getRichTextMarkup( '\u221e', 'normal' ),
// integration symbol
integralMarkup: MathSymbolFont.getRichTextMarkup( '\u222B', 'normal' ),
// pi
piMarkup: MathSymbolFont.getRichTextMarkup( '\u03c0', 'normal' ),
// summation symbol
sigmaMarkup: MathSymbolFont.getRichTextMarkup( '\u03a3', 'normal' ) And then there are strings in MathSymbols -- EQUAL_TO, MINUS, etc. @zepumph Are you suggesting that we should create Properties for these, so that they are autoselectable? I think we need another meeting about autoselect. Because our decision to make all strings in the UI autoselectable is (in practice) resulting in a large amount of work. |
I definitely missed the point in #235 (comment). Sorry about that. I am now up to speed and not recommending any changes.
No I'm not at all. I was trying to think of a possible example where we would have something instrumented, that needs to go into the model strings, but isn't derived. Should we continue with #235 (comment) now. |
Yes. I said:
I think we need to do this too. But I'm not sure how to proceed. A new issue? Schedule a meeting? MK: I added this to the phet-io meeting agenda. |
Raising the priority of this. Deciding where to put these strings is a prerequisite for completing phetsims/tandem#298. And phetsims/graphing-quadratics#176 (schedule for 6/9-29 iteration) also requires this. |
Since what remains here is a design issue, I'm going to unassign everyone except @arouinfar. @zepumph thank you for your input above. @samreid if you have any input, please comment. |
@arouinfar and I had a Zoom call about this. Conclusions:
|
In the above commit, I used DerivedStringProperty (from https://github.com/phetsims/phet-io/issues/1943) for derived strings. I identified these by searching for |
Next (final?) step is to decide whether to uninstrument any of the PatternStringProperty or DerivedStringProperty instances. @arouinfar and I suspect that we should uninstrument some (many?) of them. But since they serve as examples, I'll leave them "as is" until we can discuss this topic in PhET-iO meeting. |
What I heard in today's PhET-iO meeting about autoselect was that it's OK if all UI strings are not autoselectable -- see https://github.com/phetsims/studio/issues/305#issuecomment-1591658247. So I think that we should reconsider the derived strings that were added to this sim, and uninstrument many (most?) of them. Fourier is similar to Graphing Quadratic -- they both have a lot of math symbols that are wrapped in markup, and therefore deeply-nested derives strings. So I'll wait to see what @arouinfar has to say about phetsims/graphing-quadratics#186 before removing any instrumentation in Fourier. |
Discussed during PhET-iO meeting today, and we updated the technical guide to the same effect that @pixelzoom's sentiment reflects above. https://github.com/phetsims/phet-io/commit/6444524780372bf3004e1861398950f73ce89b50 Marking off hold. |
My understanding from today's meeting was that @arouinfar was going to test-drive graphing-quadratics and fourier before I make changes here. So this remains on hold until phetsims/graphing-quadratics#186 is closed. |
Actually, forget I ever said that. If we keep this, we need to keep all the related dependencies, which will add up. If this string was truly important, I'd cover it in examples.md. But it's not, and I won't. @pixelzoom please proceed with uninstrumenting all pattern and derived string properties. |
Thanks @arouinfar, will do. |
In the above commit, I uninstrumented derived strings that I do not think are useful. The end result is a much smaller number of elements under The above elements are the symbols descriptions in the "Info" dialogs for the first 2 screens. While their dependencies do not have a link to the associated symbol's string Property, they do link to the description of the symbol --- and this is most likely what they might want to change. The only other derived strings that exist are the descriptions of each game level, and the message that appears in the status bar for each game level. For example, for Level 3: @arouinfar please test drive. If this feels OK, please close. And I'm sure this will get a closer look when this sim is someday "PhET-iO designed". |
Thanks @pixelzoom I think you found a really good compromise. We no longer have the nested dependencies problem. The derived strings section is much easier to navigate now, and the portion of the string that people likely want to edit is easily accessible. Closing. |
From https://github.com/phetsims/phet-io/issues/1942, I passed some tandems through but mostly
Tandem.OPT_OUT
s, please review this sim's instrumentation of PatternStringProperties in correlation to this sims' phet-io priorities. In general all PatternStringProperties should be instrumented unless they are just symbols or patterns that aren't for i18n purposes.The text was updated successfully, but these errors were encountered: