import SwiftUI import LChatCore // 🤖 The Threads list, as an iOS sheet: this chat's threads, freshest first, // one row per thread root. The list itself is LChatCore's ReplyThreadListView // (shared with the Mac's docked column, so the rows and their accessible names // are word for word the same); this file is only the sheet chrome around it — // the title, the Done button, and the dismissal a tapped row rides out on. // // Why a sheet rather than a column: the iPhone has no room for a second one, // and a tapped row lands in the thread pane (iPad) or the lifted thread // overlay (iPhone) — so the list is a transient index you come out of, exactly // like Media, Links & Docs. That also matches the web's single-right-dock // rule: finding the thread and reading it are never both on screen. struct ThreadListSheet: View { @ObservedObject var model: ChatFeedModel /// Open this thread. The screen dismisses the sheet first, then opens the /// thread the same way a "N Replies" tally tap does. let onOpen: (Int64) -> Void @Environment(\.dismiss) private var dismiss // The reader's chosen colour theme, so a row highlights in the same // bubble tint the feed behind the sheet uses. @AppStorage("nativeTheme") private var themeName = "classic" var body: some View { NavigationStack { // The sheet's navigation bar carries the title and Done, so the // shared view draws no header of its own. ReplyThreadListView(model: model, theme: .named(themeName), showsHeader: false, onOpen: onOpen, onClose: { dismiss() }) .navigationTitle("Threads") .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .confirmationAction) { Button("Done") { dismiss() } } } } } }