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

[Table] Refactor header menus to divorce click-target size from gradient size #906

Merged
merged 3 commits into from
Apr 3, 2017

Conversation

cmslewis
Copy link
Contributor

Builds on #891

Changes proposed in this pull request:

Table column headers suffer from a problem:

  • The gradient effect isn't wide enough for the text to fade out entirely before reaching the popover target (separate issue: the icon doesn't have a background, so text is visible beneath it):
    image
  • Making the gradient bigger also makes the popover click target bigger—to a silly extent.
    2017-03-29 15 47 14

This PR divorces the gradient from the popover click target. Now, we can resize the gradient without affecting the size of the click target. Specific changes:

  • Elements are now organized like this:
    • bp-table-th-menu-container (new)
      • bp-table-th-menu-container-background (new; sibling of bp-table-th-menu)
      • bp-table-th-menu (same thing we had before)
  • Click target is now a perfect 30px x 30px.
  • Gradient is now 10px wider to ensure the text fades out before reaching the icon.
  • Gradient has pointer-events: none to not swallow clicks meant for the underlying header cell.

Reviewers should focus on:

  • Implementation look good?
  • Visuals look good?
  • Interactions feel good?

Screenshot

Gradient before:
image

Gradient after:
image

Click target before:
image

Click target after:
image

@blueprint-bot
Copy link

Refactor header menus to divorce click-target size from gradient size

Preview: docs | table
Coverage: core | datetime

@cmslewis
Copy link
Contributor Author

cmslewis commented Mar 29, 2017

Whoops, style regression with interaction bars:

Before:
image

After:
image

Copy link
Contributor

@llorca llorca left a comment

Choose a reason for hiding this comment

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

In addition to the interaction bar regression, the dark theme is broken. Otherwise, 👍 on the refactor, much better implementation of the truncation gradient

image

@pkwi
Copy link
Contributor

pkwi commented Mar 30, 2017

The new gradient and click target are great!

@@ -51,7 +51,20 @@
}
}

.bp-table-th-menu {
.bp-table-th-menu-container {
flex-shrink: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't need flex properties if you're using position: absolute but whatever

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i wasn't actually sure what this rule was doing (i'm no flex expert), but it was there before, so i left it in the refactor.

cursor: $action-cursor;
width: $column-header-min-height + $pt-grid-size;
width: $column-header-min-height; // create a larger, more accessible click target
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think comment means much, and will mean even less in a month. it doesn't even look correct when i compare with code on the left, where the width was obviously larger.

Copy link
Contributor Author

@cmslewis cmslewis Mar 31, 2017

Choose a reason for hiding this comment

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

fair, though in general i like quick little CSS comments explaining the intent behind a rule. regardless of the target size prior to this refactor, this element's purpose is still to create a larger click target than the 16px icon it wraps, so the comment seemed helpful. if the intent is obvious, happy to remove.

@cmslewis
Copy link
Contributor Author

cmslewis commented Apr 3, 2017

@llorca @pkwi fixed the visual bugs. ready for re-review.

@cmslewis cmslewis requested a review from pkwi April 3, 2017 19:33
@blueprint-bot
Copy link

Fix interaction bar style bugs

Preview: docs | table
Coverage: core | datetime

@giladgray giladgray merged commit e894d61 into master Apr 3, 2017
@giladgray giladgray deleted the cl/table-header-menu-clickable-region branch April 3, 2017 20:44
@giladgray giladgray mentioned this pull request Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants