Skip to content

fix(#187): Implement 'Other' option for dropdowns, multiple choice & checkboxes#206

Closed
Absy00 wants to merge 8 commits intodevelopfrom
187-dropdown-other-option-no-input-for-custom-value-rag-handling
Closed

fix(#187): Implement 'Other' option for dropdowns, multiple choice & checkboxes#206
Absy00 wants to merge 8 commits intodevelopfrom
187-dropdown-other-option-no-input-for-custom-value-rag-handling

Conversation

@Absy00
Copy link
Contributor

@Absy00 Absy00 commented Feb 22, 2026

Summary

Resolves #187 — When "Other" is enabled for dropdown/multiple choice/checkbox questions, an input field now appears for the respondent to type a custom answer. The answer is submitted as { other: "custom value" } and the backend correctly extracts and uses the custom value for RAG analytics.

Changes

Frontend

  • QuestionEditor.tsx — Added "Allow Other" checkbox for dropdown, multiple choice, and checkbox question types
  • PublicFormView.tsx — Shows text input when "Other" is selected; submits as { other: "..." }
  • FormPreview.tsx — Same "Other" input logic in preview mode
  • RawResponsesTable.tsx — Fixed [object Object] display bug; now shows Other: custom value

Backend

  • form.schema.ts — Added canBeOther: boolean to Question schema
  • response.service.ts — Normalizes { other } answers with metadata.normalizedValue; handles "Other" in analytics grouping
  • prompt.builder.ts — Extracts .other value for RAG/LLM prompts (language-independent)
  • response.processor.ts — Robust text content detection that handles old responses without hasTextContent metadata

Test data & docs

  • generate-fake-responses.ts — Generates { other: "..." } test data for all question types with canBeOther
  • architecture_overview.md — Documents the "Other" value data structure

Acceptance Criteria (all met)

  • Frontend: Input appears when "Other" is selected
  • Frontend: Submits as { other: "..." } (not just the label)
  • Backend: Prompt builder extracts .other value for analytics
  • Multilingual: Logic is label-independent
  • Schema: canBeOther property documented

Known issue (separate from #187)

The analytics pipeline (BullMQ worker) experiences job stalling under the default lock settings. This is an infrastructure concern tracked separately — the lockDuration and stalledInterval need to be increased for long-running AI analysis jobs. The "Other" value handling itself works correctly end-to-end.

rkorszun and others added 5 commits April 28, 2025 17:01
installs vite for frontend and liblaries like prettier, tailwind, add…
…checkboxes

Frontend:
- Add 'Allow Other' checkbox in QuestionEditor for dropdown/MC/checkbox types
- Show text input when 'Other' is selected in PublicFormView and FormPreview
- Submit 'Other' answers as { other: "custom value" } structure
- Fix [object Object] display in RawResponsesTable — now shows 'Other: value'

Backend:
- Add canBeOther property to Question schema
- Normalize { other } answers in response.service.ts with metadata.normalizedValue
- Extract .other value in prompt.builder.ts for RAG/analytics
- Robust text content detection in response.processor.ts (handles old responses)

Test data & docs:
- Update generate-fake-responses.ts to produce { other: "..." } test data
- Document Other value handling in architecture_overview.md

Closes #187
rkorszun
rkorszun previously approved these changes Feb 25, 2026
Copy link
Collaborator

@rkorszun rkorszun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw some '' vs "" formatiing in some cases is strange but overall is ok

…-option-no-input-for-custom-value-rag-handling
@rkorszun rkorszun changed the base branch from main to develop February 28, 2026 19:43
@rkorszun rkorszun closed this Feb 28, 2026
@Absy00 Absy00 linked an issue Feb 28, 2026 that may be closed by this pull request
5 tasks
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.

Dropdown 'Other' Option: No Input for Custom Value & RAG Handling

2 participants