Remove unused camera components and refresh translations

This commit is contained in:
Matt Bruce 2026-01-05 09:38:02 -06:00
parent 1907ce773d
commit fa8ef4ca1a
6 changed files with 2256 additions and 2675 deletions

View File

@ -1,71 +0,0 @@
//
// ColorPickerOverlay.swift
// SelfieCam
//
// Created by Matt Bruce on 1/4/26.
//
import SwiftUI
import Bedrock
// MARK: - Color Picker Overlay
struct ColorPickerOverlay: View {
@Binding var selectedColor: Color
@Binding var isPresented: Bool
private let colors: [Color] = [
.white, .red, .orange, .yellow, .green, .blue, .purple, .pink,
.gray, .black, Color(red: 1.0, green: 0.5, blue: 0.0), // Coral
Color(red: 0.5, green: 1.0, blue: 0.5), // Mint
Color(red: 0.5, green: 0.5, blue: 1.0), // Periwinkle
Color(red: 1.0, green: 0.5, blue: 1.0), // Magenta
]
var body: some View {
ZStack {
// Semi-transparent background
Color.black.opacity(Design.Opacity.medium)
.ignoresSafeArea()
// Color picker content
VStack(spacing: Design.Spacing.medium) {
// Header
Text("Ring Light Color")
.font(.system(size: 18, weight: .semibold))
.foregroundStyle(Color.white)
// Color grid
LazyVGrid(columns: Array(repeating: GridItem(.flexible()), count: 4), spacing: Design.Spacing.small) {
ForEach(colors, id: \.self) { color in
Circle()
.fill(color)
.frame(width: 50, height: 50)
.overlay(
Circle()
.stroke(Color.white.opacity(selectedColor == color ? 1.0 : 0.3), lineWidth: selectedColor == color ? 3 : 1)
)
.onTapGesture {
selectedColor = color
isPresented = false
}
}
}
// Done button
Button("Done") {
isPresented = false
}
.font(.system(size: 16, weight: .medium))
.foregroundStyle(Color.white)
.padding(.vertical, Design.Spacing.small)
}
.padding(Design.Spacing.large)
.background(
RoundedRectangle(cornerRadius: Design.CornerRadius.large)
.fill(Color.black.opacity(Design.Opacity.strong))
)
.padding(.horizontal, Design.Spacing.large)
}
}
}

View File

@ -1,254 +0,0 @@
//
// ExpandableControlsPanel.swift
// CameraTester
//
// Created by Matt Bruce on 1/2/26.
//
import SwiftUI
import Bedrock
import MijickCamera
// MARK: - Expandable Controls Panel
struct ExpandableControlsPanel: View {
@Binding var isExpanded: Bool
// Collapsed state info
let hasActiveSettings: Bool
let activeSettingsIcons: [String]
// Control properties
let flashMode: CameraFlashMode
let flashIcon: String
let onFlashTap: () -> Void
let isFlashSyncedWithRingLight: Bool
let onFlashSyncTap: () -> Void
let hdrMode: CameraHDRMode
let hdrIcon: String
let onHDRTap: () -> Void
let isGridVisible: Bool
let gridIcon: String
let onGridTap: () -> Void
let photoQuality: PhotoQuality
let onQualityTap: () -> Void
let isCenterStageAvailable: Bool
let isCenterStageEnabled: Bool
let onCenterStageTap: () -> Void
let isFrontCamera: Bool
let onFlipCameraTap: () -> Void
let isRingLightEnabled: Bool
let onRingLightTap: () -> Void
let ringLightColor: Color
let onRingLightColorTap: () -> Void
let ringLightSize: CGFloat
let onRingLightSizeTap: () -> Void
let ringLightOpacity: Double
let onRingLightOpacityTap: () -> Void
// Layout constants
private let collapsedHeight: CGFloat = 36
private let iconSize: CGFloat = 16
private let maxVisibleIcons: Int = 3
// Grid layout
private let columns = [
GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible())
]
var body: some View {
VStack(spacing: 0) {
// Header row (always visible) - acts as the collapsed pill
Button(action: { isExpanded.toggle() }) {
HStack(spacing: Design.Spacing.small) {
// Chevron that rotates
Image(systemName: "chevron.down")
.font(.system(size: iconSize, weight: .semibold))
.foregroundStyle(Color.white)
.rotationEffect(.degrees(isExpanded ? 180 : 0))
// Show active setting icons when collapsed
if !isExpanded && hasActiveSettings {
HStack(spacing: Design.Spacing.xSmall) {
ForEach(activeSettingsIcons.prefix(maxVisibleIcons), id: \.self) { icon in
Image(systemName: icon)
.font(.system(size: iconSize, weight: .medium))
.foregroundStyle(Color.yellow)
}
}
}
if isExpanded {
Spacer()
}
}
.frame(height: collapsedHeight)
.frame(maxWidth: isExpanded ? .infinity : nil)
.padding(.horizontal, Design.Spacing.medium)
}
.accessibilityLabel("Camera controls")
.accessibilityHint(isExpanded ? "Tap to collapse settings" : "Tap to expand camera settings")
// Expandable content
if isExpanded {
ScrollView {
VStack(spacing: Design.Spacing.large) {
// Camera Controls Section
VStack(spacing: Design.Spacing.medium) {
// Section header
Text("Camera Controls")
.font(.system(size: 14, weight: .semibold))
.foregroundStyle(Color.white.opacity(0.8))
.frame(maxWidth: .infinity, alignment: .leading)
// Controls grid
LazyVGrid(columns: columns, spacing: Design.Spacing.medium) {
// Flash
ExpandedControlItem(
icon: flashIcon,
label: flashLabel,
isActive: flashMode != .off,
action: onFlashTap
)
// Flash Sync
ExpandedControlItem(
icon: isFlashSyncedWithRingLight ? "link" : "link.slash",
label: "SYNC",
isActive: isFlashSyncedWithRingLight,
action: onFlashSyncTap
)
// HDR
ExpandedControlItem(
icon: hdrIcon,
label: hdrLabel,
isActive: hdrMode != .off,
action: onHDRTap
)
// Grid
ExpandedControlItem(
icon: gridIcon,
label: "GRID",
isActive: isGridVisible,
action: onGridTap
)
// Quality
ExpandedControlItem(
icon: photoQuality.icon,
label: photoQuality.rawValue.uppercased(),
isActive: false,
action: onQualityTap
)
// Center Stage (if available)
if isCenterStageAvailable {
ExpandedControlItem(
icon: isCenterStageEnabled ? "person.crop.rectangle.fill" : "person.crop.rectangle",
label: "STAGE",
isActive: isCenterStageEnabled,
action: onCenterStageTap
)
}
// Flip Camera
ExpandedControlItem(
icon: "arrow.triangle.2.circlepath.camera",
label: isFrontCamera ? "FRONT" : "BACK",
isActive: false,
action: onFlipCameraTap
)
}
}
// Ring Light Section
VStack(spacing: Design.Spacing.medium) {
// Section header
Text("Ring Light")
.font(.system(size: 14, weight: .semibold))
.foregroundStyle(Color.white.opacity(0.8))
.frame(maxWidth: .infinity, alignment: .leading)
// Ring light controls grid
LazyVGrid(columns: columns, spacing: Design.Spacing.medium) {
// Ring Light Enable/Disable
ExpandedControlItem(
icon: isRingLightEnabled ? "circle.fill" : "circle",
label: "ENABLE",
isActive: isRingLightEnabled,
action: onRingLightTap
)
// Ring Color
ExpandedControlItem(
icon: "circle.fill",
label: "COLOR",
isActive: false,
action: onRingLightColorTap
)
.foregroundStyle(ringLightColor)
// Ring Size
ExpandedControlItem(
icon: "circle",
label: "SIZE",
isActive: false,
action: onRingLightSizeTap
)
// Ring Brightness
ExpandedControlItem(
icon: "circle.fill",
label: "BRIGHT",
isActive: false,
action: onRingLightOpacityTap
)
.foregroundStyle(Color.white.opacity(ringLightOpacity))
}
}
}
.padding(.top, Design.Spacing.small)
.padding(.bottom, Design.Spacing.medium)
.padding(.horizontal, Design.Spacing.small)
}
.frame(maxHeight: 400) // Limit max height to prevent excessive scrolling
.scrollIndicators(.hidden) // Hide scroll indicators for cleaner look
}
}
.padding(.horizontal, Design.Spacing.small)
.background(
RoundedRectangle(cornerRadius: isExpanded ? Design.CornerRadius.large : collapsedHeight / 2)
.fill(Color.black.opacity(isExpanded ? Design.Opacity.strong : Design.Opacity.medium))
)
.animation(.easeInOut(duration: 0.25), value: isExpanded)
}
private var flashLabel: String {
switch flashMode {
case .off: return "FLASH"
case .auto: return "AUTO"
case .on: return "ON"
}
}
private var hdrLabel: String {
switch hdrMode {
case .off: return "HDR"
case .auto: return "AUTO"
case .on: return "ON"
}
}
}

View File

@ -1,45 +0,0 @@
//
// ExpandedControlItem.swift
// CameraTester
//
// Created by Matt Bruce on 1/2/26.
//
import SwiftUI
import Bedrock
// MARK: - Expanded Control Item
struct ExpandedControlItem: View {
let icon: String
let label: String
let isActive: Bool
let action: () -> Void
// Layout constants
private let iconSize: CGFloat = 28
private let buttonSize: CGFloat = 56
private let labelFontSize: CGFloat = 10
var body: some View {
Button(action: action) {
VStack(spacing: Design.Spacing.xSmall) {
ZStack {
Circle()
.fill(isActive ? Color.yellow : Color.black.opacity(Design.Opacity.light))
.frame(width: buttonSize, height: buttonSize)
Image(systemName: icon)
.font(.system(size: iconSize, weight: .medium))
.foregroundStyle(isActive ? Color.black : Color.white)
}
Text(label)
.font(.system(size: labelFontSize, weight: .medium))
.foregroundStyle(isActive ? Color.yellow : Color.white)
}
}
.accessibilityLabel("\(label)")
.accessibilityValue(isActive ? "On" : "Off")
}
}

View File

@ -1,72 +0,0 @@
//
// OpacitySliderOverlay.swift
// SelfieCam
//
// Created by Matt Bruce on 1/4/26.
//
import SwiftUI
import Bedrock
// MARK: - Opacity Slider Overlay
struct OpacitySliderOverlay: View {
@Binding var selectedOpacity: Double
@Binding var isPresented: Bool
private let minOpacity: Double = 0.1
private let maxOpacity: Double = 1.0
var body: some View {
ZStack {
// Semi-transparent background
Color.black.opacity(Design.Opacity.medium)
.ignoresSafeArea()
// Opacity slider content
VStack(spacing: Design.Spacing.medium) {
// Header
Text("Ring Light Brightness")
.font(.system(size: 18, weight: .semibold))
.foregroundStyle(Color.white)
// Current opacity display as percentage
Text("\(Int(selectedOpacity * 100))%")
.font(.system(size: 24, weight: .bold))
.foregroundStyle(Color.white)
.frame(width: 80)
// Slider
Slider(value: $selectedOpacity, in: minOpacity...maxOpacity, step: 0.05)
.tint(Color.white)
.padding(.horizontal, Design.Spacing.medium)
// Opacity range labels
HStack {
Text("10%")
.font(.system(size: 14))
.foregroundStyle(Color.white.opacity(0.7))
Spacer()
Text("100%")
.font(.system(size: 14))
.foregroundStyle(Color.white.opacity(0.7))
}
.padding(.horizontal, Design.Spacing.medium)
// Done button
Button("Done") {
isPresented = false
}
.font(.system(size: 16, weight: .medium))
.foregroundStyle(Color.white)
.padding(.vertical, Design.Spacing.small)
}
.padding(Design.Spacing.large)
.background(
RoundedRectangle(cornerRadius: Design.CornerRadius.large)
.fill(Color.black.opacity(Design.Opacity.strong))
)
.padding(.horizontal, Design.Spacing.large)
}
}
}

View File

@ -1,72 +0,0 @@
//
// SizeSliderOverlay.swift
// SelfieCam
//
// Created by Matt Bruce on 1/4/26.
//
import SwiftUI
import Bedrock
// MARK: - Size Slider Overlay
struct SizeSliderOverlay: View {
@Binding var selectedSize: CGFloat
@Binding var isPresented: Bool
private let minSize: CGFloat = SettingsViewModel.minRingSize
private let maxSize: CGFloat = SettingsViewModel.maxRingSize
var body: some View {
ZStack {
// Semi-transparent background
Color.black.opacity(Design.Opacity.medium)
.ignoresSafeArea()
// Size slider content
VStack(spacing: Design.Spacing.medium) {
// Header
Text("Ring Light Size")
.font(.system(size: 18, weight: .semibold))
.foregroundStyle(Color.white)
// Current size display
Text("\(Int(selectedSize))")
.font(.system(size: 24, weight: .bold))
.foregroundStyle(Color.white)
.frame(width: 60)
// Slider
Slider(value: $selectedSize, in: minSize...maxSize, step: 5)
.tint(Color.white)
.padding(.horizontal, Design.Spacing.medium)
// Size range labels
HStack {
Text("\(Int(minSize))")
.font(.system(size: 14))
.foregroundStyle(Color.white.opacity(0.7))
Spacer()
Text("\(Int(maxSize))")
.font(.system(size: 14))
.foregroundStyle(Color.white.opacity(0.7))
}
.padding(.horizontal, Design.Spacing.medium)
// Done button
Button("Done") {
isPresented = false
}
.font(.system(size: 16, weight: .medium))
.foregroundStyle(Color.white)
.padding(.vertical, Design.Spacing.small)
}
.padding(Design.Spacing.large)
.background(
RoundedRectangle(cornerRadius: Design.CornerRadius.large)
.fill(Color.black.opacity(Design.Opacity.strong))
)
.padding(.horizontal, Design.Spacing.large)
}
}
}

View File

@ -123,7 +123,6 @@
},
"%lldpt": {
"comment": "A label displaying the current ring size, formatted as a number followed by the unit \"pt\".",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -508,7 +507,6 @@
},
"Boomerang": {
"comment": "Display name for the \"Boomerang\" capture mode.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -625,7 +623,6 @@
},
"Captured photo": {
"comment": "A label describing a captured photo.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -650,7 +647,6 @@
},
"Captured video": {
"comment": "A label describing a captured video.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -769,15 +765,54 @@
},
"Choose the color of the ring light around the camera preview": {
"comment": "A description under the title of the light color preset section, explaining its purpose.",
"isCommentAutoGenerated" : true
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Elige el color del aro de luz alrededor de la vista previa de la cámara"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Choisissez la couleur de l'anneau lumineux autour de l'aperçu de la caméra"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Choisissez la couleur de l'anneau lumineux autour de l'aperçu de la caméra"
}
}
}
},
"Close": {
"comment": "A button label that closes the view.",
"isCommentAutoGenerated" : true
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Cerrar"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Fermer"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Fermer"
}
}
}
},
"Close preview": {
"comment": "A button label that closes the preview screen.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -1018,7 +1053,6 @@
},
"Enable Center Stage": {
"comment": "An accessibility label for the toggle that enables the \"Center Stage\" feature.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -1259,7 +1293,6 @@
},
"Front Flash": {
"comment": "Title of a toggle in the Settings view that controls whether the front flash is enabled.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -1404,7 +1437,6 @@
},
"Hide preview during capture for flash effect": {
"comment": "Text displayed in a toggle within the \"Camera Controls\" section, allowing the user to enable or disable the feature of hiding the camera preview during a photo capture to simulate a flash effect.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -1524,7 +1556,6 @@
}
},
"Last synced %@": {
"extractionState" : "stale",
"localizations": {
"es-MX": {
"stringUnit": {
@ -1691,7 +1722,6 @@
}
},
"Photo": {
"extractionState" : "stale",
"localizations": {
"es-MX": {
"stringUnit": {
@ -1931,7 +1961,6 @@
},
"Retake": {
"comment": "Title for a button that allows the user to retake a captured photo or video.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -1956,7 +1985,27 @@
},
"Retake photo": {
"comment": "A button that, when tapped, allows the user to retake a photo.",
"isCommentAutoGenerated" : true
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Tomar otra foto"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Reprendre la photo"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Reprendre la photo"
}
}
}
},
"Ring Light": {
"localizations": {
@ -2126,7 +2175,6 @@
},
"Save": {
"comment": "Title for a button that saves the currently captured photo or video to the user's photo library.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -2151,11 +2199,30 @@
},
"Save photo": {
"comment": "A button that saves the currently displayed photo to the user's library.",
"isCommentAutoGenerated" : true
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Guardar foto"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Enregistrer la photo"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Enregistrer la photo"
}
}
}
},
"Saved to Photos": {
"comment": "Text shown as a toast message when a photo is successfully saved to Photos.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -2180,7 +2247,27 @@
},
"Saves the photo to your library": {
"comment": "An accessibility hint for the save button in the photo review view.",
"isCommentAutoGenerated" : true
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Guarda la foto en tu biblioteca"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Enregistre la photo dans votre photothèque"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Enregistre la photo dans votre photothèque"
}
}
}
},
"Saving...": {
"comment": "A text that appears while a photo is being saved.",
@ -2376,7 +2463,6 @@
},
"Share": {
"comment": "Title for a button that shares the captured media.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -2401,7 +2487,27 @@
},
"Share photo": {
"comment": "An accessibility label for the share button.",
"isCommentAutoGenerated" : true
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Compartir foto"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Partager la photo"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Partager la photo"
}
}
}
},
"Show colored light ring around camera preview": {
"comment": "Subtitle for the \"Enable Ring Light\" toggle in the Settings view.",
@ -2501,7 +2607,6 @@
},
"Sign in to iCloud to enable sync": {
"comment": "Subtitle of the iCloud sync section when the user is not signed into iCloud.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -2602,7 +2707,7 @@
"localizations": {
"en": {
"stringUnit": {
"state" : "new",
"state": "translated",
"value": "Subscribe to %1$@ for %2$@"
}
},
@ -2628,7 +2733,6 @@
},
"Sync Now": {
"comment": "A button label that triggers a sync action.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -2653,7 +2757,6 @@
},
"Sync Settings": {
"comment": "Title of a toggle that allows the user to enable or disable iCloud sync settings.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -2678,7 +2781,6 @@
},
"Sync settings across all your devices": {
"comment": "Subtitle of the \"Sync Settings\" toggle in the Settings view, describing the functionality when sync is enabled.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -2703,7 +2805,6 @@
},
"Synced": {
"comment": "Text displayed in the iCloud sync section when the user's settings have been successfully synced.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -2727,7 +2828,6 @@
}
},
"Syncing...": {
"extractionState" : "stale",
"localizations": {
"es-MX": {
"stringUnit": {
@ -2775,7 +2875,6 @@
},
"Syncs settings across all your devices via iCloud": {
"comment": "An accessibility hint describing the functionality of the sync toggle in the settings view.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -3036,7 +3135,6 @@
},
"Use the buttons at the bottom to save or share your photo": {
"comment": "An accessibility hint for the photo review view, instructing the user on how to interact with the view.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -3061,7 +3159,6 @@
},
"Uses screen flash when taking front camera photos": {
"comment": "A toggle that enables or disables the use of the front camera's flash during photo captures.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -3086,7 +3183,6 @@
},
"Video": {
"comment": "Display name for the \"Video\" capture mode.",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {
@ -3111,7 +3207,6 @@
},
"View on GitHub": {
"comment": "A button label that says \"View on GitHub\".",
"extractionState" : "stale",
"isCommentAutoGenerated": true,
"localizations": {
"es-MX": {