simplify the javascript code for sanitizing and validating the dose table, and apply similar rules to other handsontables (the ability to convert 5:80 -> 06:20, disallowing typing illegal characters, removing extra colons or periods, accepting either clock or relative times depending on the mode)#188
simplify the javascript code for sanitizing and validating the dose table, and apply similar rules to other handsontables (the ability to convert 5:80 -> 06:20, disallowing typing illegal characters, removing extra colons or periods, accepting either clock or relative times depending on the mode)#188
Conversation
…able, and apply similar rules to other handsontables (the ability to convert 5:80 -> 06:20, disallowing typing illegal characters, removing extra colons or periods, accepting either clock or relative times depending on the mode)
Summary of ChangesHello @daattali, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors and enhances the input validation and sanitization mechanisms for Handsontable components across the application. By centralizing JavaScript hook management and introducing dedicated functions for filtering keys and sanitizing input, the changes ensure more robust and consistent data entry, particularly for time and dose values. This improves user experience by preventing invalid input and automatically formatting data, while also making the codebase more modular and easier to maintain. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Preview Deployment This PR has been deployed to: https://steveshafer.shinyapps.io/stanpumpr_PR_188/ This deployment will be automatically cleaned up when the PR is closed. |
There was a problem hiding this comment.
Code Review
The pull request simplifies the JavaScript code for sanitizing and validating the dose table and applies similar rules to other Handsontable instances. The changes introduce a new addHotHooks function in R/shiny-utils.R to centralize the application of beforeKeyDown and beforeChange hooks, improving code reusability and maintainability. The JavaScript logic in inst/www/hot_funs.js has been refactored to use these new hooks, and the cleanTime function has been enhanced to handle both relative and clock time formats more robustly. Additionally, type = "numeric" has been added to 'Dose' and 'Target' columns in R/app_server.R, and the format = "0" has been removed from the 'Time' column in the event table, which is a good change as time values are not strictly numeric.
No description provided.