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

Ensure TableViewHeaderFooterView has a themed default text color and font style #2076

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

nodes11
Copy link
Contributor

@nodes11 nodes11 commented Jul 24, 2024

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

Issue: Attributed strings in the TableViewHeaderFooterView were showing as black if a foreground color attribute was not provided.

Root Cause: The attributed text color will default to the textColor of the UITextView. According to the Apple documentation, the default text color for a UITextView is black, explaining why we were seeing the text show as black in both light and dark modes

Fix: Check if an attributed foreground color is provided with string. If not, apply the fluent theme text color. Also do the same thing for font.

Binary change

Total increase: 19,560 bytes
Total decrease: 0 bytes

File Before After Delta
Total 30,900,560 bytes 30,920,120 bytes ⚠️ 19,560 bytes
Full breakdown
File Before After Delta
TableViewHeaderFooterView.o 282,296 bytes 297,712 bytes ⚠️ 15,416 bytes
__.SYMDEF 4,744,576 bytes 4,746,832 bytes ⚠️ 2,256 bytes
FocusRingView.o 834,848 bytes 836,576 bytes ⚠️ 1,728 bytes
PopupMenuSectionHeaderView.o 24,496 bytes 24,656 bytes ⚠️ 160 bytes

Verification

  • In the demo controller, I validated that an attributed string with both foreground color and font attributes uses the attributes.
  • In the demo controller, I validated that an attributed string without a foreground color and font attributes uses the fluent theme colors.
  • Validated that the change fixes our internal use case.
Visual Verification

Before change, without attributes applied to string:
Screenshot 2024-07-24 at 11 04 00 AM
Screenshot 2024-07-24 at 11 03 54 AM

After change, without attributes applied to string:
Screenshot 2024-07-24 at 11 05 38 AM
Screenshot 2024-07-24 at 11 05 42 AM

After change, with attributes applied to string:
Screenshot 2024-07-24 at 11 01 04 AM
Screenshot 2024-07-24 at 11 00 57 AM

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@nodes11 nodes11 requested a review from a team as a code owner July 24, 2024 18:08
@nodes11 nodes11 changed the title Ensure that TableViewHeaderFooterView has a themed default text color… Ensure TableViewHeaderFooterView has a themed default text color and font style Jul 24, 2024
Copy link
Contributor

@joannaquu joannaquu left a comment

Choose a reason for hiding this comment

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

can you run the binary size change

@nodes11 nodes11 merged commit 584aeed into microsoft:main Jul 25, 2024
7 checks passed
@harrieshin harrieshin mentioned this pull request Aug 16, 2024
12 tasks
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