Skip to content

Comments

fix: make question widget options clickable inline (#79)#80

Merged
dzianisv merged 2 commits intomainfrom
issue-79-fix-question-widget
Feb 15, 2026
Merged

fix: make question widget options clickable inline (#79)#80
dzianisv merged 2 commits intomainfrom
issue-79-fix-question-widget

Conversation

@dzianisv
Copy link
Owner

Summary

  • Fixed inline question options in ToolCallPart.tsx — options were rendered as non-clickable <span> elements, now they are interactive <button> elements with checkbox-style selection, submit/skip actions, and loading/error states
  • Fixed QuestionDialog X button — previously called handleReject() which rejected the question on the server; now calls dismissDialog() which only hides the dialog, letting users answer inline instead
  • Fixed question SSE event delivery — added question event handling in session-level useSSE hook so events are not silently dropped when no repo-level SSE connection exists
  • Added 47 tests across 3 new test files covering QuestionContext, QuestionDialog, and ToolCallPart

Root Cause

The question widget had a dual rendering architecture with a critical disconnect:

  1. Inline options in the message stream (ToolCallPart.tsx) were non-clickable <span> elements that just showed "Click the dialog to respond"
  2. The full-screen QuestionDialog depended on receiving a question.asked SSE event via PermissionContext, but this SSE connection only existed for repos with cached session queries — if no connection existed, the event was silently dropped and the dialog never appeared

Changes

File Change
ToolCallPart.tsx Interactive buttons with selection state, submit/skip handlers via useQuestionContext()
QuestionContext.tsx Added dismissDialog(), isDialogDismissed state; new questions reset dismissed state
QuestionDialog.tsx X button dismisses instead of rejecting; hidden when isDialogDismissed
types.ts Added SSEQuestionAskedEvent, SSEQuestionRepliedEvent, SSEQuestionRejectedEvent types
useSSE.ts Added question event handling in session-level SSE
QuestionContext.test.tsx 17 tests for context provider and questionEvents pub/sub
QuestionDialog.test.tsx 13 tests for dialog rendering, selection, submit, reject, dismiss, error states
ToolCallPart.test.tsx 17 tests for inline question UI, option clicking, submit/skip, single/multi select

Testing Done

  • cd frontend && npm run build — no TypeScript errors
  • 47 new tests all passing (cd frontend && npx vitest run)
  • Pre-existing test failures (25 in stt/TalkMode files) are unrelated to this change

Issue

Closes #79

engineer added 2 commits February 14, 2026 16:37
…#79)

- Transform inline question options from non-clickable <span> to interactive <button> elements
- Add checkbox-style selection UI with submit/skip buttons and loading/error states
- Add dismissDialog() to QuestionContext so X button hides dialog without rejecting on server
- Handle question SSE events in session-level useSSE hook for reliable delivery
- Add 47 tests across QuestionContext, QuestionDialog, and ToolCallPart
@github-actions
Copy link

🔔 Push Browser E2E Test Recording

Screencast

Run #22026915422 | Commit c04a403

@github-actions
Copy link

🎥 Browser E2E Test Recording

Screencast

Run #22026915422 | Commit c04a403

@github-actions
Copy link

⚙️ Settings E2E Test Recording

Screencast

Run #22026915422 | Commit c04a403

@github-actions
Copy link

🔔 Push Browser E2E Test Recording

Screencast

Run #22026945759 | Commit 99e6dc9

@github-actions
Copy link

⚙️ Settings E2E Test Recording

Screencast

Run #22026945759 | Commit 99e6dc9

@github-actions
Copy link

🎥 Browser E2E Test Recording

Screencast

Run #22026945759 | Commit 99e6dc9

@dzianisv dzianisv merged commit 26394fc into main Feb 15, 2026
5 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 widget doesnt' work

1 participant