-
Notifications
You must be signed in to change notification settings - Fork 3
Add Markdown support, add optional detailed descriptions to question pages #80
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 pull request adds Markdown support for description fields and introduces optional detailed explanations for complex questions. The changes enhance the form generation capabilities by allowing richer formatting and better explanations for users.
Key changes include:
- Added support for Markdown formatting in description fields (
description,before_you_start,what_happens_next) and detailed explanations - Introduced a
detailed_explanationfield for questions that need more context than hint text can provide, consisting of aquestion_titleandexplanation_text - Added
show_progress_indicatorsoption to allow hiding question progress indicators (e.g., "Question 1 of 3")
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/types/schemas/prototype-schema.ts |
Added show_progress_indicators field to ITemplateData and detailed_explanation field to ITemplateField with supporting schema definitions |
src/types/schemas/form-types.ts |
Updated QuestionHeaderOptions to include new required fields for progress indicators and detailed explanations; removed totalQuestions from FieldGeneratorOptions |
src/form-generator.ts |
Modified form generation to support detailed explanations, conditionally include hint text using spread operators, and adjust heading sizes based on whether detailed explanation is present |
src/form-constants.ts |
Updated getQuestionHeader to render progress indicators and detailed explanations in Nunjucks templates with Markdown support |
src/utils.ts |
Added logic to automatically remove hint text when detailed explanation is present or for certain complex answer types |
src/routes/prototype-routes.ts |
Added backtick escaping to jsonText to prevent template literal injection |
views/results.njk |
Restructured JSON editor div and added link to help documentation for supported options |
public/font-override.css |
Updated CSS selector from #editor to #aceEditor to match new structure |
docs/help/supported-prototype-options.md |
New comprehensive documentation page listing all form and question field options with Markdown formatting guidelines |
docs/help/help-files.json |
Added entry for new supported prototype options help page |
docs/help/update-a-prototype.md |
Added link to new supported options documentation |
docs/help/create-a-new-prototype.md |
Removed duplicate documentation and added reference to new comprehensive options page |
data/extract-form-questions-schema.json |
Updated schema to support Markdown descriptions, detailed explanations, and progress indicators with comprehensive field descriptions |
data/example-llm-response.json |
Updated example to demonstrate new features including detailed explanation and show_progress_indicators |
src/__test__/form-generator.test.ts |
Added test coverage for detailed explanations and updated assertions for conditional hint text rendering |
src/__test__/form-constants.test.ts |
Added tests for progress indicators and detailed explanations in question headers |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
body-parser <2.2.1 Severity: moderate body-parser is vulnerable to denial of service when url encoding is used - GHSA-wqch-xfxh-vrr4 fix available via `npm audit fix` node_modules/body-parser
Description
Add support for Markdown in the description text. This was in fact already supported, but the LLM will now generate it and backticks are properly escaped. Instructions are included in the help guide.
Add a detailed explanation to the question schema.
Add a new help guide page to explain all the supported options. A link to this is visible from the JSON editor.
Also:
body-parserwithnpm audit fix.Related issues: closes #62 and closes #77
Checklist before marking as ready for review
Before marking as ready for review, please check that you have:
Check the contributing guidelines for more details.
Screenshots (if appropriate)