Skip to content

feat(effects): implement visual and custom hover effects - #1136

Merged
Kyle-Ye merged 7 commits into
feature/opacityfrom
feature/visual_effect
Oct 11, 2026
Merged

Kyle-Ye merged 7 commits into
feature/opacityfrom
feature/visual_effect

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Implement geometry-driven visual effects with composition and animation data forwarding.
  • Add custom hover effects with content evaluation, phase and group state, and accessibility handling.
  • Connect opacity to the Core effect types and add clipping, offset, and repeating offset APIs.
  • Add documentation for the public visual and hover effect APIs.

Stack

Depends on #1135.

@Kyle-Ye
Kyle-Ye added this pull request to stack #1137 October 11, 2026 15:06
@github-actions github-actions Bot added area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. type: feature New API, behavior, platform support, or user-facing capability. labels Oct 11, 2026

@augmentcode augmentcode Bot 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.

Deep Code Review Agent🐛

Review completed with 3 suggestions.

Reviewed commit: 3bede44

size: inputs.size,
transform: inputs.transform,
environment: inputs.environment,
safeAreaInsets: .init(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

This constructs the GeometryProxy with an empty safe-area attribute instead of the view's inputs.safeAreaInsets, so proxy.safeAreaInsets inside visualEffect always falls back to zero. That breaks effects that depend on the container's safe-area data even though GeometryReader and renderer effects forward the same input.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

switch self {
case let .opacity(opacity):
return .opacity(opacity)
case let .clip(path, _, _):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

Converting .clip to HoverEffectContentList.Effect.clip(path) drops the FillStyle that HoverEffectContent.clipShape(_:style:) just accepted. Non-default styles such as even-odd fill or antialiasing therefore render as the default style in hover effects.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

///
/// struct FadeInHoverEffect: CustomHoverEffect {
/// func body(content: Content) -> some CustomHoverEffect {
/// content.hoverEffect { effect, isActive, proxy in

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

These examples reference content.hoverEffect and the View.hoverEffect modifier, but no hoverEffect overload is defined anywhere in the repository. The documented custom effect cannot compile, and the new _makeCustomHoverEffect evaluation path has no public entry point.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

@augmentcode

augmentcode Bot commented Oct 11, 2026

Copy link
Copy Markdown

PR Risk Analyzer Agent 🛡️

👀 Human review needed

Justification

This PR adds ~1,529 lines across 10 files, implementing new core rendering and effects infrastructure rather than a mechanical or documentation-only change:

  • New public API protocols and supporting types — VisualEffect, CustomHoverEffect, HoverEffectContent, plus their input/output/composition types — with attribute-graph-driven _make... entry points.
  • Substantial rendering logic: geometry/transform resolution, display-list effect mapping, animation-data forwarding (appearanceAnimation / repeatForever), and hover-effect group, phase, accessibility, and disabled-state handling (much of it #if os(visionOS)-gated).
  • Activates previously unimplemented stubs: repeatingOffset (was _openSwiftUIUnimplementedFailure()), clipShape for HoverEffectContent / VisualEffect (was TODO), and moves the VisualEffect / HoverEffectContent protocol definitions out of OpenSwiftUI into OpenSwiftUICore.

The size, new public surface area, and behavioral rendering/animation/accessibility logic place this beyond the automatic low-risk threshold, so a human reviewer should verify correctness.

Reviewed commit 3bede44

@augmentcode

augmentcode Bot commented Oct 11, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Replaces placeholder effects with core graph-based visual and custom hover-effect support.
Changes:

  • Adds geometry-driven View.visualEffect(_:) and EmptyVisualEffect.
  • Composes renderer and geometry effects while forwarding animatable data.
  • Moves visual and hover protocols from opacity placeholders into OpenSwiftUICore.
  • Adds custom hover-effect body evaluation with dynamic-property support.
  • Builds hover content lists for opacity, transforms, clipping, and scoped animations.
  • Tracks hover phases, groups, disabled state, accessibility IDs, delays, and touch filters.
  • Adds effect offset/clipping APIs and appearance-driven repeating offsets.
Technical notes: Expands public API documentation; depends on #1135, with visionOS-specific hover state.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot 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.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@tuist

tuist Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 2dcceba51

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 37.3s 2dcceba51

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 341 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.41%. Comparing base (6ec941c) to head (f2bbfee).

Files with missing lines Patch % Lines
...re/Render/HoverEffect/HoverEffectContentCore.swift 0.00% 135 Missing ⚠️
...tUICore/Render/HoverEffect/CustomHoverEffect.swift 0.00% 87 Missing ⚠️
...SwiftUICore/Render/VisualEffect/VisualEffect.swift 0.00% 35 Missing ⚠️
...UICore/Render/HoverEffect/HoverEffectContext.swift 0.00% 24 Missing ⚠️
...iftUICore/Render/HoverEffect/HoverEffectInfo.swift 0.00% 21 Missing ⚠️
...der/VisualEffect/VisualEffectImplementations.swift 0.00% 21 Missing ⚠️
...enSwiftUI/Render/GeometryEffect/OffsetEffect.swift 0.00% 12 Missing ⚠️
...SwiftUICore/Render/RendererEffect/ClipEffect.swift 0.00% 4 Missing ⚠️
...iftUICore/Render/GeometryEffect/OffsetEffect.swift 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           feature/opacity    #1136      +/-   ##
===================================================
- Coverage            26.59%   26.41%   -0.18%     
===================================================
  Files                  823      830       +7     
  Lines                61807    62143     +336     
===================================================
- Hits                 16435    16416      -19     
- Misses               45372    45727     +355     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Kyle-Ye merged commit 5def810 into main Oct 11, 2026
5 of 6 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/visual_effect branch October 11, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant