Skip to content

feat: Add travelling active-tab indicator for Tabs in One Theme - #5010

Draft
ywyyu17 wants to merge 6 commits into
mainfrom
dev-v3-ywy-motion
Draft

ywyyu17 wants to merge 6 commits into
mainfrom
dev-v3-ywy-motion

Conversation

@ywyyu17

@ywyyu17 ywyyu17 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Behavior

A single indicator travels from the origin tab to the destination, morphing width to fit the target label along the way. Duration is distance-scaled: short hops are snappy, longer jumps take slightly more time. Light weight + high frequency = fast and responsive with personality.

Description

Today the component renders the underline as a separate ::after on each tab header, sitting at opacity: 0, and selection cross-fades opacity between the old and new one. Those underlines are pinned one-per-tab, so none of them can travel, and the native motion can only ever be a cross-fade.

We replace the per-tab underline cross-fade with a single shared indicator that slides and morphs width between tabs, scoped to expressive-motion themes (One Theme). Other themes are unchanged.

Related links, issue #, if available: n/a

How has this been tested?

Unit test
Manual test

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.66%. Comparing base (e26ae03) to head (91c3e97).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/tabs/tab-header-bar.tsx 96.42% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5010      +/-   ##
==========================================
- Coverage   97.67%   97.66%   -0.01%     
==========================================
  Files         960      960              
  Lines       31382    31410      +28     
  Branches    11605    11614       +9     
==========================================
+ Hits        30651    30678      +27     
+ Misses        724      686      -38     
- Partials        7       46      +39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/tabs/tab-header-bar.tsx Outdated
onBlur={onBlur}
>
{isOneTheme && (
<span className={styles['tabs-active-indicator']} ref={activeIndicatorRef} aria-hidden="true" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we use the existing tab indicator? Or remove the old one and make it look like before in visual refresh, so we don't have to have 2 tab indicators?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

what is existing tab indicator? if you mean ::after on each tab header, we need to keep it when its not one-theme

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we keep it? Or should we use this new span for both VR and One Theme?

Comment thread src/tabs/tab-header-bar.scss Outdated
}

.tabs-active-indicator {
@include theming.expressive-motion-only {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's try to only add actual animation properties inside of this mixin. The rest should be outside and shared between visual refresh and one theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants