Skip to content

Implements column width features #2996

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

Merged
merged 15 commits into from
Mar 15, 2023
Merged

Implements column width features #2996

merged 15 commits into from
Mar 15, 2023

Conversation

mperrotti
Copy link
Contributor

@mperrotti mperrotti commented Mar 7, 2023

Closes https://github.com/github/primer/issues/1882

These changes allow consumers to control how the column widths are calculated.

To do:

  • Support responsive values?
  • Handle the sizing of the row action column

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@mperrotti mperrotti requested review from a team and siddharthkp March 7, 2023 23:39
@changeset-bot
Copy link

changeset-bot bot commented Mar 7, 2023

🦋 Changeset detected

Latest commit: 7b3b553

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mperrotti
Copy link
Contributor Author

I didn't update DataTable.docs.json because I didn't see any of the other column props documented. @joshblack - do you have a follow-up issue to handle that? Or do we need to come up with a plan?

/**
* The minimum width the column can shrink to
*/
// TODO: uncomment ResponsiveValue<T> when I'm ready to implement the responsive part
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not even sure we need to make these props responsive. Reviewers: how would you feel about leaving out the responsive value feature until we find we actually need it?

Copy link
Member

Choose a reason for hiding this comment

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

Reviewers: how would you feel about leaving out the responsive value feature until we find we actually need it?

Definitely down for this 👍

@mperrotti mperrotti requested a review from joshblack March 7, 2023 23:44
@github-actions github-actions bot temporarily deployed to storybook-preview-2996 March 7, 2023 23:46 Inactive
@mperrotti mperrotti temporarily deployed to github-pages March 7, 2023 23:48 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2996 March 7, 2023 23:48 Inactive
@joshblack
Copy link
Member

joshblack commented Mar 8, 2023

@mperrotti real quick, noticed the layout on safari is off for the new story example:

image

And this funkiness on Firefox:

image

@joshblack
Copy link
Member

I didn't update DataTable.docs.json because I didn't see any of the other column props documented. @joshblack - do you have a follow-up issue to handle that? Or do we need to come up with a plan?

@mperrotti I have it as a task under: https://github.com/github/primer/issues/1813 to document the TS types for things like Column if that helps to track this work! (Will convert it to an issue when we start work on it). I figured we could do it towards the end since Column as a type may be changing shape depending on how sorting/pagination turns out

@mperrotti
Copy link
Contributor Author

@joshblack - the Safari and FF layout bug was caused by a silly mistake in the @supports block. Should be back to normal now 😅

@mperrotti mperrotti temporarily deployed to github-pages March 10, 2023 18:23 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2996 March 10, 2023 18:24 Inactive
@mperrotti mperrotti temporarily deployed to github-pages March 14, 2023 17:15 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2996 March 14, 2023 17:16 Inactive
Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Looks great! 🥳

@joshblack
Copy link
Member

Just curious, for the TS error that's causing the builds to fail what's the best way to handle CSS Custom Properties in TS? 🤔 Do you typically just cast as React.CSSProperties or do you extend that type with the Custom Property name? (Or something else entirely lol)

@mperrotti
Copy link
Contributor Author

Just curious, for the TS error that's causing the builds to fail what's the best way to handle CSS Custom Properties in TS? 🤔

In the past I've just cast it as React.CSSProperties. There might be a better way, but idk what it is 😅

@mperrotti mperrotti enabled auto-merge March 15, 2023 20:56
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
dist/browser.esm.js 94.48 KB (0%)
dist/browser.umd.js 95.05 KB (0%)

@mperrotti mperrotti added this pull request to the merge queue Mar 15, 2023
Merged via the queue into main with commit baa6395 Mar 15, 2023
@mperrotti mperrotti deleted the mp/data-table-column-widths branch March 15, 2023 21:18
@primer-css primer-css mentioned this pull request Mar 15, 2023
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