-
Notifications
You must be signed in to change notification settings - Fork 20
[ENH] Adding Canvas Input to Capture User Drawings #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a canvas element to capture user drawings as part of the MOCA protocol input. Key changes include updating configuration (githubSrc) for image sourcing, integrating and implementing a new CanvasInput component for drawing input, and updating the InputSelector to conditionally render the canvas input.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/config.js | Updated githubSrc URL to a localhost endpoint for development use. |
src/components/SurveyItem/SurveyItem.vue | Added a uiConfig computed property and debug logging for background Image. |
src/components/Inputs/CanvasInput/CanvasInput.vue | New component implementation for canvas drawing input using bootstrap-vue. |
src/components/InputSelector/InputSelector.vue | Integrated CanvasInput component as an additional input option. |
src/components/CanvasInput.vue | Alternative CanvasInput implementation using plain HTML/CSS. |
babel.config.js | Reformatted preset configuration for babel. |
Comments suppressed due to low confidence (1)
src/components/CanvasInput.vue:1
- There appear to be two components named 'CanvasInput' in different directories; consider renaming one to reduce possible confusion during component registration and maintenance.
<template>
src/config.js
Outdated
@@ -1,5 +1,5 @@ | |||
module.exports = { | |||
githubSrc: 'https://raw.githubusercontent.com/ReproNim/demo-protocol/main/DemoProtocol/DemoProtocol_schema', | |||
githubSrc: 'http://localhost:3000/DemoProtocol/DemoProtocol_schema', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this URL is intended for local development only, consider using an environment variable to manage different endpoints (development versus production) to avoid misconfiguration in production.
githubSrc: 'http://localhost:3000/DemoProtocol/DemoProtocol_schema', | |
githubSrc: process.env.GITHUB_SRC || 'http://localhost:3000/DemoProtocol/DemoProtocol_schema', |
Copilot uses AI. Check for mistakes.
console.log('SurveyItem processActivityData - data:', this.data); | ||
console.log('SurveyItem processActivityData - backgroundImage:', this.data['http://schema.repronim.org/backgroundImage']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider removing or conditionally enabling console.log statements before production to avoid exposing internal data and to reduce console clutter.
console.log('SurveyItem processActivityData - data:', this.data); | |
console.log('SurveyItem processActivityData - backgroundImage:', this.data['http://schema.repronim.org/backgroundImage']); | |
if (process.env.NODE_ENV === 'development') { | |
console.log('SurveyItem processActivityData - data:', this.data); | |
} | |
if (process.env.NODE_ENV === 'development') { | |
console.log('SurveyItem processActivityData - backgroundImage:', this.data['http://schema.repronim.org/backgroundImage']); | |
} |
Copilot uses AI. Check for mistakes.
put the original url back
@bendhouseart, thanks for the PR! We need to fix the relative path for importing |
This adds the canvas element to capture user inputs via drawing for protocols such as MOCA.