feat(web): onLinkPress and onMentionPress functionality#678
Open
hejsztynx wants to merge 10 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Web support for onLinkPress and onMentionPress in EnrichedText, including press-state styling via CSS variables and validating behavior through Playwright E2E coverage.
Changes:
- Introduces a Web press-interaction hook to intercept clicks on links, mentions, and checkbox list inputs.
- Extends HTML-style → CSS-variable conversion and mention CSS generation to support press-state colors (links + mentions).
- Updates docs + example-web screen and adds Playwright tests for link/mention presses (including inside lists).
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/usePressInteractions.ts | New click-interaction hook to emit onLinkPress / onMentionPress and manage checkbox click behavior. |
| src/web/styleConversion/htmlStyleToCSSVariables.ts | Adds enriched-text press CSS variables (link + mention) and helper conversion API. |
| src/web/styleConversion/buildMentionRulesCSS.ts | Adds mention press-state CSS rules and CSS var fallbacks to default mention style. |
| src/web/styleConversion/tests/htmlStyleToCSSVariables.test.ts | Adds unit tests for enriched-text press CSS variables and fallback behavior. |
| src/web/styleConversion/tests/buildMentionRulesCSS.test.ts | Updates/extends tests for mention CSS var fallbacks and press-state rules. |
| src/web/EnrichedText.tsx | Wires new press callbacks into the web EnrichedText component using stable refs. |
| src/web/EnrichedText.css | Adds link :active styling; adjusts checkbox list interactivity to allow presses. |
| docs/WEB.md | Documents that web now supports onLinkPress / onMentionPress. |
| docs/TEXT_API_REFERENCE.md | Updates platform support tables to include Web for press callbacks. |
| apps/example-web/src/testScreens/TestEnrichedText.tsx | Displays last press events for verification and E2E assertions. |
| apps/example-web/src/App.tsx | Adds demo handlers logging link/mention press events. |
| .playwright/tests/enrichedTextPress.spec.ts | Adds E2E coverage for link/mention presses (incl. nested styling + list cases). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
exploIF
approved these changes
Jul 6, 2026
Comment on lines
+30
to
+35
| onLinkPress={(event) => { | ||
| setLastLinkPress(event); | ||
| }} | ||
| onMentionPress={(event) => { | ||
| setLastMentionPress(event); | ||
| }} |
Collaborator
There was a problem hiding this comment.
Suggested change
| onLinkPress={(event) => { | |
| setLastLinkPress(event); | |
| }} | |
| onMentionPress={(event) => { | |
| setLastMentionPress(event); | |
| }} | |
| onLinkPress={setLastLinkPress} | |
| onMentionPress={setLastMentionPress} |
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
Implemented the
onLinkPressandonMentionPresscallback functionality.Test Plan
Compatibility
Checklist