fix: resolve chat UI locking up after AssemblyAI API error - #5
Conversation
…uting - getPanelPosition(): clamp saved panel coords against the display they belong to instead of always clamping to primary workArea; falls back to primary only when no display contains the saved position (e.g. monitor was disconnected) - createWidgetWindow(): spawn widget on the display where the mouse cursor is at launch time instead of always using primary display - positionWidgetBottomRight(): resolve the display the widget is currently on via getDisplayNearestPoint() so bottom-right anchor is relative to the correct monitor - set-widget-height IPC handler: clamp widget height against the workArea of the display the widget occupies, not the primary display - DEFAULT_SYSTEM_PROMPT: add MULTI-SCREEN RULE instructing the AI to append :screenN to POINT tags when multiple screenshots are present, ensuring resolveTargetDisplay() selects the correct display instead of falling back to primary every time Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mo-tunn
left a comment
There was a problem hiding this comment.
Thanks for the quick fix attempt and the detailed write-up. I found a few issues that should be addressed before merge:
-
State-reset race condition on textarea focus (high impact)
renderer/js/panel/bootstrap.jsresetsisStreamingtofalseontextInputfocus without aborting the in-flight request. This can re-enable UI while a response is still streaming, allowing overlapping requests and inconsistent UI/session state. -
60s timeout forces idle state without cancelling the backend stream (medium impact)
renderer/js/panel/messaging.jssafety timeout also flips UI to idle and re-enables send, but does not abort the active request. A legitimate slow response can still be in progress while user sends another message. -
Multi-monitor position logic still rejects valid negative coordinates (medium impact)
main.js:getPanelPosition()treats saved coordinates< 0as invalid and falls back to primary display defaults. This breaks common multi-monitor layouts where displays on the left/top have negative coordinates.
Please fix these and I’ll re-review.
- Fix focus race condition by aborting backend stream via api.invoke on text input focus. - Abort active AI request via api.invoke when 60-second safety timeout triggers. - Allow negative coordinates in getPanelPosition for complete multi-monitor support.
|
Addressed all requested changes: Fixed textarea focus race condition by aborting in-flight requests before resetting UI state Fixed 60-second timeout to abort active backend streams before re-enabling input Fixed multi-monitor positioning by allowing valid negative coordinates instead of treating them as invalid Ready for re-review. |
Summary
When users encountered an API or connection error (e.g., invalid API Key) while using AssemblyAI, the chat input ("Ask anything...") area would completely lock up and become unclickable/untypable. Two main root causes for this issue were identified and fixed:
User-Visible Changes
Technical Details
Validation Performed