Repository navigation
feat(snippets): add universal keyboard snippets with Dynamic Island & Duo integration - #1170
Open
Balajitechlabs wants to merge 34 commits into
Open
Balajitechlabs wants to merge 34 commits into
Balajitechlabs wants to merge 34 commits into
Conversation
- Implement animated drop-down capsule beneath the camera ring with OvershootInterpolator showing keyword and title preview - Expand Duo touch anchor window to 280dp x (diameter + 72dp) with screen-width boundary clamping - Prioritize snippet expansion tap with forgiving human touch slop (up to 650ms) and suppress ring gestures during active snippet interaction
…rgonomics - Dynamically measure active input field bounds directly on text change to position pill comfortably above keyboard - Add vertical drag gesture support to floating pill frame so users can move it out of the way - Route SNIPPETS_DISPLAY_BOTH concurrently to Dynamic Island and Duo camera ring while keeping keyboard typing area clear
…tegration - Implement getRecommendedSnippetsSuggestionDisplayMode() to dynamically evaluate active features (Island, Duo, or both) and default accordingly - Display (Recommended) badge on matching setup option in SnippetDisplayStyleSheet - Add Text snippets toggle with gear button and live mode descriptions to Dynamic Island and Duo settings screens - Streamline SnippetsBottomSheet settings hierarchy
…ard settings - Add SnippetIslandPlugin to display snippet keyword peeks on Dynamic Island - Register SnippetIslandPlugin in IslandCoordinator and expose showSnippet/hideSnippet - Update IslandController to execute custom interactions.onTap on Line stage items - Wire SnippetAccessibilityHandler lifecycle into ScreenOffAccessibilityService - Expose Text snippets item in KeyboardSettingsUI to open management bottom sheet
…-collapse - Allow InteractionOverrides.onLongPress to return Any? to support both Unit and Boolean lambdas - Prevent premature collapse in IslandController when onLongPress returns true - Route targeted item long-press events in IslandRoot before falling back to compact gestures
…n tap - Add localized action strings for insert and copy actions - Implement SnippetExpanded composable with header badge, preview, and button row - Wire clipboard copying on tap and long-press expansion in SnippetIslandPlugin
sameerasw
force-pushed
the
develop
branch
3 times, most recently
from
October 5, 2026 19:02
9fb6cff to
a453ce1
Compare
sameerasw
marked this pull request as draft
October 6, 2026 10:45
Balajitechlabs
marked this pull request as ready for review
October 11, 2026 12:51
sameerasw
requested changes
Oct 11, 2026
sameerasw
left a comment
Owner
There was a problem hiding this comment.
Request changes.
Blockers
- The feature defaults to on, and the PR adds
typeViewTextChangedto the shared accessibility service. Every user's text input in every app starts feeding it with no opt-in. Default it to off. {clipboard}expands into whatever field has focus. The default!quotesnippet uses it, so it can leak clipboard contents into the wrong field.replaceKeywordInNoderewrites the whole field withACTION_SET_TEXT.- It wipes formatting and spans.
- It uses
lastIndexOf, so it can replace the wrong occurrence when the cursor isn't at the end. - It never checks whether
performActionsucceeded. expandSnippetrelies on the stalelastTypedWord.
- There is no guard against re-triggering.
ACTION_SET_TEXTfires another text-changed event, which can show a suggestion right after expansion. - The accessibility handler also receives events from Essentials' own IME, which already expands on space. The same keystroke can expand twice.
- Keyword matching is inconsistent. The accessibility path is case-sensitive and the IME path is case-insensitive.
Serious
7. SnippetRepository can lose data.
- Writes run concurrently on
Dispatchers.IO, so an older save can overwrite a newer one. - The file is written in place, so a crash can truncate it.
- A corrupt file loads as empty, and the next edit overwrites it.
- Updates should use
MutableStateFlow.update.
findMatchingmatches any prefix and any title substring of two or more characters. Ordinary typing triggers suggestions in every app, and snippets also rank first in the IME suggestions.SuggestionEngineusesdistinctBy { it.text }, which can drop a snippet whose title equals a dictionary word. The spell-checker callback can also keep stale snippet suggestions from the previous word.showFloatingPillandhideFloatingPillrun in separatepostblocks on shared state. Rapid events can leave an orphan overlay.activeNodeis never released when replaced.- The
IslandControllerchange makesLinestage tap and long-press callonTapandonLongPressfirst. This touches the shared gesture path, so existing plugins need a regression check. - While a Duo snippet suggestion is active, all ring gestures are swallowed. If nothing hides it, the ring stays dead.
Minor
- Narrating comments and multi-line KDoc on
expandandfindMatching, against the repo rules. - The unrelated
intent?.tointent.change inScreenOffAccessibilityService. isKeyboardPackageusescontains("keyboard"), which can match non-IME apps.- Magic numbers for keyboard height and offsets.
- No tests for the expander, matching or replace logic.
sameerasw
marked this pull request as draft
October 11, 2026 14:51
Balajitechlabs
force-pushed
the
feature/ime-snippets
branch
from
October 11, 2026 15:15
7c672d4 to
ae72ef1
Compare
Balajitechlabs
marked this pull request as ready for review
October 11, 2026 15:24
Collaborator
Author
|
done 👍🏻 check now :} |
… a11y replacement, and touch isolation
# Conflicts: # app/src/main/res/values/strings.xml
Balajitechlabs
marked this pull request as ready for review
October 18, 2026 06:00
Collaborator
Author
|
minor change: should add permission checker and some minor improvements; everything else is fine |
…n and deduplicate settings
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.
Description
Adds universal text snippet expansion for external keyboards (Gboard, SwiftKey, physical keyboards) along with display integration across Dynamic Island, Duo camera ring, and a floating pill.
!keyword), multi-line text preview, and quick action buttons (Insert,Copy,Dismiss).Type of change
UI changes
Checklist
Before submitting, please make sure:
develop(notmain)../gradlew assembleDebug../gradlew testDebugUnitTest.SettingsRepositoryfor keys and getter/setter methods.FeatureRegistry.ktfor search indexing.ui/core/(RoundedCardContainer,IconToggleItem, etc.).res/values/strings.xmland drawables use rounded variants (R.drawable.rounded_*).