Skip to content

Release 2024.09.29: Improved Event Handling, DOM Traversal, and Logging

Latest
Compare
Choose a tag to compare
@Symonovskyi Symonovskyi released this 29 Sep 07:25
c2ba5c5

🎉 New Features & Improvements

  • Event Handling Refactor: Refactored the keyboard event handling mechanism. Now Enter, Ctrl+Enter, and Shift+Enter are properly handled for line break insertion and message sending. This improves interaction with contenteditable elements and input fields.

  • Enhanced DOM Traversal: Improved the logic for locating send and edit buttons. The traversal is now more reliable and scalable, preventing errors in complex DOM hierarchies. More accurate button detection based on selectors has been added.

  • Logging & Debugging: Introduced a flexible logging system to track key script behaviors. This helps to quickly identify and fix issues, as well as to understand the logic during debugging.

🛠️ Bug Fixes

  • Fixed Line Break Insertion: Resolved the issue with line break insertion in contenteditable elements and text fields. Now line breaks are inserted correctly upon pressing Enter or Shift+Enter, avoiding event loops and conflicts.

  • Corrected Message Send Simulation: Fixed bugs related to simulating the message send button click on Ctrl+Enter. The updated button-finding logic ensures successful message sending.

  • Event Conflict Prevention: Implemented safeguards against event conflicts during keypress simulations. The function now accounts for all possible key combinations and prevents cyclic behavior.

🔧 Under the Hood

  • Improved Code Structure: The code has been cleaned up and made more maintainable. Key functions have been rewritten and documented for better readability and to reduce technical debt.

  • Better Performance: Optimized DOM element traversal processes, reducing browser load and improving script performance.