Commit 848f5d0
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
- app
- src/main/kotlin/me/nanova/summaryexpressive
- llm/tools
- ui
- component
- page
- util
- vm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
8 | 20 | | |
9 | 21 | | |
10 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
0 commit comments