new tests

This commit is contained in:
Mark Gregory
2026-10-19 09:47:26 +01:00
parent f63d40ff48
commit ff3658352a
8 changed files with 447 additions and 1056 deletions
+2 -6
View File
@@ -355,7 +355,7 @@ struct DBSynSchemaDiagramView: View {
// previous implementation only saved the checkboxes, leaving the diagram
// scrolled to stale positions after None / All / individual selections.
private func updateIncludedObjects(_ updated: Set<String>) {
let valid = updated.intersection(Set(allObjects))
let valid = DiagramLogic.selectedObjects(updated, available: allObjects)
guard valid != includedObjects else { return }
includedObjects = valid
if let selectedObject, !valid.contains(selectedObject) {
@@ -371,11 +371,7 @@ struct DBSynSchemaDiagramView: View {
private func arrange() {
let names = allObjects.filter { includedObjects.contains($0) }
let countPerRow = max(1, Int(ceil(sqrt(Double(max(1, names.count))))))
for (index, name) in names.enumerated() {
positions[name] = CGPoint(x: CGFloat(index % countPerRow) * 290 + 30,
y: CGFloat(index / countPerRow) * 300 + 30)
}
positions.merge(DiagramLogic.arrangedPositions(names)) { _, latest in latest }
}
private func loadCatalog() {
let stored = UserDefaults.standard.stringArray(forKey: catalogKey) ?? ["Main"]