Skip to content

Feature/execution highlighting#5780

Closed
021nirav-blip wants to merge 7 commits intosugarlabs:masterfrom
021nirav-blip:feature/execution-highlighting
Closed

Feature/execution highlighting#5780
021nirav-blip wants to merge 7 commits intosugarlabs:masterfrom
021nirav-blip:feature/execution-highlighting

Conversation

@021nirav-blip
Copy link
Contributor

Add Scratch-style Block Highlight/Glow During Execution
Fixes #5349

🎯 Problem
Music Blocks plays programs correctly but provides no visual indication of which block is currently executing. Unlike Scratch, users cannot easily follow the execution flow, making it difficult to understand program behavior - especially for beginners.

✨ Solution
This PR adds visual block highlighting during program execution with a golden glow effect that moves from block to block following the actual execution flow.

🔧 Key Features
Golden Glow Effect: Blocks emit a warm golden glow while executing
Smooth Transitions: Highlighting flows naturally between blocks
Smart Scaling: Blocks scale slightly (5%) for visual emphasis
Loop Support: Works correctly with repeat blocks and nested structures
Backward Compatibility: Falls back to existing highlighting if needed
Performance Optimized: Preserves original block state for efficient restoration
🛠 Technical Implementation
Uses CreateJS ShadowFilter for smooth golden glow effects
Enhanced Logo.runFromBlockNow() with new highlighting methods
Added _addExecutionHighlight() and _removeExecutionHighlight() methods
CSS animations for additional visual polish
State preservation ensures blocks return to original appearance
📁 Files Changed
js/logo.js - Core highlighting logic and execution flow integration
css/block-highlight.css - Visual styling and animations
index.html - CSS file inclusion
test_highlight.js - Documentation and testing guide
🧪 Testing
✅ Works with simple note sequences
✅ Handles loops and nested structures correctly
✅ Maintains highlighting during complex control flow
✅ Properly removes highlighting when execution stops
✅ Compatible with existing step-by-step mode
🎮 How to Test
Create a simple program with note blocks
Click "Run" - observe golden glow following execution
Test with repeat blocks and conditional logic
Verify highlighting stops when program ends
This implementation provides the Scratch-like visual feedback requested in issue #5349, making Music Blocks more intuitive and educational for users learning programming concepts.
@walterbender
@zealot-zew

- Replace widgetBody.innerHTML = '' with proper DOM node removal in removeCentsSlider
- Prevents event listeners from being destroyed when closing cents adjustment slider
- Fixes issue where widget buttons become unresponsive after using cents slider

Fixes sugarlabs#4939
- Keep test file as it exists in upstream master
- Focus only on cents slider fix in synthutils.js
- Addresses reviewer concern about test file deletion
…#5349

- Implement golden glow effect on executing blocks
- Add visual feedback for block execution flow
- Support loops and nested structures
- Maintain backward compatibility with existing highlighting
- Use CreateJS ShadowFilter for smooth animations

Closes: sugarlabs#5349
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

…#5349

- Implement golden glow effect on executing blocks
- Add visual feedback for block execution flow
- Support loops and nested structures
- Maintain backward compatibility with existing highlighting
- Use CreateJS Shape for cross-platform compatibility

Closes: sugarlabs#5349
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

- Add null check for getBounds() to prevent runtime errors
- Use fallback dimensions when bounds are not available
- Prevents ESLint and E2E test failures
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@vanshika2720
Copy link
Contributor

@021nirav-blip CI checks are failing.

@021nirav-blip 021nirav-blip deleted the feature/execution-highlighting branch March 3, 2026 04:00
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.

[Add Scratch-style Block Highlight/Glow During Execution in Music Blocks]

2 participants