Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Merge main into Ensu Android quality work

Manav Rathi7fac9385a31a
diff --cc .github/scripts/ci/paths.json
index fd7296f8f1,b9a3fd9bdb..fb4aeedf09
--- a/.github/scripts/ci/paths.json
+++ b/.github/scripts/ci/paths.json
@@@ -30,9 -16,9 +30,10 @@@
".github/workflows/dependency-review.yml"
],
"desktop-lint": [
+ ".github/actions/restore-rust-target/**",
".github/workflows/desktop-lint.yml",
"desktop/**",
+ "rust/.cargo/config.toml",
"rust/Cargo.lock",
"rust/Cargo.toml",
"rust/bindings/napi/**",
@@@ -120,26 -94,25 +124,37 @@@
],
"repo-lint": null,
"rust-cli-test": [
+ ".github/actions/restore-rust-target/**",
".github/workflows/rust-cli-test.yml",
- "rust/apps/cli-next/**"
+ "rust/.cargo/config.toml",
+ "rust/Cargo.lock",
+ "rust/Cargo.toml",
+ "rust/apps/cli-next/**",
+ "rust/crates/accounts/**",
+ "rust/crates/assets/**",
+ "rust/crates/collections/**",
+ "rust/crates/core/**",
+ "rust/crates/exif/**",
+ "rust/crates/location/**",
+ "rust/crates/photos/**",
+ "rust/crates/test-support/**"
],
- "rust-lint": [".github/workflows/rust-lint.yml", "rust/**"],
- "rust-test": [".github/workflows/rust-test.yml", "rust/**", "server/**"],
+ "rust-lint": [
+ ".github/actions/restore-rust-target/**",
+ ".github/workflows/rust-lint.yml",
+ "rust/**"
+ ],
+ "rust-test": [
+ ".github/actions/restore-rust-target/**",
+ ".github/workflows/rust-test.yml",
+ "rust/**",
+ "server/**"
+ ],
"server-lint": [".github/workflows/server-lint.yml", "server/**"],
"web-lint": [
+ ".github/actions/restore-rust-target/**",
".github/workflows/web-lint.yml",
+ "rust/.cargo/config.toml",
"rust/Cargo.lock",
"rust/Cargo.toml",
"rust/bindings/wasm/**",
diff --cc android/apps/ensu/app/src/main/java/io/ente/ensu/chat/MarkdownRenderer.kt
index 249a467e44,54c5c4659c..9b6e1da728
--- a/android/apps/ensu/app/src/main/java/io/ente/ensu/chat/MarkdownRenderer.kt
+++ b/android/apps/ensu/app/src/main/java/io/ente/ensu/chat/MarkdownRenderer.kt
@@@ -51,72 -51,66 +51,72 @@@ import io.ente.ensu.designsystem.HugeIc
fun MarkdownView(
markdown: String,
enableSelection: Boolean = true,
- trailingCursor: Boolean = false
+ trailingCursor: Boolean = false,
) {
val blocks = remember(markdown) { MarkdownParser.parse(markdown) }
- val content = @Composable {
- Column(verticalArrangement = Arrangement.spacedBy(EnsuSpacing.md.dp)) {
- blocks.forEachIndexed { index, block ->
- key(index) {
- val appendCursor = trailingCursor && index == blocks.lastIndex
- when (block) {
- is MarkdownBlock.Heading -> {
- InlineMarkdownText(
- text = block.text,
- style = headingStyle(block.level),
- color = EnsuColor.textPrimary(),
- appendCursor = appendCursor
- )
- }
- is MarkdownBlock.Paragraph -> {
- InlineMarkdownText(
- text = block.text,
- style = EnsuTypography.message,
- color = EnsuColor.textPrimary(),
- appendCursor = appendCursor
- )
- }
- is MarkdownBlock.BlockQuote -> {
- BlockQuoteView(text = block.text, appendCursor = appendCursor)
- }
- is MarkdownBlock.Code -> {
- CodeBlockView(code = block.text)
- if (appendCursor) {
- TrailingCursor()
+ val content =
+ @Composable {
+ Column(verticalArrangement = Arrangement.spacedBy(EnsuSpacing.md.dp)) {
+ blocks.forEachIndexed { index, block ->
+ key(index) {
+ val appendCursor = trailingCursor && index == blocks.lastIndex
+ when (block) {
+ is MarkdownBlock.Heading -> {
+ InlineMarkdownText(
+ text = block.text,
+ style = headingStyle(block.level),
+ color = EnsuColor.textPrimary(),
+ appendCursor = appendCursor,
+ )
}
- }
- is MarkdownBlock.Math -> {
- MathBlockView(text = block.text)
- if (appendCursor) {
- TrailingCursor()
+ is MarkdownBlock.Paragraph -> {
+ InlineMarkdownText(
+ text = block.text,
+ style = EnsuTypography.message,
+ color = EnsuColor.textPrimary(),
+ appendCursor = appendCursor,
+ )
}
- }
- is MarkdownBlock.ListItems -> {
- Column(verticalArrangement = Arrangement.spacedBy(EnsuSpacing.md.dp)) {
- block.items.forEachIndexed { itemIndex, item ->
- key(itemIndex) {
- val itemCursor = appendCursor && itemIndex == block.items.lastIndex
- Row(
- verticalAlignment = Alignment.Top,
- horizontalArrangement = Arrangement.spacedBy(EnsuSpacing.sm.dp)
- ) {
- Text(
- text = "β€’",
- style = EnsuTypography.message,
- color = EnsuColor.textPrimary()
- )
- InlineMarkdownText(
- text = item,
- style = EnsuTypography.message,
- color = EnsuColor.textPrimary(),
- appendCursor = itemCursor
- )
+ is MarkdownBlock.BlockQuote -> {
+ BlockQuoteView(text = block.text, appendCursor = appendCursor)
+ }
+ is MarkdownBlock.Code -> {
+ CodeBlockView(code = block.text)
+ if (appendCursor) {
+ TrailingCursor()
+ }
+ }
+ is MarkdownBlock.Math -> {
+ MathBlockView(text = block.text)
+ if (appendCursor) {
+ TrailingCursor()
+ }
+ }
+ is MarkdownBlock.ListItems -> {
+ Column(
- verticalArrangement = Arrangement.spacedBy(EnsuSpacing.xs.dp)
++ verticalArrangement = Arrangement.spacedBy(EnsuSpacing.md.dp)
+ ) {
+ block.items.forEachIndexed { itemIndex, item ->
+ key(itemIndex) {
+ val itemCursor =
+ appendCursor && itemIndex == block.items.lastIndex
+ Row(
+ verticalAlignment = Alignment.Top,
+ horizontalArrangement =
+ Arrangement.spacedBy(EnsuSpacing.sm.dp),
+ ) {
+ Text(
+ text = "β€’",
+ style = EnsuTypography.message,
+ color = EnsuColor.textPrimary(),
+ )
+ InlineMarkdownText(
+ text = item,
+ style = EnsuTypography.message,
+ color = EnsuColor.textPrimary(),
+ appendCursor = itemCursor,
+ )
+ }
}
}
}
diff --cc android/apps/ensu/app/src/main/java/io/ente/ensu/designsystem/Theme.kt
index 8fe06fae1f,ec7948a1d7..c072da5ddc
--- a/android/apps/ensu/app/src/main/java/io/ente/ensu/designsystem/Theme.kt
+++ b/android/apps/ensu/app/src/main/java/io/ente/ensu/designsystem/Theme.kt
@@@ -124,115 -122,38 +124,115 @@@ object EnsuTypography
private val messageFamily = uiFamily
- private val codeFamily = FontFamily(
- Font(R.font.jetbrainsmono_regular, FontWeight.Normal)
- )
-
- val h1 = TextStyle(fontFamily = serifFamily, fontSize = 48.sp, fontWeight = FontWeight.Medium, lineHeight = 82.sp)
- val h2 = TextStyle(fontFamily = serifFamily, fontSize = 32.sp, fontWeight = FontWeight.Medium, lineHeight = 39.sp)
- val h3 = TextStyle(fontFamily = serifFamily, fontSize = 24.sp, fontWeight = FontWeight.Medium, lineHeight = 29.sp)
- val large = TextStyle(fontFamily = serifFamily, fontSize = 18.sp, fontWeight = FontWeight.Medium, lineHeight = 22.sp)
-
- val h1Bold = TextStyle(fontFamily = serifFamily, fontSize = 48.sp, fontWeight = FontWeight.SemiBold, lineHeight = 82.sp)
- val h2Bold = TextStyle(fontFamily = serifFamily, fontSize = 32.sp, fontWeight = FontWeight.SemiBold, lineHeight = 39.sp)
- val h3Bold = TextStyle(fontFamily = serifFamily, fontSize = 24.sp, fontWeight = FontWeight.SemiBold, lineHeight = 29.sp)
-
- val body = TextStyle(fontFamily = uiFamily, fontSize = 16.sp, fontWeight = FontWeight.Medium, lineHeight = 20.sp)
- val small = TextStyle(fontFamily = uiFamily, fontSize = 14.sp, fontWeight = FontWeight.Medium, lineHeight = 17.sp)
- val mini = TextStyle(fontFamily = uiFamily, fontSize = 12.sp, fontWeight = FontWeight.Medium, lineHeight = 15.sp)
- val tiny = TextStyle(fontFamily = uiFamily, fontSize = 10.sp, fontWeight = FontWeight.Medium, lineHeight = 12.sp)
-
- val message = TextStyle(fontFamily = messageFamily, fontSize = 15.sp, fontWeight = FontWeight.Normal, lineHeight = 22.sp)
- val code = TextStyle(fontFamily = codeFamily, fontSize = 13.sp, fontWeight = FontWeight.Normal, lineHeight = 19.sp)
-
- val material = Typography(
- bodyLarge = body,
- bodyMedium = body,
- bodySmall = small,
- titleLarge = h2,
- titleMedium = h3,
- titleSmall = large,
- labelLarge = small,
- labelMedium = mini,
- labelSmall = tiny
- )
+ private val codeFamily = FontFamily(Font(R.font.jetbrainsmono_regular, FontWeight.Normal))
+
+ val h1 =
+ TextStyle(
+ fontFamily = serifFamily,
+ fontSize = 48.sp,
+ fontWeight = FontWeight.Medium,
+ lineHeight = 82.sp,
+ )
+ val h2 =
+ TextStyle(
+ fontFamily = serifFamily,
+ fontSize = 32.sp,
+ fontWeight = FontWeight.Medium,
+ lineHeight = 39.sp,
+ )
+ val h3 =
+ TextStyle(
+ fontFamily = serifFamily,
+ fontSize = 24.sp,
+ fontWeight = FontWeight.Medium,
+ lineHeight = 29.sp,
+ )
+ val large =
+ TextStyle(
+ fontFamily = serifFamily,
+ fontSize = 18.sp,
+ fontWeight = FontWeight.Medium,
+ lineHeight = 22.sp,
+ )
+
+ val h1Bold =
+ TextStyle(
+ fontFamily = serifFamily,
+ fontSize = 48.sp,
+ fontWeight = FontWeight.SemiBold,
+ lineHeight = 82.sp,
+ )
+ val h2Bold =
+ TextStyle(
+ fontFamily = serifFamily,
+ fontSize = 32.sp,
+ fontWeight = FontWeight.SemiBold,
+ lineHeight = 39.sp,
+ )
+ val h3Bold =
+ TextStyle(
+ fontFamily = serifFamily,
+ fontSize = 24.sp,
+ fontWeight = FontWeight.SemiBold,
+ lineHeight = 29.sp,
+ )
+
+ val body =
+ TextStyle(
+ fontFamily = uiFamily,
+ fontSize = 16.sp,
+ fontWeight = FontWeight.Medium,
+ lineHeight = 20.sp,
+ )
+ val small =
+ TextStyle(
+ fontFamily = uiFamily,
+ fontSize = 14.sp,
+ fontWeight = FontWeight.Medium,
+ lineHeight = 17.sp,
+ )
+ val mini =
+ TextStyle(
+ fontFamily = uiFamily,
+ fontSize = 12.sp,
+ fontWeight = FontWeight.Medium,
+ lineHeight = 15.sp,
+ )
+ val tiny =
+ TextStyle(
+ fontFamily = uiFamily,
+ fontSize = 10.sp,
+ fontWeight = FontWeight.Medium,
+ lineHeight = 12.sp,
+ )
+
+ val message =
+ TextStyle(
+ fontFamily = messageFamily,
+ fontSize = 15.sp,
+ fontWeight = FontWeight.Normal,
- lineHeight = 26.sp,
++ lineHeight = 22.sp,
+ )
+ val code =
+ TextStyle(
+ fontFamily = codeFamily,
+ fontSize = 13.sp,
+ fontWeight = FontWeight.Normal,
+ lineHeight = 19.sp,
+ )
+
+ val material =
+ Typography(
+ bodyLarge = body,
+ bodyMedium = body,
+ bodySmall = small,
+ titleLarge = h2,
+ titleMedium = h3,
+ titleSmall = large,
+ labelLarge = small,
+ labelMedium = mini,
+ labelSmall = tiny,
+ )
}
@Composable