Skip to content

Update floating buttons and keyboard actions for native-widget#8548

Merged
malmstein merged 1 commit into
developfrom
aibrahim/features/carriage-return
May 13, 2026
Merged

Update floating buttons and keyboard actions for native-widget#8548
malmstein merged 1 commit into
developfrom
aibrahim/features/carriage-return

Conversation

@aibrahim-
Copy link
Copy Markdown
Contributor

@aibrahim- aibrahim- commented May 13, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1212608036467427/task/1214733589467185?focus=true

Description

Steps to test this PR

In Search mode

  • Search toggle selected
    • Keyboard action: Submit
    • No Floating Carriage Return
  • Duck.ai toggle selected
    • No text
      • Keyboard action: Submit
      • No Floating Carriage Return
    • Text present
      • Keyboard action: Submit
      • Floating Carriage Return

In Duck.ai

  • Search toggle selected
    • Keyboard action: Submit
    • No Floating Carriage Return
  • Duck.ai toggle selected
    • With/Without text
      • Keyboard action: Carriage Return
      • Submit button present in bottom row buttons

UI changes

output

Note

Medium Risk
Changes submission semantics and IME/input-type handling across browser vs Duck.ai contexts, which can affect message sending and keyboard behavior. Also adjusts button hosting/visibility logic, so regressions are possible in chat controls across states (focus/streaming/attachments).

Overview
Updates native chat input so hardware Enter no longer always submits: InputModeWidget now gates hardware-enter submission via overridable shouldSubmitOnHardwareEnter(), and NativeInputModeWidget disables it for Duck.ai chat.

Refines Duck.ai vs browser IME behavior by switching Duck.ai chat to multiline input with IME_ACTION_NONE, and forcing an InputMethodManager.restartInput when the input context changes.

Reworks native submit/voice controls to support a separate floating button host (including a new-line button shown only in browser-context chat with text and not streaming), simplifies bottom-row visibility logic, and tweaks layout spacing (removes rowSpacer, adds margins around toggle row/bottom row).

Reviewed by Cursor Bugbot for commit f8d07d1. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f8d07d1. Configure here.

inputField.maxLines = MAX_LINES
}
updateSendButtonVisibility()
updateNewLineButtonVisibility()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Floating buttons never created until first streaming event

High Severity

setFloatingSubmitContainer stores the container reference but never triggers configureSubmitButtons(). The only callers of configureSubmitButtons() are prepareSubmitButtons() (during onAttachedToWindow, before the floating container is set) and setChatStreaming() (on chat state changes). Since NativeInputManager.bindWidget calls setFloatingSubmitContainer after onAttachedToWindow has already run, floatingButtons is never created until the first chat state change fires setChatStreaming. In the browser/search context where no streaming occurs, floatingButtons stays null permanently — so updateNewLineButtonVisibility() is a no-op, voice buttons fall back to submitButtons (wrong host), and the floating carriage return button never appears.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f8d07d1. Configure here.

@malmstein malmstein self-assigned this May 13, 2026
Copy link
Copy Markdown
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected, thanks @aibrahim- !

@malmstein malmstein merged commit 27f48c0 into develop May 13, 2026
21 checks passed
@malmstein malmstein deleted the aibrahim/features/carriage-return branch May 13, 2026 21:03
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