Skip to content
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

Add AI Chat toolbar #3470

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open

Add AI Chat toolbar #3470

wants to merge 37 commits into from

Conversation

Bunn
Copy link
Collaborator

@Bunn Bunn commented Oct 29, 2024

Task/Issue URL: https://app.asana.com/0/1204167627774280/1208607376873996/f
Tech Design URL:
CC:

Description:
Add AI Chat toolbar icon onboarding flow

Steps to Test This PR:

  1. To start fresh, navigate to the Debug menu and select "AI Chat Reset."
  2. Open the website: https://duck.ai/.
  3. If this is your first time using Duck Chat, complete the onboarding process, then open it again in a new tab.
  4. Check for a popover prompting you to add the toolbar icon.
  5. Click on "Add Shortcut."
  6. Confirm that you see a confirmation message and that the icon remains in the window toolbar.
  7. Verify that in Settings -> AI Chat, the option to display the icon is selected.
  8. Click the icon and ensure that you are redirected to the AI Chat webpage.

  1. Repeat the steps from the first block of tests, but this time open multiple windows. Ensure that the popover is only displayed in the active window.

  1. Follow the same steps as in the first block of tests, but instead of accepting the popover modal, click "No Thanks."
  2. Confirm that the icon is not added to the toolbar.
  3. Check that in Settings -> AI Chat, the option for the toolbar icon is not selected.

Copy link

github-actions bot commented Oct 29, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.
Messages
📖

You seem to be updating localized strings. Make sure that you request translations and include translated strings before you ship your change. See Localization Guidelines for more information.

Generated by 🚫 dangerJS against eb5c440

Copy link
Collaborator

@jotaemepereira jotaemepereira left a comment

Choose a reason for hiding this comment

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

@Bunn Functionality-wise, it looks excellent 👍🏼 .

I’ve added a comment around tests. What do you think of implementing the suggestions before merging?

DuckDuckGo/AIChat/AIChatDebugMenu.swift Show resolved Hide resolved
@@ -95,9 +88,44 @@ class AIChatMenuConfigurationTests: XCTestCase {
}
cancellable.cancel()
}

func testShouldNotDisplayToolbarShortcutWhenDisabled() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ There are some missing test cases here. The logic to display or not display the toolbar or the application menu shortcut also relies on the remote settings; we are always setting those to true.

We should have the following tests:

  • We do not display the toolbar shortcut when the remote flag is true, but the storage is false
  • We do not display the toolbar when the remote setting is false, and the storage is true
  • The same for the shortcut

The same goes for showing the toolbar and shortcut. We should be explicit that the remote settings flags need to be false if you take a look at the test now, it seems that you only need the storage flag.

@Bunn Bunn changed the base branch from release/1.112.0 to main October 30, 2024 18:34
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.

3 participants