Skip to content

feat(web): onLinkPress and onMentionPress functionality#678

Open
hejsztynx wants to merge 12 commits into
mainfrom
@ksienkiewicz/feat-web-enriched-text-press-actions
Open

feat(web): onLinkPress and onMentionPress functionality#678
hejsztynx wants to merge 12 commits into
mainfrom
@ksienkiewicz/feat-web-enriched-text-press-actions

Conversation

@hejsztynx

Copy link
Copy Markdown
Collaborator

Summary

Implemented the onLinkPress and onMentionPress callback functionality.

Test Plan

  • write a mention or a link using the input in the example app
  • press on it
  • a relevant callback should be visible in the logs

Compatibility

OS Implemented
iOS
Android
Web

Checklist

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

Copilot AI review requested due to automatic review settings July 6, 2026 11:21
@hejsztynx hejsztynx marked this pull request as draft July 6, 2026 11:21

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

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.

Comment thread src/web/usePressInteractions.ts
Comment thread src/web/usePressInteractions.ts
Comment thread src/web/usePressInteractions.ts
@hejsztynx hejsztynx marked this pull request as ready for review July 6, 2026 11:52
Comment thread apps/example-web/src/testScreens/TestEnrichedText.tsx Outdated

@kacperzolkiewski kacperzolkiewski 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.

LGTM!

@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.

Overall looks solid but I noticed one strange thing; the press colors are prone to transitioning which looks pretty weird IMO. We could add a transition: none; to link's and mention's css rules which should disable it for them.

here's a video where I'm going over a press frame-by-frame:

Screen.Recording.2026-07-07.at.17.31.42.mov

@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.

A few things I noticed, but overall nice work

Comment thread src/web/usePressInteractions.ts Outdated
Comment thread src/web/styleConversion/buildMentionRulesCSS.ts
Comment thread src/web/styleConversion/htmlStyleToCSSVariables.ts Outdated
hejsztynx and others added 2 commits July 7, 2026 21:12
Co-authored-by: Igor Furgała <74370735+exploIF@users.noreply.github.com>
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.

5 participants