#if DEBUG import AppKit import EquipoKit import SwiftUI /// Captures the real AppKit conversation after its asynchronous actions settle. struct StoppedConversationFixture: View { @State private var session = StoppedWorkFixture.makeSession() var body: some View { TranscriptView(projectSelectionID: nil, projectSelectionNotice: nil, items: Feed.build(session), session: session, focusCard: .constant(nil), openTask: { _ in }) .frame(minWidth: 800, minHeight: 760) .task { await session.refresh() try? await Task.sleep(for: .seconds(4)) guard let path = ProcessInfo.processInfo.environment["EQUIPO_FIXTURE_CAPTURE"], let window = NSApp.windows.first(where: { $0.isVisible && !$0.isSheet }), let view = window.contentView else { return } window.setContentSize(NSSize(width: 900, height: 900)) view.layoutSubtreeIfNeeded(); window.displayIfNeeded() if let bitmap = view.bitmapImageRepForCachingDisplay(in: view.bounds) { view.cacheDisplay(in: view.bounds, to: bitmap) if let data = bitmap.representation(using: .png, properties: [:]) { _ = FileManager.default.createFile(atPath: path, contents: data) } } } } } #endif