feat(web): textShortcuts support#665
Conversation
There was a problem hiding this comment.
Pull request overview
Adds web support for the textShortcuts prop by introducing a TipTap/ProseMirror plugin that converts typed trigger sequences into paragraph styles (lists/headings/etc.) and inline marks (bold/italic/code/etc.), and updates the example app + Playwright coverage to validate the behavior.
Changes:
- Introduce
TextShortcutsPlugin(web) to implement paragraph + inline shortcut handling viahandleTextInput. - Remove built-in list input rules in
EnrichedOrderedList/EnrichedUnorderedListso list triggers are driven bytextShortcuts. - Wire
textShortcutsthrough the web editor, exportTextShortcut, and add example UI + Playwright tests for default/custom/disabled scenarios.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/pmPlugins/TextShortcutsPlugin.ts | New web plugin implementing paragraph + inline text shortcuts via ProseMirror transactions. |
| src/web/formats/EnrichedUnorderedList.ts | Removes default input rule so list creation is controlled by textShortcuts. |
| src/web/formats/EnrichedOrderedList.ts | Removes default input rule so list creation is controlled by textShortcuts. |
| src/web/EnrichedTextInput.tsx | Plumbs textShortcuts into the editor and configures TextShortcutsPlugin. |
| src/index.tsx | Re-exports TextShortcut type for consumers. |
| apps/example-web/src/testScreens/VisualRegression.tsx | Adds a UI override for textShortcuts JSON in the visual regression screen. |
| .playwright/tests/textShortcuts.spec.ts | Adds E2E coverage for default/custom/disabled shortcuts and mark-clearing behavior. |
| .playwright/helpers/visual-regression.ts | Adds a selector + helper to set the text shortcuts override input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
hejsztynx
left a comment
There was a problem hiding this comment.
Currently applying shortcut styles, strips the current inline styles
Screen.Recording.2026-07-02.at.10.03.00.mov
szydlovsky
left a comment
There was a problem hiding this comment.
Found one more thing that I'm kinda uncertain about; do we always check only for the previous shortcut delimiters? As you can see on the recording here, only the trailing ones actually work and I'm unsure if it's expected (what do mobile platforms do?):
Screen.Recording.2026-07-07.at.16.15.49.mov
@szydlovsky The mobile implementations work the same way. When implementing this feature, I used Slack's mobile implementation as a reference, and it behaves the same way. |
| // eslint-disable-next-line @typescript-eslint/no-unsafe-return | ||
| return JSON.parse(raw) as TextShortcut[]; |
There was a problem hiding this comment.
Could you elaborate why eslint is complaining here and why it's safe to do it that way?
There was a problem hiding this comment.
It's inside the example-web app. I noticed an eslint warning, so I thought we could simply disable eslint for that line since it's only used in our internal example app.
|
|
||
| ## Enriched Text Input | ||
|
|
||
| ### What works |
There was a problem hiding this comment.
Before making web stable we should completely remove this section, as by default everything should work (other than known limitations)
There was a problem hiding this comment.
I save the note about it

Summary
Add
textShortcutssupport for webTest Plan
Screenshots / Videos
Screen.Recording.2026-06-30.at.11.02.12.mov
Compatibility
Checklist