Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

DEVPROD-1647 Add animation to details button when details menu items are changed. #424

Merged
merged 14 commits into from
Nov 14, 2023

Conversation

khelif96
Copy link
Collaborator

DEVPROD-1647

Description

Adds an animation to the details menu item when ever the search range is changed.

Screenshots

Screen.Recording.2023-10-31.at.3.52.37.PM.mov

Testing

Copy link

cypress bot commented Oct 31, 2023

Passing run #4020 ↗︎

0 124 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Wait for 2 updates
Project: Parsley Commit: 5487ee9f48
Status: Passed Duration: 03:50 💡
Started: Nov 14, 2023 2:53 PM Ended: Nov 14, 2023 2:57 PM

Review all test suite changes for PR #424 ↗︎

@khelif96 khelif96 requested a review from a team November 1, 2023 19:05
Copy link
Collaborator

@sophstad sophstad left a comment

Choose a reason for hiding this comment

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

Looks very cool 😎

Copy link
Collaborator

@sophstad sophstad left a comment

Choose a reason for hiding this comment

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

Oops I take it back! The animation still applies when a user manually changes the range which seems a bit aggressive.

@khelif96
Copy link
Collaborator Author

khelif96 commented Nov 6, 2023

Oops I take it back! The animation still applies when a user manually changes the range which seems a bit aggressive.

Good call!

@khelif96 khelif96 requested a review from sophstad November 6, 2023 20:58
Copy link
Collaborator

@sophstad sophstad left a comment

Choose a reason for hiding this comment

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

It seems like the animation also applies on initial load now

Screen.Recording.2023-11-07.at.10.23.42.AM.mov

@khelif96
Copy link
Collaborator Author

khelif96 commented Nov 7, 2023

It seems like the animation also applies on initial load now

Screen.Recording.2023-11-07.at.10.23.42.AM.mov

I pushed up a fix that will prevent it from happening on production builds. Due to how react 18 renders things twice in dev mode the animation will only display on first render locally but shouldn't on a production build. (You can disable strict mode to test this)

@khelif96 khelif96 requested a review from sophstad November 7, 2023 19:29
Copy link
Collaborator

@SupaJoon SupaJoon left a comment

Choose a reason for hiding this comment

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

Single line search in range selection isn't updating the details menu nor showing the animation. Those code changes can be made in a separate PR if you like.
I'm unable to figure out how to reset the search in range selection without opening the details menu. Is it possible?

} from "./Toggles";

interface DetailsMenuProps {
["data-cy"]?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
["data-cy"]?: string;
"data-cy"?: string;

Comment on lines +76 to +79
expect(detailsButton).toHaveAttribute("data-variant", "primary");
jest.runAllTimers();
await waitFor(() => {
expect(detailsButton).toHaveAttribute("data-variant", "default");
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: add assertions for all 3 states. flash off -> flash on -> flash off

}
const DetailsMenu: React.FC<DetailsMenuProps> = ({ disabled, ...rest }) => {
const [lowerRange] = useQueryParam(QueryParams.LowerRange, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const [lowerRange] = useQueryParam(QueryParams.LowerRange, 0);
const [lowerRange] = useQueryParam(QueryParams.LowerRange);

@khelif96
Copy link
Collaborator Author

Single line search in range selection isn't updating the details menu nor showing the animation. Those code changes can be made in a separate PR if you like.
That is intentional.

if (startingLine === undefined || endingLine === undefined) return;

We can open a ticket to update it if the flow doesn't make sense.

I'm unable to figure out how to reset the search in range selection without opening the details menu. Is it possible?

That is not possible. When we originally opened this pr the UX didn't make sense to reset the search range from the selection menu. It is why this pr exists so that users are made aware of the change in the details menu.

@khelif96 khelif96 requested a review from SupaJoon November 13, 2023 22:23
Copy link
Collaborator

@SupaJoon SupaJoon left a comment

Choose a reason for hiding this comment

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

Good stuff!!

@khelif96 khelif96 merged commit 67fa915 into evergreen-ci:main Nov 14, 2023
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants