Skip to content

Refactor CameraDevice implementation - #4

Merged
LiYanan2004 merged 2 commits into
mainfrom
semantic-camera
Dec 31, 2025
Merged

LiYanan2004 merged 2 commits into
mainfrom
semantic-camera

Conversation

@LiYanan2004

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 31, 2025 16:24
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the camera device architecture by renaming CameraDevice to SemanticCamera and restructuring the implementation to better support automatic camera selection and external camera types.

Key changes:

  • Renamed CameraDevice protocol to SemanticCamera with updated property semantics (position is now optional, uses uniqueID instead of id)
  • Refactored AutomaticCamera to support system-preferred and user-preferred camera selection with KVO observation
  • Split external camera types into separate implementations (ExternalCamera, ContinuityCamera, DeskViewCamera)

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Sources/Aperture/Capture/Devices/SemanticCamera.swift New protocol definition replacing CameraDevice with optional position and Hashable conformance
Sources/Aperture/Capture/Devices/Essentials/CameraDevice.swift Removed old CameraDevice protocol definition
Sources/Aperture/Capture/Devices/AutomaticCamera.swift Refactored to support preference-based camera selection with observer pattern
Sources/Aperture/Capture/Devices/Built-In Cameras/BuiltInCamera.swift New implementation consolidating built-in camera logic
Sources/Aperture/Capture/Devices/External Cameras/*.swift Split external cameras into separate device types
Sources/Aperture/Capture/Camera.swift Updated to use SemanticCamera and added automatic camera observer
Sources/Aperture/UI/*.swift Updated device references from .automatic to .builtInCamera
Sources/Aperture/Documentation.docc/*.md Updated documentation structure to reflect new types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/Aperture/Capture/Devices/SemanticCamera.swift Outdated
extension SemanticCamera where Self == AutomaticCamera {
/// An automatic camera that resolves to the system-preferred device when available.
///
/// This might result in single camera instead of fusion camera, if you're working on iOS app, use ``builtInCamera`` instead.

Copilot AI Dec 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing article 'a' before 'single camera' and 'a' before 'fusion camera'.

Suggested change
/// This might result in single camera instead of fusion camera, if you're working on iOS app, use ``builtInCamera`` instead.
/// This might result in a single camera instead of a fusion camera; if you're working on an iOS app, use ``builtInCamera`` instead.

Copilot uses AI. Check for mistakes.
Comment thread Sources/Aperture/Capture/Camera.swift
Comment thread Sources/Aperture/Capture/Camera.swift
Comment thread Sources/Aperture/UI/CameraFlipButton.swift
Comment thread README.md
@LiYanan2004
LiYanan2004 merged commit f4c0db5 into main Dec 31, 2025
2 checks passed
@LiYanan2004
LiYanan2004 deleted the semantic-camera branch December 31, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants