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

Fix/tooltip tools #5692

Merged
merged 4 commits into from
Feb 21, 2019
Merged

Fix/tooltip tools #5692

merged 4 commits into from
Feb 21, 2019

Conversation

ndelangen
Copy link
Member

Issue:

  • I found a couple of state & initial state bugs in the tool addons
  • When switching panels/nav with hotkeys the tooltip would stick
  • When clicking inside the preview the tooltip would stick

What I did

Added an core-event for a PreviewClick
I'm not quite done, I wasn't able to successfully testing it.

@tmeasday
Copy link
Member

Can we merge the bug fixes to the addons separately?

I'm not sure about this technique, I think we can do this another way

@tmeasday
Copy link
Member

tmeasday commented Feb 21, 2019

So I have thought about this a bit. I think it is better for:

A. The WithTooltip component to setup its own global keydown listener (it does this for click already via the react-popper-tooltip lib). This will pickup keydowns inside the manager

B. We don't need to detect keydowns inside the iframe I don't think (you'd have to click or press a key first to get in there).

C. Maybe the tooltip component should also find all iframes on the screen (when it opens) and bind a click listener (and a keydown one too?) inside them. If it's not a x-origin iframe I think you can do something like iframe.contentDocument.addEventListener(..).

The technique of triggering a click via a message over the channel is a bit hacky for me and also will break if there are more iframes on the screen (which there may be one day)

@codecov
Copy link

codecov bot commented Feb 21, 2019

Codecov Report

Merging #5692 into next will increase coverage by 0.11%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #5692      +/-   ##
==========================================
+ Coverage   33.24%   33.36%   +0.11%     
==========================================
  Files         648      647       -1     
  Lines        9363     9331      -32     
  Branches     1355     1348       -7     
==========================================
  Hits         3113     3113              
+ Misses       5635     5603      -32     
  Partials      615      615
Impacted Files Coverage Δ
addons/a11y/src/components/ColorBlindness.js 0% <ø> (ø) ⬆️
addons/storysource/src/StoryPanel.js 0% <0%> (ø) ⬆️
addons/viewport/src/Tool.js 0% <0%> (ø) ⬆️
.../backgrounds/src/containers/BackgroundSelector.tsx 0% <0%> (ø) ⬆️
lib/theming/src/index.ts 0% <0%> (ø) ⬆️
lib/core/src/server/build-dev.js 0% <0%> (ø) ⬆️
.../core/src/server/manager/manager-webpack.config.js 0% <0%> (ø) ⬆️
lib/components/src/bar/bar.js 100% <0%> (ø) ⬆️
lib/theming/src/ensure.ts
lib/ui/src/core/context.js 10% <0%> (+0.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 816b45a...3480bc0. Read the comment docs.

@ndelangen
Copy link
Member Author

@tmeasday Sure, good point, I removed the last 2 commits, so now it's just fixes on the tool addons

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

👍

@shilman shilman merged commit cedc39f into next Feb 21, 2019
@shilman shilman deleted the fix/tooltip-tools branch February 21, 2019 15:59
@shilman
Copy link
Member

shilman commented Feb 22, 2019

@ndelangen This is not merging cleanly into release/5.0 because it relies on code that's not part of the 5.0 release: BackgroundSelector.tsx. Mind taking a look?

@ndelangen
Copy link
Member Author

Can you explain what I should do? Try to merge this into release/5.0 ?

@shilman
Copy link
Member

shilman commented Feb 22, 2019

@ndelangen For now, nothing. After we get the next RC out I'm going to cherry-pick the PR that introduced BackgroundSelector.tsx and this PR into release/5.0. At that point I might enlist your help getting things working there depending on how it turns out.

shilman added a commit that referenced this pull request Feb 23, 2019
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch:done Patch/release PRs already cherry-picked to main/release branch ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants