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 border overlap between Buttons in outlined ButtonGroup #6966

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

ggdouglas
Copy link
Contributor

@ggdouglas ggdouglas commented Sep 10, 2024

Fixes #0000

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Fixes an issue where outlined button styles were not rendering properly when wrapped in a Popover inside of ButtonGroup. Also adds an outlined variant prop example to the "Usage with popovers" ButtonGroup example to allow for visual testing of this issue in the future.

New outlined prop toggle on ButtonGroup's "Usage with popovers" example.

Screenshot 2024-09-09 at 21 30 56

This change fixes borders on outlined buttons with popovers in two instances:

  1. The first is where the outlined prop is applied to the ButtonGroup parent container:
<ButtonGroup outlined>
  <Popover content={...}>
    <Button icon="git-branch" rightIcon="caret-down" text="Main" />
  </Popover>
  <Button icon="more" />
</ButtonGroup>

In this case, buttons surrounded by popovers weren't being styled as outlined at all. The .bp5-popover-target class breaks the selector applying the outlined styling.

Before After
before after
  1. The other is where the outlined prop is applied to the individual buttons within the group
<ButtonGroup>
  <Popover content={...}>
    <Button icon="git-branch" rightIcon="caret-down" text="Main" outlined />
  </Popover>
  <Button icon="more" outlined />
</ButtonGroup>

In this case, the outline styles render, but there is a slight overlap between the intermediate borders of the button group. This overlap is noticeable due to the semi-transparent styling of the borders on outlined buttons.

Screenshot 2024-09-09 at 21 29 04@2x

Reviewers should focus on:

  • Various possible Button variants/permutations that can be contained within a ButtonGroup wrapper
  • Buttons surrounded by Popovers
  • Buttons surrounded by Tooltips

@changelog-app
Copy link

changelog-app bot commented Sep 10, 2024

Generate changelog in packages/core/changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Fix border overlap between Buttons in outlined ButtonGroup


Generate changelog in packages/docs-app/changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Fix border overlap between Buttons in outlined ButtonGroup


Check the box to generate changelog(s)

  • Generate changelog entry

@ggdouglas ggdouglas force-pushed the gdouglas/fix-button-group-outlined branch from 7b20efb to 7066a7f Compare September 10, 2024 01:13
@svc-palantir-github
Copy link

Fix overlapping borders between buttons in outlined button group

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

> .#{$ns}-button {
.#{$ns}-button {
Copy link
Member

Choose a reason for hiding this comment

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

We likely need to keep the child combinator here, otherwise a button inside an inline overlay within the button group would be affected by these styles. We'll need to be specific for popovers, similar to L100-L112 above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, good point. I'd neglected to test for inline overlays since it's a bit more involved to set up an example for those. Does this same issue not apply to the &.#{$ns}-minimal, &.#{$ns}-outlined selector above also?

&.#{$ns}-minimal, &.#{$ns}-outlined {
.#{$ns}-button {

Added back child combinator and selected for popovers here: 84f92db

@include pt-button-outlined();
}

&:not(.#{$ns}-vertical) {
> .#{$ns}-popover-target:not(:last-child) .#{$ns}-button,
Copy link
Member

Choose a reason for hiding this comment

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

same

Comment on lines +157 to +162
&:not(.#{$ns}-vertical) {
> .#{$ns}-popover-target:not(:last-child) .#{$ns}-button.#{$ns}-outlined,
> .#{$ns}-button.#{$ns}-outlined:not(:last-child) {
border-right: none;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this for vertical button groups too (with border-bottom)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good catch! Added in 79e3441

@svc-palantir-github
Copy link

Handle vertical button groups with outlined button children

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@svc-palantir-github
Copy link

Keep child combinator, explicitly select for popover target children

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@ggdouglas ggdouglas requested a review from invliD September 11, 2024 01:17
}

&:not(.#{$ns}-outlined) {
> .#{$ns}-popover-target:not(:last-child) .#{$ns}-button:not(.#{$ns}-outlined) {
Copy link
Member

Choose a reason for hiding this comment

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

There seems to be a lot of duplicate (or at least similar) styles for popovers here and in the other file. We should probably consolidate them and also merge the selectors for popover-target and popover-wrapper, since they should likely apply the exact same styles (the latter only existing for back-compat anyway).

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 noticed this as well, but was hesitant to tackle reorganizing those styles in this PR since it's a more involved change. I'm also not super familiar with the historical use of the popover-wrapper class, so that also made the prospect of that change seem more brittle to me.

Happy to address cleaning these up though. Would you recommend this PR or a FLUP?

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

Successfully merging this pull request may close these issues.

3 participants