Skip to content

Conversation

@cmenon12
Copy link
Member

@cmenon12 cmenon12 commented Nov 24, 2025

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.

  • This is intended for complex questions that need a more detailed explanation than can be provided in the hint text.
  • A title is added to the question and the question text is made a bit smaller.
  • Hint text and a detailed explanation are not both shown; if both are present then the detailed explanation takes precedence.
  • See the example here (scroll down to the interview needs question) https://design-system.service.gov.uk/patterns/question-pages/.

Add a new help guide page to explain all the supported options. A link to this is visible from the JSON editor.

Also:

  • Allow the user to disable the progress indicators, they are shown by default.
  • Update the example.
  • Remove the hint text property if it won't be shown.
  • Let the user view the schema.
  • Fix a moderate vulnerability in body-parser with npm 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:

  • Added appropriate and passing tests for the changes I made.
  • Not broken any existing functionality or tests.
  • Not introduced any new linting or formatting errors.
  • Only added new dependencies that are necessary, do not introduce security vulnerabilities, and with tilde (~) version ranges.
  • Checked and resolved UI accessibility issues using Axe devtools. Unresolved issues are described above.
  • Updated the documentation if necessary.

Check the contributing guidelines for more details.

Screenshots (if appropriate)

Copilot finished reviewing on behalf of cmenon12 November 24, 2025 19:06
Copy link

Copilot AI left a 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_explanation field for questions that need more context than hint text can provide, consisting of a question_title and explanation_text
  • Added show_progress_indicators option 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
@cmenon12 cmenon12 marked this pull request as ready for review November 25, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow additional text to be included on the question page Add rich-text formatting to description text

3 participants