Fralleee / Fralleee/SwiftPaste

Nested Suggestions

Open
#13 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

Implement support for nested suggestions within the SwiftPaste component. This feature would allow specific suggestions to have subcategories or variations grouped under a main suggestion. For example, a suggestion like "Name" could have nested variations such as "First Name," "Last Name," and "Full Name." Users could navigate and select specific subcategories within the suggestion hierarchy.

### Suggested Solution

To implement nested suggestions in the SwiftPaste component, the following steps need to be taken:

1. Storage Restructuring:
- Modify the storage structure to support a new data type: `string | array`. This allows for storing both single-value and nested suggestions with multiple variations.
- Implement logic to determine how to handle the stored value based on whether it's a string or an array. For example, when a single-value suggestion is selected, it can be directly inserted. When a nested suggestion is selected, the variations can be displayed for further selection.

2. SwiftPaste Component Rewrite:
- Update the SwiftPaste component to accommodate the new storage structure and handle nested suggestions.
- Implement the necessary UI changes to support nested suggestion navigation and display.
- Add functionality to handle opening new popups or expanding the current popup when navigating into nested suggestions.

3. Positioning and Navigation Logic:
- Review and update the positioning logic to ensure proper display and alignment of nested suggestions within the popup.
- Consider the layout and interaction design for nested suggestion navigation, such as using arrow keys or mouse clicks to navigate between variations.
- Implement search functionality to allow users to find specific suggestions or variations within the nested structure quickly.

**Expected Outcome**
1. Restructured storage that supports single-value and nested suggestions with multiple variations.
2. SwiftPaste component updated to handle nested suggestions and provide a user-friendly interface for navigation.
3. Positioning logic adjusted to accommodate nested suggestions and ensure proper display.
4. Navigation functionality implemented to allow users to explore and select variations within nested suggestions.
5. Search feature added to facilitate quick access to specific suggestions or variations within the nested structure.

**Additional Notes**
- Care should be taken to ensure the performance and responsiveness of the SwiftPaste component when handling nested suggestions and navigation.
- Consider user testing and feedback to refine the design and interaction of the nested suggestion feature.
- Maintain backward compatibility with existing single-value suggestions to ensure a smooth transition for users.

This enhancement would significantly enhance the capabilities of the SwiftPaste component by allowing the storage and display of nested suggestions with multiple variations. It would give users more options and flexibility when selecting and utilizing suggestions.

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.