Skip to content

Conversation

ToMESSKa
Copy link
Contributor

@ToMESSKa ToMESSKa commented Sep 9, 2025

INSTUI-4683

ISSUE:

  • a prop is needed to disable the animation in TreeBrowser

TEST PLAN:

  • add animation={false} or animation={true} prop to the examples in the documentation
  • according to the props value, the animation should be disabled/enabled for the TreeBrowser when opening the elements
  • when no animation prop is supplied, the animation should be enabled

@ToMESSKa ToMESSKa self-assigned this Sep 9, 2025
Copy link

github-actions bot commented Sep 9, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-09-25 14:47 UTC

@ToMESSKa ToMESSKa requested review from HerrTopi and matyasf September 9, 2025 13:01
animationFillMode: 'forwards',
animationTimingFunction: 'ease-out',
animationDelay: '0.2s',
...(state.animation !== false && {
Copy link
Contributor

Choose a reason for hiding this comment

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

just a nitpic: you don't have to check with !==, since animation is a boolean itself. It would look better to use just the value itself: state.animation && {...

Another nitpic of mine is false && {} fill resolve to false. Even so spreading false into an object works for some reason (that's js for you :D ) it doesn't make much sense. You could write these expressions like:

Suggested change
...(state.animation !== false && {
...(state.animation ? {<animation code>} : {}

This way it is clearly stated what you indend in both branches

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@HerrTopi thanks, I made the changes you suggested

animationDuration: '0.2s',
animationFillMode: 'forwards',
animationTimingFunction: 'ease-out',
...(state.animation !== false && {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as prev comments

@ToMESSKa ToMESSKa force-pushed the INSTUI-4683-add-prop-to-disable-animations-in-tree-browser branch from db13291 to 9a3e3ec Compare September 16, 2025 07:33
@ToMESSKa ToMESSKa requested a review from HerrTopi September 16, 2025 07:49
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

looks good, just 1 small change

* @module
*/
const TreeBrowserContext = createContext<TreeBrowserContextType>({
animation: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be true for that very edge case if someone uses these components outside of a TreeBrowser

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matyasf thanks, I fixed that.

@ToMESSKa ToMESSKa force-pushed the INSTUI-4683-add-prop-to-disable-animations-in-tree-browser branch from 9a3e3ec to 6bb7a8e Compare September 17, 2025 15:16
@ToMESSKa ToMESSKa requested a review from matyasf September 17, 2025 15:31
@ToMESSKa ToMESSKa merged commit 5906a0a into master Sep 25, 2025
11 checks passed
@ToMESSKa ToMESSKa deleted the INSTUI-4683-add-prop-to-disable-animations-in-tree-browser branch September 25, 2025 14:46
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.

3 participants