Skip to content

Conversation

@sainihas
Copy link
Contributor

@sainihas sainihas commented Feb 21, 2024

WHY are these changes introduced?

Fixes an issue where the text in contextual save bar was not truncating and instead overflows by pushing the actions outside the viewport.

Before After
Screenshot 2024-02-20 at 10 00 Screenshot 2024-02-20 at 9 59

WHAT is this pull request doing?

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

🎩 checklist

@sainihas sainihas requested review from a team February 21, 2024 03:06
@sainihas sainihas force-pushed the fix/truncate-text-in-ContextualSaveBar branch from f09650f to 5159480 Compare February 21, 2024 03:08
Comment on lines 75 to 82
& [class*='Polaris-Icon__Svg'],
& [class*='Icon-Svg'] {
& [class*='Polaris-Icon__Svg'] {
fill: var(--p-color-text-inverse);
}
& [class*='Polaris-Icon'] {
flex-shrink: 0; /* Prevents the icon from shrinking */
}
Copy link
Member

@alex-page alex-page Feb 21, 2024

Choose a reason for hiding this comment

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

@sam-b-rose is there a reason we have [class*='Icon-Svg']? We couldn't see it's usage in contextual save bar examples. It was added in an button PR here: #9817

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sam-b-rose is out of office, but I can ship a fix later if we think this is needed once confirmed.

Copy link
Member

@alex-page alex-page left a comment

Choose a reason for hiding this comment

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

One question for @sam-b-rose around the icon class name. Not blocking feel free to ship.

@sainihas sainihas force-pushed the fix/truncate-text-in-ContextualSaveBar branch 3 times, most recently from 5f84c35 to 6abb1bc Compare February 21, 2024 03:25
Fixes

Co-authored-by: Alex Page <hi@alexpage.dev>

Fixes

Co-authored-by: Alex Page <hi@alexpage.dev>
@sainihas sainihas force-pushed the fix/truncate-text-in-ContextualSaveBar branch from d896088 to f2f6d86 Compare February 21, 2024 03:30
@sainihas sainihas merged commit 9aed8c1 into main Feb 21, 2024
@sainihas sainihas deleted the fix/truncate-text-in-ContextualSaveBar branch February 21, 2024 14:43
lgriffee pushed a commit that referenced this pull request Feb 22, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/polaris-icons@8.5.0

### Minor Changes

- [#11639](#11639)
[`4db32af27`](4db32af)
Thanks [@ardakaracizmeli](https://github.com/ardakaracizmeli)! - Added a
new icon: ArrowDiagonal

### Patch Changes

- [#11633](#11633)
[`8a9225306`](8a92253)
Thanks [@heyjoethomas](https://github.com/heyjoethomas)! - Update mobile
icon design

## @shopify/polaris@12.18.0

### Minor Changes

- [#11625](#11625)
[`9aed8c18f`](9aed8c1)
Thanks [@sainihas](https://github.com/sainihas)! - Fix truncate issue
for text in ContextualSaveBar


- [#11604](#11604)
[`376e6ded7`](376e6de)
Thanks [@mrcthms](https://github.com/mrcthms)! - Updated IndexFilters to
better support a configuration of only search and sort


- [#11613](#11613)
[`92d02613b`](92d0261)
Thanks [@lgriffee](https://github.com/lgriffee)! - Deprecated
`heading2xl` and `heading3xl` variants in `Text` component


- [#11611](#11611)
[`b79741cf8`](b79741c)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added `size` prop
to `Tag`

### Patch Changes

- [#11624](#11624)
[`b60ba0710`](b60ba07)
Thanks [@lgriffee](https://github.com/lgriffee)! - Reverted application
of native mobile styles to Button component


- [#11628](#11628)
[`bef27c076`](bef27c0)
Thanks [@ardakaracizmeli](https://github.com/ardakaracizmeli)! - Fixed
an issue where a border displayed between the main content of the frame
and the sidebar

- Updated dependencies
\[[`4db32af27`](4db32af),
[`8a9225306`](8a92253)]:
    -   @shopify/polaris-icons@8.5.0

## polaris.shopify.com@0.63.1

### Patch Changes

- Updated dependencies
\[[`b60ba0710`](b60ba07),
[`4db32af27`](4db32af),
[`9aed8c18f`](9aed8c1),
[`376e6ded7`](376e6de),
[`8a9225306`](8a92253),
[`92d02613b`](92d0261),
[`b79741cf8`](b79741c),
[`bef27c076`](bef27c0)]:
    -   @shopify/polaris@12.18.0
    -   @shopify/polaris-icons@8.5.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
### WHY are these changes introduced?

Fixes an issue where the text in contextual save bar was not truncating
and instead overflows by pushing the actions outside the viewport.

| Before  | After |
| ------------- | ------------- |
| ![Screenshot 2024-02-20 at 10
00](https://github.com/Shopify/polaris/assets/41344212/81a9c794-bbdd-4d40-b8cb-113ff51fdbd4)
| ![Screenshot 2024-02-20 at 9
59](https://github.com/Shopify/polaris/assets/41344212/53d2f988-f3a3-4517-89e4-5648d6ebe41c)
|

### WHAT is this pull request doing?
*
[`polaris-react/src/components/Frame/components/ContextualSaveBar/ContextualSaveBar.module.scss`](diffhunk://#diff-654612881065e78ef49ae5b04a227d423e5dd71663e4128c00bb39cac649fccdR73-R82):
Added `overflow: hidden;` and `margin-right: var(--p-space-200);` to
improve the layout and spacing of the component. Also added
`flex-shrink: 0;` to prevent the icon from shrinking.

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#install-dependencies-and-build-workspaces)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

### 🎩 checklist

- [x] Tested a
[snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases)
- [x] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [x] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [x] Updated the component's `README.md` with documentation changes
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide

Co-authored-by: Alex Page <hi@alexpage.dev>
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.

2 participants