Skip to content

feat(Timeline): Convert Timeline to CSS modules behind team feature flag - #5329

Merged
francinelucca merged 9 commits into
mainfrom
4366-update-timeline-to-css-modules
Nov 25, 2024
Merged

feat(Timeline): Convert Timeline to CSS modules behind team feature flag#5329
francinelucca merged 9 commits into
mainfrom
4366-update-timeline-to-css-modules

Conversation

@francinelucca

@francineluccafrancinelucca commented Nov 22, 2024

Copy link
Copy Markdown
Member

Closeshttps://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

@francineluccafrancinelucca added component: Timeline update snapshots 🤖 Command that updates VRT snapshots on the pull request labels Nov 22, 2024
@github-actionsgithub-actionsBot added the staff Author is a staff member label Nov 22, 2024
@francineluccafrancinelucca added component: TimelineItem status: wip and removed staff Author is a staff member labels Nov 22, 2024
@github-actionsgithub-actionsBot 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
@github-actions

Copy link
Copy Markdown
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!

@github-actions

github-actionsBot commented Nov 22, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js102.74 KB (+0.21% 🔺)
packages/react/dist/browser.umd.js103.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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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

@changeset-bot

changeset-botBot commented Nov 22, 2024

Copy link
Copy Markdown

🦋 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
NameType
@primer/reactMinor

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-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 22, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5329 November 22, 2024 19:05 Inactive
@github-actionsgithub-actionsBot 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
Copy Markdown

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

@primer-integration

Copy link
Copy Markdown

🟢 golden-jobs completed with status success.

@github-actionsgithub-actionsBot 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 ownersNovember 22, 2024 22:06
@francineluccafrancinelucca added the staff Author is a staff member label Nov 25, 2024

@langermanklangermank left a comment

Copy link
Copy Markdown
Contributor

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 👍

Comment threadpackages/react/src/Timeline/Timeline.module.css Outdated
Comment threadpackages/react/src/Timeline/Timeline.module.css Outdated
Comment threadpackages/react/src/Timeline/Timeline.module.css Outdated
francineluccaand 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-actionsgithub-actionsBot 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
@github-actions

Copy link
Copy Markdown
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-actionsgithub-actionsBot 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
@github-actions

Copy link
Copy Markdown
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-actionsgithub-actionsBot 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
@github-actions

Copy link
Copy Markdown
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
@github-actions

Copy link
Copy Markdown
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-actionsgithub-actionsBot 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
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5329 November 25, 2024 18:02 Inactive
@francinelucca
francinelucca added this pull request to the merge queueNov 25, 2024
@github-merge-queue
github-merge-queueBot 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 queueNov 25, 2024
Merged via the queue into main with commit e7547e8Nov 25, 2024
@francinelucca
francinelucca deleted the 4366-update-timeline-to-css-modules branch November 25, 2024 20:22
@primerprimerBot mentioned this pull request Nov 25, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: Timelinecomponent: TimelineItemintegration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghstaffAuthor is a staff memberstatus: review needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@francinelucca@jonrohan@langermank