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(Timeline): Convert Timeline to CSS modules behind team feature flag #5329

Merged
merged 9 commits into from
Nov 25, 2024

Conversation

francinelucca
Copy link
Member

@francinelucca francinelucca commented Nov 22, 2024

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

Changelog

New

  • Timeline dev story to test sx and style props with VRT
  • Timeline module css
  • Snapshots for new dev story
  • Tests for Timeline.Break and Timeline.Body
  • className support tests for all Timeline components

Changed

  • Refactor Timeline e2e tests and add new dev story
  • Refactor Timeline to use CSS modules when team feature flag is turned on
  • Deprecate TimelineItemsProps in favor of TimelineItemProps

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@github-actions github-actions bot added the staff Author is a staff member label Nov 22, 2024
@francinelucca francinelucca added component: TimelineItem status: wip and removed staff Author is a staff member labels Nov 22, 2024
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 22, 2024
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

github-actions bot commented Nov 22, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 102.74 KB (+0.21% 🔺)
packages/react/dist/browser.umd.js 103.02 KB (+0.19% 🔺)

Comment on lines 70 to 71
/* TODOl not quite sure if this is the correct migration for this line */
background-color: var(--timelineBadge-bgColor);
Copy link
Member Author

Choose a reason for hiding this comment

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

Can I get a check on this line? I wasn't quite sure what the correct mapping was here. i pulled the --timelineBadge-bgColor from the computer styles in production

Comment on lines +92 to +109
it('should support `className` on the outermost element', () => {
const Element = () => <Timeline.Badge className={'test-class-name'} />
const FeatureFlagElement = () => {
return (
<FeatureFlags
flags={{
primer_react_css_modules_team: true,
primer_react_css_modules_staff: true,
primer_react_css_modules_ga: true,
}}
>
<Element />
</FeatureFlags>
)
}
expect(HTMLRender(<FeatureFlagElement />).container.firstChild?.firstChild).toHaveClass('test-class-name')
})
})
Copy link
Member Author

Choose a reason for hiding this comment

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

The sx-compliant Timeline.Badge doesn't support className, I thought it'd make sense to add it to the css modules refactor and therefore I'm only testing for that one here, but lmk if that doesn't make sense and I can revert!

Comment on lines +109 to +114
/**
* @deprecated Use the `TimelineItemProps` type instead
*/
export type TimelineItemsProps = StyledTimelineItemProps & HTMLProps<HTMLDivElement>

export type TimelineItemProps = StyledTimelineItemProps & HTMLProps<HTMLDivElement>
Copy link
Member Author

Choose a reason for hiding this comment

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

It seems to me the "correct" prop name would be TimelineItemProps singular, so I'm proposing deprecating TimelineItemsProps in favor of TimelineItemProps. Would love to hear thoughts on this one

Copy link

changeset-bot bot commented Nov 22, 2024

🦋 Changeset detected

Latest commit: db6b3eb

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 Minor

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

@github-actions github-actions bot temporarily deployed to storybook-preview-5329 November 22, 2024 19:05 Inactive
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 22, 2024
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/352333

@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Nov 22, 2024
@francinelucca francinelucca marked this pull request as ready for review November 22, 2024 22:06
@francinelucca francinelucca requested review from a team as code owners November 22, 2024 22:06
@francinelucca francinelucca added the staff Author is a staff member label Nov 25, 2024
Copy link
Contributor

@langermank langermank left a comment

Choose a reason for hiding this comment

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

Just a few nitpicks! The color vars look good 👍

packages/react/src/Timeline/Timeline.module.css Outdated Show resolved Hide resolved
packages/react/src/Timeline/Timeline.module.css Outdated Show resolved Hide resolved
packages/react/src/Timeline/Timeline.module.css Outdated Show resolved Hide resolved
francinelucca and others added 2 commits November 25, 2024 12:59
Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>
Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 25, 2024
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>
@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 25, 2024
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 25, 2024
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

1 similar comment
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 25, 2024
@francinelucca francinelucca added this pull request to the merge queue Nov 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 25, 2024
@francinelucca francinelucca added this pull request to the merge queue Nov 25, 2024
Merged via the queue into main with commit e7547e8 Nov 25, 2024
43 checks passed
@francinelucca francinelucca deleted the 4366-update-timeline-to-css-modules branch November 25, 2024 20:22
@primer primer bot mentioned this pull request Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Timeline component: TimelineItem integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh staff Author is a staff member status: review needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants