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(core): Tooltip remove delay on click #3502

Merged
merged 6 commits into from
Feb 14, 2023
Merged

feat(core): Tooltip remove delay on click #3502

merged 6 commits into from
Feb 14, 2023

Conversation

vladimirpotekhin
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows Conventional Commits
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Code style update
  • Build or CI related changes
  • Documentation content changes

What is the current behavior?

Closes #3450

What is the new behavior?

We need to separate click$ stream from toggle$, because toggle() also called on hover from HintComponent

We need to add zero delay to click$ stream, because without delay event bubbles up and closes hint immediately

Does this PR introduce a breaking change?

  • Yes
  • No

@lumberjack-bot
Copy link

lumberjack-bot bot commented Jan 25, 2023

Pull request was closed ✔️

All saved screenshots (for current PR) were deleted 🗑️

@github-actions
Copy link
Contributor

github-actions bot commented Jan 25, 2023

Visit the preview URL for this PR (updated for commit 6333690):

https://taiga-ui--pr3502-hint-delay-2tbvrmmz.web.app

(expires Wed, 15 Feb 2023 12:24:46 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4b5ece1e114386f6a105425ef799091475b249eb

@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Base: 61.20% // Head: 68.19% // Increases project coverage by +6.98% 🎉

Coverage data is based on head (bfdf83b) compared to base (7ac0c1e).
Patch coverage: 75.00% of modified lines in pull request are covered.

❗ Current head bfdf83b differs from pull request most recent head 6333690. Consider uploading reports for the commit 6333690 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3502      +/-   ##
==========================================
+ Coverage   61.20%   68.19%   +6.98%     
==========================================
  Files        1569     1142     -427     
  Lines       18546    13773    -4773     
  Branches     2568     1919     -649     
==========================================
- Hits        11352     9393    -1959     
+ Misses       6720     4052    -2668     
+ Partials      474      328     -146     
Flag Coverage Δ
addon-charts 71.87% <ø> (-0.12%) ⬇️
addon-doc 49.81% <ø> (+0.11%) ⬆️
addon-editor 50.29% <ø> (+0.56%) ⬆️
addon-mobile 61.73% <ø> (-0.05%) ⬇️
addon-table 60.61% <ø> (ø)
addon-tablebars 98.11% <ø> (ø)
cdk ∅ <ø> (∅)
core 76.81% <75.00%> (+<0.01%) ⬆️
kit 72.91% <ø> (-0.03%) ⬇️
summary 68.19% <75.00%> (+6.98%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...jects/core/directives/hint/hint-hover.directive.ts 85.71% <75.00%> (-8.04%) ⬇️
...ore/directives/dropdown/dropdown-host.directive.ts 80.00% <0.00%> (-20.00%) ⬇️
projects/core/components/dialog/dialog.tokens.ts 83.33% <0.00%> (-5.56%) ⬇️
...jects/kit/constants/max-day-range-length-mapper.ts 23.07% <0.00%> (-5.50%) ⬇️
.../kit/components/input-year/input-year.component.ts 73.91% <0.00%> (-4.35%) ⬇️
...cts/core/directives/dropdown/dropdown.directive.ts 84.00% <0.00%> (-4.00%) ⬇️
...cts/core/directives/dropdown/dropdown.component.ts 41.66% <0.00%> (-3.79%) ⬇️
projects/addon-editor/extensions/link/link.ts 23.07% <0.00%> (-1.93%) ⬇️
.../kit/components/input-date/input-date.component.ts 83.33% <0.00%> (-1.29%) ⬇️
...nents/mobile-calendar/mobile-calendar.component.ts 45.31% <0.00%> (-0.43%) ⬇️
... and 506 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bundlemon
Copy link

bundlemon bot commented Jan 25, 2023

BundleMon

Files updated (1)
Status Path Size Limits
demo/browser/main.(hash).js
337.16KB (+90B +0.03%) +10%
Unchanged files (4)
Status Path Size Limits
demo/browser/vendor.(hash).js
203.34KB +10%
demo/browser/runtime.(hash).js
35.52KB +10%
demo/browser/polyfills.(hash).js
19.92KB +10%
demo/browser/scripts.(hash).js
18.08KB +10%

Total files change +90B +0.01%

Groups updated (1)
Status Path Size Limits
demo/browser/*..js
2.28MB (+90B 0%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@vladimirpotekhin vladimirpotekhin changed the title fix(core): Hint remove delay on click feat(core): Hint add tuiHintClickDelay option, Tooltip remove delay on click Jan 25, 2023
@waterplea
Copy link
Collaborator

Looks a bit like overcomplication to me :(

@vladimirpotekhin
Copy link
Member Author

Looks a bit like overcomplication to me :(

check other solution plz

@vladimirpotekhin vladimirpotekhin changed the title feat(core): Hint add tuiHintClickDelay option, Tooltip remove delay on click feat(core): Tooltip remove delay on click Jan 31, 2023
@waterplea
Copy link
Collaborator

Looks a bit like overcomplication to me :(

check other solution plz

Now it's a bit hacky :( Could you check the following idea:

Do we need a delay on toggling to true at all? What if we remove HostListener on click and a showDelay for toggle$ and only trigger it from Tooltip component?

@vladimirpotekhin vladimirpotekhin marked this pull request as draft February 6, 2023 06:35
@vladimirpotekhin
Copy link
Member Author

Looks a bit like overcomplication to me :(

check other solution plz

Now it's a bit hacky :( Could you check the following idea:

Do we need a delay on toggling to true at all? What if we remove HostListener on click and a showDelay for toggle$ and only trigger it from Tooltip component?

I checked it. Toggle triggered from hint and yes we need delay for it. I didn't find a solution without separating click into another stream (

@waterplea
Copy link
Collaborator

We don't really need delay for true values though. In hint we only care about delay for false so it's not immediately closed when we hover away from the hint bubble. What if we remove delay for true values in toggle?

@splincode splincode marked this pull request as ready for review February 14, 2023 12:02
@splincode splincode merged commit d6ed9e0 into main Feb 14, 2023
@splincode splincode deleted the hint-delay branch February 14, 2023 12:21
@well-done-bot
Copy link

well-done-bot bot commented Feb 14, 2023

'Well done'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

🐞 - tui-tooltip and tui-hint don't work if you quickly click multiple times on host element
3 participants