-
Notifications
You must be signed in to change notification settings - Fork 95
[iOS & Android] Enable borderRadius in all mention types #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[iOS & Android] Enable borderRadius in all mention types #720
Conversation
…s to all mentions
apple/MarkdownTextLayoutFragment.mm
Outdated
| CGFloat marginLeft = _markdownUtils.markdownStyle.blockquoteMarginLeft; | ||
| CGFloat borderWidth = _markdownUtils.markdownStyle.blockquoteBorderWidth; | ||
| CGFloat paddingLeft = _markdownUtils.markdownStyle.blockquotePaddingLeft; | ||
| CGFloat shift = marginLeft + borderWidth + paddingLeft; | ||
|
|
||
| fragmentTextBounds.origin.x -= (paddingLeft + borderWidth) + shift * ([_depth unsignedIntValue] - 1); | ||
| fragmentTextBounds.size.width = borderWidth + shift * ([_depth unsignedIntValue] - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the blockquote logic is now duplicated, can we somehow dedupe it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already :/
I could create a helper function to get the shift to make it look better but the logic would stay unchanged
I think we need it to be that way because boundingRect is also used in renderingSurfaceBounds
…e` to a separate file
android/src/main/java/com/expensify/livemarkdown/spans/MarkdownBackgroundSpan.java
Outdated
Show resolved
Hide resolved
|
I fixed last known iOS issue in this commit - 28b6a13 |
jmusial
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno if those are connected to this PR, or just existing bugs. In all cases, it's just on mobile devices
- android, switching to single line breaks highlights :(
Screen.Recording.2025-08-22.at.13.04.20.mov
- android, Cursor not visible when within
codeblockormention
Screen.Recording.2025-08-22.at.13.08.38.mov
|
Na ios dzieją się rzeczy niestworzone :( Ale to też single - line to jest Simulator.Screen.Recording.-.iPhone.15.Pro.-.2025-08-22.at.14.34.03.mp4 |
We can try to fix it in a separate PR but I think we need to consult with the design team. I'll leave it as an open idea because it's not in the scope of this PR Thanks for noticing! |
For the context, this was discussed on Slack: https://swmansion.slack.com/archives/C01GTK53T8Q/p1755699466781499 |
|
@tomekzaw @parasharrajat @Skalakid PR's ready for review 🎉 Please review it carefully and ask me any questions because the solution is quite complicated in a few places. If you think adding comments would be valuable let me know! |
Skalakid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, amazing work! Left some comments, but overall LGTM
android/src/main/java/com/expensify/livemarkdown/spans/MarkdownBackgroundSpan.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/expensify/livemarkdown/spans/MarkdownBackgroundSpan.java
Show resolved
Hide resolved
| mPreBackgroundColor = parseColor(map, "pre", "backgroundColor", context); | ||
| mMentionHereColor = parseColor(map, "mentionHere", "color", context); | ||
| mMentionHereBackgroundColor = parseColor(map, "mentionHere", "backgroundColor", context); | ||
| mMentionHereBorderRadius = parseFloat(map, "mentionHere", "borderRadius") * screenDensity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep the original value of borderRadius in MarkdownStyle and multiply it by screenDensity near the drawing logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that but context is not available in span so I had to pass it down and the code looked messy
We can do that but this approach is much cleaner
|
@parasharrajat kind bump :) |



Details
This PR adds support for
borderRadiusprop in mentions styles on iOS & AndroidRelated Issues
Expensify/App#19299
Manual Tests
iOS & Android:
Linked PRs