feat: Brand UI updates (M2-9137) - #2091
Merged
Merged
Conversation
Add custom helpers
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
farmerpaul
reviewed
Jun 11, 2025
farmerpaul
left a comment
Contributor
There was a problem hiding this comment.
I have 5 pending comments but I can't seem to locate them on this rather slow Files changed tab… so gonna post what I have so far!
farmerpaul
approved these changes
Jun 11, 2025
farmerpaul
left a comment
Contributor
There was a problem hiding this comment.
I'm gonna approve this, pending my earlier comments. I haven't looked at every single code change but I trust the quality of it, and it appears to be mainly search & replace. I've mentioned the couple things that stood out to me, and I think the remaining peer testing can be done by QA.
Amazing work in such a short period of time! 💪🏻
farmerpaul
reviewed
Jun 16, 2025
Addresses larger text element due to typography style updates
Minor alignments for general Chip styles as well
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.
fixorfeaturebranches intodeveloporreleasebranches viaSquash and Merge(to keep clean history)📝 Description
🔗 Jira Ticket M2-9137
🔗 Jira Ticket M2-9396
🔗 Jira Ticket M2-9421
🔗 Jira Ticket M2-9422
🔗 Jira Ticket M2-9425
This PR introduces the main new brand UI changes to align with Curious's branding. The two main changes covered in this PR are:
🎨 Palette updates
A whole revamp of the current palette system was introduced, with new helper functions like
flattenPaletteObjectandhexToRgba. This revamp will allow for easier maintainability in the future and reduced modifications needed for a single change.The palette object is now constructed from three main pieces:
The
basePaletteobject. This object contains all base "primitive" colors, taken straight out of the design system. No semantics here, just main name and numeric or string items inside to target a specific color. For example:primary[90],blue.light,neutral_variant[95], etc. These will serve as a reference base for the next object. To understand the next two objects, a simple palette object with tonal variations will be used:The
semanticPaletteobject. This object consists of two main components:basePalette, transforming object references like that ofprimary(containing different tonal variations within it) and flattening them into values likeprimary30,primary40,primary50, and so on. One special note to make for these flattened objects is that for each palette object, either the value fordefault(if any exists) or the value from the tonal 40 (primary[40], in the example that's being used) will be used as the main color reference so that the color can be used as usually expectedpalette.primary. In the case that a "default" value exists, the value will ONLY be returned as the main color entry (palette.primary), otherwise the tonal value 40 will be returned as both the main color entry and its corresponding tonal value (palette.secondaryandpalette.secondary40). This all happens within theflattenPaletteObjecthelper function.surface,on_surface,on_primary,primary_container,on_primary_container, etc.The
alphaVariantsPaletteobject. This object contains any variants that make use of the semantic values from thesemanticPaletteobject, and then applies a custom alpha value to them, giving values to the required color variables likeon_secondary_container_alpha12. The helper functionhexToRgbais crucial for this to happen.The final palette object is built with the values from both the
semanticPaletteandalphaVariantsPaletteobjects.⌨️ Typography updates
An initial base revamp on how are font stylings alined to the design system was also introduced, with one main change in mind:
Improving
font-size,line-heightandletter-spacingconsistency to match the new typography styles, comprised of 5 main categories (display, headline, title, label and body) and each of those subdivided into sizes.This was achieved by providing updates to two main areas:
Along these two main areas of changes, specific changes were introduced:
outline_variantas their border color.Finally, propagation to custom overwrites to match new design system were included.
📸 Screenshots
A couple of screenshots across the platform:
🪤 Peer Testing
These changes are now reflected throughout the entire platform and are aligned with the new design system.
📝 Notes
An interesting find during the test updates for these changes was an issue with cyclic barrel imports:
When running tests, a single error was being raised in multiple places, all in reference to styled components:
After some digging, these are the findings:
Root cause
SelectController.styles.ts(and a few other files) do this:shared/styles/index.tsre-exports everything fromshared/styles/styledComponents.One of those re-exported files (
shared/styles/styledComponents/ConditionalSummary.ts) importsSelectControlleragain, which of course pulls inSelectController.styles.ts.This gives the circular loading chain below (→ means “requires”):
When Node (used by Jest) hits the arrow that goes back to a module that is still being evaluated, the current, half-initialised
exportsobject is returned. At that momentStyledBodyLargehas not been defined yet, so insideSelectController.styles.tsit isundefined.styled(StyledBodyLarge)therefore tries to read__emotion_stylesonundefinedand we get the runtime error only during tests.Why the app still works in the browser Webpack bundles the code as ES-modules with live bindings; the second access to
StyledBodyLargehappens after the module finishes evaluating, so the value is there. Jest runs the CommonJS build produced bybabel-jest, where the value is captured at import-time, so the cycle bites.This issue was solved with a simple fix: Breaking the cycle.
Updates were added to
SelectController.styles.ts,ActivityThumbnail.tsandBadge.ts.The imports were updated moving from something like this:
To something like this:
This was the exact update done to
SelectController.styles.ts, the first (and worst) offender.Now, we can live worry free of this being an issue again (at least while we keep that it was an issue in mind).
My research took me a tad (way) further down the road on this, but I believe enough context was given to note the importance of avoiding this issue. Always up for sharing more notes for those who want to see just how deep the rabbit hole goes.