Skip to content

Fix question panel input focus handling#77

Merged
EdgeTypE merged 1 commit into
EdgeTypE:mainfrom
PandaYuuHa:fix/question-panel-input-focus
Jun 18, 2026
Merged

Fix question panel input focus handling#77
EdgeTypE merged 1 commit into
EdgeTypE:mainfrom
PandaYuuHa:fix/question-panel-input-focus

Conversation

@PandaYuuHa

Copy link
Copy Markdown
Contributor

Summary

This PR fixes an input focus issue in the BDS question panel shown for <BDS:ask_question> prompts.

Previously, text inputs inside bds-question-panel could only be focused reliably by clicking the leading icon or the
very beginning of the input field. Clicking other visible areas of the input row often failed to enter typing mode.

The fix improves event isolation and input focusing behavior when the question panel is mounted inside DeepSeek's
native composer area.

Changes

Update question panel event handling:

  • src/content/ui/QuestionPanel.svelte

Add panel-level pointer/mouse event isolation so DeepSeek's native composer does not steal focus from BDS panel
inputs.

Add a focused input container action so clicking the visible input row focuses the inner input consistently.

Apply the focus behavior to:

  • Free text question inputs.
  • Single-choice custom answer rows.
  • Multiple-choice custom answer rows.

Preserve existing click behavior for buttons and options:

  • Normal option button clicks still select and submit answers correctly.
  • Custom answer confirm button clicks still work.
  • Keyboard navigation and Enter handling remain unchanged.

Improve input sizing:

  • Custom text inputs now fill the available row width more reliably.
  • Free text inputs keep stable sizing inside their wrapper.

Add regression coverage:

  • tests/integration/ui/QuestionPanel.test.js

New coverage includes:

  • Normal option button clicks.
  • Free text wrapper clicks focusing the input without leaking pointer events to the native composer.
  • Custom answer row clicks focusing the custom input.
  • Custom answer confirmation still submitting correctly.

Motivation

The question panel is inserted into DeepSeek's native prompt/composer area. That means BDS panel inputs share an
interaction region with DeepSeek's own textarea/contenteditable editor.

DeepSeek's composer can handle pointer and mouse events to focus its own input. Without stronger event isolation,
clicks inside bds-question-panel may bubble to the native composer, causing DeepSeek to steal focus back from the
BDS input.

This made the visible input row misleading: users could see a full-width input area, but only a small part of it
reliably entered typing mode.

This PR keeps the existing QuestionPanel structure and applies a small, local fix similar to the existing
event-isolation approach used by the Deep Research revision panel.

Risk

Low.

The change is limited to QuestionPanel input interaction handling and does not change the question data format,
answer formatting, injection flow, or public tag contract.

The main risk is accidentally interfering with Svelte delegated click handlers. To reduce that risk, panel-level
isolation only handles pointer/mouse events, and input-container click handling explicitly avoids blocking button
clicks.

Regression tests cover normal option clicks and custom confirm button behavior to ensure existing selection and submit
paths still work.

Testing

Ran targeted QuestionPanel integration tests:

npx vitest run tests/integration/ui/QuestionPanel.test.js

Result:

6 tests passed

Ran full unit test suite:

npm run test:unit

Result:

58 test files passed
642 tests passed

@EdgeTypE EdgeTypE merged commit e16674f into EdgeTypE:main Jun 18, 2026
2 checks passed
@PandaYuuHa PandaYuuHa deleted the fix/question-panel-input-focus branch June 23, 2026 00:43
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.

2 participants