-
Notifications
You must be signed in to change notification settings - Fork 3k
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
change font size for code block in H1 #30876
change font size for code block in H1 #30876
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
src/components/HTMLEngineProvider/HTMLRenderers/CodeRenderer.js
Outdated
Show resolved
Hide resolved
src/components/HTMLEngineProvider/HTMLRenderers/CodeRenderer.js
Outdated
Show resolved
Hide resolved
src/components/HTMLEngineProvider/HTMLRenderers/CodeRenderer.js
Outdated
Show resolved
Hide resolved
Please update the test steps to the following:
|
src/components/HTMLEngineProvider/HTMLRenderers/CodeRenderer.js
Outdated
Show resolved
Hide resolved
Please run |
Please update the tests and the qa tests as mentioned above. Also please complete the screenshots for the rest of the platforms |
Reviewer Checklist
Screenshots/Videos |
@yakupafsin Thank you! PS: Next time please tag me after making such changes because there is no notification for those actions (change title, change description, etc.) |
@s77rt sorry, I've totally forgotten about it. Thank you for your time. And sorry for the hassle :). It was my first PR with Expensify. I'll try to do it more professionally next time. |
@yakupafsin I will not be able to merge this PR since it contains unsigned commits. Please retroactively sign all the commits for this PR so that I can merge it |
You've also got lint errors it seems |
@roryabraham because last 2 commits are co-authered woth @s77rt I guess that's why it looks unsigned. We need to undo that 2 commit and re-commit them. |
aa882a4
to
da842ee
Compare
@roryabraham I've removed that 2 commits and pushed 2 new commits. I guess all will be signed now. |
@roryabraham I've double-checked but couldn't find any lint errors. |
Mentioned that fontSize controlled by getCodeFontSize function in `StyleUtils.js` Signed-off-by: Yakup Afsin <[email protected]>
Signed-off-by: Yakup Afsin <[email protected]>
Signed-off-by: Yakup Afsin <[email protected]>
7abef85
to
2f4fe78
Compare
Hi @roryabraham, I've signed all the commits. Because I've changed my device I forgot change my gitconfig file. Sorry about that. But I've signed them now. |
@yakupafsin looks like we've got some lint errors here: https://github.com/Expensify/App/actions/runs/6792085078/job/18467959217?pr=30876 Also, NAB but if you don't mind I think we could generalize /**
* Check if there is an ancestor node for which the predicate returns true.
*
* @param {TNode} tnode
* @param {Function} predicate
* @returns {Boolean}
*/
function isChildOfNode(tnode, predicate) {
let currentNode = tnode.parent;
while (currentNode) {
if (predicate(currentNode)) {
return true;
}
currentNode = currentNode.parent;
}
return false;
}
/**
* Check if node is a child of a comment tag.
*
* @param {TNode} tnode
* @returns {Boolean}
*/
function isChildOfComment(tnode) {
return isChildOfNode(tnode, (node) => isCommentTag(node.domNode.name));
}
/**
* Check if node is a child of an h1 tag.
*
* @param {TNode} tnode
* @returns {Boolean}
*/
function isChildOfH1(tnode) {
return isChildOfNode(tnode, (node) => node.domNode.name.toLowerCase() === 'h1');
} |
@roryabraham I was planning to do something like this, but I decided not to touch someone else's code 😅. But yes, that looks better. Let me change it. |
Hi @roryabraham, I've found the lint error. And also applied the changes on htmlEngineUtils.js |
@yakupafsin please run |
@roryabraham now it's ready to merge I guess :) |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.3.98-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.98-5 🚀
|
@s77rt
Details
Created a new function to check if there is an ancestor node with the name 'h1' and applied on CodeRenderer.js to change code block font-size if it is inside h1 tag.
Fixed Issues
$ #30203
PROPOSAL: #30203 (comment)
Tests
Hello
and observe its font sizeHello
Offline tests
Not connectivity related.
QA Steps
Hello
and observe its font sizeHello
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
3dcfd030-8871-4fd6-871e-f5170f9a26a4.mp4
MacOS: Desktop