Fralleee / Fralleee/SwiftPaste

Adding Suggestions via Context Menu

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
enhancement idea
Dominant language
TypeScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

### Description

Adding new suggestions in the SwiftPaste extension requires users to visit the Options page, which can be tedious and disrupt the workflow. To improve the user experience, we should explore adding suggestions directly from the context menu when users select text.

### Suggested Solution

To enable adding suggestions via the context menu, I propose the following steps:

1. Enable the necessary permissions for the extension to access the context menu, specifically the `contextMenus` permission.
2. Implement a context menu listener that triggers when users right-click or perform a similar action on selected text.
3. Provide an option in the context menu to add the selected text as a suggestion.
4. When the user selects the "Add as Suggestion" option, prompt them for a key value or generate it dynamically based on the selected text or context. Consider providing an alert or a user-friendly input form to gather the critical value.
5. Store the new suggestion in the suggestions storage with the generated key and the selected text as the value.
6. Optionally, could you provide visual feedback to the user indicating that the suggestion has been successfully added?

**Expected Outcome**
- Users can add suggestions directly from the context menu, improving efficiency and eliminating the need to visit the Options page.
- The context menu will include an intuitive option for adding selected text as a suggestion.
- The user will be prompted for a critical value or generated dynamically based on the selected text or context.
- The new suggestion will be stored in the suggestions storage, making it available for future use.
- Users will receive visual feedback indicating the successful addition of the suggestion, if applicable.

**Additional Notes**

Consider conducting user testing to gather feedback on the usability and intuitiveness of the context menu feature. Ensure that the context menu option is only available when appropriate, such as when text is selected and within the scope of supported contexts. Handle edge cases and potential conflicts with existing context menu options to maintain a smooth user experience.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.