Skip to content

Upgrade compose-material3 to 1.2.0-alpha05 version #1011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Jul 31, 2023

Changes:

  • Upgrade compose-material3 to 1.2.0-alpha05.
  • Upgrade compileSdk to 34 (needed for upgrading the lib).
  • Fix broken API changes.
  • Change line height style to match Figma's .
  • Record all screenshots to fix tests after the previous change.

@jmartinesp jmartinesp requested a review from a team as a code owner July 31, 2023 14:54
@jmartinesp jmartinesp requested review from julioromano and removed request for a team July 31, 2023 14:54
@ElementBot
Copy link
Collaborator

ElementBot commented Jul 31, 2023

Warnings
⚠️

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt#L36 - Using a material import while also using the material3 library

⚠️

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt#L37 - Using a material import while also using the material3 library

⚠️

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt#L38 - Using a material import while also using the material3 library

⚠️

gradle/libs.versions.toml#L6 - A newer version of com.android.tools.build:gradle than 8.0.2 is available: 8.1.0

⚠️

gradle/libs.versions.toml#L22 - A newer version of androidx.browser:browser than 1.5.0 is available: 1.6.0

⚠️

gradle/libs.versions.toml#L25 - A newer version of androidx.compose:compose-bom than 2023.06.01 is available: 2023.08.00

⚠️

gradle/libs.versions.toml#L26 - A newer version of androidx.compose.compiler:compiler than 1.5.0 is available: 1.5.1

⚠️

gradle/libs.versions.toml#L29 - A newer version of org.jetbrains.kotlinx:kotlinx-coroutines-test than 1.7.2 is available: 1.7.3

⚠️

gradle/libs.versions.toml#L92 - A newer version of androidx.preference:preference than 1.2.0 is available: 1.2.1

Generated by 🚫 dangerJS against 0082e5c

@github-actions
Copy link
Contributor

github-actions bot commented Jul 31, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/HXSgQn

@jmartinesp jmartinesp force-pushed the chore/jme/upgrade-material-components-lib-to-1.2.0-alpha branch from c580624 to 21a1617 Compare July 31, 2023 18:52
@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch coverage: 92.85% and project coverage change: +0.05% 🎉

Comparison is base (4587b51) 56.89% compared to head (06fdaab) 56.94%.
Report is 2 commits behind head on develop.

❗ Current head 06fdaab differs from pull request most recent head 0082e5c. Consider uploading reports for the commit 0082e5c to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1011      +/-   ##
===========================================
+ Coverage    56.89%   56.94%   +0.05%     
===========================================
  Files         1015      990      -25     
  Lines        25776    25261     -515     
  Branches      5201     5110      -91     
===========================================
- Hits         14666    14386     -280     
+ Misses        8819     8613     -206     
+ Partials      2291     2262      -29     
Files Changed Coverage Δ
...ages/impl/timeline/components/html/HtmlDocument.kt 70.68% <0.00%> (ø)
...libraries/designsystem/theme/components/Divider.kt 38.46% <0.00%> (ø)
...braries/designsystem/theme/components/SearchBar.kt 72.04% <0.00%> (ø)
...io/element/android/libraries/theme/ElementTheme.kt 43.75% <0.00%> (ø)
...droid/libraries/designsystem/preview/SheetState.kt 75.00% <50.00%> (-25.00%) ⬇️
...s/messages/impl/timeline/components/EmojiPicker.kt 50.00% <100.00%> (+3.33%) ⬆️
...ges/impl/timeline/components/MessageEventBubble.kt 87.67% <100.00%> (ø)
.../timeline/components/MessageStateEventContainer.kt 76.66% <100.00%> (ø)
.../timeline/components/TimelineEventTimestampView.kt 73.80% <100.00%> (ø)
.../timeline/components/event/TimelineItemTextView.kt 60.00% <100.00%> (ø)
... and 10 more

... and 154 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@julioromano julioromano requested review from ganfra and removed request for julioromano August 1, 2023 06:49
Copy link

@julioromano julioromano left a comment

Choose a reason for hiding this comment

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

Some comments

@@ -60,7 +60,11 @@ fun EmojiPicker(

val emojiProvider = remember { GoogleEmojiProvider() }
val categories = remember { emojiProvider.categories }
val pagerState = rememberPagerState()
val pagerState = rememberPagerState(
initialPage = 0,

Choose a reason for hiding this comment

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

Aren't these default params? Can we omit them?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, you're right. We just need to provide the pageCount.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 8601c25

@@ -35,110 +23,142 @@ object TypographyTokens {
lineHeight = 22.sp,
fontSize = 16.sp,
letterSpacing = 0.015629999999999998.em,
platformStyle = PlatformTextStyle(includeFontPadding = false),

Choose a reason for hiding this comment

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

These are also all new defaults, do we actually need to specify them?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we can avoid doing that, since the default params are all null. Also, these files are auto-generated by the compound tokens project.

Choose a reason for hiding this comment

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

You mean also includeFontPadding = false is not a default?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is false by default now, but LineHeightStyle depends on it being false to work fine, so I think it's better if we're explicit.

Choose a reason for hiding this comment

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

BTW forceLineHeight() seems to be used only once and it's public, is it meant to be public API or can we "privatize" or "inline" it with its only usage?

Copy link
Member Author

Choose a reason for hiding this comment

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

I left it there because I thought we might need to add it for custom styles, but:

  1. There should be no custom styles.
  2. If there are, they should be derived from our Compound ones and they would already have the right line height style.

So there's probably no need for it anymore.

@@ -35,7 +35,7 @@ fun Divider(
thickness: Dp = ElementDividerDefaults.thickness,
color: Color = DividerDefaults.color,
) {
androidx.compose.material3.Divider(
androidx.compose.material3.HorizontalDivider(

Choose a reason for hiding this comment

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

Should we change the outer composable name too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in cbad214

@julioromano julioromano requested review from julioromano and removed request for ganfra August 1, 2023 07:31
@jmartinesp jmartinesp force-pushed the chore/jme/upgrade-material-components-lib-to-1.2.0-alpha branch from 06fdaab to e0e3112 Compare August 1, 2023 07:43
Copy link

@julioromano julioromano left a comment

Choose a reason for hiding this comment

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

LGTM!

@jmartinesp jmartinesp force-pushed the chore/jme/upgrade-material-components-lib-to-1.2.0-alpha branch from 116d891 to 86ac305 Compare August 17, 2023 09:09
@jmartinesp jmartinesp changed the title Upgrade compose-material3 to 1.2.0-alpha04 version Upgrade compose-material3 to 1.2.0-alpha05 version Aug 17, 2023
@jmartinesp jmartinesp force-pushed the chore/jme/upgrade-material-components-lib-to-1.2.0-alpha branch from 9c122da to 0082e5c Compare August 17, 2023 11:29
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@jmartinesp jmartinesp merged commit 0324719 into develop Aug 17, 2023
@jmartinesp jmartinesp deleted the chore/jme/upgrade-material-components-lib-to-1.2.0-alpha branch August 17, 2023 12:20
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.

3 participants