Commit graph

12 commits

Author SHA1 Message Date
ByteAtATime
59174dddca
feat(snippets): reduce delay before typing
Previously, we had a 50ms delay between deleting and pasting, as well as a 10ms delay between each keypress. This was intended to be on the safe side and sure the contents get resolved before pasting. However, the delay was a bit overkill, and this commit changes it to 5ms/2ms.
2025-06-25 11:03:52 -07:00
ByteAtATime
b1c4693998
refactor(snippets): simplify key mapping and state management
This commit replaces the large, brittle `match` statements for key mapping with `lazy_static` `HashMap`s, making the logic declarative and much easier to update.
2025-06-25 10:34:15 -07:00
ByteAtATime
3054b5bfb1
refactor(snippets): extract clipboard handling into a separate function
This commit refactors the `inject_text` method in both `RdevInputManager` and `EvdevInputManager` to utilize a new `with_clipboard_text` function for clipboard operations.
2025-06-25 10:15:07 -07:00
ByteAtATime
a34968f851
feat(snippets): use clipboard to type text
This commit changes the `inject_text` method in both `RdevInputManager` and `EvdevInputManager` to utilize clipboard functionality for text input. This allows for both instantaneous snippet resolving as well as the ability to type symbols not on the keyboard (e.g. ⌘)
2025-06-25 10:07:49 -07:00
ByteAtATime
6365d18cdb
style(backend): formatting 2025-06-25 08:38:24 -07:00
ByteAtATime
56813684e1
feat(snippets): add import snippet feature
Currently, our application does not support snippets without keywords. We will have to figure out why it's possible to have a text replacement item without the text to replace.
2025-06-25 08:38:14 -07:00
ByteAtATime
b68c4ccb6e
feat(snippets): implement snippet placeholder resolution
This commit introduces a new method to parse and resolve placeholders in snippet content, allowing for dynamic content insertion such as clipboard text, current date, and time. Additionally, it implements cursor positioning for better user experience during snippet expansion.
2025-06-24 20:50:55 -07:00
ByteAtATime
77f7f8c113
fix(snippets): adjust evdev keycode offset for input handling 2025-06-24 20:35:57 -07:00
ByteAtATime
bf6d9a960a
feat(snippets):
delete keyword after triggering snippet

This commit improves the `inject_text` method to handle backspace characters correctly by buffering text input.
2025-06-24 20:26:44 -07:00
ByteAtATime
de0b26e8ae
feat(snippets): add create snippet form
This commit introduces a new `SnippetForm` component for creating snippets, updates the `ViewManager` to handle the new 'create-snippet-form' view, and integrates the form into the main page routing.
2025-06-24 20:00:15 -07:00
ByteAtATime
7088cb17fd
feat(snippets): Implement core expansion engine
This commit implements implements the `inject_text` method using the `enigo` crate for input simulation. A new `ExpansionEngine` is created to listen for keyboard input, maintain a buffer of recent characters, and check against the database for a matching keyword to trigger an expansion.
2025-06-24 18:59:10 -07:00
ByteAtATime
21cd217a26
feat(snippets): implement keyboard event handling
This commit sets up the codebase for the Snippets feature. Specifically, it implements an InputManager trait, which listens for, well, inputs. In the future, we will be using this to keep track of the user's keypresses, triggering the text expansion when the trigger word is entered.
2025-06-24 18:44:22 -07:00