Skip to content

[SDK-366] parse-styles-for-components#817

Merged
lposen merged 10 commits intoemb-ootb/masterfrom
loren/embedded/SDK-366-new-parse-styles-for-components
Feb 27, 2026
Merged

[SDK-366] parse-styles-for-components#817
lposen merged 10 commits intoemb-ootb/masterfrom
loren/embedded/SDK-366-new-parse-styles-for-components

Conversation

@lposen
Copy link
Contributor

@lposen lposen commented Feb 24, 2026

🔹 JIRA Ticket(s) if any

✏️ Description

Parses styles according for each component type, with the ability to override them externally

Test

  • Run the example app
  • Click "get messages for placement ids" -- A slew of default styles should appear in the section below the hr
  • Switch between banner, card and notification -- The styles should change depending on the component
  • Click "set view config"
  • Update the json to override any of the styles. EG: {"backgroundColor":"blue"}
  • Look at the styles again -- They should have been overridden to apply your change
Screen.Recording.2026-02-23.at.5.02.20.PM.mov

@github-actions
Copy link

github-actions bot commented Feb 24, 2026

Lines Statements Branches Functions
Coverage: 63%
63.81% (432/677) 45.67% (132/289) 60.92% (145/238)

@qltysh
Copy link

qltysh bot commented Feb 24, 2026

Qlty

Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (4)

RatingFile% DiffUncovered Line #s
New file Coverage rating: A
src/embedded/hooks/useEmbeddedView/useEmbeddedView.ts100.0%
New file Coverage rating: A
src/embedded/components/IterableEmbeddedView.tsx100.0%
New file Coverage rating: A
src/embedded/constants/embeddedViewDefaults.ts100.0%
New file Coverage rating: A
src/embedded/hooks/useEmbeddedView/getStyles.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@qltysh
Copy link

qltysh bot commented Feb 24, 2026

All good ✅

@lposen lposen marked this pull request as ready for review February 24, 2026 01:07
Copy link

@sumeruchat sumeruchat left a comment

Choose a reason for hiding this comment

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

Good work on the style-parsing system — clean separation of concerns, solid test coverage on getStyles, and the config override pattern using ?? is correct. A few items to address before merge, most notably the debug output left in the production component.

</Text>
<Text>
parsedStyles.bodyTextColor: {String(parsedStyles.bodyTextColor)}
</Text>

Choose a reason for hiding this comment

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

Blocker: This entire debug block (lines 51-81) renders raw style values as <Text> nodes on screen, and wraps <Cmp> in an extra <View>. This looks like scaffolding/dev output and should be removed before merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just for demonstration and easy testing purposes. It will be removed in future PRs.

<Text>
parsedStyles.bodyTextColor: {String(parsedStyles.bodyTextColor)}
</Text>
<Cmp {...props} />

Choose a reason for hiding this comment

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

parsedStyles is computed but never passed to <Cmp>. The child components (Banner/Card/Notification) won't receive or apply these styles. Should this be something like <Cmp {...props} parsedStyles={parsedStyles} />?

Copy link
Contributor Author

@lposen lposen Feb 27, 2026

Choose a reason for hiding this comment

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

The whole function is going to go inside the other components in future PRs. This is just for making it easy to test.

banner: '#F5F4F4',
};

export const embeddedStyles = {

Choose a reason for hiding this comment

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

embeddedMediaImageBorderColors and embeddedMediaImageBackgroundColors are defined and added to embeddedStyles, but never consumed in getStyles.ts. Remove them or add the corresponding style resolution to avoid dead code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're 100% correct. Good eye. They ended up in here because I was breaking down a very large PR. I'll remove them and add them back in later when they are needed.

Copy link
Member

@joaodordio joaodordio left a comment

Choose a reason for hiding this comment

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

+1 on the comments Sumeru already added, other than that looks good!

Copy link

@franco-zalamena-iterable franco-zalamena-iterable left a comment

Choose a reason for hiding this comment

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

This is a really technical implementation and I lack the needed knowledge to give helpful insights for React Native. I tested the app with this branch and everything seems to be working.

@lposen lposen merged commit 6cd11bb into emb-ootb/master Feb 27, 2026
4 of 5 checks passed
@lposen lposen deleted the loren/embedded/SDK-366-new-parse-styles-for-components branch February 27, 2026 21:31
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.

4 participants