-
Notifications
You must be signed in to change notification settings - Fork 654
DYN-5965: introduce new string from nodes that accept numeric format specifiers #14369
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
Conversation
…ynamoDS#14344) * fixing mem leaks in progress * fix test and remove todo
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
UI Smoke TestsTest: success. 11 passed, 0 failed. |
@mjkkirschner @Jingyi-Wen color choice of the icon is a bit faded. Also green suggests good - when experimental should be neutral. Suggest switching to Blue here which is our "Informational" color. Also, styling of the hover tooltip is outdated @mjkkirschner |
@mjkkirschner could we also replace the Dynamo Icon in the Library with the Experimental one? |
can you give me an example tooltip to checkout that has the correct styling?
I can look into this - if it's easy will do it otherwise will file an improvement. I can change the color as long as I can find the info state color in the resource dictionary - @Jingyi-Wen any idea what else it's used for? |
actually, I don't think this such a great idea - we can control it from the feature flag, but I see two big downsides:
I will still evaluate how difficult it is to do technically, but it might benefit from ux thinking about it a bit more. @Jingyi-Wen - maybe we only swap it out if the icon is not the default... or perhaps communicating that the node is experimental is more important than the icon - I'm not sure how to make that call. |
@@ -8,6 +8,7 @@ namespace ProtoCore.Utils | |||
{ | |||
public static class StringUtils | |||
{ | |||
//TODO consider removing this option. It makes sharing harder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sort of looks similar to the scale factor setting issue where we have one in preferences and another setting in the workspace (graph), where the latter overrides the former. I would have suggested adding this format specifier at the graph level as well but I don't think that's needed if we're going to deprecate the old string nodes at some point.
doc/distrib/NodeHelpFiles/CoreNodeModels.FormattedStringFromArray.md
Outdated
Show resolved
Hide resolved
doc/distrib/NodeHelpFiles/CoreNodeModels.FormattedStringFromArray.md
Outdated
Show resolved
Hide resolved
@@ -104,8 +107,6 @@ public FormattedStringFromObject() : base("__ToStringFromObjectAndFormat") | |||
[OutPortTypes("string")] | |||
[IsDesignScriptCompatible] | |||
[AlsoKnownAs("DSCoreNodesUI.StringNodes.FromObject", "DSCoreNodesUI.FromObject")] | |||
[Obsolete("this node is obsolete, please use the version of string from _ with numeric format option")] | |||
[NodeDeprecated] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't we deprecating this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reasoning was as follows:
Since I am marking the new nodes experimental, I did not want to also mark the old nodes as obsolete (hiding them from the lib) - then it would not be clear to users how to proceed in a safe / future proof way.
I'd like to propose we follow this pattern when introducing new nodes (that replace existing ones) - if we are not so sure about the design.
- phase 1:
- Introduce new nodes as experimental.
- Old nodes are untouched.
- phase 2:
- gather feedback on experimental nodes.
- experimental nodes can be changed at any time.
- phase 3:
- experimental attribute is removed from new nodes.
- old nodes are marked obsolete
- phase 4:
- old nodes are removed in a major release.
@mjkkirschner I agree with this, experimental is more of a state instead of a symbol for the node itself. I'd suggest not swapping the icon in library |
@@ -2782,6 +2782,7 @@ static Dynamo.Properties.Resources.DescriptionResource1.get -> string | |||
static Dynamo.Properties.Resources.DirectoryNotFound.get -> string | |||
static Dynamo.Properties.Resources.DisplayEngineFailureMessageDescription.get -> string | |||
static Dynamo.Properties.Resources.DllLoadException.get -> string | |||
static Dynamo.Properties.Resources.DocsExperimentalPrefixMessage.get -> string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we still seeing these API analysis warnings in PRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected to see them but lately I've not been seeing them. I wonder if something changed. @avidit ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw them in the github build checks
@@ -641,7 +643,16 @@ public bool IsFrozenExplicitly | |||
return false; | |||
} | |||
} | |||
|
|||
[Experimental("NVM_ISEXPERIMENTAL_GLPYH")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the glyph need to be experimental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but it has to be public AFAK for wpf binding and was not sure we'd want to support it. Experimental experimental mode ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments and some questions. LGTM.
internal static readonly IEnumerable<string> InitialExperimentalLib_Namespaces = | ||
[ | ||
//TODO remove tsplines - it's no longer experimental. | ||
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.TSpline", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I thought I removed the TSpline feature flag check would be enough, I guess not..
@@ -145,7 +146,12 @@ public FunctionDescriptorParams() | |||
/// <summary> | |||
/// Indicates if the lacing strategy is disabled on the function | |||
/// </summary> | |||
public bool IsLacingDisabled { get; set; } | |||
public bool IsLacingDisabled { get; set; } | |||
//TODO - should this somehow contain more info - ExperimentalInfo{IsExperimental, ExperimentalMessage/url}?} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would the message be surfaced in your opinion if it exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of like how the underlying system.diagnostics.codeanalysis.experimental
attribute surfaces them. In this case it shows the errors in the errors tab of visual studio as compile time warnings and generates a url given a base url format and the experimental diagnostic id.
we could do something similar, show info states on nodes pointing to the docs browser, though it would be much more useful if you get a link to some dynamic documentation that we update, for example in the forum or primer.
For now I will just leave it as a TODO and file a follow-up to consider it.
see:
https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/experimental-overview
I think I have addressed all review comments, I will merge after I see a passing test result - at the moment a date time test is failing, I think @pinzart90 was trying to improve in another pr. |
Purpose
DYN-5965
DYN-6557
this PR does the following:
String From Object
andString From Array
nodes call internally.formatSpecifier
the nodes pass these specifiers down in the case of integer or double to string calls.String From Object And Format
andString From Array And Format
.DynamoPreferencesNumberFormat
as a special format that uses the preferences to set the specifier - maybe a simpler name for thisDYNFORMAT
? I am still on the fence about this.support all c# numeric specifiers:





a new experimental glyph is added - we also display this glyph on nodes that are in the experimental category in the preferences - this is done with namespace matching.
we use the standard dotnet
experimental
attribute to control the experimental state - we also have a tooltip explaining what this means. Package authors can use this and it integrates into c# - if someone tries to use an experimental API it is a compile time error and they need to explicitly disable the warning to compile their c# code.also add a bit of text to extended description of the node in the library.
extended docs for the new string format nodes are added and link to the super detailed c# docs.
TODO:
f6
which keeps the behavior consistent with the old nodes... though I think actuallyG
is a better default. It's what most users would expect IMODeclarations
Check these if you believe they are true
*.resx
filesRelease Notes
String From
nodes that allows control over format of generated string using format specifiers.DynamoPreferencesNumberFormat
. (this is currently undocumented) I'd like insight from team members and ux if it makes sense.system.diagnostics.codeanalysis.experimental
attribute https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.experimentalattribute?view=net-8.0 and will display a small experimental symbol on experimental nodes as well as adding some information to the description for these nodes.Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of