-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Fix #5949: Make RTE spacing uniform #5953
Conversation
Hi @seanlip, @bansalnitish PTAL! |
Codecov Report
@@ Coverage Diff @@
## develop #5953 +/- ##
==========================================
Coverage ? 45.47%
==========================================
Files ? 517
Lines ? 30378
Branches ? 4571
==========================================
Hits ? 13814
Misses ? 16564
Partials ? 0 Continue to review full report at Codecov.
|
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.
Hi @ankita240796,
You cleared of the paragraph spaces that were indeed needed in the preview mode. The expected thing to do here was to add the spaces at the start of next paragraph in the editor mode (though in the preview mode it works fine).
You cleared off the spaces that should be there at the start of paragraph in the preview mode. Let me know if you need some more clarification on this one.
Hi @bansalnitish, I have made the changes as suggested by you. PTAL! |
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 good!
A minor nit and also one thing to note here is that we don't need bottom margin for the last paragraph. You could try something like:
.oppia-rte > p:not(:last-child) {
line-height: 1.5;
margin-bottom: 18px;
}
*/ | ||
.rte-viewer > p { | ||
line-height: 28px; | ||
margin-bottom: 18px; | ||
margin-top: 18px |
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.
Missing Semicolon!
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.
Done, PTAL!
Hi @bansalnitish, I have made the changes, PTAL! |
Hi @ankita240796, This works fine in the editor mode but just try creating an item selection exploration and click the preview button. All those paragraph spaces are gone! This needs to be fixed. Screenshot: This is what I got. |
Hi @bansalnitish, I have made the paragraph margin consistent for all p tags. I also tested it for various interactions and hints as well. It works fine now, PTAL! Thanks! |
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.
This looks like a good fix @ankita240796. LGTM!
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.
In the editor view, when not in editing mode:
In the editor view, while editing:
- I think the spacing is different while editing, while the spacing matches on the editor and preview tabs.
- The spacing below the image also differs.
- In the original issue report, the comparison was between the "while editing" stage and the "not editing" state of the editor view.
To me it still looks like the spacing is different. Is this similar to what you see @bansalnitish? If so I think the issue is still not fixed...
text-align: left; | ||
word-spacing: 0; | ||
word-break: break-word; | ||
} | ||
|
||
p:last-child { |
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.
Hi @bansalnitish, @ankita240796 I think this will affect all paragraph tags on Oppia right? Is this intended? Just clarifying...
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.
Yes @nithusha21 , it affects the behaviour of all paragraph tags on Oppia but it provides a consistent behaviour as well. I checked for various pages and interactions and the change does not create any issues.
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.
Just to avoid merge!
I tried some other stuff as follows: We can fix p tags in rte editor using the following css:
This introduces issues with multiple choice and item selection interaction where margin is seen in editor but not in preview. To fix that we can use following css:
Further this leaves p tags without margin in add response modal which are not nested in some specific class. Here is a screenshot for the same: We can either introduce a class or use the Can you please provide your inputs here about how can I further approach this issue. Thanks! |
Hmmm, I am not sure. Deferring to @bansalnitish |
@nithusha21 to me the spacing looks good, I have some screenshots for the same. I also checked the spacing between paragraphs via the inspect element and it's In the editor mode while editing: |
Ah I see..... The paragraph spacing looks good to me. I think I was confused 😅. I was looking at the line spacing (Within a paragraph). And that still looks off to me. Can we file an issue for that? (If you can confirm the behavior, and also check if there already exists an issue for the same). |
Also, thanks for filing the issue for image spacing I pointed out! 😄 |
Yes, you're right @nithusha21 the line spacing in the editor mode while editing and after saving look different to me as well. I'll check once again and file an issue (if it exists). |
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.
Thanks @ankita240796 for the PR, LGTM!
Explanation
Fixes #5949: Adding bottom margin for paragraphs in editor mode fixes the issue of inconsistent spacing.
Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.