Repository navigation
Conversation
hsource
force-pushed
the
feat/link-destination-in-style-state
branch
3 times, most recently
from
September 24, 2026 00:03
1a2dc79 to
8d6d19a
Compare
hsource
force-pushed
the
feat/link-destination-in-style-state
branch
from
September 24, 2026 00:29
8d6d19a to
d5fedc9
Compare
onChangeState and context-menu styleState.link now include destination when the caret is inside a manual link, including at the half-open range end index where iOS often places the caret. Co-authored-by: Cursor <cursoragent@cursor.com>
… flow The playground prints the latest onChangeState payload as JSON, and the flow checks that tapping into a link reports its destination. Co-authored-by: Cursor <cursoragent@cursor.com>
hsource
force-pushed
the
feat/link-destination-in-style-state
branch
from
September 24, 2026 00:48
d5fedc9 to
a33aa49
Compare
Author
|
Moved upstream: software-mansion#883 |
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.
Note: this PR has been manually reviewed and is a version of code that's been part of the Wanderlog (wanderlog.com) mobile apps for the past 3 weeks
What/Why?
Rich-text toolbars need the URL of the link at the caret, not only whether link formatting is active (for example, to prefill an "edit link" dialog). This adds
destinationtostyleState.linkinonChangeStateand in the context-menuonPressevent.StyleState.linkis now a discriminated union,{ isActive: false } | { isActive: true; destination: string }, so TypeScript can narrow onisActive. Both platforms send{ isActive, destination }withdestinationset to""when there's no link, matching the codegen spec, and JS narrows it with a single ternary.setLink,removeLinkand the iOS link prompt, so they always agree: the link containing the first selected character, or, for a collapsed caret, the link the caret is inside or right after. Link ranges are half-open, and the caret often lands just past a link's last character after tapping it. Before, the toolbar could show a link as active at that position whileremoveLinkfound nothing. On Android,setLinknow also updates an existing link's URL like iOS does, instead of requiring a selection. Backspace still deletes a link atomically based on the character before the caret.onChangeStateevent when only the destination changes, for example when moving the caret between two adjacent links.onChangeStatepayload as JSON under the input, and a Maestro flow checks the link's destination in it.Testing
Checks run:
yarn typecheck, eslint, clang-format on the changed iOS files, ktlint, AndroidcompileDebugKotlin, and example app builds for the iOS simulator (iPhone 17, iOS 26.4) and a Pixel 6a.Test results for linkDestination
link_destination_test.yamlpasses on both platforms: after creating a link and tapping into it, the style state reports the link as active withdestinationhttps://example.com. The recordings show the playground's style-state JSON under the input. The flow swipes the formatting toolbar first, because the link button is now off-screen at the end of it (the existinglink_test.yamlonmainhas the same problem).Manual testing for unified iOS logic
Here's some additional manual testing after the iOS link logic changes. I specifically tested:
PR Checklist