macOS 26: retain cycle detected when navigation link label contains a Swift Chart

I'm running into an issue where my application will hang when switching tabs. The issue only seems to occur when I include a Swift Chart in a navigation label. The application does not hang If I replace the chart with a text field.

This appears to only hang when running on macOS 26. When running on iOS (simulator) or visionOS (simulator, on-device) I do not observe a hang. The same code does not hang on macOS 15.

Has any one seen this behavior?

The use case is that my root view is a TabView where the first tab is a summary of events that have occurred. This summary is embedded in a NavigationStack and has a graph of events over the last week. I want the user to be able to click that graph to get additional information regarding the events (ie: a detail page or break down of events).

Initially, the summary view loads fine and displays appropriately. However, when I switch to a different tab, the application will hang when I switch back to the summary view tab.

In Xcode I see the following messages

=== AttributeGraph: cycle detected through attribute 162104 ===
=== AttributeGraph: cycle detected through attribute 162104 ===
=== AttributeGraph: cycle detected through attribute 162104 ===
=== AttributeGraph: cycle detected through attribute 162104 ===
=== AttributeGraph: cycle detected through attribute 162104 ===

A simple repro is the following

import SwiftUI
import Charts

@main
struct chart_cycle_reproApp: App {
    var body: some Scene {
        WindowGroup {
            TabView {
                Tab("Chart", systemImage: "chart.bar") {
                    NavigationStack {
                        NavigationLink {
                            Text("this is an example of clicking the chart")
                        }
                        label: {
                            Chart {
                                BarMark(
                                    x: .value("date", "09/03"),
                                    y: .value("birds", 3)
                                )
                                // additional marks trimmed
                            }
                            .frame(minHeight: 200, maxHeight: .infinity)
                        }
                    }
                }
                
                Tab("List", systemImage: "list.bullet") {
                    Text("This is an example")
                }
            }
        }
    }
}

I'm also experiencing this issue, but I'm not using Charts. It's when navigating back to my Home tab on macOS only. This works fine on iOS.

import SwiftData
import SwiftUI

struct ContentView: View {
    @Environment(\.modelContext) private var modelContext
    @Query private var publications: [Publication]

    @State private var publicationError: EncodedPublicationError?
    @State private var showErrorAlert = false
    @State private var selectedTab = 0

    var body: some View {
        NavigationStack {
            TabView(selection: $selectedTab) {
                ScrollView {
                    FeaturedView()
                    RecentlyOpenedView()
                    Spacer(minLength: 20)
                    RecentlyUpdatedView()
                    Spacer(minLength: 60)
                }
                .tag(0)
                .tabItem {
                    Label("Home", systemImage: "house.fill")
                }
                
                LibraryView()
                    .tag(1)
                    .tabItem {
                        Label("Library", systemImage: "books.vertical.fill")
                    }
                
                QuestionView()
                    .tag(2)
                    .tabItem {
                        Label("Answers", systemImage: "text.bubble.fill")
                    }
                
                SearchView()
                    .tag(3)
                    .tabItem {
                        Label("Search", systemImage: "magnifyingglass")
                    }
            }
            .navigationTitle(navigationTitle)
            .tabViewStyle(.sidebarAdaptable)
            .refreshable { await refreshPublications() }
        }
        .overlay {
            if publications.isEmpty {
                initialSetupView
            }
        }
        .alert(isPresented: $showErrorAlert, error: publicationError) {
            Button("OK", role: .cancel) { }
        }
        .task {
            if publications.isEmpty {
                await refreshPublications()
            }
        }
    }
    
    private var navigationTitle: String {
        switch selectedTab {
        case 0: return "Home"
        case 1: return "Library"
        case 2: return "Answers"
        case 3: return "Search"
        default: return ""
        }
    }
    
    @ViewBuilder
    private var initialSetupView: some View {
        Color.primary
            .colorInvert()
            .overlay {
                ProgressView {
                    Text("Loading Publications…")
                }
            }
            .ignoresSafeArea()
            .transition(.opacity)
    }

    // MARK: - Data Refresh
    @MainActor
    private func refreshPublications() async {
        let importer = PublicationImporter(modelContainer: modelContext.container)
        do {
            try await importer.backgroundInsert()
        } catch {
            self.publicationError = error as? EncodedPublicationError
            self.showErrorAlert = true
        }
    }
}
macOS 26: retain cycle detected when navigation link label contains a Swift Chart
 
 
Q