Remove unsafe assertions from badge and theme style defaults - #100026
Draft
KJ21-ENG wants to merge 1 commit into
Draft
Remove unsafe assertions from badge and theme style defaults#100026KJ21-ENG wants to merge 1 commit into
KJ21-ENG wants to merge 1 commit into
Conversation
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.
Explanation of Change
Remove four unsafe type assertions from
StatusBadgeand the default ThemeStyles contexts. Pass existingColorValuevalues directly to the background style helper, construct the text color as a typed React NativeTextStyle, and replace assertion-backed proxies with typed lazy getters. Preserve the rendered badge colors and the cachedstylesandStyleUtilsidentities.Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
ColorValuetext and background colors to a status badge.useThemeStylesanduseStyleUtils.Offline tests
QA Steps
Count change
Current baseline source: verifier-owned authoritative cleanup count for exact diff
sha256:7e68a3a1e9d54eb1b5b67f296205e1407279ae6c8f9f1c6d4a07dc4c4de5bd4b.Before:
src/components/StatusBadge.tsx: 2src/components/ThemeStylesContextProvider/default.ts: 2After:
src/components/StatusBadge.tsx: 0src/components/ThemeStylesContextProvider/default.ts: 0Net reduction:
TSV evidence: the verifier restored
config/eslint/eslint.seatbelt.tsvand confirmed it is not part of the changed-path set.Changed files
src/components/StatusBadge.tsxsrc/components/ThemeStylesContextProvider/default.tsPR Author Checklist
Focused verification, exact-head Fork CI, and three independent reviews cover this narrow assertion cleanup. The change preserves the existing Badge colors and the cached ThemeStyles context identities. It adds no UI, CSS, assets, copy, message editing, Storybook behavior, direct deeplink behavior, or new code pattern. Those checklist categories are N/A. Manual QA remains required by the final regression review.
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
N/A. This cleanup changes no visual output.
Changed files (2)
src/components/StatusBadge.tsxsrc/components/ThemeStylesContextProvider/default.ts