Skip to content

chore: Adds internal style api v2 to tabs - #5256

Merged
vvaliyev merged 2 commits into
mainfrom
style-v2-tabs-refactor-2
Nov 11, 2026
Merged

vvaliyev merged 2 commits into
mainfrom
style-v2-tabs-refactor-2

Conversation

@vvaliyev

@vvaliyev vvaliyev commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Description

Adds the internal Style API v2 to Tabs: tabsHeader, tab (a class name or a function of the tab), tabLink, content, dismissButton forwards to Button.root. No container slot: a styled Container around a default-variant Tabs covers that case.

Default rendering is unchanged.

The style-docs snapshot and the VR registration of the dev page follow in one PR for all components.

Tracker section: P3d34KdbCd6o.

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

How has this been tested?

Unit tests for every slot and forward, dev page tabs/style-api-v2, build and lint green.

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 Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.86%. Comparing base (645627b) to head (0dc9ec0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5256   +/-   ##
=======================================
  Coverage   97.86%   97.86%           
=======================================
  Files        1016     1016           
  Lines       32847    32850    +3     
  Branches    12176    12181    +5     
=======================================
+ Hits        32146    32149    +3     
  Misses        695      695           
  Partials        6        6           

☔ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the tab styling update.

No open issues 🎉

What changed in this PR

Moves default tab colors and typography to the tab container so future container-level styles can reach labels in every state, while keeping style.tab styling on the link.

Changes:

  • Makes tab links inherit container typography and state colors while preserving action and dismiss styling.
  • Adds tests confirming where style.tab, indicator, and separator styles are applied.
  • Adds disabled-tab examples with text actions and dismiss buttons.
File Description
src/​tabs/​tab-header-bar.scss Moves default typography and state colors to containers, preserving link-level overrides.
src/​tabs/​__tests__/​tabs.test.tsx Tests link and container style placement and padding passthrough.
pages/​tabs/​actions.page.tsx Adds disabled tabs with text actions and dismiss buttons.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two-value padding customizations generate invalid longhand values and lose tab padding, while the hover rule overrides disabled-tab colors.

2 open issues

Review effort: Balanced

Comment thread pages/tabs/style-api-v2.scss Resolved
Comment thread src/tabs/tab-header-bar.scss Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The styled-tab selections use local state instead of the required AppContext URL parameters, so they are lost on reload and cannot be shared via links or directly targeted by integration tests.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread pages/tabs/style-api-v2.page.tsx Outdated
Comment on lines +46 to +47
const [activeId, setActiveId] = useState('one');
const [containerActiveId, setContainerActiveId] = useState('one');
@vvaliyev
vvaliyev marked this pull request as ready for review November 9, 2026 06:46
@vvaliyev
vvaliyev requested a review from a team as a code owner November 9, 2026 06:46
@vvaliyev
vvaliyev requested review from cansuaa and removed request for a team November 9, 2026 06:46
@vvaliyev
vvaliyev enabled auto-merge November 9, 2026 06:49
@vvaliyev
vvaliyev force-pushed the style-v2-tabs-refactor-2 branch from 1d3fb84 to 32c4ae0 Compare November 9, 2026 11:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Inactive-tab hover labels have near-invisible contrast, and local-only tab selection prevents URL-based sharing and reload persistence required by the dev-page convention.

3 open issues

Review effort: Balanced

Comment thread pages/tabs/style-api-v2.scss Resolved
Comment thread src/tabs/__tests__/style-api.test.tsx Outdated
Comment on lines +116 to +117
const el = container.querySelector('.dismiss-root');
expect(el).not.toBeNull();
Comment thread pages/tabs/style-api-v2.page.tsx Outdated
const disabledTabs: TabsProps['tabs'] = [
{ id: 'one', label: 'Overview', content: 'Overview content.' },
{ id: 'two', label: 'Details', disabled: true, content: 'Details content.' },
{ id: 'three', label: 'History', content: 'History content.' },

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.

nit: I'd simplify the test page as most of the examples are identical. E.g. instead of having separate baseTabs and disabledTabs - we can have a single set of tabs with some tabs being disabled. In that case it is best to have more than 3 tabs so that we can see different combinations of edges. Likewise, we can add a tab with a dismiss button to the same set.

Then, we can style the same set of tabs differently with 2-3 style combinations, so as result we should have 2-3 styled versions of tabs instead of 9.

Comment thread src/tabs/styles.scss Outdated
flex: 1;
@include focus-visible.when-visible {
@include styles.container-focus();
@include styles.windows-high-contrast-outline($offset: 2px);

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 introduce a version of container-focus inside src/internal/styles/style-api.scss - same as we did for styled focus-highlgiht

Comment thread src/tabs/tab-header-bar.scss Outdated
active-indicator-width,
var(#{custom-props.$styleTabsActiveIndicatorWidth}, awsui.$border-active-width)
);
@if style-api.enabled() {

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.

I'd drop the @if style-api.enabled() - it is just three lines of code, and by making those conditional we introduce a difference in styles between packages which can lead to package-specific regressions.

@vvaliyev
vvaliyev added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit a7dc9e1 Nov 11, 2026
68 checks passed
@vvaliyev
vvaliyev deleted the style-v2-tabs-refactor-2 branch November 11, 2026 21:21

This branch was successfully deployed

3 active deployments
dev-pages-react18 — 0dc9ec0e Deployed Nov 11, 2026 by pan-kot via deploy (React 18) / deploy #3273
dev-pages-react16 — 0dc9ec0e Deployed Nov 11, 2026 by pan-kot via deploy (React 16) / deploy #3273
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.

3 participants