Sub topic 12
Designing templates people will fill in
This chapter assumes you can write a pull request template, a Markdown issue template, and an issue form with required fields. It covers the choices that decide whether contributors fill those templates in well or click past them.
Ask only for what you will use
Every field costs the contributor effort. A long template gets skipped, or filled with "N/A". Before you add a field, name the decision it supports. A version number helps you reproduce a bug. A "Priority" field filled in by the reporter rarely helps, because reporters and maintainers disagree about priority.
A useful test is to read the last ten issues you triaged and note which questions you had to ask in comments. Those questions belong in the template. Fields you never looked at can go.
Match the field to the answer
Choose the element by the kind of answer you expect.
| You need | Use | Why |
|---|---|---|
| A short value such as a version | `input` | One line, easy to scan |
| A fixed set of choices such as an OS | `dropdown` | Gives consistent values you can filter on |
| Free text such as reproduction steps | `textarea` | Allows multiple lines and Markdown |
| Confirmations such as "I searched for duplicates" | `checkboxes` | Can be made required |
| Guidance that is not an input | `markdown` | Displays text and collects nothing |
Require only the essentials
Mark a field required: true only if you cannot act without it. If everything is required, contributors fill in junk to get past the form. Reproduction steps and version usually qualify. Logs and screenshots usually do not.
Validations apply only to issue forms. A Markdown template, including a pull request template, has no enforcement. A checklist item in a pull request template is a reminder, and the author can delete it.
Guide with labels, descriptions, and placeholders
A good label is a short noun phrase. Put the instruction in description and an example in placeholder. A placeholder disappears once the user types, so don't put required guidance only there.
name: Bug report
description: Report something that is not working
labels: ["bug", "triage"]
body:
- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: Number each step. Include the command you ran.
placeholder: |
1. Run `app start --debug`
2. Open the settings page
3. See the error
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect to happen?The steps field has an instruction, an example, and a requirement. The expected field is optional, because a missing answer will not block triage.
Keep Markdown templates readable
In a pull request template, put a comment under each heading with an HTML comment such as <!-- What does this change do, and why? -->. The comment is hidden in the rendered description, so the author does not have to delete it. Keep the checklist to items a reviewer would check, such as tests, docs, and breaking changes. Four or five items is enough.
For issues, use a Markdown template when you want free-form writing. Use a form when you need structured, filterable answers.
Guide people before they file
Put the cheapest help first. A markdown element at the top of a form can link to the troubleshooting guide. In config.yml, blank_issues_enabled: false forces people through a template, and contact_links sends questions to Discussions. Use both only if your templates cover the common cases. Otherwise people with an unusual problem have nowhere to go.
Revise from evidence
Treat a template as a draft. Watch for these signals:
- Fields that are often empty or contain "N/A" can be removed or made optional.
- Questions you keep asking in comments point to a missing field.
- Reports that reach you without a template suggest the chooser or
config.ymlis confusing.
Change one thing at a time so you can tell what helped.
Exercise
Your bug form has seven required fields, and reporters often type "n/a" in the logs field. What two changes would you make, and why?
Show answer
Make the logs field optional, because you can often triage without it and a forced answer produces junk. Reduce the required fields to those you cannot act without, such as version and steps to reproduce. You could also keep the logs field but set render: shell and explain in its description when logs are useful.