Skip to content

Commit

Permalink
[AIAssistance] Simplify input shadow animation based on scroll
Browse files Browse the repository at this point in the history
Previously, there were 2 things:
* We were setting the visibility depending on the scrollable
status of the container.
* We were updating the opacity of the shadow based on the
scroll status of the container.

We don't need to do these 2 things and we can go with
only setting the opacity when the animation is active
and setting it to `0` for the cases when the animation is
not active.

Bug: 373832540
Change-Id: I12f6eac31ba7636faa3c2dce33989bfaf7c53992
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6174730
Commit-Queue: Samiya Caur <[email protected]>
Auto-Submit: Ergün Erdoğmuş <[email protected]>
Reviewed-by: Samiya Caur <[email protected]>
  • Loading branch information
ergunsh authored and Devtools-frontend LUCI CQ committed Jan 16, 2025
1 parent b42069a commit f431d36
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions front_end/panels/ai_assistance/components/chatView.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,9 @@
height: 100%;
box-shadow: 0 -3px 2px -2px var(--app-color-ai-assistance-input-divider);
animation: reveal;
opacity: 0%;
/* stylelint-disable-next-line property-no-unknown */
animation-timeline: --scroll-timeline;
animation-fill-mode: both;

--visibility-if-can-scroll: var(--can-scroll) visible;
--visibility-if-cant-scroll: hidden;

visibility: var(--visibility-if-can-scroll, var(--visibility-if-cant-scroll));
}
}
}
Expand Down Expand Up @@ -528,9 +523,6 @@ main {

/* stylelint-disable-next-line property-no-unknown */
scroll-timeline: --scroll-timeline y;
animation: detect-scroll;
/* stylelint-disable-next-line property-no-unknown */
animation-timeline: --scroll-timeline;
}

.empty-state-container {
Expand Down Expand Up @@ -690,8 +682,3 @@ main {
opacity: 0%;
}
}

@keyframes detect-scroll {
from,
to { --can-scroll: ; }
}

0 comments on commit f431d36

Please sign in to comment.