Skip to content

feat: text alignment text shortcuts - #781

Open
hejsztynx wants to merge 10 commits into
mainfrom
@ksienkiewicz/feat-text-alignment-shortcuts
Open

feat: text alignment text shortcuts#781
hejsztynx wants to merge 10 commits into
mainfrom
@ksienkiewicz/feat-text-alignment-shortcuts

Conversation

@hejsztynx

Copy link
Copy Markdown
Collaborator

Summary

Wired up textAlignment to the already existing textShortcuts feature

Test Plan

On the main example apps' screens, I've prepared basic textShortcuts so you can test this feature

## - toggle a heading style
++ - apply a center alignment

Play around, mix them together. Everything should work as expected.

Screenshots / Videos

Screen.Recording.2026-08-19.at.18.56.48.mov

Compatibility

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Copilot AI lite review requested due to automatic review settings August 19, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 textShortcuts configurations 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.

Comment thread src/web/pmPlugins/TextShortcutsPlugin.ts
Comment thread ios/utils/ShortcutsUtils.mm Outdated
hejsztynx and others added 2 commits August 19, 2026 19:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread ios/utils/ShortcutsUtils.mm Outdated

@szydlovsky szydlovsky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after some thought, iOS looks good 👍

Comment thread ios/EnrichedTextInputView.mm Outdated
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.

3 participants