-
-
Notifications
You must be signed in to change notification settings - Fork 430
Improve Clibpboard and Inline Suggestions #1864
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
Conversation
- Make ClipboardSuggestionUi inside AlwaysUi - Don't remove suggestion on key action, keep it until timeout reached - Long click to edit clip text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request improves clipboard and inline suggestions functionality by refactoring the implementation and simplifying the state management. The PR has a typo in its title ("Clibpboard" should be "Clipboard"), but the actual code changes appear focused on consolidating inline suggestion handling into the QuickBar component and switching clipboard monitoring from system ClipboardManager to ClipboardHelper.
Key Changes:
- Refactored inline suggestions from a separate
SuggestionCandidateModuleto integrated handling withinQuickBar - Simplified
QuickBarStateMachineby removing separate Suggestion and Clipboard states - Created new
InlineSuggestionsUicomponent with support for pinned and scrollable suggestions - Added user preference toggle for inline suggestions
- Changed clipboard monitoring from system
ClipboardManagertoClipboardHelper - Removed
CandidateModulewrapper class and promotedCompactCandidateModuledirectly - Updated drawable resources for inline suggestions with separate light/dark themes
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Added string resource for inline suggestions preference |
| app/src/main/res/values-zh-rTW/strings.xml | Added Traditional Chinese translation for inline suggestions |
| app/src/main/res/values-zh-rCN/strings.xml | Added Simplified Chinese translation for inline suggestions |
| app/src/main/res/drawable/bg_inline_suggestion_light.xml | New drawable resource for light theme inline suggestions (has XML structure issue) |
| app/src/main/res/drawable/bg_inline_suggestion_dark.xml | Updated drawable colors for dark theme inline suggestions (has XML structure issue) |
| app/src/main/java/com/osfans/trime/ime/keyboard/CommonKeyboardActionListener.kt | Removed clipboard content handling call |
| app/src/main/java/com/osfans/trime/ime/dependency/InputComponent.kt | Changed candidate type from CandidateModule to CompactCandidateModule |
| app/src/main/java/com/osfans/trime/ime/core/TrimeInputMethodService.kt | Added inline suggestions preference check and refactored to use new InlineSuggestions object |
| app/src/main/java/com/osfans/trime/ime/core/InputView.kt | Simplified inline suggestions handling by delegating to QuickBar |
| app/src/main/java/com/osfans/trime/ime/core/InlineSuggestions.kt | New object to create inline suggestion requests with themed styling |
| app/src/main/java/com/osfans/trime/ime/candidates/suggestion/* | Removed SuggestionViewItem, SuggestionViewAdapter, SuggestionItemUi, SuggestionCandidateModule, InlineSuggestionHelper |
| app/src/main/java/com/osfans/trime/ime/candidates/compact/CompactCandidateModule.kt | Added @Inject and @InputScope annotations for dependency injection |
| app/src/main/java/com/osfans/trime/ime/candidates/CandidateModule.kt | Removed wrapper class |
| app/src/main/java/com/osfans/trime/ime/bar/ui/InlineSuggestionsUi.kt | New UI component for displaying inline suggestions with pinned and scrollable views |
| app/src/main/java/com/osfans/trime/ime/bar/ui/InlineSuggestionUi.kt | Removed old inline suggestion UI wrapper |
| app/src/main/java/com/osfans/trime/ime/bar/ui/ClipboardSuggestionUi.kt | Updated license header and added GestureFrame wrapper with ripple effect |
| app/src/main/java/com/osfans/trime/ime/bar/ui/AlwaysUi.kt | Added Clipboard and InlineSuggestion states, integrated new UI components |
| app/src/main/java/com/osfans/trime/ime/bar/QuickBarStateMachine.kt | Simplified by removing Suggestion and Clipboard states and related transitions |
| app/src/main/java/com/osfans/trime/ime/bar/QuickBar.kt | Major refactoring: integrated inline suggestions and clipboard handling, switched to ClipboardHelper |
| app/src/main/java/com/osfans/trime/data/prefs/AppPrefs.kt | Added inline suggestions preference toggle |
Comments suppressed due to low confidence (1)
app/src/main/res/drawable/bg_inline_suggestion_dark.xml:13
- The
android:shape="rectangle"attribute should not be on the<item>element. It should either be removed (as the<shape>element defaults to rectangle) or moved to the<shape>element inside. The current structure is invalid XML for Android drawables.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Make InlineSuggestionsUi inside AlwaysUi - Improve the UI design - Add preference to enable or disable it
bead0f7 to
9095f8b
Compare
Pull request
Issue tracker
Fixes will automatically close the related issues
Fixes #
Fixes #
Feature
Describe features of this pull request
Code of conduct
Code style
make sytle-lintBuild pass
make debugManually test
Code Review
Daily build
Login and download artifact at https://github.com/osfans/trime/actions
Additional Info