Skip to content

Conversation

@mischreiber
Copy link
Collaborator

@mischreiber mischreiber commented Mar 7, 2025

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

This PR lights up FluentTheme and various other low-level Fluent utilities on macOS by moving them to a new cross-platform module, FluentUI_common. To walk through the changes, I've split the diff into four commits.

320e374: Create FluentUI_common target

  • Nice and easy: updating Package.swift to specify a new build target, FluentUI_common.
  • Updating both FluentUI_macos and FluentUI_ios to depend on this new target.

e6b2370: Move common files to FluentUI_common directory

  • This moves many FluentTheme- and token-related files to the new FluentUI_common directory, with almost no changes.
  • First exception to this is Color+Extensions.swift, which hooks into the new macOS-specific DynamicColor integration found in NSColor+Extensions.swift.
  • Second exception is FluentUI.swift, which now also exports FluentUI_common in addition to the platform-specific module. This means users can continue to simply import FluentUI and get the code they expect.

069ec24: Add import FluentUI_common to iOS files

  • This is a big commit, but nothing interesting is happening.
  • I've just added import FluentUI_common to every remaining file in FluentUI_ios, now that so much of the support structure of Fluent iOS has been moved to that library.

1e07c89: Add import FluentUI_common to tests

  • Same for tests :)

Binary change

TBA, will be testing the built app to see impact.

Verification

Ran all automation on both iOS and macOS, and got the same level of success as before my change (there are some failing Notification tests that we should fix later).

Also added a direct FluentTheme reference in the new FluentUI demo app, demonstrating the ability to access Fluent colors from macOS.

Before After
before after
before_dark after_dark

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

@mischreiber mischreiber requested review from a team as code owners March 7, 2025 23:48
Saadnajmi
Saadnajmi previously approved these changes Mar 7, 2025
@amoggo amoggo requested review from amoggo and removed request for amoggo April 22, 2025 18:06
@mischreiber mischreiber merged commit ee70145 into microsoft:main Apr 22, 2025
7 checks passed
@mischreiber mischreiber deleted the FluentUI_Common branch April 22, 2025 21:17
@mischreiber mischreiber mentioned this pull request Jun 13, 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.

6 participants