-
-
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 #3093: Popover of Userhelp button remains constant when the user creates the exploration for the first time. #3267
Conversation
Added .popover class that overtakes thridparty.css class
Codecov Report
@@ Coverage Diff @@
## develop #3267 +/- ##
===========================================
+ Coverage 45.6% 45.95% +0.34%
===========================================
Files 222 237 +15
Lines 18176 18350 +174
Branches 2931 2951 +20
===========================================
+ Hits 8290 8433 +143
- Misses 9886 9917 +31
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, @shaz13! This looks good to me. However, while it solves the problem of not being able to access the navigation dropdown, I'm going to loop in @anthkris for an opinion on whether this is sufficient or if we still want to also make the popover disappear after five seconds or on click.
@anthkris -- I feel like this is probably sufficient, but is there anything else I'm not considering?
@jaredsilver @shaz13 My gut feeling is that it ought to fade out after several seconds (5 at least, I think). I mean it's just sitting there, tooltip in perpetuity. It's not in anyone's way anymore, but it might still be distracting. Also @shaz13, I noticed that it doesn't travel with the page when the screen is resized. That seems like an issue. |
@anthkris After going through the code-base realized that, "5 second" popup rule is already present. After exploring and testing further. The current behavior seems apt with the code. The $scope value does changes from Do correct me if my theory does not set right. Please do suggest a further approach.
Kindly do guide me @anthkris @jaredsilver |
Okay @shaz13 I think I get what you're saying. So my recommendation would be to try and figure out how to get that script to work (in other words, debug first). If there's just no way it can work in it's current form, then try fix it some other way. |
I'm not terribly familiar with Angular, but from my very limited understanding what I suspect may be happening here is the view is not properly synchronizing with This might be of interest: https://nathanleclaire.com/blog/2014/01/31/banging-your-head-against-an-angularjs-issue-try-this/ |
The isLargeScreen interupted the postTutorialHelpPopoverIsShown= false value. Henced in the favour of expected behavior removed the ng-if condition.
@jaredsilver Thanks for the reference. After going through it realised that the present code was just fine but there was problems if @anthkris The popup inherits properties from Would 5 second fade off rule will supplement for resizing? Kindly, review the current commit. 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.
Thanks a bunch, @shaz13!
I'm pretty happy with this on large screens, but removing the ng-if="ifLargeScreen"
seems to mean that the popover will also appear on smaller screens:
(See upper right.)
It would be ideal if we could avoid this.
Sure. I have noticed it too. Thanks for pointing out. I will first
experiment with another $scope for ng-if tag and make some changes to see
if it works.
Or will introduce a @media only class which should solve the large screen
only issue.
…On Apr 6, 2017 8:39 AM, "Jared Silver" ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Thanks a bunch, @shaz13 <https://github.com/shaz13>!
I'm pretty happy with this on large screens, but removing the
ng-if=ifLargeScreen seems to mean that the popover will also appear on
smaller screens:
[image: screen shot 2017-04-05 at 11 06 57 pm]
<https://cloud.githubusercontent.com/assets/1312199/24736233/c9691cf4-1a54-11e7-86a2-e1ffb831a998.png>
It would be ideal if we could avoid this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3267 (review)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AXToVeenMPQW2LrA1FPmk97ookSmNlxRks5rtFdVgaJpZM4MwjDY>
.
|
isLargeScreen condition checked at the function $scope.$on('openPostTutorialHelpPopover', function()
@jaredsilver Thought about a CSS fix with media and |
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, @shaz13! LGTM from the design side of things!
@kevinlee12 -- could you take a quick look to make sure the code here looks alright? |
@jaredsilver, sure! |
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 @shaz13, I have a minor comment. Once that is addressed, we can merge this.
@@ -38,10 +38,14 @@ oppia.directive('editorNavigation', [function() { | |||
$scope.postTutorialHelpPopoverIsShown = false; | |||
|
|||
$scope.$on('openPostTutorialHelpPopover', function() { | |||
$scope.postTutorialHelpPopoverIsShown = true; | |||
$timeout(function() { | |||
if ($scope.isLargeScreen) { |
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.
Move $scope.isLargeScreen
above this function, this is so that we can get that defined before this gets a chance to trigger.
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.
Actually -- I think everything gets initialized before anything runs, so the existing code is fine. Does it not trigger on your end?
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.
Hmm, on second thought (and trial), it is fine, though it might be better if we shift those variable instantiation higher up for readability's sake.
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.
@kevinlee12 openPostTutorialHelpPopover
triggers when the user comes to create explorations for the first time.
If adopted this code:
if ($scope.isLargeScreen) {
$scope.$on('openPostTutorialHelpPopover', function() {
$scope.postTutorialHelpPopoverIsShown = true;
$timeout(function() {
$scope.postTutorialHelpPopoverIsShown = false;
}, 5000);
});
} else {
$scope.postTutorialHelpPopoverIsShown = false;
}
The helptool tip doesnt appear at all. Because, scripts of isLargeScreen execute first and misses openPostTutorialHelpPopover before it could initialize.
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.
nope, that's not what I meant. I was speaking of moving line 103 above this function.
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 line: $scope.isLargeScreen = (windowDimensionsService.getWidth() >= 1024);
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.
@kevinlee12 Sure. Will push another commit on 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.
Done
@@ -81,3 +81,11 @@ | |||
{% endif %} | |||
</ul> | |||
</script> | |||
<style type="text/css"> | |||
.popover { |
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 is too broad and needs to be scoped to just this directive.
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.
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.
PR #3277
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.
That PR has the same mistake. /cc @shivanXI
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.
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.
Sorry, I don't know, and I can't look into that now, but you're right that if there are conflicts the person whose PR gets merged later must handle them. This is a normal part of shared repository dev workflows so I wouldn't worry too much about it -- but if your PRs overlap then you should coordinate and figure out what to do.
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.
@seanlip Sure. 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.
My 2 cents: just proceed with the PR as-is, only because #3277 is now focused on changing the color (which means that PR will have to remove parts where it duplicates work on this PR).
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.
@kevinlee12 Sure.
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 @shaz13, just the CSS name, once you are done, please assign this PR back to me. thanks!
@@ -81,3 +81,11 @@ | |||
{% endif %} | |||
</ul> | |||
</script> | |||
<style type="text/css"> | |||
ul .popover.bottom { |
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 is still problematic, can you introduce a new class name that is unique to the popover? What I am saying is to add another class along side dropdown
@kevinlee12, Just a confirmation. That this PR doesn't indent to solve the
Popover issue instead it focuses on fading it off in 5 seconds.
And as the other PR deals with CSS fixes, perhaps it would be better if I
remove the over all CSS code from this PR and focus on just fade off in 5
second rule.
What do you think
|
Since we've been changing the focus of the PR's quite a bit, I think we should keep it as is now to prevent further confusion and you've already implemented some of the features: This PR:
PR #3277:
As Sean mentioned, the PR that gets merged later will have to deal with the name changes. |
The div is introduce to bring the specificity because popover acts as class itself as well as dropdown is a class too. Hence binding it in div might avoid all future errors.
@kevinlee12 Done as suggested. Class is specific now. Please review the code (assigning it to you) |
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 a nit.
@@ -70,14 +70,24 @@ | |||
</li> | |||
|
|||
{% if username %} | |||
<li ng-if="isLargeScreen" class="dropdown" popover-is-open="postTutorialHelpPopoverIsShown" | |||
<div class="oppia-help-dropdown nav navbar-nav oppia-navbar-nav pull-right ng-cloak"> |
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.
The additional class should be in the line below, not this one. (We're manipulating the popover directly, not this class)
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.
@kevinlee12 I have tried making changes so, but the alignment and the navbar-nav settings breaks or popover are not functional when adding it to dropdown
.
Could you please confirm the changes locally? Or if I misinterpreted could you quote the code snippet for clarity.
Interestingly, popover is acting alike an element here. Modifying it anything else, breaks one or other thing. (nav bar, material icon or the popover itself)
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 gives error if adopt so;
<li class="oppia-help-dropdown dropdown" popover-is-open="postTutorialHelpPopoverIsShown" popover-placement="bottom" popover-trigger="none" popover="To get help in the future, click here!">
As popover is inline with the <li>
tag itself
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 mentioned in my other comment), we can keep this placement. I was wondering if you can experiment with oppia-navbar-breadcrumb
instead of the CSS you've defined (so that we can get a consistent experience for our users). No need to push, but do report back to this thread. 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.
However, you do want to move oppia-help-dropdown
to the right of oppia-navbar-nav
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.
<div class="oppia-help-dropdown nav navbar-nav oppia-navbar-nav pull-right ng-cloak">
to
<div class="nav navbar-nav oppia-navbar-nav oppia-help-dropdown pull-right ng-cloak">
@kevinlee12 This sounds good?
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.
yup!
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! Will push another commit now. Suggesting this change.
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
You are doing it so that its like `class="dropdown oppia-help-dropdown"`
right?
…On Sat, Apr 8, 2017 at 11:23 PM, Shahebaz ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In core/templates/dev/head/pages/exploration_editor/editor_
navigation_directive.html
<#3267 (comment)>:
> @@ -70,14 +70,24 @@
</li>
{% if username %}
- <li ng-if="isLargeScreen" class="dropdown" popover-is-open="postTutorialHelpPopoverIsShown"
+ <div class="oppia-help-dropdown nav navbar-nav oppia-navbar-nav pull-right ng-cloak">
@kevinlee12 <https://github.com/kevinlee12> I have tried making changes
so, but the alignment and the navbar-nav settings breaks or popover are not
functional when adding it to dropdown. Could you please confirm locally?
Or if I misinterpreted could you quote the code snippet for clarity.
Interestingly, popover is acting alike an element here. Modifying it
anything else, breaks one or other thing. (nav bar, material icon or the
popover itself)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3267 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFfdMJUZppJX9-kvoF_4bWo6xW9P2yRlks5ruHlagaJpZM4MwjDY>
.
|
@kevinlee12 Yes, exactly. It doesnt work.
|
Hmm, after looking how they implemented the CSS regarding the other popovers, your approach earlier is correct. |
@kevinlee12 Thanks!. Earlier refers to latest commit or the previous |
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.
Nit
@@ -70,14 +70,24 @@ | |||
</li> | |||
|
|||
{% if username %} | |||
<li ng-if="isLargeScreen" class="dropdown" popover-is-open="postTutorialHelpPopoverIsShown" | |||
<div class="oppia-help-dropdown nav navbar-nav oppia-navbar-nav pull-right ng-cloak"> |
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.
However, you do want to move oppia-help-dropdown
to the right of oppia-navbar-nav
@kevinlee12 Done. Pushed new commit. Kindly review 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.
lgtm!
#3093
The tooltip "To get help in future click here" doesn't disappear on the click and causes unintended behavior with profile menu.
How to produce error?
Error
Expected behavior
This PR's fix