Skip to content

feat(sdui): port adaptive questionnaire demo to Vue and Lit renderers #465

@roblevintennis

Description

@roblevintennis

Context

The React demo (v2/sdui/demo/) gained an adaptive questionnaire workflow in #462 (PR #464). The Vue and Lit demos have StreamingOutput and WorkflowPicker counterparts but no AdaptiveOutput equivalent.

The fixture file (v2/sdui/demo/src/fixtures/adaptive-questionnaire.ts) is already shared across all three demos, so getNextNodes(answers) and the step node arrays are available without duplication.

Scope

Vue demo (v2/sdui/demo-vue/)

  • Add AdaptiveOutput.vue — equivalent of AdaptiveOutput.tsx, using @agnosticui/render-vue and Vue's ref/reactive for answers accumulation
  • Update App.vue to route adaptive-questionnaire to AdaptiveOutput and hide the Regenerate button for that workflow
  • Vue wrappers emit detail directly as the first handler argument, so the ANSWER_CHANGE handler receives { id, value } directly

Lit demo (v2/sdui/demo-lit/)

  • Add AdaptiveOutput.ts (LitElement) — equivalent using @agnosticui/render-lit and Lit's @state() for answers
  • Update App.ts / entry point to route the workflow appropriately

Acceptance criteria

  • Selecting "Adaptive questionnaire" in the Vue and Lit demos streams in the health intake step 1
  • All branching and skip logic (severe symptoms bypass contact form) works identically to the React demo
  • The accumulated answers panel updates in real time
  • Restart works
  • Existing workflows in both demos are unaffected

Depends on

Notes

The picker.ts update adding the questionnaire card is already in the shared fixtures, so it will appear in the WorkflowPicker of the Vue and Lit demos automatically once their AdaptiveOutput components are wired up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions