|
| 1 | +--- |
| 2 | +title: "GSoC '25 Week 6 Update by Elwin Li" |
| 3 | +excerpt: "Weekly progress report for JSEditor updates" |
| 4 | +category: "DEVELOPER NEWS" |
| 5 | +date: "2025-07-12" |
| 6 | +slug: "2025-07-12-gsoc-25-Elwin-Li-week06" |
| 7 | +author: "@/constants/MarkdownFiles/authors/elwin-li.md" |
| 8 | +tags: "gsoc25,sugarlabs,midterm,week6,javaScript editor,debugger,syntax highlighting" |
| 9 | +image: "assets/Images/GSOC.png" |
| 10 | +--- |
| 11 | + |
| 12 | +<!-- markdownlint-disable --> |
| 13 | + |
| 14 | +# Week 6 Progress Report by Elwin Li |
| 15 | + |
| 16 | +**Project:** [Advanced JavaScript Editor with MusicBlocks Interactions](https://github.com/sugarlabs/musicblocks/tree/config_driven_conversion/elwin) |
| 17 | +**Mentors:** [Walter Bender](https://github.com/walterbender), [Anindya Kundu](https://github.com/meganindya), [Devin Ulibarri](https://github.com/pikurasa) |
| 18 | + |
| 19 | +**Reporting Period:** 2025-07-05 - 2025-07-12 |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Goals for This Week |
| 24 | + |
| 25 | +- **Goal:** Complete syntax/error highlighting, and conclude the project |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## This Week’s Achievements |
| 30 | + |
| 31 | +**Made PR for Syntax highlighting project** |
| 32 | + |
| 33 | +The syntax/error highlighting project has been complete and a [PR has been made](https://github.com/sugarlabs/musicblocks/pull/4723). This project adds syntax highlighting and error highlighting to the JS editor, making the editor easier to work with. The syntax highlighting was done using |
| 34 | +the highlightjs library, and the error highlighting was done by using the acorn library to parse the JavaScript code, and marking down the location |
| 35 | +of any errors, and doing some calculations to highlight the associating places red. |
| 36 | + |
| 37 | +Any syntax errors will not only cause the place of errors to be highlighted, but it will also print an error message in the console log. This will additionally make it easier for the user to understand when and where an error occurs. A demo of the highlighting is displayed below: |
| 38 | + |
| 39 | +<a href="https://ibb.co/VpVMyZFM"><img src="https://i.ibb.co/yB0gT1zg/Screenshot-2025-07-12-at-9-01-37-PM.png" alt="Syntax Highlight"></a> |
| 40 | + |
| 41 | +<a href="https://ibb.co/1YTRYQFx"><img src="https://i.ibb.co/Y4hf4QHG/Screenshot-2025-07-12-at-9-01-48-PM.png" alt="Error Highlight"></a> |
| 42 | + |
| 43 | +**Made prototype for prompt to valid JavaScript code that can convert to MusicBlocks AI** |
| 44 | + |
| 45 | +This week, I have also made a gemini wrapper that takes in a prompt such as "Play twinkle twinkle little star with the guitar" and outputs JavaScript code that specifically works with MusicBlocks, so the user can copy paste the result into the JSeditor, convert the code to blocks, and play the result. This was done with a Google gemini API call along with extensive prompt engineering making sure it knows exactly what kind of code works with MusicBlocks, and what kind of code will cause errors if attempted to convert to blocks. |
| 46 | + |
| 47 | +[youtube: BFY3Bbi8V2g] |
| 48 | + |
| 49 | +[youtube: TEGWOAf5iO4] |
| 50 | + |
| 51 | +## Midterm Progress Summary |
| 52 | + |
| 53 | +**Over the 6 weeks of GSoC, I have accomplished the following** |
| 54 | + |
| 55 | +### Community Bonding: Project Foundation |
| 56 | +- **Planning and Research**: Defined project scope and educational goals |
| 57 | +- **Initial Implementation**: Started with basic JavaScript-to-blocks conversion for rhythm, flow, number, and boolean palettes |
| 58 | +- **Architecture Design**: Planned the overall system architecture and feature roadmap |
| 59 | + |
| 60 | +### Week 1: Architecture Breakthrough |
| 61 | +- **Config-Driven Refactoring**: Developed JSON-based configuration system for block mappings |
| 62 | +- **AST Integration**: Implemented Acorn parser for JavaScript code analysis |
| 63 | +- **Pattern Matching**: Created flexible AST pattern matching for complex JavaScript constructs |
| 64 | +- **Extensibility**: Made adding new blocks as simple as updating configuration files |
| 65 | + |
| 66 | +### Week 2: Complete Implementation |
| 67 | +- **Full Block Support**: Extended system to support all compatible block types |
| 68 | +- **Optimization**: Implemented JSON minification and config consolidation |
| 69 | +- **Documentation**: Created comprehensive conversion guide and unit tests |
| 70 | +- **Production Deployment**: Successfully deployed feature through merged PR |
| 71 | + |
| 72 | +### Week 3: Debugger Development |
| 73 | +- **Interactive Debugger**: Built working debugger with breakpoint system |
| 74 | +- **Variable Inspection**: Implemented real-time variable display and tracking |
| 75 | +- **Visual Integration**: Connected debugger statements to visual blocks |
| 76 | +- **Educational Features**: Added step-by-step execution and status block integration |
| 77 | + |
| 78 | +### Week 4: Debugger Refinement |
| 79 | +- **UX Optimization**: Simplified debug mode and improved user interface |
| 80 | +- **Status Block Enhancement**: Optimized variable management and display |
| 81 | +- **Execution Control**: Enhanced integration with existing play controls |
| 82 | +- **Bug Fixes**: Resolved execution flow and block behavior issues |
| 83 | + |
| 84 | +### Week 5: Final Integration |
| 85 | +- **Debugger Completion**: Finalized debugger with comprehensive PR |
| 86 | +- **Syntax Highlighting**: Added basic syntax highlighting to JavaScript editor |
| 87 | +- **Production Ready**: Completed all planned features and deployed to production |
| 88 | +- **Documentation**: Finalized user guides and technical documentation |
| 89 | +--- |
| 90 | + |
| 91 | +## Key Learnings |
| 92 | + |
| 93 | +- Improved skills in UX design and keeping tools simple for the user |
| 94 | +- Deepened understanding of highlightjs |
| 95 | +- Learned Gemini API calls |
| 96 | +- Improved skills in prompt engineering |
| 97 | +- Improved skills in **debugging**, **code design**, and **collaboration workflows**. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## Next Week’s Roadmap |
| 102 | + |
| 103 | +- Fine tune an LLM to work better with MusicBlocks specific requests |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## Acknowledgments |
| 108 | + |
| 109 | +Thank you to my mentors, the Sugar Labs community, and fellow GSoC contributors for ongoing support. |
| 110 | + |
| 111 | +--- |
0 commit comments