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

Gpii 4207 Updates to default values and some settings that were missing #824

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

sgithens
Copy link
Member

@sgithens sgithens commented Nov 1, 2019

This contains sluething from testing results on the latest capture tool build.

@the-t-in-rtf Could you take a look at the JAWS settings I added? I did it all based on just toggling them in the JAWS UI and then looking at what changed in DEFAULT.JCF. Some of the bit mask fields obviously shouldn't be strings, but they seem to be just consistent repeats of the same number in each field so it seems like they should work for now.

- Adding temporary notes on some settings during investigation
- Fixing some ranges and default values on settings that are
  straight forward.
@gpii-bot
Copy link

gpii-bot commented Nov 1, 2019

CI job passed: https://ci.gpii.net/job/universal-tests/1967/

@gpii-bot
Copy link

gpii-bot commented Nov 4, 2019

CI job passed: https://ci.gpii.net/job/universal-tests/1969/

"type": "string",
"default": "1|1|1|Access Key",
"enum": [
"0|0|0|Access Key",
Copy link
Member

Choose a reason for hiding this comment

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

Is this literally what's stored in the settings file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, it's the actual string, of three matching numbers and the label separated by pipes. I just copied them straight from the .ini file format after saving the dialog with different options. It's admittedly pretty wonky.

Copy link
Member

Choose a reason for hiding this comment

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

As long as we're clear with Gregg that we can only really handle them as enums for now, it doesn't matter how funny they get. They can use the table flipping ascii image as "false" for all we care.

Copy link
Member Author

Choose a reason for hiding this comment

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

@the-t-in-rtf I think it's ok. It is an enum, so this odd string isn't showing up in any of the user facing tools.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, if all of these are the literal values that are expected to be written to the INI file, then I'm fine. Just wanted to confirm as with the others.

"type": "string",
"default": "1|1|1|Tutor",
"enum": [
"0|0|0|Tutor",
Copy link
Member

Choose a reason for hiding this comment

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

Same question here, is the literal value 0 here or the string you've put here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, same as above, this is the actual odd string value that shows up in the ini formatted settings.

// Control Panel UI GPII Capture
// low: 100 5000
// high: 500 1000 (yes it's inverse)
// default: 300 3000
"Acceleration": {
"schema": {
"title": "Mouse keys acceleration",
"description": "Acceleration of mouse keys",
"type": "number",
Copy link
Member

Choose a reason for hiding this comment

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

All the examples make it seem like this should be type integer instead of number?

Copy link
Member Author

Choose a reason for hiding this comment

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

That seems like it would be correct. Have updated it to integer

@@ -6743,6 +6840,7 @@
"schema": {
"title": "Video audio description",
"description": "Hear descriptions of what's happening in videos",
// GPII-4207 Test to see if this `default` is getting cast correctly
Copy link
Member

Choose a reason for hiding this comment

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

You are right to flag all of these with TODOs. Previously we have used an imprecise mix of truthy and falsy stuff to represent values like these, there was a lot of it previously in the JAWS settings as well. Until we come up with our own means of standardising these (for example, intra-application settings transforms), we should put the literal value the settings handler needs to read and write the correct value. We can get away with using booleans, which do cast to strings, but really need to be careful about representing ones and zeros in schemas as booleans.

@gpii-bot
Copy link

gpii-bot commented Nov 4, 2019

CI job passed: https://ci.gpii.net/job/universal-tests/1971/

@gpii-bot
Copy link

gpii-bot commented Nov 7, 2019

CI job passed: https://ci.gpii.net/job/universal-tests/1978/

@gpii-bot
Copy link

CI job passed: https://ci.gpii.net/job/universal-tests/2004/

* }
* ```
*/
gpii.universal.solutionsRegistry.findDefaultValue = function (schema) {
Copy link
Member

Choose a reason for hiding this comment

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

It's helpful, but it is not used by anything in the codebase - does it belong in the capture tool instead?
Also note that the one place where we do fetch setting defaults, we do not use this approach - https://github.com/GPII/universal/blob/master/gpii/node_modules/flowManager/src/PSPChannel.js#L139 - instead, we read the value from build/schemas/solution-schema-codex.json . What do you think, @cindyli , @the-t-in-rtf ?

Copy link
Member

Choose a reason for hiding this comment

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

I was confused as to where and why you'd use this, but then I looked at some of the deeper structures like the SPI settings here:

// TODO: Discuss somehow simplifying the structure of SPI settings for easier UI input.

I guess my questions are, what do you expect to do with this potential "deep default" and why do you preserve the "type" but not anything else? If you're putting up controls or anything else, you don't have enough information to create controls. You don't know the range any longer, you don't know if the field is required, et cetera. If you're getting that info somewhere else, why not get the type from there as well?

Also, your code is focused on the value property, there are others, like this object that has RGB properties. How do you plan to handle those?

It seems to me like you need proper handling for nested properties, and this type of recursion should be possible in both javascript and handlebars templates. But maybe I just don't get what you're doing, and an example of what you're feeding into this and where you use it would help. Apologies if you've already covered that in the longer conversation.

I also am not sure this belongs in this particular part of the Solutions Registry. The use case would help confirm, but if it's truly about UI generation, it seems like this would be an early utility that would make up part of the "presentation registry" instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

@amb26 Well, it's first use is the capture tool (and I've already temporarily duplicated it there), but it will all need to be used in the PPT, Morphic Vaults and other user facing applications build on top of universal. Quite a number of our UX specs at some point highlight what the default value of a particular setting is.

Also, regardless of the input, whether it's from win32.json or from solution-schema-codex.json, I believe we have the same problems. (and this impl I believe should still work if you pass in the corresponding property/schema either way. Here is a section from my locally generated solution-schema-codex.json:

       "SlowKeysInterval": {
        "title": "Slow keys interval",
        "description": "Slow keys interval time in milliseconds",
        "properties": {
          "path": {
            "type": "string",
            "required": true
          },
          "value": {
            "required": true,
            "type": "integer",
            "minimum": 0,
            "maximum": 20000,
            "default": 1000
          }
        }
      },
      "BounceKeysInterval": {
        "title": "Bounce keys interval",
        "description": "Bounce keys interval time in milliseconds",
        "type": "integer",
        "default": 0
      }

Here, you can see that the default is at the top level for BounceKeysInterval, and then for SlowKeysInterval you need to drill down a level to get the default value.

Copy link
Member Author

Choose a reason for hiding this comment

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

@the-t-in-rtf An example of what I'm doing with the default value (regardless of whether it's in the top level of the items schema, or further down), is here in the capture tool where you can filter values on and off, depending if they match the default:

image

In the PPT, on the tables that show settings for each solution there is a column for the default.

Current I'm just preserving type because it's the amount of information I need to build these UI's (maybe not a great answer, but the truth). I just need the default, and it's type so I can compare them. I've haven't yet dealt with RGB values or anything, as the comments on the method allude to, I'm trying to knock out the largest number of settings at the moment that show up on these UI's with the simplest solution so far.

I'm ok with it being anywhere in universal, but it would be nice to have it in at least one of our most central repos... at the moment every one of our user facing projects still includes universal. Also, I can imagine a time soon where this default value information would be needed to create some time of data feed endpoint in universal.

Copy link
Member

Choose a reason for hiding this comment

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

I still don't understand why you can't just use the schema in its entirety. We should discuss in the meeting today.

// "default": "%SystemRoot%\\Web\\Wallpaper\\Windows\\img0.jpg"
// }
// }
else if (schema.properties && schema.properties.value && schema.properties.value["default"] !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a great place to use fluid.get.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, updated to use fluid.get

@gpii-bot
Copy link

gpii-bot commented Feb 3, 2020

CI job passed: https://ci.gpii.net/job/universal-tests/2125/

@amb26
Copy link
Member

amb26 commented May 5, 2020

Should be merged up to resolve some conflicts - does the capture work depend on this?

"MaxSpeed": {
"schema": {
"title": "Mouse keys speed",
"description": "Speed of mouse keys",
"type": "number",
"multipleOf": 10
"multipleOf": 10,
"default": 80
Copy link
Member

Choose a reason for hiding this comment

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

Awesome, very good use of the capture tool to fill these in.

}
}
}
},
// GPII-4207 This default looks correct... it probably isn't getting casted to
Copy link
Member

Choose a reason for hiding this comment

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

"cast"

// In the current Windows 10 UI this goes from 0.0 seconds
// to 20.0 seconds in somewhat random steps in a combo box:
// 0.0, 0.3, 0.5, 0.7, 1.0, 1.4, 2.0, 5.0, 10.0, 20.0
// TODO try manually setting a differnet value under the covers,
Copy link
Member

Choose a reason for hiding this comment

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

"different"

@@ -4803,7 +4884,7 @@
]
},
"com.microsoft.windows.desktopBackground": {
"name": "Windows desktop background personalization",
"name": "Windows desktop background wallpaper",
Copy link
Member

Choose a reason for hiding this comment

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

Bless you for updating the wording on these.

@@ -7117,6 +7212,7 @@
"title": "Keyboard as preferred input method",
"description": "Set the keyboard as the preferred input method",
"type": "boolean",
// GPII-4207 This is coming out of the capture as 0 rather than false... TODO
Copy link
Member

Choose a reason for hiding this comment

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

I suspect there is some leftover sloppiness around truthy and falsy values that we'll need to pin down somehow, ideally when we have "intra-application settings" and can more easily have a user-facing true/false setting that is transformed to a 1/0 for a settings-handler specific setting.

@the-t-in-rtf
Copy link
Member

the-t-in-rtf commented May 7, 2020

I had a quick look and didn't see anything troubling, it's really only the upstream conflicts that need to be addressed from what I can see. Everything else is the same since February.

@sgithens
Copy link
Member Author

sgithens commented May 8, 2020

Hi @the-t-in-rtf @kaspermarkus I went back through this again, and I think the parts of this that are absolutely required for the capture tool (1.3.5) have been addressed in other tickets. It would still be good for me to clean these up, and keep it tagged as 1.3.x, but we can remove the 1.3.5 label from this I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants