feat(tabs): migrate to Modular Ionic#31116
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| <button class="expand" onclick="updateBadgeCount()">Update Badge Count</button> | ||
| <button class="expand" onclick="updateBadgeColor()">Update Badge Color</button> |
There was a problem hiding this comment.
These buttons weren't doing anything. I do plan on adding updateBadgeCount to the tab-bar/test/badge page when we migrate.
| private setActive(selectedTab: HTMLIonTabElement): Promise<void> { | ||
| if (this.transitioning) { | ||
| return Promise.reject('transitioning already happening'); | ||
| return Promise.reject(new Error('transitioning already happening')); |
There was a problem hiding this comment.
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`); |
There was a problem hiding this comment.
This kept showing as [ion-tabs] - Tab with id: "undefined" does not exist so I fixed it by passing the correct variable.
|
|
||
| contain: layout size style; | ||
| z-index: $z-index-page-container; | ||
| z-index: 0; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
brandyscarney
left a comment
There was a problem hiding this comment.
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"; | |||
There was a problem hiding this comment.
Why was this not changed to @use?
There was a problem hiding this comment.
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; | |||
There was a problem hiding this comment.
Why was this not changed to @use?
There was a problem hiding this comment.
Was adding the s to make it tabs.interfaces.ts instead of tabs.interface.ts intentional?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Shouldn't this be a token value?
There was a problem hiding this comment.
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.
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>
Issue number: resolves internal
What is the current behavior?
ion-tabsuses a legacy@importin its stylesheet, has a separatetabs-interface.tsfile (hyphen naming), and carries a@virtualProp themedoc that is no longer applicable after the Modular Ionic migration. An error message in thegetTabhelper always logs"undefined"instead of the actual tab id that was passed.What is the new behavior?
tabs-interface.ts->tabs.interfaces.tsto match the format in Modular Ionic@import "native.globals"to@use "../../themes/mixins" as mixins@virtualProp themeJSDocgetTab. Now correctly logs the tab id passed by the caller instead of always logging"undefined"Does this introduce a breaking change?
Other information
Previews