Skip to content

[V2 ListItem] Add Token for Modifying Text Overflow in ListItem Item and Header #792

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 2 commits into from
Jun 29, 2025

Conversation

Dhruv-Mishra
Copy link
Collaborator

@Dhruv-Mishra Dhruv-Mishra commented Jun 24, 2025

Changes

Added ability to change the Text Overflow for ListItem.Item and Header, through tokens.
Requested in #785

Screenshots

Before (Default using TextOverflow.Ellipsis After (UsingTextOverflow.Clip)
image image

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • Automated Tests
  • Documentation and demo app examples
  • VoiceOver and Keyboard Accessibility
  • Internationalization and RTL layouts
  • Size classes and window sizes (notched devices, multitasking, different window sizes, etc)

@Copilot Copilot AI review requested due to automatic review settings June 24, 2025 09:51
@Dhruv-Mishra Dhruv-Mishra requested a review from a team as a code owner June 24, 2025 09:51
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds tokenization support for modifying the text overflow behavior in ListItem.Item and Header components, providing flexibility to change the default ellipsis behavior.

  • Introduces a new token method textOverflow in ListItemTokens.kt.
  • Updates ListItem.kt to utilize token.textOverflow in multiple UI elements instead of the hard-coded TextOverflow.Ellipsis.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
fluentui_listitem/src/main/java/com/microsoft/fluentui/tokenized/listitem/ListItem.kt Replaces fixed TextOverflow.Ellipsis with a token-based overflow value in various text components
fluentui_core/src/main/java/com/microsoft/fluentui/theme/token/controlTokens/ListItemTokens.kt Adds a new textOverflow token returning TextOverflow.Clip
Comments suppressed due to low confidence (1)

fluentui_listitem/src/main/java/com/microsoft/fluentui/tokenized/listitem/ListItem.kt:1042

  • The use of a fallback default (TextOverflow.Ellipsis) here is inconsistent with other instances where token.textOverflow is used directly. Consider standardizing by either always relying on the token's return value or providing a fallback consistently across all usages.
        val textOverflow = token.textOverflow(listItemInfo) ?: TextOverflow.Ellipsis

@Dhruv-Mishra Dhruv-Mishra merged commit c4468f6 into master Jun 29, 2025
2 checks passed
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.

3 participants