Skip to content

feat: introduce Section as a new question type - #3664

Draft
Koc wants to merge 1 commit into
mainfrom
feat/add-new-type-section-continue
Draft

Koc wants to merge 1 commit into
mainfrom
feat/add-new-type-section-continue

Conversation

@Koc

@Koc Koc commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

This is continuation of the #2913 and #2824 but rebased and adopted to Vue3 and composition API.

image

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AndyScherzinger

Copy link
Copy Markdown
Member

Hi @Koc, thanks for picking this up! A heads-up and three questions, because #3123 has changed in the meantime.

#3123 is now split into the stack #3833 → #3838, and conditional logic is no longer a question type of its own: branches are part of a normal question (extraSettings.branches), and follow-up questions are question rows with parentQuestionId and branchId (background in #3123 (comment)). So parentQuestionId now means "follow-up question of a branch", and the top-level lists, validation and export treat every question with a parent that way.

The good news: your diff already models sections the way Google Forms does, as an item in the ordered list that groups the questions up to the next section (like Google's PageBreakItem), without parentQuestionId. That fits well.

  1. parentQuestionId: the description mentions reusing it for sections. Could you drop that plan and keep sections as items in the list, as the code does now? Otherwise one column would carry two meanings.
  2. Pages: right now all sections are shown on one page with sticky headings. Is that meant as the end result, or as a step towards one section per page with Next/Back, like Google Forms? For "go to section based on answer" later on, sections need to be pages, with required questions checked per page before Next.
  3. Numbering: a section currently takes a question number (the counter also goes up for sections), so the question after a section at position 2 is numbered 3. I think sections should not be numbered. Do you agree?

Navigation between sections ("after this section go to …", and "go to section" on radio and dropdown options) would then build on top of this as a follow-up.

The stack and this PR both change the question list in Submit.vue; the conflict should be easy to resolve, follow-up questions just stay in the group of their question.

@AndyScherzinger

Copy link
Copy Markdown
Member

Hi @Koc, a short update on timing, so you know what to expect from my side.

I am finishing the iteration on conditional questions first. That is the stack starting at #3833, which is being reworked right now (#3833 (comment); it is now #3833 → #3834 → #3835 → #3837).

Once that iteration is done, sections are a good next step, and I will get back to you and your work here then. My three questions above stay open until then.

@AndyScherzinger

Copy link
Copy Markdown
Member

Hi @Koc, an update to my comment from 7 November, because the conditional questions stack has changed its model since then and parts of that comment no longer hold.

What changed in the stack

What this means for sections

  • Question 1 (parentQuestionId) is moot: the column is gone. Keeping sections as items in the ordered list, as your diff does, is exactly right. A section item then becomes a valid jump target without any format change.
  • Inside a section, the jumps keep the Microsoft behaviour: questions are revealed one after another, and an answer can skip a later question of the same section. When several questions of a section have jumps that leave the section, the first one decides, and the editor should warn about that case.
  • "After this section go to …" will use the same next key on the section item, and "go to section" on an answer is just a section id as goTo target. Both are follow-ups, not part of this PR. Backward jumps between sections (as Google Forms allows) are planned there too, with a server-side guard.
  • Questions 2 (one section per page with Next/Back, required questions checked per page) and 3 (sections take no question number) still stand. Numbering also matters for the jump targets in the editor, which are labelled "Question N: title".

Conflict with the stack

The note about follow-up questions staying in the group of their question is obsolete. Submit.vue now renders the respondent's path: questions are wrapped in KeepAlive and shown when they are in visibleQuestionIds, computed by getVisibleQuestions() in src/utils/Jumps.ts, mirrored on the server by SubmissionService::getVisibleQuestions(). A section item has to pass through that walk like a question without an answer, on both sides, and must not end the path.

I'll get back to you once the stack is merged; this PR should then be rebased onto main with it.

Assisted by Claude Code:claude-opus-5-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress enhancement New feature or request feature: 📑 form creation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants