Skip to content

[List][SwiftUI control] Add color and font from token set for List header & footer#2141

Merged
alexanderboswell merged 5 commits intomicrosoft:mainfrom
alexanderboswell:user/alboswel/AddFontAndColor
Mar 20, 2025
Merged

[List][SwiftUI control] Add color and font from token set for List header & footer#2141
alexanderboswell merged 5 commits intomicrosoft:mainfrom
alexanderboswell:user/alboswel/AddFontAndColor

Conversation

@alexanderboswell
Copy link
Copy Markdown
Contributor

@alexanderboswell alexanderboswell commented Mar 20, 2025

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

For the swiftUI control for List / ListItem, which is the TableViewCell swiftUI version, we don't support tokens yet. This change is to add in color and font.

  • Added in a token set on the view
  • Added a new enum for header style. We have TableViewHeaderFooterView.Style which maps to the token set, but the new swiftUI control, header and footer are distinctly different and will be in the future. To break that trend, from a consumer standpoint we can separate out the styles to just be an option for a header as we only have 1 footer style.

Binary change

Not measured

Verification

Tested with the demo app. We dont have a demo page for this yet, but could be added in a future change.

Visual Verification
header regular style header primary style
image image

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

@alexanderboswell alexanderboswell requested a review from a team as a code owner March 20, 2025 03:08
@alexanderboswell alexanderboswell enabled auto-merge (squash) March 20, 2025 14:52
@joannaquu
Copy link
Copy Markdown
Contributor

but the new swiftUI control, header and footer are distinctly different and will be in the future

does it still make sense to reuse the tableview token set then?

@alexanderboswell
Copy link
Copy Markdown
Contributor Author

alexanderboswell commented Mar 20, 2025

but the new swiftUI control, header and footer are distinctly different and will be in the future

does it still make sense to reuse the tableview token set then?

@joannaquu
Well I guess if I understand, the token system is already well established and having two two token sets for the same thing is not preferred (like we want the same font and color for the section header no matter if it is in swiftui or UIKit).

I guess what I meant by this is that it's not a "HeaderFooterView" as one component anymore, its HeaderView and a FooterView which dont overlap.

Thoughts? This was my motivation on this approach.

@joannaquu
Copy link
Copy Markdown
Contributor

but the new swiftUI control, header and footer are distinctly different and will be in the future

does it still make sense to reuse the tableview token set then?

@joannaquu Well I guess if I understand, the token system is already well established and having two two token sets for the same thing is not preferred (like we want the same font and color for the section header no matter if it is in swiftui or UIKit).

I guess what I meant by this is that it's not a "HeaderFooterView" as one component anymore, its HeaderView and a FooterView which dont overlap.

Thoughts? This was my motivation on this approach.

ahh ok gotcha, I totally read that wrong and interpreted it as our header and footer styles would change in the future

@alexanderboswell alexanderboswell merged commit 70e7757 into microsoft:main Mar 20, 2025
7 checks passed
@alexanderboswell alexanderboswell deleted the user/alboswel/AddFontAndColor branch March 20, 2025 20:26
@joannaquu joannaquu mentioned this pull request Apr 4, 2025
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.

2 participants