Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

WIP Display popover intelligently - #2599

Merged
jasonLaster merged 4 commits into
firefox-devtools:masterfrom
AnshulMalik:preview-popup
Apr 9, 2017
Merged

WIP Display popover intelligently#2599
jasonLaster merged 4 commits into
firefox-devtools:masterfrom
AnshulMalik:preview-popup

Conversation

@AnshulMalik

Copy link
Copy Markdown
Contributor

Associated Issue: #2565

Summary of Changes

  • Added popover direction

Screenshots

as

const top = targetTop - height;

return { left, top };
return { left, top, dir: "up" };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice.

We might also want to do left/right here in a bit

Comment thread src/components/shared/Popover.js Outdated
let top = targetBottom;
return { left, top };
if (top + height > window.innerHeight) {
console.log("Going out of bounds");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets remove this...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, I forgot.

@codecov

codecov Bot commented Apr 8, 2017

Copy link
Copy Markdown

Codecov Report

Merging #2599 into master will decrease coverage by 0.78%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2599      +/-   ##
==========================================
- Coverage   58.55%   57.76%   -0.79%     
==========================================
  Files          51       51              
  Lines        1959     1996      +37     
  Branches      398      401       +3     
==========================================
+ Hits         1147     1153       +6     
- Misses        812      843      +31
Impacted Files Coverage Δ
src/utils/function.js
src/utils/editor/source-editor.js 31.37% <0%> (ø)
src/utils/object-inspector.js 76.47% <0%> (+2.18%) ⬆️

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 28e7850...30dce77. Read the comment docs.

Comment thread src/components/shared/Popover.js Outdated
const { top, left } = this.state;
const { top, left, dir } = this.state;

if (dir === "up") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets see if we can consolidate these two renders into one...

Comment thread src/components/shared/Popover.js Outdated
if (dir === "up") {
return dom.div(
{
className: "popover popover-up",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can use the classnames helper to do classnames("popover", { up: dir =="up" })

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Didn't know about that. Yeah, we can use this.

Comment thread src/components/shared/Popover.js Outdated
onMouseLeave,
style: { top, left }
},
children,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the ordering here is the hard one, but we can likely do something clever :)

try to reduce size of render functions
@jasonLaster

jasonLaster commented Apr 9, 2017

Copy link
Copy Markdown
Contributor

Hey @AnshulMalik I made some additional follow up tweaks

  1. generalized getChildren so popovers and tooltips had gaps
  2. refactored the CSS so there were popovers and tooltips
  3. removed the tooltip caret as the tooltips are much more lightweight interactions
  4. moved the preview function css to its own stylesheet

Let me know what you think and we can land this soon.


Here's a GIF of how it looks now:

Light Theme

Dark Theme

I think it's looking pretty good! The only follow up item I see is that we will want to also adjust the horizontal (left/right ) orientation as well. But, lets do this in a different a new issue!

@AnshulMalik

Copy link
Copy Markdown
Contributor Author

Looks good to me.

@jasonLaster
jasonLaster merged commit 65445c1 into firefox-devtools:master Apr 9, 2017
@AnshulMalik
AnshulMalik deleted the preview-popup branch April 10, 2017 02:38
DanUgelow pushed a commit to DanUgelow/debugger.html that referenced this pull request May 4, 2017
* Display popover intelligently
* popover ui improvements try to reduce size of render functions
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants