Skip to content

Commit 848f5d0

Browse files
committed
feat: add multi-language TTS and improve summary card UI
This commit introduces multi-language text-to-speech (TTS) support for summaries, allows summary cards to be expanded and collapsed, and refactors history deletion to use a swipe gesture. Article extraction accuracy is also improved. **Key Changes:** - **Multi-language TTS:** - Implemented `getLanguageCode` in `LocaleUtil.kt` to detect the language of the summary text using `TextClassifier`. - `SummaryCard` now sets the TTS engine language based on the detected language, falling back to the default if necessary. - TTS playback state is now managed by the parent composables (`HomeScreen`, `HistoryScreen`) and passed down to `SummaryCard`. - **Expandable/Collapsible Summary Card:** - `SummaryCard` can now be expanded or collapsed to show more or less of the summary text if it exceeds a certain number of lines. - Added "Show More" / "Show Less" text button for toggling expansion. - `isExpandedByDefault` parameter added to `SummaryCard`. - **History Deletion by Swipe:** - In `HistoryScreen`, summary items can now be deleted by swiping them from end to start. - Replaced long-press deletion with `SwipeToDismissBox`. - **Improved Article Extraction:** - Updated `ArticleExtractorTool` to include `[class~=content]` in its CSS selectors for better content identification. - **UI & ViewModel Updates:** - `HistoryViewModel` now uses `StateFlow` for `historySummaries` and `searchText`. - `summariesToShow` in `HistoryViewModel` is now a `StateFlow` derived from `searchText` and `historySummaries`. - `HomeScreen` and `HistoryScreen` now manage the `isPlaying` state for TTS in `SummaryCard`. - **Dependency Updates:** - Compose BOM to `2025.09.01` - Navigation Compose to `2.9.5` - Updated `CHANGELOG.md` and `README.md`. - Incremented app version to 0.9.0 (versionCode 36).
1 parent bbe5945 commit 848f5d0

9 files changed

Lines changed: 352 additions & 133 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.9.0] - 2025-09-25
9+
10+
### Added
11+
12+
- Support multi lang read out
13+
- Collapse and expand the summary result card
14+
15+
### Changed
16+
17+
- History deletion action using swipe gesture instead of long press
18+
- Improve article extraction accuracy
19+
820
## [0.8.0] - 2025-09-21
921

1022
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ package previously.
7676

7777
- **Configurable summary length**
7878

79-
- **Read-Out the summaries**
79+
- **Read-Out the summaries with multilingual support**
8080

8181
- **History search**
8282

app/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ android {
1818
applicationId = "me.nanova.summaryexpressive"
1919
minSdk = 33
2020
targetSdk = 36
21-
versionCode = 35
22-
versionName = "0.8.0"
21+
versionCode = 36
22+
versionName = "0.9.0"
2323

2424
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2525
}
@@ -103,7 +103,7 @@ android {
103103

104104
dependencies {
105105
// https://developer.android.com/develop/ui/compose/bom/bom-mapping
106-
val composeBomVersion = "2025.09.00"
106+
val composeBomVersion = "2025.09.01"
107107

108108
// Core & Lifecycle
109109
implementation("androidx.core:core-ktx:1.17.0")
@@ -117,7 +117,7 @@ dependencies {
117117
ksp("com.google.dagger:hilt-compiler:2.57.1")
118118

119119
// Navigation
120-
implementation("androidx.navigation:navigation-compose:2.9.4")
120+
implementation("androidx.navigation:navigation-compose:2.9.5")
121121
implementation("androidx.hilt:hilt-navigation-compose:1.3.0")
122122

123123
// Jetpack Compose

app/src/main/kotlin/me/nanova/summaryexpressive/llm/tools/ArticleExtractorTool.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private fun extractArticleContent(htmlContent: String, sourceUrl: String): Extra
6868
?: doc.select("main").first()
6969
// For section and divs, look for the one with the most content
7070
?: doc.select("section").maxByOrNull { it.text().length }
71-
?: doc.select("#content, .content, #main, .main, #main-content, #article, .article, #post-body, .post-body")
71+
?: doc.select("#content, .content, #main, .main, #main-content, #article, .article, #post-body, .post-body, [class~=content]")
7272
.maxByOrNull { it.text().length }
7373

7474
// Get text from the found element, or fall back to the whole body

0 commit comments

Comments
 (0)