Skip to content

DYN-6228 Light theme supported - #17342

Open
edwin-vasquez-ucaldas wants to merge 16 commits into
masterfrom
DYN-6228_light_theme_supported
Open

edwin-vasquez-ucaldas wants to merge 16 commits into
masterfrom
DYN-6228_light_theme_supported

Conversation

@edwin-vasquez-ucaldas

@edwin-vasquez-ucaldas edwin-vasquez-ucaldas commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Aaron Tang: the legacy 2.12 look is not the deliverable. "User confirmed that she need light theme, not necessarily the legacy theme." So this is scoped as a light theme, not a 2.12 revival.
JT Pierson's comment carries the agreed plan. Its core findings: there is no theming system to lean on — just 13 loose XAML dictionaries under UI\Themes\Modern, loaded once at startup, with ~1000 inline hex literals across src/ and ~200 hardcoded brushes in C#. It offers three options and recommends Option A: "Light theme (restart required)", colors only.

Declarations

Check these if you believe they are true

Release Notes

There was no theming system. What existed:

  • 13 loose XAML dictionaries under UI\Themes\Modern\, shipped as files (CopyToOutputDirectory=Always), loaded once at startup.
  • SharedDictionaryManager.ThemesDirectory — a file-system path hardcoded to UI\Themes\Modern\. Every dictionary URI derived from it. This one property was the hook.
  • No App.xaml and no Application.Current.Resources. 66 XAML files merge the dictionaries individually via SharedResourceDictionary, which caches by URI in a public static dictionary.
  • PreferenceSettings had no theme/appearance property.
  • Colours were not centralised. DynamoColorsAndBrushes.xaml was one of at least four sources:
    DynamoModern.xaml (~6700 lines, hundreds of inline hex literals), converter properties with baked-in literals, ~200 hardcoded brushes across ~54 C# files, and an embedded .xshd.

Theme selection

Piece Location
enum DynamoTheme { Dark, Light } src/DynamoCore/Configuration/DynamoTheme.cs (no WPF dependency, so DynamoCore stays cross-platform)
PreferenceSettings.Theme Defaults to Dark; serialises to DynamoSettings.xml like DefaultRunType
SharedDictionaryManager.CurrentTheme src/DynamoCoreWpf/UI/SharedResourceDictionary.cs
Startup assignment DynamoViewModel(StartConfiguration), immediately after the model is assigned
Preferences UI Visual Settings → Display Settings → Theme dropdown (row 0)

Two deliberate design points:

  • Dark maps to the folder name Modern. Renaming the folder would break the ~66 XAML merge sites and any package referencing them.
  • CurrentTheme must be set before the first view is constructed. SharedResourceDictionary caches every dictionary by URI, and the codebase resolves colours almost entirely through StaticResource. Assigning it later leaves the UI with a mix of both themes. This constraint is documented on the property; treat it as startup-only configuration.

Surfaces converted

Each row lists the role-named key(s) introduced and the consumer moved onto them. All base values
were kept identical, so the dark theme is unchanged unless noted.

Surface Keys Consumer
Canvas backdrop existing WorkspaceBackgroundBrush DynamoView.xaml — was a hardcoded #232323
Node body / header NodeBodyBackgroundBrush, NodeHeaderBackgroundBrush NodeView.xaml.cs — was DarkerGrey / DarkMidGrey
Wires Connector{None,Selection,Hover,ExecutionPreview,Transient} (Color and Brush) DynamoConverters.xaml — literals baked into converter properties
Port text PortLabelForegroundBrush InPorts.xaml.cs, OutPorts.xaml.cs — was PrimaryCharcoal200Brush
Port pill PortBackgroundBrush, PortBackgroundPreviewOffBrush, PortBorderBrush PortViewModel.cs — was Color.FromRgb(...)
Port value markers PortValueMarker{Default,Blue,Red,Grey}Brush, PortKeepListStructureBorderBrush InPortViewModel.cs, OutPortViewModel.cs
Node inputs NodeInput{Background,Border,Foreground,SecondaryForeground,LabelForeground,Caret,Highlight}Brush DynamoTextBox.cs, DynamoSlider.xaml, DateTimeInputControl.xaml
Slider NodeSliderThumbBrush, NodeSliderTrackBrush DynamoSlider.xaml
Code block editor CodeEditor{Background,Foreground,LineNumbers,Border,Number,Class,Method,Link}Brush CodeCompletionEditor.xaml, CodeBlockEditorUtils.cs
Canvas context menus NodeContextMenu{Foreground,ForegroundHighlight,Background,BackgroundHighlight,SeparatorColor,AccentBrush} NodeView.xaml.cs, WorkspaceView.xaml, AnnotationView.xaml.cs, ContextMenuItemStyle
In-canvas search box InCanvasSearch{Background,Border,Foreground,Placeholder,Caret,Accent}Brush IncanvasSearchControl.xaml — was borrowing library keys plus two literals

Evidence

DYN-6228

Reviewers

@jasonstratton @RobertGlobant20

@jnealb

FYIs

@johnpierson

Copilot AI lite review requested due to automatic review settings September 21, 2026 23:07

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-6228

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

static InPorts()
{
_primaryCharcoal200Brush.Freeze();
_portLabelForegroundBrush.Freeze();
static OutPorts()
{
_primaryCharcoal200Brush.Freeze();
_portLabelForegroundBrush.Freeze();
private static Color GetThemedColor(string resourceKey)
{
var brush = SharedDictionaryManager.DynamoColorsAndBrushesDictionary[resourceKey] as SolidColorBrush;
return brush.Color;
_primaryCharcoal300.Freeze();
_midGreyBrush.Freeze();
_blue300Brush.Freeze();
_nodeContextMenuAccent.Freeze();
_nodeContextMenuBackgroundHighlight.Freeze();
_nodeContextMenuBackground.Freeze();
_nodeContextMenuForeground.Freeze();
_nodeContextMenuForegroundHighlight.Freeze();
midGrey.Freeze();
darkerGreyBrush.Freeze();
darkMidGreyBrush.Freeze();
nodeBodyBackgroundBrush.Freeze();
darkerGreyBrush.Freeze();
darkMidGreyBrush.Freeze();
nodeBodyBackgroundBrush.Freeze();
nodeHeaderBackgroundBrush.Freeze();
darkMidGreyBrush.Freeze();
nodeBodyBackgroundBrush.Freeze();
nodeHeaderBackgroundBrush.Freeze();
nodeContextMenuForeground.Freeze();
nodeBodyBackgroundBrush.Freeze();
nodeHeaderBackgroundBrush.Freeze();
nodeContextMenuForeground.Freeze();
nodeContextMenuForegroundHighlight.Freeze();
nodeHeaderBackgroundBrush.Freeze();
nodeContextMenuForeground.Freeze();
nodeContextMenuForegroundHighlight.Freeze();
nodeContextMenuBackground.Freeze();

@jasonstratton jasonstratton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Approved!

@edwin-vasquez-ucaldas , Just one thing:

PreferencesViewModel.cs uses Res.ResourceManager.GetString("PreferencesViewThemeDark", CultureInfo.CurrentUICulture) in a few spots instead of the generated Res.PreferencesViewThemeDark property everywhere else in the same file

While there is nothing really wrong with this, I wonder about the inconsistency. No need to change anything though. Just bringing it to your attention.

Looks like Dynamo SelfServe failed and you may need an update to retrigger the PR checks. I think it may be a merge conflict.

@johnpierson

Copy link
Copy Markdown
Member

Curious what the graph mapper (or is it called curve mapper) node looks like,

@johnpierson

Copy link
Copy Markdown
Member

There seems to be some weird cases
image

@johnpierson

Copy link
Copy Markdown
Member
image

@johnpierson johnpierson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

currently working through a full audit, with changes requested to come.

@johnpierson

Copy link
Copy Markdown
Member

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://autodesk.atlassian.net/browse/DYN-6228

@edwin-vasquez-ucaldas

Copy link
Copy Markdown
Contributor Author

@johnpierson some updates regarding the Audit document.

1. Fixed
image

2. Fixed
image

3. Fixed
image

4. I was not able to reproduce the same as audit reported, however include an improvement
image

5. Partial Fixed, the icons look choppy.
image

6. Fixed
image

7. Fixed
image

8. Fixed
image

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants