Add UI Components and feature flag for duck.ai recent chats#7685
Add UI Components and feature flag for duck.ai recent chats#7685YoussefKeyrouz merged 1 commit intodevelopfrom
Conversation
dbeb1b8 to
754abb3
Compare
...ckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/inputscreen/ui/InputScreenFragment.kt
Outdated
Show resolved
Hide resolved
duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/feature/DuckChatFeature.kt
Show resolved
Hide resolved
.../src/main/java/com/duckduckgo/duckchat/impl/inputscreen/ui/viewmodel/InputScreenViewModel.kt
Outdated
Show resolved
Hide resolved
|
|
||
| // Chat Suggestions Tests | ||
|
|
||
| @SuppressLint("DenyListedApi") |
There was a problem hiding this comment.
nit: Can just suppress once at the top of the class
There was a problem hiding this comment.
I usually like to keep it scoped per test so if someone add a new test that causes the same linting warning, they would be aware of it and specifically indicate they are ok suppressing it. But if you prefer top of the file I can do that. let me know
| assertTrue(initialState.showChatLogo) | ||
|
|
||
| viewModel.onChatSelected() | ||
| advanceUntilIdle() |
There was a problem hiding this comment.
You can remove the advanceUntilIdle() in these tests, it’s not needed
| app:layout_constraintTop_toTopOf="parent" | ||
| tools:visibility="visible" /> | ||
|
|
||
| <androidx.recyclerview.widget.RecyclerView |
There was a problem hiding this comment.
As mentioned, this causes sliding of the list. The behavior should be the same as the new tab page/autocomplete list.
There was a problem hiding this comment.
The list also needs the bottom blur
There was a problem hiding this comment.
Yeah this whole component will be made to match the autocomplete list
| android:layout_height="match_parent" /> No newline at end of file | ||
| android:layout_height="match_parent" > | ||
|
|
||
| <com.duckduckgo.common.ui.view.text.DaxTextView |
There was a problem hiding this comment.
Compared to Figma, the header needs some bottom padding
There was a problem hiding this comment.
The header is also static, it needs to scroll with the list
There was a problem hiding this comment.
The padding/margin is on my list of things to address. Haven’t properly match them yet. For the header I will address it too but just curious how did you know it needs to scroll?
There was a problem hiding this comment.
Checked with @Bunn and there’s no header anymore, you can delete it.
joshliebe
left a comment
There was a problem hiding this comment.
Nothing blocking but added some comments
3825105 to
2fb5325
Compare
...ckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/inputscreen/ui/InputScreenFragment.kt
Show resolved
Hide resolved
...ckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/inputscreen/ui/InputScreenFragment.kt
Show resolved
Hide resolved
...kchat-impl/src/main/java/com/duckduckgo/duckchat/impl/inputscreen/ui/tabs/ChatTabFragment.kt
Show resolved
Hide resolved
2fb5325 to
595d297
Compare
joshliebe
left a comment
There was a problem hiding this comment.
Code changes look good and it works great, LGTM 🚀
Task/Issue URL: https://app.asana.com/1/137249556945/task/1213218251714196 ### Description With the addition of the recent chat overlay ([PR](#7685)), the Duck.ai logo should be hidden when chat suggestions are available and visible when they are not. The implementation simplifies the code by removing multiple boolean checks and accommodates for all different transition use cases and interactions with the DuckDuckGo logo (that shows on the Search tab). When moving from one tab to another: - If both logos are visible —> transition with animation - If one logo is visible while the other hidden by an overlay or favourites —> logo fades in/out - Both tap and swipe gestures follow same behaviour. Swiping animates progression. - Dismissing the overlay on the current tab shows the correct logo depending on which tab you are in ### Additional notes - Addressed the use cases where changing text on one tab, should reflect properly on the other tab when going back (logo animations should accommodate for what both tabs are showing) - Fixed an existing bug when we access the input screen from a website (click on the address bar while visiting a website). The search box is not empty but the autocomplete overlay is hidden, this breaks the logo swipe animation due to it relying on the box being empty to do transitions. ### Steps to test this PR Note: in order to facilitate testing, I created an additional branch with static data. Feel free to pull the `feature/youssef/do_not_merge/test_input_screen_logo_transition` branch to test with suggestions. - Pull the changes - Go to the input screen, make sure the omnibar is enabled - Switch between search tab and duck.ai tab with no overlays (both logos visible) - Write a search query for the auto complete to show up and switch between tabs to see fade in/out animations - Add favourite and switch between tabs - Write a search query in the search tab, toggle the duck.ai tab, delete the text from the chat box, swipe back to the search tab —> animation should play because autocomplete is now hidden. - Go to a website (example.com) tap on the address bar to show the input screen. Swipe between the tabs. Logo should animate properly (existing bug fixed) - Test with feature flag OFF —> No changes or regression from current production behaviour ### UI changes Demo for the full feature: https://github.com/user-attachments/assets/96abf963-59f5-4b2e-8742-753d957e1142 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches core UI state and animation logic for the input screen; regressions would primarily be visual/interaction-related (logo/overlay transitions) rather than data or security, but the behavior matrix is broad. > > **Overview** > Updates input-screen logo behavior so the Duck.ai logo hides when chat suggestions are present and logo transitions only *morph* when both the search and chat logos are visible; otherwise mode changes use simple fade in/out based on per-mode logo visibility. > > Simplifies gesture handling by removing swipe-start state flags and relying on `showSearchLogo`/`showChatLogo` in `onPageScrolled`/`onTabTapped`, adds `chatSuggestionsVisible` to `InputScreenVisibilityState`, and proactively clears stale search text when chat input is emptied to keep logo state/animations consistent (including the “opened from URL” case). Tests are updated to match the new command-emission rules. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 84ee39d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Youssef Keyrouz <ykeyrouz@Youssefs-MacBook-Pro.local>

Task/Issue URL: https://app.asana.com/1/137249556945/task/1213130409431278
Description
First part of the recent chats feature, which implements a chat suggestion list in the duck.ai tab of the input screen.
Introduces a new feature flag: aiChatSuggestions. When enabled, the AI chat suggestions (pinned and recent chats) in the input screen's duck.ai mode.
The UI is currently a work in progress and is using static test data.
Changes:
Next Steps
Steps to test this PR
Notes: in order to facilitate testing, I created an additional branch with static data. Please pull the
origin/feature/youssef/do_not_merge/recent_ai_chats_ui_test_databranch to test this PR with data and see the behavior. This would prevent having test data part of the merge and allow PR testing.UI changes
Note
Medium Risk
Feature-flagged but touches core input-screen UI state/animation and overlay interaction, which can introduce subtle regressions in tab switching, visibility, and touch handling.
Overview
Adds a new remote sub-feature flag,
DuckChatFeature.aiChatSuggestions, to gate an in-progress “recent/pinned chats” suggestions experience in the Duck.ai input-screen tab.When enabled, the input screen now includes a new
chatSuggestionsOverlay(RecyclerView + bottom fade/blur) and shared overlay animation logic, and updates logo/overlay/viewpager-interaction behavior to avoid showing the Duck.ai logo and to ensure autocomplete/suggestions overlays don’t overlap during mode switches.ChatTabFragmentis expanded to wire up aChatSuggestionsAdapterand observe a newInputScreenViewModel.chatSuggestionsflow (loading stubbed via a TODO), with new pin/chat icons and anitem_chat_suggestionrow layout; tests are updated to inject the new feature toggle dependency.Written by Cursor Bugbot for commit 595d297. This will update automatically on new commits. Configure here.