summaryrefslogtreecommitdiff
path: root/Sora/Views
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-23 11:22:00 -0800
committerFuwn <[email protected]>2026-02-23 13:33:43 -0800
commit0e2785fd8e5947aa66528095d2bebac2bf3cb00a (patch)
tree182665fd58c8b29957575a477c8040d64a6c53f4 /Sora/Views
parentfeat: add explicit accessibility metadata for grid cells (diff)
downloadsora-testing-0e2785fd8e5947aa66528095d2bebac2bf3cb00a.tar.xz
sora-testing-0e2785fd8e5947aa66528095d2bebac2bf3cb00a.zip
feat: add accessibility metadata to interactive image view
Diffstat (limited to 'Sora/Views')
-rw-r--r--Sora/Views/InteractiveImageView.swift14
1 files changed, 14 insertions, 0 deletions
diff --git a/Sora/Views/InteractiveImageView.swift b/Sora/Views/InteractiveImageView.swift
index 2bafa5d..11b4c62 100644
--- a/Sora/Views/InteractiveImageView.swift
+++ b/Sora/Views/InteractiveImageView.swift
@@ -33,6 +33,10 @@ struct InteractiveImageView<MenuItems: View>: View {
.contextMenu { if !isZoomed { contextMenu } }
.frame(maxWidth: .infinity, maxHeight: .infinity)
.ifiOS26Unavailable { $0.clipped() }
+ .accessibilityElement(children: .ignore)
+ .accessibilityLabel(Text("Image"))
+ .accessibilityValue(Text(isZoomed ? "Zoomed in" : "Fit to screen"))
+ .accessibilityHint(Text("Double-tap to zoom. Pinch to adjust zoom level."))
#else
Group {
image
@@ -97,6 +101,16 @@ struct InteractiveImageView<MenuItems: View>: View {
}
}
)
+ .accessibilityElement(children: .ignore)
+ .accessibilityLabel(Text("Image"))
+ .accessibilityValue(
+ Text(
+ currentScale > 1
+ ? "Zoom \(Int((currentScale * 100).rounded())) percent"
+ : "Fit to screen"
+ )
+ )
+ .accessibilityHint(Text("Double-tap to zoom. Pinch to adjust zoom level."))
#endif
}