Skip to content

Conversation

@WhiredPlanck
Copy link
Collaborator

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

Build pass

  • make debug

Manually test

  • Done

Code Review

  1. No wildcards import
  2. Manual build and test pass
  3. GitHub Action CI pass
  4. At least one contributor review and approve
  5. Merged clean without conflicts
  6. PR will be merged by rebase upstream base

Daily build

Login and download artifact at https://github.com/osfans/trime/actions

Additional Info

- Make ClipboardSuggestionUi inside AlwaysUi
- Don't remove suggestion on key action, keep it until timeout reached
- Long click to edit clip text
Copy link

Copilot AI left a 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 SuggestionCandidateModule to integrated handling within QuickBar
  • Simplified QuickBarStateMachine by removing separate Suggestion and Clipboard states
  • Created new InlineSuggestionsUi component with support for pinned and scrollable suggestions
  • Added user preference toggle for inline suggestions
  • Changed clipboard monitoring from system ClipboardManager to ClipboardHelper
  • Removed CandidateModule wrapper class and promoted CompactCandidateModule directly
  • 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
@WhiredPlanck WhiredPlanck merged commit 09a229b into osfans:develop Dec 25, 2025
3 checks passed
@WhiredPlanck WhiredPlanck deleted the bar-20251225 branch December 25, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants