feat: combined improvements (debugLog refactor, search debounce, safer DOM methods)#7781
Open
NAME-ASHWANIYADAV wants to merge 2 commits into
Open
feat: combined improvements (debugLog refactor, search debounce, safer DOM methods)#7781NAME-ASHWANIYADAV wants to merge 2 commits into
NAME-ASHWANIYADAV wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7781 +/- ##
==========================================
+ Coverage 59.00% 59.01% +0.01%
==========================================
Files 175 175
Lines 57920 57939 +19
==========================================
+ Hits 34176 34195 +19
Misses 23744 23744 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
This PR combines three small improvements across different files:
console.log()calls inmusickeyboard.jswith the project'sdebugLog()utility so they can be safely disabled in production.delayto the jQuery autocomplete inputs insearch-controller.js(both main and helpful search) to debounce keystrokes and reduce lag on slower educational devices.innerHTMLassignments insvgAssetSelector.js(tab headers and upload buttons) with saferdocument.createElement()andtextContentDOM manipulations to prevent potential XSS vulnerabilities.PR Category
Changes Made
js/widgets/musickeyboard.js: Replacedconsole.logwithdebugLogand updated the global declarations at the top of the file.js/activity/search-controller.js: Addeddelay: 200to the configuration objects for both$search.autocomplete()and$helpfulSearch.autocomplete().js/svgAssetSelector.js: ReplacedinnerHTMLwithdocument.createElement+textContentfor building the modal header, "Built-in Images" tab, "Upload from Device" tab, and the "Choose File" upload button.Testing Performed
npx prettier --check .to ensure the files conform to the project's formatting guidelines.npx eslinton modified files to verify no lint errors were introduced.Checklist
npm run lintandnpx prettier --check .with no errors.Additional Notes for Reviewers
N/A