-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat(table): add tooltips to buttons and shrink icon size to 16 px, upgrade Carbon to v10.12.0 #1238
Conversation
package.json
Outdated
@@ -86,8 +86,8 @@ | |||
"@carbon/layout": "10.7.1", | |||
"@carbon/motion": "10.6.0", | |||
"@carbon/themes": "10.10.3", | |||
"carbon-components": "10.10.3", | |||
"carbon-components-react": "7.10.3", | |||
"carbon-components": "^10.12.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be pinned to specific version.
"carbon-components": "^10.12.0", | |
"carbon-components": "10.12.0", |
Deploy preview for carbon-addons-iot-react ready! Built with commit d4c65b8 https://deploy-preview-1238--carbon-addons-iot-react.netlify.app |
Deploy preview for carbon-addons-iot-react ready! Built with commit 05764e4 https://deploy-preview-1238--carbon-addons-iot-react.netlify.app |
@@ -26,6 +20,11 @@ div.#{$prefix}--toolbar-action.#{$prefix}--toolbar-search-container-expandable { | |||
padding-top: $spacing-01; | |||
} | |||
|
|||
// small fix to allow tooltips to show outside the toolbar if the batch action isn't active |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, I was just fighting the clip-path myself, trying to figure out how to work around it without causing a breaking change. So you are sure it was only needed for the batch actions and not for anything else? What about custom toolbar content that might rely on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so @bjornalm I almost opened a bug on carbon to only set the clip-path initially if the batch actions was active to make sure they approved.
"defaultProps": Object { | ||
"accept": Array [], | ||
"buttonKind": "primary", | ||
"disableLabelChanges": false, | ||
"disabled": false, | ||
"labelText": "Add file", | ||
"multiple": false, | ||
"onChange": [Function], | ||
"onClick": [Function], | ||
"role": "button", | ||
"tabIndex": 0, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should look into Carbon changelogs to see why this has changed.
package.json
Outdated
@@ -35,7 +35,7 @@ | |||
"lint:stylelint": "stylelint './src/**/*.scss' --syntax scss --ignorePath .gitignore", | |||
"prepare": "yarn build", | |||
"publish-npm": "yarn semantic-release", | |||
"start": "yarn test:engines && yarn storybook", | |||
"start": "yarn test:engines && NODE_OPTIONS='--max-old-space-size=16384' yarn storybook", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try a killall node -9
and then try running this command?
I assume you saw a heap out of memory error and added this. These are typically a result of resource issues on the local machine vs a reproducible issue across other machines. We shouldn't set this flag unless necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it's fine if you wanna take it out, but I couldn't even get my initial build to work without it, and as far as I could tell I didn't have anything else eating local memory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no luck with the killall node -9
even after reboot, I couldn't do the yarn start
without upping the heapsize! not sure if something is strange with the new carbon.
Co-authored-by: David Conner <david@david-conner.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple things I noticed on the following story
https://deploy-preview-1238--carbon-addons-iot-react.netlify.app/?path=/story/watson-iot-table--with-resize-hascolumnselection-and-initial-column-widths
-
Do we want the tooltips to appear immediately (as they do), to on a timer on hover (like most tooltips in html). Is there anything in the design for that. I can see lots of comments coming back from users with inconsistencies if we do it immediately here on these buttons, but, don't do it immediately on all buttons, etc, or just the annoyance of it being immediate. Once you know the buttons, having the tooltips is more annoying than helpful.
-
The tooltips clip off the screen. It's pretty much a guarantee that tooltips will will larger descriptions esp in different languages, and that these buttons are going to pushed to the edge of the screen (in both rtl and ltr environments)
-
The entire window body adds in horz scrollbar. This is ugly, and it's not like we can actually scroll the page to see the tooltip, since, as soon as you mouse away the toolttip is gone.
Almost like we need a universal tooltip manager to mange using tooltips in all cases.
…bon-addons-iot-react into fix-table-toolbarbuttons
@CynZhang what do you think? |
ok @stuckless resubmitted after talking with @CynZhang and we gonna go with the native browser tooltips for now until Carbon gives us more options to make the default tooltips less intrusive. |
@CynZhang in the TableCard the icon size no longer matches once it's next to the CardIcons, should we update the CardIcon size as well? |
@scottdickerson yes, those icons in the toolbar should all be 16px. Can you also check if the icon colors are the same? |
use-resize-observer@^6.0.0: | ||
version "6.1.0" | ||
resolved "https://registry.yarnpkg.com/use-resize-observer/-/use-resize-observer-6.1.0.tgz#d4d267a940dbf9c326da6042f8a4bb8c89d29729" | ||
integrity sha512-SiPcWHiIQ1CnHmb6PxbYtygqiZXR0U9dNkkbpX9VYnlstUwF8+QqpUTrzh13pjPwcjMVGR+QIC+nvF5ujfFNng== | ||
dependencies: | ||
resize-observer-polyfill "^1.5.1" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming from Carbon. We use an older version. It would be very beneficial if we updated our version of this dep to also use v6.1.
I've created a separate issue #1250 but we can include here if you'd prefer @scottdickerson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1253 Will fix the heap out of memory issue - lets wait to merge this until that one is in.
#1253 (comment):
A bit more context on this heap out of memory issue: it's a storybook issue with terser and react-docgen. It should be totally resolved in v6, but upgrading to Node 12 is a workaround.
@tay1orjones thanks for the fix, I put in the PR with a dependency on yours, and it should be ready to go now |
…fix-table-toolbarbuttons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node 12 PR is in, which should resolve the heap error we saw.
I pulled down the branch and verified locally - yarn start
works fine on Node 12.17.0 👍
carbon-components-react@7.12.0: | ||
version "7.12.0" | ||
resolved "https://registry.yarnpkg.com/carbon-components-react/-/carbon-components-react-7.12.0.tgz#d41125e774fa40e5c5fbc1d536c1923111273f6b" | ||
integrity sha512-zsVD9/Dh8Rgl9LOO7vltS8AXj14eCbmSddQrDMkHeq5JSpQWtIqUAI7A7sT2uAhmowi1hk8d0BAroyGzhLHzAg== | ||
dependencies: | ||
"@carbon/icons-react" "^10.9.3" | ||
"@carbon/icons-react" "^10.11.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we should've upgraded icons-react too. I've opened a new PR: #1263
🎉 This PR is included in version 2.84.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #975
Closes #1174
Closes https://github.ibm.com/Watson-IoT/pal-tracking/issues/399
Closes #1080
Summary
Fixes the toolbar buttons to be 16 px instead of 20, to use the official Carbon icon only buttons and to support tooltips. Also adds an active state to the button.
Change List (commits, features, bugs, etc)
Acceptance Test (how to verify the PR)
watson-iot-table--stateful-example-with-expansion-maxpages-and-column-resize
that the tooltips, and active button states work correctly. Verify the keyboard support of all the toolbar buttons