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

feat: show type badge in DataGrid header #144

Merged
merged 5 commits into from
Oct 17, 2024

Conversation

keita-determined
Copy link
Contributor

@keita-determined keita-determined commented Oct 14, 2024

  • ET-792
  • Show type badge in DataGrid header
Screen.Recording.2024-10-16.at.11.01.51.AM.mov

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for hew-ui ready!

Name Link
🔨 Latest commit 1ff4cba
🔍 Latest deploy log https://app.netlify.com/sites/hew-ui/deploys/6711437e406954000864de0f
😎 Deploy Preview https://deploy-preview-144--hew-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@determined-ci
Copy link
Collaborator

determined-ci commented Oct 14, 2024

Hello! DesignKit diffs for commit 1ff4cba are available for you to view here

@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.75%. Comparing base (09548a8) to head (1ff4cba).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #144   +/-   ##
=======================================
  Coverage   82.75%   82.75%           
=======================================
  Files          49       49           
  Lines        6499     6499           
  Branches      457      457           
=======================================
  Hits         5378     5378           
  Misses       1121     1121           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 123 to 133
const backgroundColor = '#13569c';

ctx.beginPath();
ctx.font = tagFont;
ctx.fillStyle = backgroundColor;
ctx.strokeStyle = backgroundColor;
ctx.lineWidth = 1;
roundedRect(ctx, x, y - 10, measureTextCached(typeName, ctx, tagFont).width + 16, 18, 4);
ctx.stroke();
ctx.fill();
ctx.fillStyle = '#fff';
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use the data grid theme here? the colors should probably respond to the overall theme. i see in the theme there's a textBubble and bgBubble theme that we could use here source.

Copy link
Contributor Author

@keita-determined keita-determined Oct 15, 2024

Choose a reason for hiding this comment

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

fixed it.

light mode

image

dark mode

image

what do you think? I think it's hard to look at the type badge. Also, should badge color be the same or similar to hew badge color? (default badge).

image

Copy link
Contributor

@ashtonG ashtonG Oct 16, 2024

Choose a reason for hiding this comment

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

I agree -- looking at the theme it appears we use the textBubble theme variable as the border of the tags for the tag cell. That said, the badge background color does change with the theme -- could we reproduce the logic from the badge component here?

in addition, note that the badge font weight is bold. that's definitely something we want to retain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dark Mode

image

Light Mode

image

...bgColor,
s: bgColor.s > 0 ? 70 : 0,
});
const textColor = getComputedStyle(ctx.canvas).getPropertyValue('--gdg-text-bubble');
Copy link
Contributor

Choose a reason for hiding this comment

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

i think for the text color we might need to copy the text color logic from the badge as well. as mentioned before, we're using that color variable for the tags text border source

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getComputedStyle(ctx.canvas).getPropertyValue('--gdg-text-bubble'); and theme.textBubble are equivalent.
Did you mean textDark code?

with textDark

image image

Copy link
Contributor

@ashtonG ashtonG left a comment

Choose a reason for hiding this comment

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

lgtm!

@keita-determined keita-determined merged commit 922affe into main Oct 17, 2024
9 checks passed
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.

4 participants