Skip to content

Remove redundant EditingCanvasMode.preview compatibility alias#306

Merged
muukii merged 1 commit into
v5from
claude/remove-editing-canvas-preview-mode
Jun 17, 2026
Merged

Remove redundant EditingCanvasMode.preview compatibility alias#306
muukii merged 1 commit into
v5from
claude/remove-editing-canvas-preview-mode

Conversation

@muukii

@muukii muukii commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

EditingCanvasMode.preview was a dead compatibility alias of .renderedEditPreview. This removes it and collapses its switch arms into .renderedEditPreview.

Why

An audit of all four EditingCanvasMode cases found that .preview:

  • Was documented in-source as a "Compatibility spelling for renderedEditPreview" and was introduced in the same commit as .renderedEditPreview (it is not an older, migrated-away-from name).
  • Is never constructed anywhere — production, demo, or tests. git grep for any producer (= .preview, return .preview, mode: .preview, EditingCanvasMode.preview) returns nothing.
  • Appears only as a passive switch co-arm, always paired with .renderedEditPreview and handled identically, in every switch over the enum:
    • EditingCanvasPublicTypes.swiftlocalEffect, activeLocalEffect, defaultInteractionMode
    • EditingCanvasRenderImageFactory.swiftmakeRenderImages, makeCropOutputRenderImages

So 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 public enum case, so it is technically source-breaking for any external caller that explicitly referenced EditingCanvasMode.preview. There are no such references inside this repository.

Verification

  • git grep confirms zero remaining .preview references in Sources/ and Dev/.
  • xcodebuild -scheme BrightroomUI -destination 'generic/platform=iOS Simulator'BUILD SUCCEEDED (Swift 6 mode).

Follow-up (not in this PR)

.renderedEditPreview itself is only selected by CropView.CanvasRenderPlan when 2+ local-adjustment layers are simultaneously active — a state the built-in PhotosCrop UI cannot currently produce. It (and CanvasRenderPlan, 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

`.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>
@muukii muukii merged commit 760ec2c into v5 Jun 17, 2026
2 checks passed
@muukii muukii deleted the claude/remove-editing-canvas-preview-mode branch June 17, 2026 14:05
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.

1 participant