brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.61k stars 2.28k forks source link

History clearing for Brave AI chat #31441

Closed bbondy closed 1 year ago

bbondy commented 1 year ago

Add a checkbox to clear "Leo assistant history" in brave://settings/clearBrowserData (Both on Advanced and On Exit tabs):

Screenshot 2023-07-17 at 10 33 41 AM

It should call some empty handlers for now since there is no chat history to clear

The clear in brave://settings/leo-assistant should have only 1 link and it should have a dialog to confirm when you clear. This one will in the future clear history. But it will also continue to clear the opt-in status and reset any other future settings related to our browser AI.

Here is how the confirmation dialog should be:

Screenshot 2023-07-17 at 10 33 18 AM

Text should read:

Reset Brave Leo Resetting the Leo assistant will require you to opt-in to use Brave Leo in the future and will also clear your chat history. Clearing your chat history will delete all your previous conversations with Brave Leo. This action cannot be undone.

aguscruiz commented 1 year ago

I like having it as a checkbox on the clear browsing data panel.

Also, Added a separate button in Leo Settings to clear chat history so you users don't have to clear all Leo data along with it.

https://www.figma.com/file/h7fKSJF2P556bZWfyLTfwD/Brave-AI?type=design&node-id=1105%3A28709&mode=design&t=a3n39VowDTWloKOM-1

bbondy commented 1 year ago

Comment 0 is updated with the latest.

fmarier commented 1 year ago

I like having it as a checkbox on the clear browsing data panel.

That also seems to me like the most natural way to do this.

So maybe we could have two separate things:

bbondy commented 1 year ago

Updated comment 0 again with the latest understanding of the work. You should be good to go @vadimstruts

stephendonner commented 11 months ago

Verification PASSED using

Brave | 1.60.89 Chromium: 118.0.5993.70 (Official Build) beta (x86_64)
-- | --
Revision | 801f851e0c0664d110cccd46708cd084a83c3729
OS | macOS Version 11.7.10 (Build 20G1427)

Default (Brave Leo disabled) - PASSED

### Steps: 1. installed `1.60.89` 2. launched Brave 3. opened `brave://settings` and confirmed no `Leo` section 4. opened `brave://settings/clearBrowserData` and confirmed no `Leo` entry on neither the `Advanced` nor `On Exit` tabs example | example | example ---------|---------|---------- Screen Shot 2023-10-13 at 2 23 47 PM | Screen Shot 2023-10-13 at 2 24 20 PM | Screen Shot 2023-10-13 at 2 24 27 PM

Brave Leo enabled

brave://settings/clearBrowserData, Advanced - PASSED

1. installed `1.60.89` 2. set `brave://flags/#brave-ai-chat` to `Enabled` 3. set `brave://flags/#brave-ai-chat-history` to `Enabled` 4. clicked `Relaunch` 5. loaded `https://www.vox.com/future-perfect/2023/10/13/23914745/basic-income-radical-economy-poverty-capitalism-taxes` 6. clicked `Summarize this page` 7. manually entered one of the pre-suggested questions and pressed `return` 8. continued to ask it the remaining pre-suggested followup questions 9. opened `brave://settings/clearBrowserData` 10. clicked on the `Advanced` tab 11. selected `Brave Leo` 12. clicked `Clear data` 13. waited 14. opened a new tab with `https://www.vox.com/future-perfect/2023/10/13/23914745/basic-income-radical-economy-poverty-capitalism-taxes` 15. confirmed `Brave Leo` wasn't already open 16. clicked on `Brave Leo` in the sidebar ### Confirmed the article/conversation state was anew example | example | example | example | example | example ---------|----------|---------|----------|----------|-------- Screen Shot 2023-10-13 at 2 37 04 PM | Screen Shot 2023-10-13 at 2 39 41 PM | Screen Shot 2023-10-13 at 3 24 13 PM | Screen Shot 2023-10-13 at 3 57 39 PM | Screen Shot 2023-10-16 at 9 53 22 AM | Screen Shot 2023-10-16 at 9 53 29 AM

brave://settings/clearBrowserData, On exit - PASSED

1. installed `1.60.89` 2. set `brave://flags/#brave-ai-chat` to `Enabled` 3. set `brave://flags/#brave-ai-chat-history` to `Enabled` 4. clicked `Relaunch` 5. loaded `https://www.wired.com/story/xs-sneaky-new-ads-might-be-illegal/` 6. clicked `Summarize this page` 7. manually entered one of the pre-suggested questions and pressed `return` 8. continued to ask it the remaining pre-suggested followup questions 9. opened `brave://settings/clearBrowserData` 10. clicked on the `On exit` tab 11. clicked on `Brave Leo` 12. clicked on `Save` 18. quit Brave 19. relaunched 20. confirmed `Brave Leo`'s panel wasn't open 21. clicked on `Brave Leo` in the sidebar ### Confirmed the article/conversation state was anew example | example | example | example | example | example ---------|---------|----------|----------|---------|--------- Screen Shot 2023-10-13 at 2 37 04 PM | Screen Shot 2023-10-13 at 3 50 30 PM |Screen Shot 2023-10-13 at 3 55 45 PM | Screen Shot 2023-10-13 at 3 55 45 PM | Screen Shot 2023-10-16 at 10 05 12 AM | Screen Shot 2023-10-16 at 10 05 16 AM

brave://settings/leo-assistant - PASSED

### Steps: 1. installed `1.60.89` 2. launched Brave 3. enabled `AI chat` via `brave://flags` 4. clicked `Restart` 5. loaded `https://www.nbcnews.com/news/investigations/top-secret-hamas-documents-show-terrorists-intentionally-targeted-elem-rcna120310` 6. clicked on `Summarize this page` 7. clicked on the other `Suggested follow-ups` questions 8. opened `brave://settings/leo-assistant` 9. clicked on `Clear Leo data` 10. confirmed clear-data warning dialog 11. clicked `OK` 12. confirmed `Show Leo icon in the sidebar` was toggled to `Enabled` 13. confirmed `Show suggested prompts in the conversation` was toggled to `Disabled` 23. opened a new window 24. loaded `https://www.nbcnews.com/news/investigations/top-secret-hamas-documents-show-terrorists-intentionally-targeted-elem-rcna120310` again ### Confirmed I had to opt-in again to `Brave Leo` after successfully clearing `Leo` data example | example | example | example ---------|----------|---------|--------- Screen Shot 2023-10-13 at 4 58 10 PM | Screen Shot 2023-10-13 at 5 04 35 PM | Screen Shot 2023-10-13 at 5 06 33 PM | Screen Shot 2023-10-13 at 5 06 49 PM
Uni-verse commented 11 months ago

Verified on Samsung Galaxy S21 using version:

Brave   1.60.109 Chromium: 119.0.6045.59 (Official Build) (64-bit) 
Revision    fc399c7c433510eb03c2b35281bf8935804b99de
OS  Android 13; Build/TP1A.220624.014; 33; REL

Note: This is still in progress on Android and not ready for testing.

Encountered: https://github.com/brave/brave-browser/issues/34018