Skip to content

Add UI Components and feature flag for duck.ai recent chats#7685

Merged
YoussefKeyrouz merged 1 commit intodevelopfrom
feature/youssef/recent_ai_chats_ui
Feb 9, 2026
Merged

Add UI Components and feature flag for duck.ai recent chats#7685
YoussefKeyrouz merged 1 commit intodevelopfrom
feature/youssef/recent_ai_chats_ui

Conversation

@YoussefKeyrouz
Copy link
Collaborator

@YoussefKeyrouz YoussefKeyrouz commented Feb 5, 2026

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:

  • Added a new overlay in the input screen fragment for the chat suggestions. This follows the same pattern as the autocomplete overlay.
  • Add a recycler view (with its adapter and items) to the chatSuggestionsOverlay to display the list of recent chats.
  • Modified how the Logo visibility is handled. The Duck.ai chat logo should no longer be visible even if there are not recent chat items. Only the search logo will be visible (Follows iOS implementation)
  • Added icons for the chats (pin vs chat bubble)
  • Added the model for the Chat suggestion. It follow the expected structure for future integration with the JS frontend.
  • Modified the Input Screen View Model to load the static list.
  • All the changes are UX/fragments, Testing will be done through Maestro. Unit tests will be implemented when real data starts flowing through the view model.

Next Steps

  • Connect with the real frontend data once the JS webview interface is ready
  • Clicking on a recent chat should navigate you to the Duck.ai page and load the related chat.
  • Maestro tests

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_data branch to test this PR with data and see the behavior. This would prevent having test data part of the merge and allow PR testing.

  • Pull the changes and run the app
  • Go to feature flags settings and turn on "aiChatSuggestions" flag (it's off by default)
  • Go back to the input screen, make sure the omnibar is enabled
  • Switch to the "Duck.ai" tab. You should see a static list of chats, both pinned and recent.
  • Switch back and forth between search and chat to make sure the interaction and visibility is correct. You can test different behaviors on the search tab such as searching or adding a favorite. No impact should be observed.
  • If "aiChatSuggestions" is disabled, the app should behave as it is currently in production. No impact should be observed

UI changes

Before After
before after
after

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. ChatTabFragment is expanded to wire up a ChatSuggestionsAdapter and observe a new InputScreenViewModel.chatSuggestions flow (loading stubbed via a TODO), with new pin/chat icons and an item_chat_suggestion row 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.

Copy link
Collaborator Author

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

@YoussefKeyrouz YoussefKeyrouz force-pushed the feature/youssef/recent_ai_chats_ui branch from dbeb1b8 to 754abb3 Compare February 5, 2026 18:36
@YoussefKeyrouz YoussefKeyrouz marked this pull request as ready for review February 5, 2026 23:26
@joshliebe joshliebe self-assigned this Feb 6, 2026

// Chat Suggestions Tests

@SuppressLint("DenyListedApi")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can just suppress once at the top of the class

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Up to you

assertTrue(initialState.showChatLogo)

viewModel.onChatSelected()
advanceUntilIdle()
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove the advanceUntilIdle() in these tests, it’s not needed

app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />

<androidx.recyclerview.widget.RecyclerView
Copy link
Contributor

Choose a reason for hiding this comment

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

As mentioned, this causes sliding of the list. The behavior should be the same as the new tab page/autocomplete list.

Copy link
Contributor

Choose a reason for hiding this comment

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

The list also needs the bottom blur

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Compared to Figma, the header needs some bottom padding

Copy link
Contributor

Choose a reason for hiding this comment

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

The header is also static, it needs to scroll with the list

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Checked with @Bunn and there’s no header anymore, you can delete it.

Copy link
Contributor

@joshliebe joshliebe left a comment

Choose a reason for hiding this comment

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

Nothing blocking but added some comments

@YoussefKeyrouz YoussefKeyrouz force-pushed the feature/youssef/recent_ai_chats_ui branch 2 times, most recently from 3825105 to 2fb5325 Compare February 9, 2026 07:22
Copy link
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 3 potential issues.

@YoussefKeyrouz YoussefKeyrouz force-pushed the feature/youssef/recent_ai_chats_ui branch from 2fb5325 to 595d297 Compare February 9, 2026 08:15
@joshliebe joshliebe assigned joshliebe and unassigned joshliebe Feb 9, 2026
Copy link
Contributor

@joshliebe joshliebe left a comment

Choose a reason for hiding this comment

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

Code changes look good and it works great, LGTM 🚀

@YoussefKeyrouz YoussefKeyrouz merged commit 79e69b4 into develop Feb 9, 2026
24 checks passed
@YoussefKeyrouz YoussefKeyrouz deleted the feature/youssef/recent_ai_chats_ui branch February 9, 2026 22:10
YoussefKeyrouz added a commit that referenced this pull request Feb 13, 2026
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>
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