Files
Talon b07362e525 feat(ios): iPhone channel drill-down, fix chat compose box, unify chat+activity
- Channels tab is now a drill-down on iPhone: ChannelBrowserView lists top-level
  channels; ChannelDetailView shows the people in a channel, its sub-channels, and
  an explicit Join button (with password prompt). iPad split view unchanged.
- Extract self-contained UserRow (context menu + sheets) from UserListView so admin
  actions are reused in the drill-down.
- Fix off-screen chat compose box: pin VoiceControlsView via per-tab
  .safeAreaInset(edge: .bottom) instead of a floating overlay, so it reserves layout
  space above the tab bar (keeping the compose box visible, cooperating with keyboard
  avoidance) without covering the tab bar buttons.
- Collapse Activity into Chat like macOS/Windows: ChatView renders a merged,
  time-sorted timeline of messages + activity (activity rows in gray); remove the
  Activity tab and ActivityLogView.
- Label the RPSystemBroadcastPickerView inner UIButton for VoiceOver
  ("Share/Stop sharing screen audio") instead of relying on an outer SwiftUI label.
2026-06-21 03:02:58 +02:00

80 lines
2.4 KiB
Swift

import SwiftUI
struct MainView: View {
@Environment(AppState.self) private var appState
@Environment(\.horizontalSizeClass) private var sizeClass
var body: some View {
if let session = appState.session {
if sizeClass == .regular {
iPadMainView(session: session)
} else {
iPhoneMainView(session: session)
}
} else {
ServerListView()
}
}
}
// MARK: - iPhone layout: TabView
private struct iPhoneMainView: View {
let session: SessionState
var body: some View {
TabView {
ChannelBrowserView(session: session)
.voiceControlsBar(session)
.tabItem {
Label("Channels", systemImage: "list.bullet.indent")
}
ChatView(session: session)
.voiceControlsBar(session)
.tabItem {
Label("Chat", systemImage: "message")
}
SettingsView(session: session)
.voiceControlsBar(session)
.tabItem {
Label("Settings", systemImage: "gear")
}
}
}
}
private extension View {
/// Pin the shared voice controls just above the tab bar, *inside each tab's content area*.
/// Applying this per-tab (rather than to the TabView itself) reserves layout space above
/// the tab bar keeping ChatView's compose box visible and cooperating with keyboard
/// avoidance without the bar covering the tab bar's buttons.
func voiceControlsBar(_ session: SessionState) -> some View {
safeAreaInset(edge: .bottom) {
VoiceControlsView(session: session)
}
}
}
// MARK: - iPad layout: NavigationSplitView
private struct iPadMainView: View {
let session: SessionState
@State private var columnVisibility = NavigationSplitViewVisibility.all
var body: some View {
NavigationSplitView(columnVisibility: $columnVisibility) {
ChannelTreeView(session: session)
.navigationTitle("Channels")
} content: {
UserListView(session: session)
.navigationTitle("Users")
} detail: {
VStack(spacing: 0) {
ChatView(session: session)
VoiceControlsView(session: session)
}
.navigationTitle("Chat")
}
}
}