Scope dark mode change only to the presenting sheet (#6144)

* Scope dark mode change only to the presenting sheet, instead of the whole window

* Apply review suggestions to the presentation colour scheme modifier

API:
- Take a `ColorScheme?` at the SwiftUI level instead of a `UIUserInterfaceStyle`
  and map it once inside the representable (`nil` means no override).
- Rename to `presentationColorScheme` and the file to match.
- Restore the `preferredColorScheme` property on the media preview details and
  redact confirmation views, and the `nil` at the media timeline call site, so
  no UIKit types leak into the views.

Cleanup:
- Walk the responder chain with `sequence(first:next:)` instead of a while loop.

* Re-record the media upload preview iPad snapshots

The Cancel button no longer has an explicit tint, so its label colour changed
very slightly from `textActionPrimary` to the default. Only the iPad references
include the toolbar, which is why the iPhone ones were unaffected.
This commit is contained in:
Mauro
2026-09-10 10:23:56 +02:00
committed by GitHub
parent 9fe64b7cd4
commit e57d872fc8
7 changed files with 96 additions and 18 deletions
@@ -35,7 +35,7 @@ struct TimelineMediaPreviewDetailsView: View {
.presentationDetents([.height(sheetHeight)])
.presentationDragIndicator(.visible)
.presentationBackground(.compound.bgCanvasDefault)
.preferredColorScheme(preferredColorScheme)
.presentationColorScheme(preferredColorScheme)
.sheet(item: $context.redactConfirmationItem) { item in
TimelineMediaPreviewRedactConfirmationView(item: item,
context: context,
@@ -38,7 +38,7 @@ struct TimelineMediaPreviewRedactConfirmationView: View {
.presentationDetents([.height(sheetHeight + topPadding)])
.presentationDragIndicator(.visible)
.presentationBackground(.compound.bgCanvasDefault)
.preferredColorScheme(preferredColorScheme)
.presentationColorScheme(preferredColorScheme)
}
private var header: some View {