Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autofix): Remove animations when navigating, handle comment popup overlap #88275

Merged
merged 3 commits into from
Mar 31, 2025

Conversation

roaga
Copy link
Member

@roaga roaga commented Mar 28, 2025

Remove animations when opening drawer and expanding insight section. Also increase clarity of which comment thread is focused when there are multiple.

@roaga roaga requested a review from jennmueng March 28, 2025 22:13
@roaga roaga requested a review from a team as a code owner March 28, 2025 22:13
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 28, 2025
Comment on lines 182 to 194
const hasRootCauseStep = steps.some(
step => step.type === AutofixStepType.ROOT_CAUSE_ANALYSIS
);
const hasSolutionStep = steps.some(step => step.type === AutofixStepType.SOLUTION);
const hasChangesStep = steps.some(step => step.type === AutofixStepType.CHANGES);

const isRootCauseFirstAppearance = hasRootCauseStep && !previousRootCauseRef.current;
const isSolutionFirstAppearance = hasSolutionStep && !previousSolutionRef.current;
const isChangesFirstAppearance = hasChangesStep && !previousChangesRef.current;

previousRootCauseRef.current = hasRootCauseStep;
previousSolutionRef.current = hasSolutionStep;
previousChangesRef.current = hasChangesStep;
Copy link
Member

Choose a reason for hiding this comment

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

can't we achieve the same but in a much simpler way by just maintaining an isMounted (or something similar if we need to wait for data to load) state for the whole drawer/all the steps, and anything that appears after initial mount is just considered that step being polled in?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

Comment on lines +339 to +350
const previousInsightsRef = useRef<AutofixInsight[]>([]);
const [newInsightIndices, setNewInsightIndices] = useState<number[]>([]);

// Compare current insights with previous insights to determine which ones are new
useEffect(() => {
if (insights.length === previousInsightsRef.current.length + 1) {
setNewInsightIndices([insights.length - 1]);
} else {
setNewInsightIndices([]);
}
previousInsightsRef.current = [...insights];
}, [insights]);
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to use the isMounted implementation for insight cards too?

Copy link
Member Author

Choose a reason for hiding this comment

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

It becomes more complex because that doesn't cover the expanding/collapsing of the insight card section, which doesn't cause a re-mount. For that to work, I have to track that state too, and then it's more complex than the current approach @jennmueng

@roaga roaga requested a review from jennmueng March 31, 2025 17:39
@roaga roaga merged commit d42e59a into master Mar 31, 2025
40 checks passed
@roaga roaga deleted the autofix/animations branch March 31, 2025 22:55
andrewshie-sentry pushed a commit that referenced this pull request Apr 8, 2025
… overlap (#88275)

Remove animations when opening drawer and expanding insight section.
Also increase clarity of which comment thread is focused when there are
multiple.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants