A couple of small tweaks. (#4569)

* Stop ignoring the safe area with the suggestions view.

They weren't visible on iPad (hidden behind the sidebar) and I can't find any instance when they're shown where the safe area comes into play.

* Make sure the room list deselects the cell when dismissed a room.

* Use the backports pattern in more places.

* Fix the annoying header on macOS.

* Silence some warnings

* Fix compound CI branch name.
This commit is contained in:
Doug
2025-10-03 12:09:17 +01:00
committed by GitHub
parent c4aebc47ee
commit 6377d9be67
31 changed files with 110 additions and 116 deletions
@@ -22,14 +22,7 @@ struct HomeScreen: View {
actions: leaveRoomAlertActions,
message: leaveRoomAlertMessage)
.navigationTitle(L10n.screenRoomlistMainSpaceTitle)
.toolbar {
if #available(iOS 26, *) {
toolbar
.sharedBackgroundVisibility(.hidden)
} else {
toolbar
}
}
.toolbar { toolbar }
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
.track(screen: .Home)
.bloom()
@@ -43,10 +36,12 @@ struct HomeScreen: View {
ToolbarItem(placement: .navigationBarLeading) {
settingsButton
}
.backportSharedBackgroundVisibility(.hidden)
ToolbarItem(placement: .primaryAction) {
newRoomButton
}
.backportSharedBackgroundVisibility(.hidden)
}
private var settingsButton: some View {
@@ -47,15 +47,11 @@ struct MediaEventsTimelineScreen: View {
if context.viewState.shouldShowEmptyState {
emptyState
} else {
if #available(iOS 26, *) {
scrollView
// Remove the glass effect of iOS 26+
// A flipped table view will always trigger it
// since the nav bar thinks is always at the bottom.
.scrollEdgeEffectHidden()
} else {
scrollView
}
scrollView
// Remove the glass effect of iOS 26+
// A flipped table view will always trigger it
// since the nav bar thinks is always at the bottom.
.backportScrollEdgeEffectHidden()
}
}
@@ -99,7 +99,6 @@ private struct BackgroundView<Content: View>: View {
.clipShape(RoundedCornerShape(radius: shadowRadius, corners: [.topLeft, .topRight]))
.shadow(color: .black.opacity(0.20), radius: 20.0, x: 0.0, y: 3.0)
.mask(Rectangle().padding(.init(top: -(shadowRadius * 2), leading: 0.0, bottom: 0.0, trailing: 0.0)))
.edgesIgnoringSafeArea(.all)
}
}
@@ -20,14 +20,7 @@ struct SpaceListScreen: View {
}
.navigationTitle(L10n.screenSpaceListTitle)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
if #available(iOS 26, *) {
toolbar
.sharedBackgroundVisibility(.hidden)
} else {
toolbar
}
}
.toolbar { toolbar }
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
.bloom()
}
@@ -90,11 +83,13 @@ struct SpaceListScreen: View {
}
.accessibilityLabel(L10n.commonSettings)
}
.backportSharedBackgroundVisibility(.hidden)
ToolbarItem(placement: .principal) {
// Hides the navigationTitle (which is set for the navigation stack label).
Text("").accessibilityHidden(true)
}
.backportSharedBackgroundVisibility(.hidden)
}
}
@@ -52,7 +52,7 @@ struct TimelineItemMenu: View {
}
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.timelineItemActionMenu)
.presentationPage()
.backportPresentationSizingPage()
.presentationDetents([.medium, .large])
.presentationBackground(Color.compound.bgCanvasDefault)
.presentationDragIndicator(.visible)
@@ -251,17 +251,6 @@ private extension EncryptionAuthenticity {
}
}
private extension View {
/// Uses the old page style modal so that on iPadOS 18 the presentation detents have no effect.
@ViewBuilder func presentationPage() -> some View {
if #available(iOS 18.0, *) {
presentationSizing(.page)
} else {
self
}
}
}
// MARK: - Previews
struct TimelineItemMenu_Previews: PreviewProvider, TestablePreview {
@@ -92,13 +92,9 @@ struct PollView: View {
private var optionsView: some View {
ForEach(poll.options, id: \.id) { option in
if #available(iOS 18, *) {
pollOption(option: option)
.accessibilityHint(L10n.a11yPollsWillRemoveSelection,
isEnabled: isRemovePreviousSelectionHintEnabled(option: option))
} else {
pollOption(option: option)
}
pollOption(option: option)
.backportAccessibilityHint(L10n.a11yPollsWillRemoveSelection,
isEnabled: isRemovePreviousSelectionHintEnabled(option: option))
}
}