Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/core-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: VisuStructCore tests
name: CI

on:
push:
Expand All @@ -17,3 +17,17 @@ jobs:
run: swift --version
- name: Build and test
run: swift test

app-build:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Xcode version
run: xcodebuild -version
- name: Build app for iOS Simulator
run: |
xcodebuild build \
-project VisuStruct-iOS/VisuStructXcodeOpen/VisuStruct.xcodeproj \
-scheme VisuStruct \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ struct DiagramCanvasView: View {
Color.clear
.frame(width: cw, height: ch)
.contentShape(Rectangle())
.accessibilityHidden(true)
.onTapGesture {
selectedPath = nil
// iPhone: Einfügemarke durch Tap auf leeren Bereich löschen.
Expand All @@ -291,13 +292,16 @@ struct DiagramCanvasView: View {

canvasView(layout: layout, cw: cw, ch: ch)
.allowsHitTesting(false)
// Gezeichnete Fläche; VoiceOver liest stattdessen die Blöcke darüber.
.accessibilityHidden(true)

if let firstRoot = layout.elements.first {
rootInsertBeforeFirstStrip(
firstRootFrame: firstRoot.frame,
canvasWidth: cw,
canvasHeight: ch
)
.accessibilityHidden(true)
}

ForEach(flat, id: \.pathKey) { node in
Expand Down Expand Up @@ -408,13 +412,30 @@ struct DiagramCanvasView: View {
.draggable(DiagramDragPayload(raw: ElementPalette.moveDragIdentifier(path: node.idPath))) {
nodeDragPreview(for: node)
}
// VoiceOver: ein Element pro Block (statt der unbeschrifteten Drop-Streifen darin).
.accessibilityElement(children: .ignore)
.accessibilityLabel(accessibilityLabel(for: node))
.accessibilityAddTraits(selectedPath == node.idPath ? [.isButton, .isSelected] : .isButton)
.accessibilityAction {
selectedPath = node.idPath
}
.accessibilityHint(
isPlaceholderNode
? lang.tr("a11y_placeholder_drop")
: lang.tr("a11y_node_drop")
)
}

/// Vorgelesener Name eines Blocks: Elementart und Text, z. B. „Anweisung: int x = 5“.
private func accessibilityLabel(for node: VisuStructLayout.Node) -> String {
// Schlüssel wie in der Palette: element_anweisung, element_verzweigung, …
let kind = lang.tr("element_\(node.element.type)")
let text = node.element.textLines
.joined(separator: " ")
.trimmingCharacters(in: .whitespacesAndNewlines)
return text.isEmpty ? kind : "\(kind): \(text)"
}

private func copyElement(at path: [Int]) {
guard let el = try? VisuStructDocumentEditing.element(at: path, in: document) else { return }
elementClipboard = el
Expand Down
Loading