Skip to content

Fix expert chat input focus on drawer open and after MQTT response#7933

Open
cstns wants to merge 4 commits into
mainfrom
fix/7931_expert-chat-input-focus
Open

Fix expert chat input focus on drawer open and after MQTT response#7933
cstns wants to merge 4 commits into
mainfrom
fix/7931_expert-chat-input-focus

Conversation

@cstns

@cstns cstns commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

  • Focus the chat textarea (not the drawer container) when the expert drawer is manually opened, so the user can start typing immediately
  • Refocus the chat input after a response completes, using a watcher on isWaitingForResponse instead of chaining .then() on handleQuery(). The old approach relied on the HTTP promise lifecycle where handleQuery resolves after the full response. Over MQTT, sendMqttQuery returns immediately, so the .then() refocus fired before the response arrived and any DOM updates from the actual response would blur the input with nothing to restore it.

Related Issue(s)

closes #7931

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@cstns
cstns requested a review from andypalmi July 24, 2026 12:40
@cstns cstns self-assigned this Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.62%. Comparing base (b327fda) to head (c6f9cf2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7933   +/-   ##
=======================================
  Coverage   75.61%   75.62%           
=======================================
  Files         434      434           
  Lines       23232    23235    +3     
  Branches     6172     6174    +2     
=======================================
+ Hits        17568    17571    +3     
  Misses       5664     5664           
Flag Coverage Δ
backend 75.62% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Expert chat input loses focus

1 participant