Combine DM call actions into one menu item

This helps give more space to the room header. Specially in the scenario when threads is enabled.
This commit is contained in:
amshak
2026-04-23 11:31:15 +01:00
committed by Stefan Ceriu
parent fa2c3169b3
commit 69822c8518
@@ -24,14 +24,30 @@ struct RoomCallControlsToolbar: ToolbarContent {
} else { } else {
if viewState.isDirectOneToOneRoom { if viewState.isDirectOneToOneRoom {
ToolbarItem(placement: .primaryAction) { ToolbarItem(placement: .primaryAction) {
Button { onCallTap(true) } label: { Menu {
CompoundIcon(\.voiceCallSolid) Button(action: { onCallTap(true) }) {
Label("Audio call", systemImage: "phone.fill")
} }
.accessibilityIdentifier(A11yIdentifiers.roomScreen.startVoiceCall)
.disabled(!viewState.canJoinCall)
Button(action: { onCallTap(false) }) {
Label("Video call", systemImage: "video.fill")
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.startVideoCall)
.disabled(!viewState.canJoinCall)
} label: {
CompoundIcon(\.voiceCallSolid)
.frame(width: 28, height: 28)
.contentShape(Rectangle())
}
.menuIndicator(.hidden)
.buttonStyle(.plain)
.accessibilityLabel(L10n.a11yStartVoiceCall) .accessibilityLabel(L10n.a11yStartVoiceCall)
.accessibilityIdentifier(A11yIdentifiers.roomScreen.startVoiceCall) .accessibilityIdentifier(A11yIdentifiers.roomScreen.startVoiceCall)
.disabled(!viewState.canJoinCall) .disabled(!viewState.canJoinCall)
} }
} } else {
ToolbarItem(placement: .primaryAction) { ToolbarItem(placement: .primaryAction) {
Button { onCallTap(false) } label: { Button { onCallTap(false) } label: {
CompoundIcon(\.videoCallSolid) CompoundIcon(\.videoCallSolid)
@@ -43,6 +59,7 @@ struct RoomCallControlsToolbar: ToolbarContent {
} }
} }
} }
}
// MARK: - Previews // MARK: - Previews