Improve sky block deletion to preserve other enabled sky blocks#378
Open
tracygardner wants to merge 1 commit intomainfrom
Open
Improve sky block deletion to preserve other enabled sky blocks#378tracygardner wants to merge 1 commit intomainfrom
tracygardner wants to merge 1 commit intomainfrom
Conversation
When multiple set_sky_color blocks exist, deleting or disabling one unconditionally cleared the sky regardless of whether it was the active block. Now only the active block (tracked by meshBlockIdMap) triggers a sky change. If the active sky block is deleted/disabled and another enabled sky block remains, that block's color is automatically reapplied instead of falling back to black. https://claude.ai/code/session_01BD9b5z9rN2dsaNPR9TiHsy
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
Enhanced the sky block deletion logic to intelligently handle cases where multiple
set_sky_colorblocks exist in the workspace. Instead of always clearing the sky to black when a sky block is deleted, the system now checks for other enabled sky blocks and reapplies one if available.Key Changes
Added new
handleSkyBlockDeletion()function inblockmesh.jsthat:set_sky_colorblocks in the workspaceUpdated
handleBlockDelete()andhandleMeshLifecycleChange()inblocks.jsto call the new function instead of unconditionally clearing and resetting the skyImplementation Details
The new function checks the
meshBlockIdMap["sky"]to determine if the deleted block was actually controlling the sky, preventing unnecessary operations. It then queries all blocks in the workspace to find remaining enabled sky blocks, maintaining a better user experience when working with multiple sky color definitions.https://claude.ai/code/session_01BD9b5z9rN2dsaNPR9TiHsy