Refactor CameraDevice implementation - #4
Merged
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
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
CameraDeviceprotocol toSemanticCamerawith updated property semantics (position is now optional, usesuniqueIDinstead ofid) - Refactored
AutomaticCamerato 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.
| 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. |
There was a problem hiding this comment.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.