-
-
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 #4781: Fixed zoom in Problem with code editor #4783
Conversation
Btw I'm not sure that hardcoding magic numbers is the right approach. It's just going to fail on other zooms. The idea of the code lines not extending beyond a certain width seems independent of the numerical value for that width, and I think the code should reflect that. There might be some way in codemirror to say "don't allow stuff to overflow". |
Hi @seanlip, I think this will work. These numbers are not randomly taken. The problem was that all the area was in one div except the logo. The div was following the rule "don't allow overflow" but the problem was the logo was outside the div by -87 px so the rule was not applicable to this logo. I just made the div larger by 87px to fit that logo in the div. |
I'm saying that typing in codemirror should not cause all the surrounding parts to change size as a matter of principle (just like me typing a long sentence into this github textarea doesn't cause it to change size). The magic numbers here are hard to maintain and no one is going to know about the significance of 87px and how it relates to the other numbers several months down the road. So I think this needs to be solved at a different level. |
Typing in code mirror does not increase size now since that was fixed in one of my PR. |
Oh, I see, thanks for explaining -- I think #4781 was described a bit vaguely. If that's the case, a solution like this might work, but can you put comments in the CSS so that it's clear what the aim is and what the 87px refers to? Also for numbers that are derived from 87 we should explain how they are computed. Passing the review back to @WickedBrat and @AllanYangZhou. Thanks! |
Sure @seanlip! Thanks 😄 |
Codecov Report
@@ Coverage Diff @@
## develop #4783 +/- ##
===========================================
+ Coverage 44.73% 44.74% +<.01%
===========================================
Files 385 385
Lines 23459 23463 +4
Branches 3791 3793 +2
===========================================
+ Hits 10494 10498 +4
Misses 12965 12965
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.
Thanks @bansalnitish! Visually, the change looks good to me.
Code mostly looks good, just some comments/questions.
width: 100%; | ||
z-index: 3; | ||
} | ||
|
||
/* Some mobile devices have CSS width below 360px, use a responsive min-width | ||
when under 360px to prevent pushing things offscreen. */ | ||
@media(max-width: 360px) { |
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 wondering, I assume you're adding 87px here but what effect does that have?
Also, you should update the above comment so its clear and matches your new max-width value.
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 think we don't need to add 87px here. 360px works fine as we are just fixing min-width of the div to 100vw when max-width is 360px for some mobile devices.
I have reverted the changes @AllanYangZhou .
Let me know if I am wrong here.
Thanks
@@ -1,4 +1,4 @@ | |||
<div layout="row" layout-align="space-between center" style="background-color: white;"> | |||
<div layout="row" layout-align="space-between center" style="background-color: white; margin-left: 87px;"> |
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.
As sean mentioned, don't forget to add some comments explaining the 87px.
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!
@AllanYangZhou I have added the comments. |
Great, LGTM. @WickedBrat do you have time to take a look? |
* upstream/develop: (114 commits) Fix line too long (oppia#4798) Fix oppia#4374: Docstrings added to core/domain/stats_jobs_one_off.py (oppia#4757) Fixes oppia#4055: Removes redundant css selector from conversation_skin_directive.html (oppia#4790) Fix oppia#3971: add activity indicator to feedback updates (oppia#4785) Fix part of oppia#4374 : Update docstrings to core.domain.stats_domain. (oppia#4731) Fix oppia#2620 (oppia#4791) Removes unused angular dependecies injected into controllers (oppia#4792) Fix oppia#4367 : Prevent null-submission for MathExpressionInput interaction (Upgraded guppy 260da6--->b5055b) (oppia#4753) Upgrade GAE version to 1.9.67. (oppia#4786) Fix #4781: Fixed zoom in Problem with code editor (oppia#4783) Changed timeout for popup to 4 seconds. (oppia#4706) Fixes oppia#3982 : Added 'open' in the open feedback thread summary. (#4767) Fix oppia#4778: Changed is_community_owned to make_community_owned. (oppia#4780) Revert "Fixes #4530: Removes spaces and new lines from end of string in RTE. (#4748)" (oppia#4782) Fixed oppia#4537: Navigating between admin pages on url change (oppia#4777) Added $log dependency in missing places. (oppia#4772) Add missing dependency. (oppia#4769) Fix oppia#3478: Added functionality to sort nodes list. (oppia#4708) Fixes #4530: Removes spaces and new lines from end of string in RTE. (#4748) Fixes oppia#4410: Fixed info modal for private explorations (#4754) ...
…" (oppia#4905) This reverts commit 73be244.
This reverts commit 73be244.
Explanation
Fixes #4781:
Zoom in problem is fixed.
Screenshots are attached below:
Zoom in: 150%
Zoom in: 175%
Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.