feat: text alignment text shortcuts - #781
Open
hejsztynx wants to merge 10 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Wires text alignment (left/center/right/justify) into the existing textShortcuts feature so users can apply alignment via typed triggers across web, iOS, and Android.
Changes:
- Web: Adds alignment shortcut handling to the TipTap text shortcuts plugin (including “don’t reapply if already aligned” logic).
- Native: Updates iOS and Android shortcut handlers to allow alignment shortcuts even when other paragraph styles (e.g., headings) are active.
- Examples: Adds demo
textShortcutsconfigurations to the example apps for manual verification.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/pmPlugins/TextShortcutsPlugin.ts | Allows alignment styles to be applied via paragraph shortcuts and avoids reapplying the same alignment. |
| src/types.ts | Extends TextShortcutStyle union with alignment values. |
| ios/utils/ShortcutsUtils.mm | Enables alignment shortcuts to run even when other paragraph styles are active; preserves typing attributes for empty-editor alignment edge case. |
| ios/EnrichedTextInputView.mm | Adds a guard to prevent typing-attributes reset from wiping newly-applied alignment in empty-editor scenarios. |
| ios/EnrichedTextInputView.h | Exposes a flag used to preserve typing attributes during empty checks after alignment shortcuts. |
| apps/example/src/screens/DevScreen.tsx | Adds sample textShortcuts for manual testing in the RN example app. |
| apps/example-web/src/App.tsx | Adds sample textShortcuts for manual testing in the web example app. |
| android/src/main/java/com/swmansion/enriched/textinput/utils/StyleUtils.kt | Introduces alignment shortcut detection helpers. |
| android/src/main/java/com/swmansion/enriched/textinput/utils/ShortcutsHandler.kt | Allows alignment shortcuts to apply even when paragraph has other non-alignment styles. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
szydlovsky
reviewed
Aug 21, 2026
szydlovsky
approved these changes
Aug 24, 2026
szydlovsky
left a comment
Collaborator
There was a problem hiding this comment.
after some thought, iOS looks good 👍
Co-authored-by: Mikołaj Szydłowski <9szydlowski9@gmail.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
Wired up
textAlignmentto the already existingtextShortcutsfeatureTest Plan
On the main example apps' screens, I've prepared basic
textShortcutsso you can test this feature##- toggle a heading style++- apply a center alignmentPlay around, mix them together. Everything should work as expected.
Screenshots / Videos
Screen.Recording.2026-08-19.at.18.56.48.mov
Compatibility
Checklist