Skip to content

fix: Fix scalar variables not applying after re-selecting a part colored by a vector component - #162

Merged
LKasianAnsys merged 4 commits into
mainfrom
feat/3.5d-fix-color-by-vector-part
Oct 15, 2026
Merged

LKasianAnsys merged 4 commits into
mainfrom
feat/3.5d-fix-color-by-vector-part

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Addresses #23

Context

User story 3.5 (#23) of the remote rendering epic sees the variable ownership and color lookup table move from the client to the server. This PR fixes a pre-existing bug (described in the summary below) when coloring by a component of a vector or tensor variable.

To test:

  • start VISOR with a variable that has a vector variable
  • select a part and color by the vector variable (e.g. normals), and select one of the components (e.g. 'x').
  • with the same part selected, color by a scalar variable
  • success -> the scalar variable is correctly applied. fail -> unable to color by the scalar variable, or it does not apply the new color correctly on the mesh.

Copilot summary

This pull request addresses an issue where scalar variables were not being correctly applied after re-selecting a part that was previously colored by a vector component. The changes ensure that, upon re-selection, the correct variable component is chosen, defaulting to the first available option when necessary. The logic for resolving the displayed component was refactored and better tested, and new tests were added to verify the fix.

Bug fix:

  • Fixed the logic so that scalar variables are now correctly applied after re-selecting a part colored by a vector component, by ensuring the appropriate component option is chosen or defaulting to the first option if the previous selection is invalid. [1] [2] [3]

Refactoring and improved logic:

  • Extracted and documented logic for resolving the node's component ID into a new static method #resolveNodeComponentId in AggregateVariableInfo, improving clarity and maintainability.

Testing improvements:

  • Updated and expanded tests to verify that the component selection falls back to the first option when a displayed component is invalid, and to ensure no warnings are emitted in this case. [1] [2]
  • Added a new test to confirm that a scalar variable is correctly applied after re-selecting a part previously colored by a vector component.
  • Added test utilities for interacting with select elements in the UI, used in new and updated tests.

@github-actions github-actions Bot added test Work associated with testing added enhancement New feature or request labels Oct 7, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/3.5c-server-created-lut October 7, 2026 17:50
@github-actions github-actions Bot removed the test Work associated with testing label Oct 7, 2026
@LKasianAnsys LKasianAnsys changed the title feat: [Remote rendering 3.5d] Fix scalar variables not applying after re-selecting a part colored by a vector component fix: Fix scalar variables not applying after re-selecting a part colored by a vector component Oct 7, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5c-server-created-lut branch from af3d4d1 to 1b26164 Compare October 7, 2026 20:33
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5d-fix-color-by-vector-part branch from 9345a46 to baabf94 Compare October 7, 2026 20:43
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5c-server-created-lut branch from 1b26164 to 0c9b735 Compare October 7, 2026 21:33
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5d-fix-color-by-vector-part branch from 79460f0 to 37fb9ea Compare October 7, 2026 21:35
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review October 7, 2026 22:39
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5c-server-created-lut branch from 0c9b735 to 0189582 Compare October 13, 2026 16:39
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5d-fix-color-by-vector-part branch from bcfa019 to 12a0c39 Compare October 13, 2026 16:43
Base automatically changed from feat/3.5c-server-created-lut to main October 14, 2026 15:02
@github-actions github-actions Bot added test Work associated with testing and removed test Work associated with testing labels Oct 14, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.5d-fix-color-by-vector-part branch from a6db32a to 77a32cd Compare October 14, 2026 20:40

@ansBAkula ansBAkula left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tested and works. One small improvement (non functional): we could probably avoid showing the "Component" label and the associated dropdown showing up as "Magnitude" for scalar fields.

@LKasianAnsys
LKasianAnsys merged commit 0af6d0d into main Oct 15, 2026
15 checks passed
@LKasianAnsys
LKasianAnsys deleted the feat/3.5d-fix-color-by-vector-part branch October 15, 2026 13:11
@LKasianAnsys

Copy link
Copy Markdown
Collaborator Author

@ansBAkula Yes agreed, nice suggestion. I've added it as an issue (#156) under the UI work feature.

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

Labels

added enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants