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

[Spike] Action Menu on text highlight #9425

Open
1 task
Pashaminkovsky opened this issue Nov 7, 2024 · 4 comments
Open
1 task

[Spike] Action Menu on text highlight #9425

Pashaminkovsky opened this issue Nov 7, 2024 · 4 comments

Comments

@Pashaminkovsky
Copy link
Collaborator

Pashaminkovsky commented Nov 7, 2024

Motivation

We're looking to improve AI writing, translation, and summarization mods. The goal of this spike is to gauge the complexity of implementing an "Action Menu" similar to what Grammarly and moly.ai have implemented (see screenshot below).

The ideal flow would be:

  1. User highlights text
  2. Action Menu opens near text
  3. User can choose an action, type a prompt, etc.
  4. User is able to drag the Action Menu to relocate it.
  5. Action Menu presents results to the user, who can can choose to insert text at cursor, or choose other actions.

Screenshot 2024-11-06 at 9.01.55 PM.png

Note: Compatability with Google Workspace is out of scope, the screenshot is meant to highlight the Action Menu.

The Action Menu would appear as an option in the "New Mod" selection in the Page Editor, and would be mutually exclusive with the Text Selection Menu (emojis that appear on highlight).

The exact naming of "Action Menu" is tbd -- we're open to suggestions.

Acceptance Criteria

  • T shirt sizing on implementation, and high-level steps / constraints / unknowns are mapped out. The main pieces to size are:
  1. Action Menu appears next to text when text is highlighted.
  2. Selecting a mod from the Action Menu to trigger the mod (along w/ any input into the text box in the Action Menu)
  3. Ability to drag the Action Menu to relocate it on the screen.
  4. Ability to show Mod response in the Action Menu (e.g. user highlights text, clicks "improve to make more confident" in Action Menu, response from Write Assist mod populates in field in Action Menu for the user to preview).
  5. Ability to insert the Mod response from Bump @fortawesome/free-brands-svg-icons from 5.14.0 to 5.15.0 #4 at the cursor with a button click.
  6. Ability to automatically replace highlighted text with Mod response (e.g. user highlights text, clicks "translate to English", highlighted text is automatically replaced with Mod response).
  7. Ability to close the Action Menu by clicking "x".

Timebox

8 hours

@grahamlangford grahamlangford added specification required blocked For denoting when an issue is blocked by an external dependency (ex. zendesk) and removed blocked For denoting when an issue is blocked by an external dependency (ex. zendesk) specification required labels Nov 7, 2024
@twschiller
Copy link
Contributor

twschiller commented Nov 9, 2024

The Action Menu would appear as an option in the "New Mod" selection in the page editor, and would be mutually exclusive with the Text Selection Menu (emojis that appear on highlight).

@Pashaminkovsky I recommend we put the UX considerations through a PRD. There's a lot to sort out with how this feature interacts with other features and how mods interact with each other.

Or are you just looking for engineering to determine the feasibility for adding a draggable floating panel to the page?

The kinds of things to sort out are:

  • I'm assuming the panel container is fixed, but the content is configurable? E.g., using the Document Builder
  • Or are you imagining the mod contributes actions to the action menu (like what we do for the Snippet Shortcut Menu, Quick Bar, etc.)

@grahamlangford
Copy link
Collaborator

Or are you just looking for engineering to determine the feasibility for adding a draggable floating panel to the page?

This was my understanding. Also, is "draggable" a requirement? That wasn't clear to me based on the description

@Pashaminkovsky
Copy link
Collaborator Author

Pashaminkovsky commented Nov 12, 2024

Or are you just looking for engineering to determine the feasibility for adding a draggable floating panel to the page?

Correct this is a feasibility spike; we'll have the PRD once we sync w/ customer on their requirements.

Is "draggable" a requirement?

"Draggable" is in scope for this spike; I added it more explicitly to acceptance criteria of the spike. TBD whether it is actually a requirement for customer. cc @fungairino

I'm assuming the panel container is fixed, but the content is configurable? E.g., using the Document Builder

Correct, this was my assumption as well. Based on what we've heard so far about the customer reqs I think this suffices and would be simplest to maintain.

@grahamlangford
Copy link
Collaborator

  1. Action Menu appears next to text when text is highlighted.
  • ✅ Same logic as the Text Selection Menu
  1. Selecting a mod from the Action Menu to trigger the mod (along w/ any input into the text box in the Action Menu)
  • ✅ Again, same logic as the Text Selection Menu
  1. Ability to drag the Action Menu to relocate it on the screen.
  • ✅ Same logic as the Floating Action Button
  1. Ability to show Mod response in the Action Menu (e.g. user highlights text, clicks "improve to make more confident" in Action Menu, response from Write Assist mod populates in field in Action Menu for the user to preview).
  1. Ability to insert the Mod response from Bump @fortawesome/free-brands-svg-icons from 5.14.0 to 5.15.0 #4 at the cursor with a button click.
  • ✅ Essentially the same logic as Insert at Cursor
  1. Ability to automatically replace highlighted text with Mod response (e.g. user highlights text, clicks "translate to English", highlighted text is automatically replaced with Mod response).
  1. Ability to close the Action Menu by clicking "x".
  • ✅ Trivial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants