Skip to content

Maintain multi-line content when switching between search and Duck.ai #6219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2025

Conversation

joshliebe
Copy link
Contributor

@joshliebe joshliebe commented Jun 12, 2025

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

Description

  • Makes the search input field multi-line but still submits when hitting enter on the keyboard.
  • Decreases the transition animation from the default 300ms to 200ms.
  • Adds a clear text button.
  • Adds layout change animations.

Steps to test this PR

  • Enable Duck.ai PoC
  • Go to Duck.ai tab
  • Enter some multi-line text
  • Switch to search tab
  • Verify that the text is multi-line
  • Hit enter
  • Verify that the search text is submitted

@Copilot Copilot AI review requested due to automatic review settings June 12, 2025 18:32
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The PR ensures that multi-line content is preserved when switching between the search and Duck.ai tabs, adds a clear-text button, and improves layout animations and transitions.

  • Switches the omnibar’s EditText to a custom SearchInterstitialEditText to handle multi-line input and Enter submission.
  • Adds a clear-text ImageView with animated layout changes in the omnibar layout.
  • Hooks up transition duration constant in the interstitial activity and tweaks animation timing in the omnibar.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
view_duck_chat_omnibar.xml Enabled animateLayoutChanges, swapped in custom EditText, and added clear-text button.
SearchInterstitialEditText.kt Introduced custom EditText that intercepts Enter for submission.
SearchInterstitialActivity.kt Applied a shared‐element transition duration constant (200ms).
DuckChatOmnibarLayout.kt Wired up clear button, updated input behavior for multi-line, adjusted animation duration and max lines.
Comments suppressed due to low confidence (1)

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/ui/DuckChatOmnibarLayout.kt:150

  • The new clear-text visibility behavior and multi-line retention logic need unit or UI tests to ensure they work as expected when switching tabs, entering text, and tapping the clear button.
duckChatClearText.isVisible = !s.isNullOrEmpty()

@joshliebe joshliebe force-pushed the feature/josh/search-multiline branch from bfb834a to 4647bf7 Compare June 12, 2025 18:36
@joshliebe joshliebe force-pushed the feature/josh/search-multiline branch from 4647bf7 to b054043 Compare June 12, 2025 18:43
Copy link
Collaborator

@aitorvs aitorvs left a comment

Choose a reason for hiding this comment

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

LGTM
Added few nit comments and also tested copy/pasting text that already contains line breaks in the search mode to ensure it doesn't trigger the search

@joshliebe joshliebe force-pushed the feature/josh/search-multiline branch from ac439a1 to 98f29e4 Compare June 13, 2025 07:58
@joshliebe joshliebe force-pushed the feature/josh/search-multiline branch from 98f29e4 to af48b25 Compare June 13, 2025 08:19
@joshliebe joshliebe merged commit ad98e5d into develop Jun 13, 2025
6 checks passed
@joshliebe joshliebe deleted the feature/josh/search-multiline branch June 13, 2025 08:41
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