Skip to content

feat: implement question tool modal (fixes #273)#434

Merged
benjaminshafii merged 1 commit intodifferent-ai:devfrom
TechWizard9999:fix/question-tool-modal-273
Feb 4, 2026
Merged

feat: implement question tool modal (fixes #273)#434
benjaminshafii merged 1 commit intodifferent-ai:devfrom
TechWizard9999:fix/question-tool-modal-273

Conversation

@TechWizard9999
Copy link
Contributor

Summary

Fixes #273 - Question tool modal does not appear (blocks workflow)

Changes

Types (types.ts)

  • Added QuestionRequest import from SDK
  • Added PendingQuestion type with receivedAt timestamp

State Management (context/session.ts)

  • Added pendingQuestions to store state
  • Added event handlers for question.asked, question.replied, question.rejected
  • Added refreshPendingQuestions() to fetch pending questions
  • Added activeQuestion computed (per-session or global first pending)
  • Added questionReplyBusy signal for busy state
  • Added respondQuestion() and rejectQuestion() API methods

UI (components/question-modal.tsx)

  • Created QuestionModal component with:
    • Sequential wizard flow: "Question X of Y" navigation
    • Keyboard navigation: Arrow Up/Down + Enter
    • Multi-select support: Multiple options with checkmarks
    • Custom input: Free-text answer when custom: true
    • Auto-advance: Single-select options auto-advance to next question
    • Matching style with existing permission modal

Integration

  • session.tsx: Rendered QuestionModal with props from store
  • app.tsx: Wired up activeQuestion, questionReplyBusy, respondQuestion

Testing

  1. Run pnpm dev:ui
  2. Create a session
  3. Send: "use the question tool to ask me if I like pizza"
  4. Modal should appear with the question and options
  5. Verify keyboard navigation (↑↓ + Enter) works
  6. Verify multi-select and custom input work

TypeScript Build

pnpm tsc --noEmit  # passes with no errors

- Add PendingQuestion type to types.ts
- Add question event handling in session.ts (question.asked, question.replied, question.rejected)
- Add pendingQuestions store, activeQuestion computed, questionReplyBusy signal
- Add respondQuestion and rejectQuestion API methods
- Create QuestionModal component with:
  - Sequential wizard flow (Question X of Y)
  - Keyboard navigation (Arrow Up/Down + Enter)
  - Multi-select and custom input support
  - Auto-advance for single-select options
- Integrate QuestionModal in session.tsx
- Wire up props in app.tsx
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The following comment was made by an LLM, it may be inaccurate:

@benjaminshafii
Copy link
Member

thx!

@benjaminshafii benjaminshafii merged commit 4ac19db into different-ai:dev Feb 4, 2026
2 checks passed
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.

Question tool modal does not appear (blocks workflow)

2 participants