feat: AI-powered features (translation, summary, reformulation, suggested replies)#9127
Open
sk7n4k3d wants to merge 2 commits intoelement-hq:developfrom
Open
feat: AI-powered features (translation, summary, reformulation, suggested replies)#9127sk7n4k3d wants to merge 2 commits intoelement-hq:developfrom
sk7n4k3d wants to merge 2 commits intoelement-hq:developfrom
Conversation
…ation, suggested replies)
Add comprehensive AI features powered by local LLM (Ollama) via OpenAI-compatible API:
## Translation
- Auto-translate timeline messages with async background translation
- Translation cache (memory LRU + disk persistence) with debounced invalidation
- Reply quote translation (extracts and translates quoted text in replies)
- Preserve reply formatting (blockquote HTML) after translation
- Strip HTML tags, Matrix IDs, and HTML entities before translation
- "Show original" toggle below translated messages
- Translated room list previews (cache-based, no extra API calls)
## Conversation Summary
- Summarize last 50 messages via toolbar menu
- Bottom sheet with loading state and copy button
## Message Reformulation
- Long-press context menu in composer ("Reformuler")
- 4 styles: Formal, Casual, Concise, Fix Grammar
- Bottom sheet with style selection and result preview
## Suggested Replies
- 2-3 contextual reply chips above composer
- Auto-hide when user starts typing
- JSON parsing with line-by-line fallback
## Notification Summary
- Auto-summarize missed notifications after 5min+ absence
- Uses translation cache for already-translated messages
- Bottom sheet with dismiss option
## Settings
- Full settings page under "Translation & AI"
- Per-feature toggles
- API configuration (URL, key, model, target language)
- Cache management (size display, clear button)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
Security (Critical): - Add signature permission on ElementAppFunctionService (was exported without protection) - Use EncryptedSharedPreferences (MasterKey) for API key storage - Enforce HTTPS for non-localhost API URLs + input length limit (4000 chars) Security (Medium): - Atomic write for translation cache (temp file + rename) - Remove message content from error logs - Add URL validation in settings Performance: - Notification translation now cache-only (no network blocking) - Replace delay(500) with polling loop in AppFunctions readMessages Architecture: - Replace lambda callbacks with FragmentResult API in bottom sheets - Use WeakReference for singleton listener (prevent Activity leak) - Add destroy() to TranslationCache and TimelineTranslationManager - Add withTimeout(30s) to AppFunctions suspendCoroutine - Truncate Bundle data to 500KB to prevent TransactionTooLargeException Code Quality: - Change all Timber.w(TRANSLATION_DEBUG) to Timber.d() - Use dynamic targetLanguage instead of hardcoded French - Move hardcoded string to string resources New: AppFunctions (Android 16 inter-app API): - ElementAppFunctionService: searchMessages, readMessages, sendMessage, listRooms, summarizeRoom, getUnreadSummary - Intent-based fallback API for non-AppFunctions consumers - Data models with Moshi JSON serialization Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Full integration of AI-powered features using a local LLM (Ollama) via OpenAI-compatible API. Privacy-first: all AI processing happens on the user's own infrastructure, no data sent to third-party services.
Features
Architecture
TranslationService.complete()→ single OpenAI-compatible API endpointFiles changed (38 files, +2668 lines)
Key design decisions
Test plan
🤖 Generated with Claude Code