Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

feat(ClauseHeader): added tooltips to icons #318

Merged
merged 2 commits into from
Mar 6, 2020

Conversation

elit-altum
Copy link
Contributor

Signed-off-by: elit-altum [email protected]

Continues: accordproject/markdown-editor#124

Changes

  • Modified the ClauseBackground UI according to the proposed changes.
  • Added tooltips on all the ClauseHeader icons for more information.

Screenshot

Tooltip-fixing

Flags

  • Design modifications and suggestions are welcome!

Related Issues

@elit-altum
Copy link
Contributor Author

@irmerk @DianaLease Please review!
The failing build is due to a failing snapshot test for the ClauseHeader icons. If you approve the changes I'll update the tests as well.

@sachdeva-shrey
Copy link
Contributor

sachdeva-shrey commented Mar 1, 2020

Screenshot

Tooltip-fixing

This looks good @elit-altum. I have a few suggestions though

  • Keep the styling(color, border-radius, background-color) of the icons and ToolbarTooltip consistent with that of Markdown Editor
  • Increase the width of the editor by around 30%
  • Increase left and right margin of the text for a cleaner look

@elit-altum
Copy link
Contributor Author

Screenshot

Tooltip-fixing

This looks good @elit-altum. I have a few suggestions though

  • Keep the styling(color, border-radius, background-color) of the icons and ToolbarTooltip consistent with that of Markdown Editor
  • Increase the width of the editor by around 30%
  • Increase left and right margin of the text for a cleaner look

Thank you for the review. Actually most of these values are controlled by props passed to the component. Thereby, they will be changed accordingly.
Will surely work on the spacing though.

@jolanglinais
Copy link
Member

Tagging @Michael-Grover @dselman @jeromesimeon @DianaLease @mttrbrts for feedback

@elit-altum
Copy link
Contributor Author

@irmerk any suggestions on this?

@Michael-Grover
Copy link
Collaborator

Applications that use the Cicero UI handle the tooltips on clause templates on their own. I am not sure how this will effect that.

Does this remove the green border and border radius around clause templates?

Something appears to be wrong with icon buttons the buttons in the PR. Only a very small area is clickable.

@jolanglinais
Copy link
Member

Applications that use the Cicero UI handle the tooltips on clause templates on their own. I am not sure how this will effect that.

Not sure what this is referring to, could you elaborate?

Does this remove the green border and border radius around clause templates?

Yes this PR does do that.

@Michael-Grover
Copy link
Collaborator

Applications that use the Cicero UI handle the tooltips on clause templates on their own. I am not sure how this will effect that.

Not sure what this is referring to, could you elaborate?

Does this remove the green border and border radius around clause templates?

Yes this PR does do that.

In some applications that use Cicero UI, such as Clause, the tooltips appear to be handled on their end. If we add tooltips on the AP side, will that result in icons having two tooltips on hover when viewed in applications that use Cicero UI?
image

@jolanglinais
Copy link
Member

I would imagine having this as low level as possible would be best. The icon exists in cicero-ui, so why wouldn't the tooltip explaining the icon live here?

@elit-altum
Copy link
Contributor Author

@Michael-Grover The icon issue might be due to the fact that I reduced the icon sizes to be equivalent in proportions. I'd revert them back on.

@elit-altum
Copy link
Contributor Author

Applications that use the Cicero UI handle the tooltips on clause templates on their own. I am not sure how this will effect that.

Does this remove the green border and border radius around clause templates?

Something appears to be wrong with icon buttons the buttons in the PR. Only a very small area is clickable.

Yes @Michael-Grover the borders and margins are handled. Do you want me to increase the spacing ?

@Michael-Grover
Copy link
Collaborator

Michael-Grover commented Mar 4, 2020

I would imagine having this as low level as possible would be best. The icon exists in cicero-ui, so why wouldn't the tooltip explaining the icon live here?

in that case, @elit-altum please make the styling of the tooltips match this by increasing the padding and adding rounded corners:

image

Please undo all changes unrelated to the tooltip improvements, such as "Modified the ClauseBackground UI according to the proposed changes." . I believe proposed UI changes should be made in separate github issue so the community can discuss them individually. Some applications that use Cicero UI will be affected by these changes so we also want to give them the opportunity to comment.

@elit-altum
Copy link
Contributor Author

I would imagine having this as low level as possible would be best. The icon exists in cicero-ui, so why wouldn't the tooltip explaining the icon live here?

in that case, @elit-altum please make the styling of the tooltips match this by increasing the padding and adding rounded corners:

image

Please undo all changes unrelated to the tooltip improvements, such as "Modified the ClauseBackground UI according to the proposed changes." . I believe proposed UI changes should be made in separate github issue so the community can discuss them individually. Some applications that use Cicero UI will be affected by these changes so we also want to give them the opportunity to comment.

All right, no problem!
I'll make a separate PR for that.

@elit-altum
Copy link
Contributor Author

I would imagine having this as low level as possible would be best. The icon exists in cicero-ui, so why wouldn't the tooltip explaining the icon live here?

in that case, @elit-altum please make the styling of the tooltips match this by increasing the padding and adding rounded corners:

image

Please undo all changes unrelated to the tooltip improvements, such as "Modified the ClauseBackground UI according to the proposed changes." . I believe proposed UI changes should be made in separate github issue so the community can discuss them individually. Some applications that use Cicero UI will be affected by these changes so we also want to give them the opportunity to comment.

@Michael-Grover made the changes to the tooltip and reverted the others
Screenshot
Screenshot (1)

@jolanglinais
Copy link
Member

@elit-altum There is still some issue with the viewbox or something where the icon isn't consistently clickable on hover.

@elit-altum
Copy link
Contributor Author

elit-altum commented Mar 5, 2020

@elit-altum There is still some issue with the viewbox or something where the icon isn't consistently clickable on hover.

Yes @irmerk just fixed it!
It was due to use of onMouseEnter() instead of onMouseOver()

Please review!

Comment on lines 202 to 203
onMouseOver={() => setHoveringTestIcon(true)}
onMouseOut={() => setHoveringTestIcon(false)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be in wrappers instead of the icons themselves. The issue is the mouse going over the explicit lines in the svg are toggling this, instead of the whole area of the icon itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@irmerk Is the issue still there ? I think it's fixed in this commit please check once at https://deploy-preview-318--cicero-ui.netlify.com/

I have nested this along with the svg because the hover is on that as well. Therefore, for a coherent behavior that the tooltips are only seen when the cursor is over the icon and the hover effect takes place. I implemented this.
Previously, I used the IconWrapper only

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, still there. I'm saying this should look like:

          <S.EditWrapper 
              onMouseOver={() => setHoveringEditIcon(true)}
              onMouseOut={() => setHoveringEditIcon(false)}
               {...iconWrapperProps}
          >
            <S.ClauseIcon {...editIconProps}>

for all the icons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@irmerk I have made these changes. Please review!

@jolanglinais
Copy link
Member

Hmm the behavior is still there. Unsure what it is, will need to look into it more and I can take a look later today or tomorrow.

@elit-altum elit-altum changed the title feat(ClauseComponent): UI/UX enhancments to ClauseComponent feat(ClauseHeader): added tooltips to icons Mar 6, 2020
@jolanglinais
Copy link
Member

I'm going to take a look locally...

@elit-altum
Copy link
Contributor Author

elit-altum commented Mar 6, 2020

Now I'm getting a slightly different issue:

Mar-06-2020 09-53-33

Okay this could be due to browsers parsing the JS differently. This works fine with Firefox. But I am having similar issue on Chrome. Let me fix it.

@elit-altum elit-altum force-pushed the ClausePlugin-modify branch 3 times, most recently from 39ec021 to 513cf7a Compare March 6, 2020 15:16
@elit-altum
Copy link
Contributor Author

@irmerk I thinks it's fixed. Works fine on my Firefox and Chrome. Please check once!

@jolanglinais
Copy link
Member

Yes, this is better!

I think the gradient color on the icon wrappers needs to be updated with the new clause background color, and also the wrapper is overlapping the tooltip caret, so maybe make the tooltip have a higher z-index?

Screen Shot 2020-03-06 at 10 42 48 AM

@elit-altum
Copy link
Contributor Author

Yes, this is better!

I think the gradient color on the icon wrappers needs to be updated with the new clause background color, and also the wrapper is overlapping the tooltip caret, so maybe make the tooltip have a higher z-index?

Screen Shot 2020-03-06 at 10 42 48 AM

Sure @irmerk I'll get this done!

Comment on lines 201 to 203
onMouseEnter={() => setHoveringTestIcon(true)}
onMouseLeave={() => setHoveringTestIcon(false)}
onClick={testIconProps.onClick}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think onClick here should be () => clauseProps.CLAUSE_TEST_FUNCTION(props), and then that function should be removed from testIconProps

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay will do!

@elit-altum elit-altum force-pushed the ClausePlugin-modify branch from 628ad35 to 56de8d3 Compare March 6, 2020 16:44
@elit-altum
Copy link
Contributor Author

@irmerk I have made the required changes. If this is okay I'll proceed to squash my commits (if required)
Please review!

@jolanglinais
Copy link
Member

Sorry just one last thing: z-index should be higher number. Lower numbers means lower priority, so it's still being covered up by the icon wrapper.

Yeah I think squashing some of the commits together could be good with interactive rebase. If it makes sense to squash all of them then go ahead.

@elit-altum
Copy link
Contributor Author

elit-altum commented Mar 6, 2020

Sorry just one last thing: z-index should be higher number. Lower numbers means lower priority, so it's still being covered up by the icon wrapper.

Yeah I think squashing some of the commits together could be good with interactive rebase. If it makes sense to squash all of them then go ahead.

@irmerk I had made those changes already.

Here, I have reduced the top and changed background-color of the IconWrapper to show that the z-index is not the problem.
Tooltip-z-index

The issue was actually due to the border adding width of its own which is now fixed!
Tooltip-z-index-fix

@elit-altum elit-altum force-pushed the ClausePlugin-modify branch from 44cedd1 to f175f7d Compare March 6, 2020 17:41
@elit-altum
Copy link
Contributor Author

@irmerk Squashed all commits. Please review!

jolanglinais
jolanglinais previously approved these changes Mar 6, 2020
Copy link
Member

@jolanglinais jolanglinais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the z-index / border-width / etc.

This looks great! I think just update the snapshots to pass the tests with npm test -- -u

@elit-altum
Copy link
Contributor Author

npm test -- -u

Running this gives me this error
image

Could you please help me ?

@jolanglinais
Copy link
Member

Hmm are you able to run npm test?

@elit-altum
Copy link
Contributor Author

Hmm are you able to run npm test?

No I cannot. It gives a similar error
image

@jolanglinais
Copy link
Member

I've cloned your branch and it works... Are you not running npm install first?

@elit-altum
Copy link
Contributor Author

I've cloned your branch and it works... Are you not running npm install first?

That's weird. I ran npm install again. Still doesn't work.

DianaLease
DianaLease previously approved these changes Mar 6, 2020
Copy link
Member

@DianaLease DianaLease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great once the snapshot is updated!

@jolanglinais
Copy link
Member

Are you on our slack? Might be faster to communicate on this one. Need to debug this because this shouldn't be an issue. Just running jest doesn't even work?

@jolanglinais jolanglinais dismissed stale reviews from DianaLease and themself via e7992b5 March 6, 2020 19:01
@jolanglinais jolanglinais merged commit 26eecd0 into accordproject:master Mar 6, 2020
@Michael-Grover
Copy link
Collaborator

I noticed a bug in this feature. I created an issue since this PR is already merged. #330

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Discussion 🗣 Type: Question ❓ Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants