Skip to content

feat(tabs): migrate to Modular Ionic#31116

Merged
thetaPC merged 8 commits into
ionic-modularfrom
FW-6909
May 18, 2026
Merged

feat(tabs): migrate to Modular Ionic#31116
thetaPC merged 8 commits into
ionic-modularfrom
FW-6909

Conversation

@thetaPC
Copy link
Copy Markdown
Contributor

@thetaPC thetaPC commented May 6, 2026

Issue number: resolves internal


What is the current behavior?

ion-tabs uses a legacy @import in its stylesheet, has a separate tabs-interface.ts file (hyphen naming), and carries a @virtualProp theme doc that is no longer applicable after the Modular Ionic migration. An error message in the getTab helper always logs "undefined" instead of the actual tab id that was passed.

What is the new behavior?

  • Renamed tabs-interface.ts -> tabs.interfaces.ts to match the format in Modular Ionic
  • Converted @import "native.globals" to @use "../../themes/mixins" as mixins
  • Removed the @virtualProp theme JSDoc
  • Fixed error message in getTab. Now correctly logs the tab id passed by the caller instead of always logging "undefined"
  • Added spec tests

Does this introduce a breaking change?

  • Yes
  • No

Other information

Previews

@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment May 18, 2026 1:51pm

Request Review

@github-actions github-actions Bot added the package: core @ionic/core package label May 6, 2026
Comment on lines -45 to -46
<button class="expand" onclick="updateBadgeCount()">Update Badge Count</button>
<button class="expand" onclick="updateBadgeColor()">Update Badge Color</button>
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.

These buttons weren't doing anything. I do plan on adding updateBadgeCount to the tab-bar/test/badge page when we migrate.

Comment thread core/src/components/tabs/test/basic/index.html Outdated
private setActive(selectedTab: HTMLIonTabElement): Promise<void> {
if (this.transitioning) {
return Promise.reject('transitioning already happening');
return Promise.reject(new Error('transitioning already happening'));
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.

This change attaches a stack trace to the rejection, making it easier to identify where the error originated when debugging.


if (!tabEl) {
printIonError(`[ion-tabs] - Tab with id: "${tabEl}" does not exist`);
printIonError(`[ion-tabs] - Tab with id: "${tab}" does not exist`);
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.

This kept showing as [ion-tabs] - Tab with id: "undefined" does not exist so I fixed it by passing the correct variable.

@thetaPC thetaPC marked this pull request as ready for review May 6, 2026 22:15
@thetaPC thetaPC requested a review from a team as a code owner May 6, 2026 22:15
@thetaPC thetaPC requested review from brandyscarney and gnbm and removed request for gnbm May 6, 2026 22:15
Copy link
Copy Markdown
Member

@ShaneK ShaneK left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just a nit

Comment thread core/src/components/tabs/tabs.scss Outdated

contain: layout size style;
z-index: $z-index-page-container;
z-index: 0;
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.

Was inlining 0 here instead of using $z-index-page-container deliberate? nav.scss and router-outlet.scss are still on the variable, so tabs becomes the lone magic number until they migrate too. Is the plan to define $z-index-page-container somewhere reachable from mixins.scss, or to inline 0 everywhere once those two migrate as well? Either way it works, but a short comment noting it tracks the page-container z-index would keep the intent visible during the transition.

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.

I create a common globals file. There's going to be duplicate imports of the z index until we can migrate the rest of the components. 51f637f

Copy link
Copy Markdown
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

Looks good! Left some comments but I don't think any are blockers. Approving. 👍

@@ -1,3 +1,4 @@
@use "../../themes/common.globals" as globals;
@import "../../themes/native/native.globals";
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.

Why was this not changed to @use?

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.

I'm trying to minimize the changes in other components as much as possible. The use migration will be done when we migrate nav to ionic modular. This is just a precaution in case an issue occurs. I don't want to spend more time on components that are not in the scope of tickets.

@@ -1,3 +1,4 @@
@use "../../themes/common.globals" as globals;
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.

Why was this not changed to @use?

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.

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.

Was adding the s to make it tabs.interfaces.ts instead of tabs.interface.ts intentional?

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.

Yes, we've been doing that with all the components we've migrated. Should we be using singular? If so, I can make those changes in a different PR.


// Z-Index
// --------------------------------------------------
$z-index-page-container: 0;
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.

Shouldn't this be a token value?

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.

No, it should be a 1:1 of the value in native.global.scss as that file will eventually be removed once we are done with the migration. However, we need to keep some variables/values since they are being shared in all themes.

Comment thread core/src/components/tabs/test/placements/index.html Outdated
Comment thread core/src/components/tabs/test/basic/index.html Outdated
Comment thread core/src/components/tabs/test/basic/index.html Outdated
Comment thread core/src/components/tabs/test/basic/index.html Outdated
thetaPC and others added 4 commits May 18, 2026 06:24
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
@thetaPC thetaPC merged commit 70fa2a6 into ionic-modular May 18, 2026
49 checks passed
@thetaPC thetaPC deleted the FW-6909 branch May 18, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants