Remove redundant EditingCanvasMode.preview compatibility alias#306
Merged
Conversation
`.preview` was documented as a "compatibility spelling" of `.renderedEditPreview`. It was introduced in the same commit, never constructed anywhere (production, demo, or tests), and every `switch` grouped it with `.renderedEditPreview` and rendered it identically, so the case carried no distinct behavior. Remove the case and collapse its switch arms into `.renderedEditPreview`. No runtime behavior changes; no first-party caller ever produced `.preview`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
EditingCanvasMode.previewwas a dead compatibility alias of.renderedEditPreview. This removes it and collapses itsswitcharms into.renderedEditPreview.Why
An audit of all four
EditingCanvasModecases found that.preview:renderedEditPreview" and was introduced in the same commit as.renderedEditPreview(it is not an older, migrated-away-from name).git grepfor any producer (= .preview,return .preview,mode: .preview,EditingCanvasMode.preview) returns nothing.switchco-arm, always paired with.renderedEditPreviewand handled identically, in everyswitchover the enum:EditingCanvasPublicTypes.swift—localEffect,activeLocalEffect,defaultInteractionModeEditingCanvasRenderImageFactory.swift—makeRenderImages,makeCropOutputRenderImagesSo the case carried no distinct behavior and could never be reached.
Behavioral impact
None. No first-party code path ever produced
.preview, and it was rendered byte-for-byte identically to.renderedEditPreview. The other three cases (.viewportBase,.localAdjustment,.renderedEditPreview) are unchanged and remain in use.API note
This removes a
publicenum case, so it is technically source-breaking for any external caller that explicitly referencedEditingCanvasMode.preview. There are no such references inside this repository.Verification
git grepconfirms zero remaining.previewreferences inSources/andDev/.xcodebuild -scheme BrightroomUI -destination 'generic/platform=iOS Simulator'→ BUILD SUCCEEDED (Swift 6 mode).Follow-up (not in this PR)
.renderedEditPreviewitself is only selected byCropView.CanvasRenderPlanwhen 2+ local-adjustment layers are simultaneously active — a state the built-in PhotosCrop UI cannot currently produce. It (andCanvasRenderPlan, already marked// TODO: Consider to remove this) is a candidate for removal/replacement once the live canvas composites multiple local-adjustment layers; left out of this PR to keep the change a pure, behavior-preserving cleanup.🤖 Generated with Claude Code