List Cell - Modifying associated object causes reload of whole list

I've got a List containing Colour objects. Each colour may have an associated Project Colour object.

What I'm trying to do is set it up so that you can tap a cell and it will add/remove a project colour.

The adding/removing is working, but each time I do so, it appears the whole view is reloaded, the scroll position is reset and any predicate is removed.

This code I have so far

List {
            ForEach(colourList) { section in
                let header : String = section.id
                Section(header: Text(header)) {
                    ForEach(section) { colour in
                        HStack {
                            if checkIfProjectColour(colour: colour) {
                                Image(systemName: "checkmark")
                            }
                            VStack(alignment: .leading){
                                HStack {
                                    if let name = colour.name {
                                        Text(name)
                                    }
                                }
                            }
                            Spacer()
                        }
                        .contentShape(Rectangle())
                        .onTapGesture {
                            if checkIfProjectColour(colour: colour) {
                                removeProjectColour(colour: colour)
                            } else {
                                addProjectColour(colour: colour)
                            }
                        }
                    }
                }
            }
            .onAppear() {
                filters = appSetting.filters
                colourList.nsPredicate = getFilterPredicate()
                print("predicate: on appear - \(String(describing: getFilterPredicate()))")
            }
            .refreshable {
                viewContext.refreshAllObjects()
            }
        }
        .searchable(text: $searchText)
        .onSubmit(of: .search) {
            colourList.nsPredicate = getFilterPredicate()
        }
        .onChange(of: searchText) {
            colourList.nsPredicate = getFilterPredicate()
        }

The checkIfProjectColour function

    func checkIfProjectColour(colour : Colour) -> Bool {
        if let proCols = project.projectColours {
            for proCol in proCols {
                let proCol = proCol as! ProjectColour
                if let col = proCol.colour {
                    if col == colour {
                        return true
                    }
                }
            }
        }
        return false
    }

and the add/remove functions

    func addProjectColour(colour : Colour) {
        let projectColour = ProjectColour(context: viewContext)
        projectColour.project = project
        projectColour.colour = colour
        
        colour.addToProjectColours(projectColour)
        project.addToProjectColours(projectColour)
        
        do {
            try viewContext.save()
        } catch {
            let nsError = error as NSError
            fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
        }
    }

    func removeProjectColour(colour: Colour) {
        if let proCols = project.projectColours {
            for proCol in proCols {
                let proCol = proCol as! ProjectColour
                if let col = proCol.colour {
                    if col == colour {
                        viewContext.delete(proCol)
                        
                        do {
                            try viewContext.save()
                        } catch {
                            let nsError = error as NSError
                            fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
                        }
                    }
                }
            }
        }
    }

@Desbrina You can start by adding
let _ = Self._logChanges() to debug the cause of the View redraw.

On loading the view I get

ProjectEditColourListView: @self, @identity, _viewContext, _editMode, _colourList, @64, @88, _searchText, _isShowingFilterView, _appSetting, _filters changed.
ProjectEditColourListView: @self changed.
ProjectEditColourListView: @88 changed.

Then after selecting a cell

ProjectEditColourListView: @88 changed.
ProjectEditColourListView: @self changed.
ProjectEditColourListView: @88 changed.
ProjectEditColourListView: @self changed.
ProjectEditColourListView: @self changed.
List Cell - Modifying associated object causes reload of whole list
 
 
Q