feat/841: add optional codemod and flag for enabling animations#843
Merged
Conversation
Signed-off-by: gitdallas <5322142+gitdallas@users.noreply.github.com>
dlabaj
approved these changes
Jul 8, 2025
Comment on lines
+17
to
+49
| In: | ||
|
|
||
| ```jsx | ||
| import { AlertGroup, TreeView } from '@patternfly/react-core'; | ||
| import { Table } from '@patternfly/react-table'; | ||
|
|
||
| export const Example = () => ( | ||
| <> | ||
| <AlertGroup isLiveRegion> | ||
| {/* alerts */} | ||
| </AlertGroup> | ||
| <TreeView /> | ||
| <Table /> | ||
| </> | ||
| ); | ||
| ``` | ||
|
|
||
| Out: | ||
|
|
||
| ```jsx | ||
| import { AlertGroup, TreeView } from '@patternfly/react-core'; | ||
| import { Table } from '@patternfly/react-table'; | ||
|
|
||
| export const Example = () => ( | ||
| <> | ||
| <AlertGroup hasAnimations isLiveRegion> | ||
| {/* alerts */} | ||
| </AlertGroup> | ||
| <TreeView hasAnimations /> | ||
| <Table hasAnimations /> | ||
| </> | ||
| ); | ||
| ``` No newline at end of file |
Collaborator
There was a problem hiding this comment.
Nit: if you put in
In:
```jsx
%inputExample%
```
Out:
```jsx
%outputExample%
```
my readme builder will insert the content of the *Input and *Output tsx files into the compiled readme
Collaborator
thatblindgeye
left a comment
There was a problem hiding this comment.
Some of this I'm not sure if we need to link t some release documentation or some of our examples that have been updated to include these animations, but some stuff that we would either need to or would be good to update/expand on:
- AlertGroup: idk if we need the callout here or maybe in release highlights (I can mention this in Erin's PR for that too), but enabling animations has a chance to break tests depending if consumers have any/how they're setup. This is due to how using animations tweaks when/how some callbacks are actually called.
- DualListSelector animations are only applicable when
isTreeprop is true, otherwise thehasAnimationsprop shouldn't be passed in. - Table: there might be more of a lfit from consumers to have the "correct" structure for animations to work correctly. We can still add the hasAnimations prop fine, but depending how they're structuring their table they may have to look at our examples (and their changes since enabling animations) to get them working as expected. PR 11865 shows the changes just we had to do in our examples for animations
Also maybe worth updating the rule README to mention that some components' DOM structure will change when animations are enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #841