docs(sp-truncated): updated sp-truncated pattern
Description
Comprehensive documentation rewrite for sp-truncated with full API reference, accessibility guidelines, usage patterns, and practical examples across multiple component contexts.
Added sp-truncated to bundle/elements.ts to ensure proper component registration and CSS rendering in documentation demo blocks.
Motivation and context
Related issue(s)
- fixes SWC-431
Screenshots (if appropriate)
Author's checklist
- [ ] I have read the CONTRIBUTING and PULL_REQUESTS documents.
- [ ] I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
- [ ] I have added automated tests to cover my changes.
- [ ] I have included a well-written changeset if my change needs to be published.
- [ ] I have included updated documentation if my change required it.
Reviewer's checklist
- [ ] Includes a Github Issue with appropriate flag or Jira ticket number without a link
- [ ] Includes thoughtfully written changeset if changes suggested include
patch,minor, ormajorfeatures - [ ] Automated tests cover all use cases and follow best practices for writing
- [ ] Validated on all supported browsers
- [ ] All VRTs are approved before the author can update Golden Hash
Manual review test cases
-
[ ] Descriptive Test Statement
- Go here
- Do this action
- Expect this result
-
[ ] Descriptive Test Statement
- Go here
- Do this action
- Expect this result
Device review
- [ ] Did it pass in Desktop?
- [ ] Did it pass in (emulated) Mobile?
- [ ] Did it pass in (emulated) iPad?
⚠️ No Changeset found
Latest commit: b93fcf4972173cb82c62ef41cb815a91dc46e343
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
📚 Branch Preview
🔍 Visual Regression Test Results
When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
- Spectrum | Light | Medium | LTR
- Spectrum | Dark | Large | RTL
- Express | Light | Medium | LTR
- Express | Dark | Large | RTL
- Spectrum-two | Light | Medium | LTR
- Spectrum-two | Dark | Large | RTL
- High Contrast Mode | Medium | LTR
Deployed to Azure Blob Storage: pr-5839
If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.
Tachometer results
Currently, no packages are changed by this PR...
Pull Request Test Coverage Report for Build 18939955006
Details
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 97.964%
| Totals | |
|---|---|
| Change from base Build 18885025935: | 0.0% |
| Covered Lines: | 34259 |
| Relevant Lines: | 34788 |
💛 - Coveralls
Known issue: sp-tooltip is getting cut off due to max-width constraint for long words. Will be tacked in SWC-1331
Looks good. I only have a couple of questions/suggestions. Also I noticed that the API tab for truncated is all empty and I wonder if that's an easy fix or should we address that separately?
Yes in our component generation template we are explicitly checking for public properties to show in the API tab. For me this is too restrictive. When there is no modifier, it infers as privacy-> undefined. We can change the logic to place everything which is not private. Let's take this in a separate PR.
return member?.privacy !== 'private';
Looks good. I only have a couple of questions/suggestions. Also I noticed that the API tab for truncated is all empty and I wonder if that's an easy fix or should we address that separately?
Yes in our component generation template we are explicitly checking for public properties to show in the API tab. For me this is too restrictive. When there is no modifier, it infers as privacy-> undefined. We can change the logic to place everything which is not private. Let's take this in a separate PR.
return member?.privacy !== 'private';
I believe we should require every property has a modifier instead of loosing the API table generation. we should be intentional about our properties
I have major accessibility concerns with this component that we need to discuss as a team.
For this specific docs PR:
- I am seeing correct copy to clipboard.
- I am seeing INCORRECT rendering of tooltip container on several examples when hovering.
Looks good. I only have a couple of questions/suggestions. Also I noticed that the API tab for truncated is all empty and I wonder if that's an easy fix or should we address that separately?
Yes in our component generation template we are explicitly checking for public properties to show in the API tab. For me this is too restrictive. When there is no modifier, it infers as privacy-> undefined. We can change the logic to place everything which is not private. Let's take this in a separate PR.
return member?.privacy !== 'private';
Yup! You got this right. I did update it in my last PR so it should be fine now (since this is up to date with main). Everything which is not private should be in the API table for now.
📚 Branch Preview Links
🔍 First Generation Visual Regression Test Results
When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
- Spectrum | Light | Medium | LTR
- Spectrum | Dark | Large | RTL
- Express | Light | Medium | LTR
- Express | Dark | Large | RTL
- Spectrum-two | Light | Medium | LTR
- Spectrum-two | Dark | Large | RTL
- High Contrast Mode | Medium | LTR
Deployed to Azure Blob Storage: pr-5839
If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.
I have major accessibility concerns with this component that we need to discuss as a team.
For this specific docs PR:
- I am seeing correct copy to clipboard.
- I am seeing INCORRECT rendering of tooltip container on several examples when hovering.
![]()
Kept this PR open due to the tooltip issue as noted here. It should be fixed now with SWC-1331 being closed
