Localize history selection to affected paths
This commit is contained in:
@@ -192,26 +192,25 @@ func sourceApplicationOrigin(application historyApplication, node *document.Node
|
||||
}
|
||||
|
||||
func sourceOriginRepresentedByOperation(model *historyModel, path Path, origin Origin) bool {
|
||||
represented := false
|
||||
model.reportedPathIndex.visitAncestors(path.String(), func(observationID int) {
|
||||
for _, observationID := range model.observationsByPointer[path.String()] {
|
||||
observation := model.observations[observationID]
|
||||
if observation.phase != historyPhaseSources || observation.role != historyRoleOperation {
|
||||
return
|
||||
continue
|
||||
}
|
||||
if !observation.afterPresent || !sameConcreteHistoryPath(path, observation.path) {
|
||||
return
|
||||
continue
|
||||
}
|
||||
operationOrigin, ok := model.resolveAttribution(observation.attributionRef)
|
||||
if !ok {
|
||||
return
|
||||
continue
|
||||
}
|
||||
if originRepresentedByChange(path, origin, Change{
|
||||
Path: observation.reportedPath, Origin: operationOrigin.origin,
|
||||
}) {
|
||||
represented = true
|
||||
return true
|
||||
}
|
||||
})
|
||||
return represented
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func originRepresentedByChange(path Path, origin Origin, change Change) bool {
|
||||
|
||||
Reference in New Issue
Block a user