Feat: Add composable Scene modifiers and Scene environment propagation#70
Merged
Conversation
- Give Scene the SwiftUI protocol shape (associated Body, SceneBuilder
body) with Never as the primitive terminator
- Add the EnvironmentModifiedScene layer with Scene.environment(_:_:),
.palette(_:), and .appearance(_:) modifiers; SceneResolution unwinds
modifier chains outside-in into the frame environment (inner values
win) and returns the renderable core
- Resolve scenes in RenderLoop before the view-level root palette
override so scene values reach all views and out-of-tree surfaces;
identity paths stay byte-identical for unwrapped scenes
- Add ScenePhase with an environment key (active by default); phase
actions arrive with the application-actions work
- Fixes the documented WindowGroup { … }.palette(…) shape from issue #2
- Add the scene-level palette section to the theming guide - Extend the scene fixture with the issue-2 palette shape, composed modifiers, and an App body using scene modifiers
- Add overrides for the Scene protocol body contract, the scene environment modifiers, WindowGroup's primitive body, ScenePhase, and the scenePhase environment key - Regenerate the manifest with TUIkitAPICheck against fresh 6.0.3 macOS and Linux snapshots
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.
Closes #19. Fixes #2.
Summary
Scenegets SwiftUI's protocol shape (associatedtype Body: Scene,@SceneBuilder var body) withNeveras the primitive terminator;WindowGroupdeclares a primitive body andSceneBuildergainsbuildExpressionScene.environment(_:_:),.palette(_:),.appearance(_:)wrap scenes in an internalEnvironmentModifiedScene;SceneResolutionunwinds chains outside-in into the frame environment (inner values win) and hands the renderable core to the render loop — this layer is the documented extension point for the Enhancement: Implementation of an Application Menu System #5 command infrastructureRenderLoopapplies scene values before the view-level root palette override, so scene environment reaches all child views and out-of-tree surfaces (status bar, app header); identity paths stay byte-identical for unwrapped scenes via existential openingScenePhase(background < inactive < active) with ascenePhaseenvironment key defaulting to.active; phase-driven actions arrive with [P2-28] Add terminal accessibility, search, refresh, and application actions #33, multiwindow semantics deliberately not copiedWindowGroup { … }.palette(…)now compiles and changes rendered colors; covered by tests and the scene compile fixture (including anAppbody using scene modifiers)Test plan
./scripts/test-linux.shverify-compatibility-manifest.shpasses against the regenerated manifest