-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[CP Stag] Fix inline code font size in composer #39516
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
[CP Stag] Fix inline code font size in composer #39516
Conversation
|
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| }, | ||
| pre: { | ||
| fontFamily: FontUtils.fontFamily.platform.MONOSPACE, | ||
| fontSize: 13, |
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've copied 13 from here:
Lines 185 to 193 in 7177173
| pre: { | |
| ...baseCodeTagStyles(theme), | |
| paddingVertical: 8, | |
| paddingHorizontal: 12, | |
| fontSize: 13, | |
| fontFamily: FontUtils.fontFamily.platform.MONOSPACE, | |
| marginTop: 0, | |
| marginBottom: 0, | |
| }, |
Perhaps we should expose it as variables.preFontSize?
| }, | ||
| code: { | ||
| fontFamily: FontUtils.fontFamily.platform.MONOSPACE, | ||
| fontSize: 13, // TODO: should be 15 if inside h1, see StyleUtils.getCodeFontSize |
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.
Currently, react-native-live-markdown supports only one fixed value for font size for each individual Markdown syntax style. However, the actual font size depends on whether the inline code is inside h1 or not:
Lines 595 to 600 in 7177173
| /** | |
| * Returns the font size for the HTML code tag renderer. | |
| */ | |
| function getCodeFontSize(isInsideH1: boolean) { | |
| return isInsideH1 ? 15 : 13; | |
| } |
I suggest that we use 13 for now as we need more time to implement it properly on Live Markdown side.
Here's how it looks with 13:
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.
@thienlnam What do you think? Can we skip this edge case as for now?
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.
Yeah this seems fine to skip
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Reviewer Checklist
Screenshots/Videos |
|
@thienlnam Please review and merge here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
…line-code-font-size Fix inline code font size in composer (cherry picked from commit 0967e60)
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.60-13 🚀
|






Details
This PR unifies the font size of codeblock and inline code between chat history and composer box by setting the correct font size in composer box (Live Markdown Preview feature).
cc @thienlnam
Android:

iOS:

Web:

Fixed Issues
$ #39458
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop