Skip to content

TreeView: Add truncate prop - #5122

Merged
TylerJDev merged 11 commits into
mainfrom
tylerjdev/truncate-opt-in-treeview
Nov 6, 2024
Merged

TreeView: Add truncate prop#5122
TylerJDev merged 11 commits into
mainfrom
tylerjdev/truncate-opt-in-treeview

Conversation

@TylerJDev

@TylerJDevTylerJDev commented Oct 14, 2024

Copy link
Copy Markdown
Member

Context https://github.com/github/primer/issues/3481

Adds truncate prop to TreeView. There currently isn't a way to wrap text inside TreeView.Itemwithout doing it manually. This adds a prop which allows you to add this behavior directly via the prop, instead of doing it manually through custom styles.

Changelog

New

  • Adds truncate prop to TreeView

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

@changeset-bot

changeset-botBot commented Oct 14, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 19e2ac9

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-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-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 14, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5122 October 14, 2024 21:19 Inactive
@github-actions

github-actionsBot commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js98.58 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js98.94 KB (+0.03% 🔺)

@primer-integration

primer-integrationBot commented Oct 21, 2024

Copy link
Copy Markdown

🟢 golden-jobs completed with status success.

@primer-integration

Copy link
Copy Markdown

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

@TylerJDev
TylerJDevforce-pushed the tylerjdev/truncate-opt-in-treeview branch from 111509e to ffe6535CompareNovember 5, 2024 16:40
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5122 November 5, 2024 16:42 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5122 November 5, 2024 17:08 Inactive
@TylerJDevTylerJDev changed the title TreeView truncation opt-in [WIP]TreeView: Add truncate propNov 5, 2024
@TylerJDev
TylerJDev marked this pull request as ready for review November 5, 2024 17:44
@TylerJDev
TylerJDev requested a review from a team as a code ownerNovember 5, 2024 17:44
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5122 November 5, 2024 17:46 Inactive
'aria-labelledby': ariaLabelledby,
children,
flat,
truncate = true,

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.

@TylerJDev do you think it might make more sense to make this false by default? Just wondering if this is kind of a breaking change. Have you run an integration test?

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.

For this, I set it to true to keep the default behavior of the text truncating when not using the prop. When using it with false, it will wrap instead. The new behavior should only be opt-in, so that we can release this under a non breaking change.

Let me know if you think we should change the prop name (e.g. shouldNotTruncate, wrap). Not sure if truncate is confusing or not 😅

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.

OH sorry I totally read the CSS wrong. Awesome! LGTM

@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.

🚀

@github-actions
github-actionsBottemporarily deployed to storybook-preview-5122 November 6, 2024 13:10 Inactive
@TylerJDevTylerJDev added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 6, 2024
@primer
primerBot requested a review from a team as a code ownerNovember 6, 2024 13:45
@primer
primerBot requested a review from maximedegreveNovember 6, 2024 13:45
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 6, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5122 November 6, 2024 13:47 Inactive
@TylerJDev

Copy link
Copy Markdown
MemberAuthor

Updated snapshots for storybook story changes!

@TylerJDev
TylerJDev added this pull request to the merge queueNov 6, 2024
@TylerJDev
TylerJDev removed this pull request from the merge queue due to a manual request Nov 6, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5122 November 6, 2024 14:05 Inactive
@TylerJDevTylerJDev added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 6, 2024
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 6, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5122 November 6, 2024 14:28 Inactive
@TylerJDev
TylerJDev added this pull request to the merge queueNov 6, 2024
Merged via the queue into main with commit e021a8fNov 6, 2024
@TylerJDev
TylerJDev deleted the tylerjdev/truncate-opt-in-treeview branch November 6, 2024 14:49
@primerprimerBot mentioned this pull request Nov 6, 2024
@siddharthkpsiddharthkp mentioned this pull request Nov 8, 2024
4 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@TylerJDev@langermank