import SwiftUI

/// Shared "currently-opened file" for the workspace, written by the file explorer
/// and read by editor panels — so clicking a file in one panel opens it in another.
/// App-wide (one selection at a time); `PaneledChatView` clears it when the open
/// chat changes so a path from one worktree never leaks into another.
@MainActor
@Observable
final class FileSelectionStore {
    var selected: URL?

    func open(_ url: URL) { selected = url }
    func clear() { selected = nil }
}
