brave / brave-browser

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

Introduce slash tools #37294

Closed nullhook closed 6 months ago

nullhook commented 7 months ago

We want to give users the ability to select quick actions with their prompts, similar to right-click actions, but from Leo's sidepanel WebUI.

This needs to function well on mobile and possibly have the following UX nuances:

  1. Users should be able to remove the action type label from the input box.
  2. Pressing backspace on an empty input box with an action type selected should remove it.
  3. Typing "/" should open the tools menu and allow users to filter.
nullhook commented 7 months ago

cc @aguscruiz to provide designs.

aguscruiz commented 7 months ago

Design system https://www.figma.com/file/MNwi0uwXNhkAbPiJ86G4vm/%E2%9C%A8-Leo?type=design&node-id=1506%3A8040&mode=design&t=8gXTvsbx8ZIUXpoy-1

Flows https://www.figma.com/file/m0Gdbf0wtqyfEFGm32VLLc/Leo?type=design&node-id=65-31891&mode=design

Input box

Tools menu

Before / after on Android image

stephendonner commented 6 months ago

Verified PASSED using

Brave | 1.67.82 Chromium: 125.0.6422.41 (Official Build) beta (64-bit)
-- | --
Revision | cbebefd4c702801af65a196ba9701a907ed0d292
OS | Windows 10 Version 22H2 (Build 19045.4355)

Quick Actions

Explain - PASSED

### Steps: 1. loaded https://en.wikipedia.org/wiki/String_theory 2. copied the first couple of paragraphs 3. typed `/` in the `Enter a prompt here` textbox 4. pressed `enter` example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/d70df9d3-fae6-4e88-800a-6dcae7ea9b03) | ![image](https://github.com/brave/brave-browser/assets/387249/623a5066-b838-420f-b83f-4dc8b5ce9f4b)

Rewrite - PASSED

### `Paraphrase` ### Steps: 1. loaded https://www.britannica.com/topic/shogun 6. selected and copied a piece of text 7. typed `/` in the `Leo` input box 8. chose `REWRITE > PARAPHRASE` example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/e2a77f3b-b02e-42fa-9b33-ac7e7fcc1270) | ![image](https://github.com/brave/brave-browser/assets/387249/f42491d4-db86-4dfe-9840-b54e31381e71) ### `Improve` 1. loaded https://www.britannica.com/topic/shogun 2. selected and copied a piece of text 3. typed `/` in the `Leo` input box 4. chose `REWRITE > IMPROVE` example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/2b82a182-be92-42f1-a83f-01e0678418b2) | ![image](https://github.com/brave/brave-browser/assets/387249/c9b9c9ef-b73f-4e65-a36c-1dd512ea8654)

Change Tone - PASSED

### Steps: 1. loaded https://en.wikipedia.org/wiki/Gardening 9. selected and copied a block of text 10. triggered the respective `REWRITE` -> `TONE` option, below ### `Academic` example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/b03c9855-8561-489f-adc0-afc07122b007) | ![image](https://github.com/brave/brave-browser/assets/387249/cd26050e-772e-4639-a0ed-037dc57b08c3) ### `Professional` example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/45b2a0a5-a9ff-4ce2-b44e-504ba3ece1aa) | ![image](https://github.com/brave/brave-browser/assets/387249/e874e571-3836-4d48-a7a0-93a5a57a0849) ### `Persuasive` expand | expand ---------|--------- ![image](https://github.com/brave/brave-browser/assets/387249/0e4705cf-4ed5-4a21-a9a3-db3201c7a34b) | ![image](https://github.com/brave/brave-browser/assets/387249/de265b88-6365-4b83-a379-a2cf780f5a98) ### `Casual` example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/4035df35-7b21-4583-a16e-c0642958ae44) | ![image](https://github.com/brave/brave-browser/assets/387249/f13feee9-947d-439c-9483-ac5900bec366) ### `Funny` example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/dacf4a0e-f97f-49c3-836e-de8ba5b9d710) | ![image](https://github.com/brave/brave-browser/assets/387249/3cad9221-c23d-43fe-ba9a-113b8b029e81) ### `Shorten` example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/0dbee609-3687-4893-ba27-9b83b3a8f092) | ![image](https://github.com/brave/brave-browser/assets/387249/f09a3ba2-5c00-4957-83a9-d638f6cc37fe) ### `Expand` example | example -----------|--------- ![image](https://github.com/brave/brave-browser/assets/387249/3370464e-eb33-47e9-acef-ad77ee7b25e7) | ![image](https://github.com/brave/brave-browser/assets/387249/1b6a4060-29cc-43ee-9aca-9a9de0caf236)

Create - PASSED

### `Tagline` - `PASSED`
example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/d3234b79-00bf-4344-a23d-8c51cc1ba940) | ![image](https://github.com/brave/brave-browser/assets/387249/49262480-5da0-47df-8610-52135a80abd0)
## `Social Media` - `PASSED`
### `Short post` ### Steps: 1. loaded https://www.wired.com/story/google-io-end-of-google-search/ 11. selected a portion of text 12. pressed `/` 13. typed `short post` 14. pasted the copied text 15. hit `enter` ### Confirmed short social-media post with hashtags example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/52fb8e27-dedc-4ea7-8d7a-8c0dabb4adc0) | ![image](https://github.com/brave/brave-browser/assets/387249/7d368cd8-a94f-4c39-b3dc-981d360ce4ef) ### `Long post` ### Steps: 1. loaded https://www.wired.com/story/google-io-end-of-google-search/ 3. selected a portion of text 4. clicked on `/` 6. selected `long post` 7. pasted the copied text 8. hit `enter` ### Confirmed long social-media post with hashtags example | example ----------|---------- ![image](https://github.com/brave/brave-browser/assets/387249/ba24b782-5a68-4fa7-9d35-e88d0264bbf6) | ![image](https://github.com/brave/brave-browser/assets/387249/93a4458e-ce51-4972-8040-cf8cfe454eb8)

/-tools UX - PASSED

### type “/” select an action the dropdown should close https://github.com/brave/brave-browser/assets/387249/acd9159f-d326-444d-863f-8ff41c6e7090 ### type “/” scroll in the dropdown up and down and put your tap outside of the dropdown (it should close) https://github.com/brave/brave-browser/assets/387249/d54b0066-cbaf-4fd4-ac01-d138a5228c1b ### type "/" select an action and press "x" button https://github.com/brave/brave-browser/assets/387249/6f74654b-583d-4075-9771-457bcc7b5029 ### type "/" select an action with your keyboard ### click "/" select an action ### type "/" select an action and remove it. click on "/" select an action and remove it while the action is selected pressing backspace on an empty input box should remove actions https://github.com/brave/brave-browser/assets/387249/c88ef3d9-0b65-4994-a2c9-4cafba24164b type "/" and start filtering https://github.com/brave/brave-browser/assets/387249/7b325848-0ac1-45f4-bb99-f5807296b33c

Accessibility - PASSED

### `tab` ![image](https://github.com/brave/brave-browser/assets/387249/5b0d3cae-18b2-41cc-bb11-94667d661fd8) ### `shift`+ `tab` ![image](https://github.com/brave/brave-browser/assets/387249/0c4ffaec-53f1-4072-8372-9b47541bc85f) ### `spacebar` ![image](https://github.com/brave/brave-browser/assets/387249/5f005c7c-de73-498a-b3ca-2f314de355f2)

Dark mode - PASSED

`Top` | `Bottom` | Invoked via `/` | `Rewrite` mode | `Paraphrase` | `tabindex` / focus ring ------|-----------|-----------------|------------------|---------------|-------------------------- ![image](https://github.com/brave/brave-browser/assets/387249/a21e1fb3-eabd-481c-a08e-80d2558b3c82) | ![image](https://github.com/brave/brave-browser/assets/387249/243140d1-40b7-47fb-83c4-62c1991dacc9) | ![image](https://github.com/brave/brave-browser/assets/387249/05e4e8b0-9f4e-4eb9-8129-164b85b96157) | ![image](https://github.com/brave/brave-browser/assets/387249/eb6122ee-face-412f-ab10-435f018d9365) | ![image](https://github.com/brave/brave-browser/assets/387249/32bdc7a9-fea3-4a4f-9907-ee7d709c8b2d) | ![image](https://github.com/brave/brave-browser/assets/387249/93b2b938-bb7d-429d-b66d-2737494383e3)

Logged:

GeetaSarvadnya commented 5 months ago

Verification PASSED on Vivo x70 pro version 12 running Bravemonoarm64.apk_1.67.100

Quick Actions

Explain - PASSED

### Steps: 1. loaded https://en.wikipedia.org/wiki/String_theory 2. copied the first couple of paragraphs 3. typed `/` in the `Enter a prompt here` textbox 4. pressed `enter` example | example | example | example | example ----------|-----------|----------|-----------|---------- ![Screenshot_20240604_200918](https://github.com/brave/brave-browser/assets/38657976/016fcc9d-a73e-4f93-9792-894c08ffcf04) | ![Screenshot_20240604_200924](https://github.com/brave/brave-browser/assets/38657976/55c8cc56-501f-440d-a99a-57485aa95340) | ![Screenshot_20240604_201029](https://github.com/brave/brave-browser/assets/38657976/37d3d665-a010-403e-84db-91569d58bf17) | ![Screenshot_20240604_201034](https://github.com/brave/brave-browser/assets/38657976/e751b3e5-b382-4f2b-a87c-55131948ce6b) | ![Screenshot_20240604_201039](https://github.com/brave/brave-browser/assets/38657976/047f0b55-6416-41d8-902b-a179f58591cb)

Rewrite - PASSED

### `Paraphrase` ### Steps: 1. loaded https://www.britannica.com/topic/shogun 6. selected and copied a piece of text 7. typed `/` in the `Leo` input box 8. chose `REWRITE > PARAPHRASE` example | example | example ----------|-----------|------------- ![Screenshot_20240604_211435](https://github.com/brave/brave-browser/assets/38657976/324e84e6-2612-4a5a-95af-83da1649afd2) | ![Screenshot_20240604_211609](https://github.com/brave/brave-browser/assets/38657976/bffd69d2-5243-48d3-a19e-3660775d3eff) | ![Screenshot_20240604_211627](https://github.com/brave/brave-browser/assets/38657976/99580c7a-34c5-44fb-b0a1-f4684bf21b15) ### `Improve` 1. loaded https://www.britannica.com/topic/shogun 2. selected and copied a piece of text 3. typed `/` in the `Leo` input box 4. chose `REWRITE > IMPROVE` example | example | example ----------|-----------|------------- ![Screenshot_20240604_211715](https://github.com/brave/brave-browser/assets/38657976/cfcf71e6-663f-4a28-996c-3e7dc6338338) | ![Screenshot_20240604_211737](https://github.com/brave/brave-browser/assets/38657976/711c542b-5492-4fee-9865-825d61a0c7fe) | ![Screenshot_20240604_211753](https://github.com/brave/brave-browser/assets/38657976/aca68e99-e8f4-4ce3-b95a-32987971662c)

Change Tone - PASSED

### Steps: 1. loaded https://en.wikipedia.org/wiki/Gardening 9. selected and copied a block of text 10. triggered the respective `REWRITE` -> `TONE` option, below ### `Academic` example | example | example ----------|-----------|---------- ![Screenshot_20240604_213140](https://github.com/brave/brave-browser/assets/38657976/bc6e10ab-6d14-42f7-94db-de5c031183c6) | ![Screenshot_20240604_213214](https://github.com/brave/brave-browser/assets/38657976/3e904558-08dc-4697-bb0c-bf803b10a5bb) | ![Screenshot_20240604_213240](https://github.com/brave/brave-browser/assets/38657976/9d2a1263-5b7a-4e30-962d-e707640c912d) ### `Professional` example | example | example ----------|-----------|------------ ![Screenshot_20240604_213308](https://github.com/brave/brave-browser/assets/38657976/5d2270c9-7ef3-4c1b-940f-16255ffe0555) | ![Screenshot_20240604_213339](https://github.com/brave/brave-browser/assets/38657976/767c60e8-975b-4e19-934a-e97648a0bd33) | ![Screenshot_20240604_213401](https://github.com/brave/brave-browser/assets/38657976/acc04dfb-0814-4128-bf2c-89186475d26a) ### `Persuasive` expand | expand | example ---------|---------|---------- ![Screenshot_20240604_213442](https://github.com/brave/brave-browser/assets/38657976/93752b16-3e2c-4e47-8c57-3bf7a5cabf93) | ![Screenshot_20240604_213507](https://github.com/brave/brave-browser/assets/38657976/b828ad46-5ca4-415b-b20c-3324069711b0) | ![Screenshot_20240604_213535](https://github.com/brave/brave-browser/assets/38657976/9a753367-9368-4098-be5e-d17d62803d40) ### `Casual` expand | expand | example ---------|---------|---------- ![Screenshot_20240604_213635](https://github.com/brave/brave-browser/assets/38657976/69faab88-b774-4361-a253-3a35079beacf) | ![Screenshot_20240604_213655](https://github.com/brave/brave-browser/assets/38657976/de42c78b-b385-4643-b28b-4994eaf759ce) | ![Screenshot_20240604_213719](https://github.com/brave/brave-browser/assets/38657976/0868cbe3-caeb-423c-b464-f81f9dadc8ad) ### `Funny` expand | expand | example ---------|---------|---------- ![Screenshot_20240605_135556](https://github.com/brave/brave-browser/assets/38657976/5027464e-298c-4e06-8951-c91d713276f9) | ![Screenshot_20240605_135515](https://github.com/brave/brave-browser/assets/38657976/624860d3-1ce2-4110-a9c2-2086e0ef1d8d) | ![Screenshot_20240605_135535](https://github.com/brave/brave-browser/assets/38657976/26724dad-9199-4192-9812-9c624def9db1) ### `Shorten` expand | expand | example ---------|---------|---------- ![Screenshot_20240605_151856](https://github.com/brave/brave-browser/assets/38657976/0715429c-5b34-499a-87d0-2dc2342b6102) | ![Screenshot_20240605_151912](https://github.com/brave/brave-browser/assets/38657976/6125c70e-6322-4a04-acab-5710b1032c86) | ![Screenshot_20240605_151931](https://github.com/brave/brave-browser/assets/38657976/3dda87e7-fa37-4d84-a283-5c50031dbad0) ### `Expand` expand | expand | example | example ---------|---------|-----------|---------- ![Screenshot_20240605_152038](https://github.com/brave/brave-browser/assets/38657976/5c0201c0-0357-44b6-bb46-aa3e94979f8d) | ![Screenshot_20240605_152104](https://github.com/brave/brave-browser/assets/38657976/c590f122-a266-4a4c-b62d-d88502fcd2cc) | ![Screenshot_20240605_152123](https://github.com/brave/brave-browser/assets/38657976/f850a94c-f084-4cfd-8aa5-e865c8a04d57) | ![Screenshot_20240605_152128](https://github.com/brave/brave-browser/assets/38657976/ac64e5dd-e362-40a9-a609-2c3fc56992f7)

Dark mode - PASSED

example | example | example | example | example ----------|-----------|----------|-----------|------------ ![Screenshot_20240605_154624](https://github.com/brave/brave-browser/assets/38657976/5d17ef9d-8ca4-4c7a-8424-6cbced8fdfc8) | ![Screenshot_20240605_154635](https://github.com/brave/brave-browser/assets/38657976/f3f880f5-6294-42fa-a089-1121744f8639) | ![Screenshot_20240605_154654](https://github.com/brave/brave-browser/assets/38657976/37508ad4-7c3a-45ad-8a5f-372d97d00a2e) | ![Screenshot_20240605_154854](https://github.com/brave/brave-browser/assets/38657976/c533be47-8b82-45af-8f39-68c72e310ea1) | ![Screenshot_20240605_154909](https://github.com/brave/brave-browser/assets/38657976/18aefa1f-ba31-4cc9-bc86-6a5c7f000967)

Create - PASSED

### `Tagline` - `PASSED`
example | example | example ----------|----------|---------- ![Screenshot_20240605_180352](https://github.com/brave/brave-browser/assets/38657976/d9f6f0c6-c164-42db-a468-b9320736810e) | ![Screenshot_20240605_180415](https://github.com/brave/brave-browser/assets/38657976/c1725fbd-e8a2-49bb-931d-1d4f81511405) | ![Screenshot_20240605_180612](https://github.com/brave/brave-browser/assets/38657976/4a307ec9-41db-4996-b6ff-1a9f5313e496)
## `Social Media` - `PASSED`
### `Short post` ### Steps: 1. loaded https://www.wired.com/story/google-io-end-of-google-search/ 11. selected a portion of text 12. pressed `/` 13. typed `short post` 14. pasted the copied text 15. hit `enter` ### Confirmed short social-media post with hashtags example | example | example ----------|----------|--------- ![Screenshot_20240605_210027](https://github.com/brave/brave-browser/assets/38657976/71648032-76a4-4c7a-b2f8-c45c662b950d) | ![Screenshot_20240605_210048](https://github.com/brave/brave-browser/assets/38657976/1c7b5d56-7ce4-4c78-b398-6c125eb23b6a) | ![Screenshot_20240605_210116](https://github.com/brave/brave-browser/assets/38657976/7e2ae3a2-fcd1-49ea-9508-3e270c18d738) ### `Long post` ### Steps: 1. loaded https://www.wired.com/story/google-io-end-of-google-search/ 3. selected a portion of text 4. clicked on `/` 6. selected `long post` 7. pasted the copied text 8. hit `enter` ### Confirmed long social-media post with hashtags example | example | example | example ----------|----------|-----------|---------- ![Screenshot_20240605_205826](https://github.com/brave/brave-browser/assets/38657976/56fd6649-0fce-4815-a47e-245976aed050) | ![Screenshot_20240605_205902](https://github.com/brave/brave-browser/assets/38657976/1f756b27-eaff-4e01-abdf-d244a4f1e87a) | ![Screenshot_20240605_205938](https://github.com/brave/brave-browser/assets/38657976/2f05e4cf-ebf6-4d83-bbd3-0075685a094b) | ![Screenshot_20240605_205943](https://github.com/brave/brave-browser/assets/38657976/2da01adb-7a71-4f50-a1fc-93b069a6dcb5)

/-tools UX - PASSED

### type “/” select an action the dropdown should close https://github.com/brave/brave-browser/assets/38657976/a361ab3a-fb5a-4d29-a6f7-8ff45a38c611 ### type “/” scroll in the dropdown up and down and put your tap outside of the dropdown (it should close) https://github.com/brave/brave-browser/assets/38657976/0636598a-298a-4c9f-a79a-b9f10458b182 ### type "/" select an action and press "x" button https://github.com/brave/brave-browser/assets/38657976/b1cf80bf-062e-4ac4-8972-9efe3d7a3c51 ### type "/" select an action with your keyboard ### click "/" select an action ### type "/" select an action and remove it. click on "/" select an action and remove it while the action is selected pressing backspace on an empty input box should remove actions https://github.com/brave/brave-browser/assets/38657976/14f222a0-2ecc-4d7e-a755-5034cafcc6eb type "/" and start filtering https://github.com/brave/brave-browser/assets/38657976/9ff17c73-bc0c-431c-a209-9c1e40238dff