-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
PaneGridView.swift wraps all nodes in AnyView to break the recursive opaque return type:
private func rootView(_ node: PaneSplitNode) -> AnyView { ... }
private func nodeView(_ node: PaneSplitNode) -> AnyView { ... }AnyView defeats SwiftUI's structural diffing — it cannot efficiently compare old and new view trees, leading to full view hierarchy destruction/recreation on any change. For a grid of terminals, this means split ratio changes or focus changes can cause terminal views to be needlessly torn down and rebuilt.
Impact
- Terminal views may be destroyed and recreated unnecessarily when focus changes or splits are adjusted
- Animation transitions may not work correctly
- SwiftUI's identity tracking is broken for the entire grid subtree
Suggested approach
Options to explore:
- Use
@ViewBuilderwith explicit conditional logic and stable view identities - Use
Groupwith stable.id()values at the leaf level - Only type-erase at the leaf
PaneCellViewlevel, not the entire tree - Consider a custom layout container that doesn't require type erasure
This is a complex change since the recursive tree structure genuinely needs type erasure somewhere — the goal is minimizing its scope.
Files
apps/purepoint-macos/purepoint-macos/Views/PaneGrid/PaneGridView.swift
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request