Skip to content
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

feat: add tooltip trigger #694

Merged
merged 9 commits into from
Jun 28, 2023

Conversation

Vlad116
Copy link
Contributor

@Vlad116 Vlad116 commented Jun 7, 2023

Brief Information

This pull request is in the type of (more info about types):

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • test

Related issues (all available keywords):

Details

  • Added a TooltipTrigger component with a question mark icon (accepts color and size as a string).
    feat1
feat3_locale - Added a tooltip visibility toggle at the top of the page feat2 - Added a small margin at the bottom for the main content (it could overlap with the operating system navigation menu) margin-bottom

Checklist

Others

Demo:
https://github.com/hypertrons/hypertrons-crx/assets/32329117/788d1878-9dcb-4a8c-99fd-e4d76924c825

@menbotics menbotics bot added the kind/feature Category issues or prs related to feature request. label Jun 7, 2023
@CLAassistant
Copy link

CLAassistant commented Jun 7, 2023

CLA assistant check
All committers have signed the CLA.

@wxharry
Copy link
Collaborator

wxharry commented Jun 7, 2023

Hi, Vladislav. Thanks for your contribution. You've open a PR before we could fully discuss. Here are my feedback on this PR:

  1. change the name of the PR. We encourage contributors to format their commit message in our project. Please refer to angular commit-message-format for more details
  2. The tooltip should be considered as a component. Could you move the src/pages/Options/TooltipTrigger/index.tsx to the component folder so that the code could be well-organized.
  3. Remove the tooltips enable/disable switch. Since you jump to pr, my opinion is to change how to trigger the tooltips only, we don't need that switch for now.
  4. Move the icon to the left. This could be optional depending on the implementation. The final goal to this issue is to make this tooltips more intuitive. My expectation was like this. Let's see if you could make it and we could discuss about it later.
  5. Organize your code. Working at an open source project is not just make it work, you could refer to the existing code to better organize your work for future maintenance

If you have any questions, feel free to comment below or contact us on slack. Again, thanks for your interests and contributions to the project. 😄

@Vlad116
Copy link
Contributor Author

Vlad116 commented Jun 7, 2023

Hi, Harry) Sure, i can move the icon like on your screnshot and edit tooltip area how on it, also remove switch.
I did not move TooltipTrigger to components, because often non-reusable components are made as subcomponents with index file.
Okay, I'll correct all comments. Could you clarify on the 5th point what exactly is wrong with the organization of the code if we abstract from the points indicated earlier?

@Vlad116 Vlad116 changed the title Feature/tooltip trigger feat: add tooltip trigger Jun 7, 2023
@Vlad116
Copy link
Contributor Author

Vlad116 commented Jun 7, 2023

Is the current icon right for you? @wxharry

@wxharry
Copy link
Collaborator

wxharry commented Jun 7, 2023

Is the current icon right for you? @wxharry

I was expecting an information mark like in the previous screenshot if possible.

Hi, Harry) Sure, i can move the icon like on your screnshot and edit tooltip area how on it, also remove switch. I did not move TooltipTrigger to components, because often non-reusable components are made as subcomponents with index file.

I understand. I was expecting it to be resuable because we are planning some new features in this option page, so we might reuse the tooltips in the near future.

Could you clarify on the 5th point what exactly is wrong with the organization of the code if we abstract from the points indicated earlier?

Sure. For example, you could refer to src/pages/ContentScripts/features/developer-networks to extract the icon. I understand it might not be the best way to do this, but we need to keep it identical within the project. Thanks for understanding.

@Vlad116 Vlad116 force-pushed the feature/tooltip-trigger branch from 1c4f5cd to dc8df59 Compare June 8, 2023 07:06
@Vlad116
Copy link
Contributor Author

Vlad116 commented Jun 8, 2023

Hello!)
I tried to make a dark background with transparency like in your screenshot, but it turned out to be not so easy with the implementation of the tooltip in this library, you also can pass background/fontColor/iconColor to TooltipTrigger component. I removed the switch (and moved the TooltipTrigger to shared components), brought the tooltips to the following form:
PR

@Vlad116
Copy link
Contributor Author

Vlad116 commented Jun 9, 2023

Are there any other changes needed to the current version or will we be able to close this PR soon? @wxharry

@wxharry
Copy link
Collaborator

wxharry commented Jun 9, 2023

Are there any other changes needed to the current version or will we be able to close this PR soon? @wxharry

Slow down. Thanks for your passion but there is no need to rush. I am running some tests and thinking about some improvements.

@Vlad116
Copy link
Contributor Author

Vlad116 commented Jun 9, 2023

Are there any other changes needed to the current version or will we be able to close this PR soon? @wxharry

Slow down. Thanks for your passion but there is no need to rush. I am running some tests and thinking about some improvements.

Of course, I'll just find out if any more updates are needed, I will check this thread once a day to find out

@wxharry
Copy link
Collaborator

wxharry commented Jun 12, 2023

It's fine if we cannot make it transparent. just make it to the default style as before will do.

@Vlad116
Copy link
Contributor Author

Vlad116 commented Jun 15, 2023

It's fine if we cannot make it transparent. just make it to the default style as before will do.

I'm update MR and fix default style for TooltipTrigger @wxharry

Copy link
Collaborator

@wxharry wxharry left a comment

Choose a reason for hiding this comment

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

Everything looks good to me, except that it feels unnatural to me change the cursor to a question mark when hovering over the icon. Could you remove it?

I understand this style given by the demo I previously provided. Sorry for letting you change the style again and again!

@Vlad116
Copy link
Contributor Author

Vlad116 commented Jun 27, 2023

@wxharry Okay, no problem. I can change to default cursor style, sorry for awaiting

@Vlad116 Vlad116 requested a review from wxharry June 27, 2023 06:35
Copy link
Collaborator

@wxharry wxharry left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!
/approve

@menbotics menbotics bot added the pull/approved If a pull is approved, it will be automatically merged label Jun 28, 2023
@menbotics menbotics bot merged commit a0764e3 into hypertrons:master Jun 28, 2023
wxharry pushed a commit to wxharry/hypertrons-crx that referenced this pull request Jul 17, 2023
* feat: add switchable TooltipTrigger to settings page, 💄

* feat: add isTooltipEnabled state and stackStyleOptions const (hypertrons#692), ♻️

* feat: change cursor css prop to 'help' (hypertrons#692), 💄

* feat: remove Toggle button and move TooltipTrigger to /components (hypertrons#692), ♻️

* feat: fix TooltipTrigger styles (hypertrons#692), ♻️ 💄

* feat: fix defaultStyle for tooltip (hypertrons#692) 💄

* feat: change cursor to 'default' on tooltip icon 💄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Category issues or prs related to feature request. pull/approved If a pull is approved, it will be automatically merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] How to trigger Tooltips in settings
3 participants