tab: Fix Pill/Underline double active background on switch animation#2505
Merged
Conversation
The sliding indicator is enabled for the `Segmented`, `Pill` and `Underline` variants, but only `Segmented` made the tab's own active background transparent while the indicator is shown. For `Pill` (active color lives in the outer `bg`) and `Underline` (active color is the bottom `border_color`), the newly selected tab painted its own active color immediately while the indicator was still sliding in, so the two overlapped during the transition. Suppress the selected tab's own active background/border once the indicator is active and ready, so the indicator alone represents the active state during the slide. Disabled tabs keep their own dimmed styling. Closes #2499 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When switching tabs, the newly selected `Pill` tab's text color snapped to `primary_foreground` instantly while the indicator pill was still sliding into place, leaving white text floating over the not-yet-filled background. Animate the selected tab's text color from the normal color to `primary_foreground` using the same duration and easing as the indicator, keyed on the indicator's animation epoch so it restarts in sync with each switch. Adds an `Hsla` implementation of the `Lerp` trait for the color interpolation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 #2499.
Area.mp4