Commit graph

20 commits

Author SHA1 Message Date
ByteAtATime
cfbd31f51b
refactor(backend): implement Storable trait and refactor database operations
This commit introduces the `Storable` trait to standardize the conversion of database rows into application data structures. It refactors existing manager implementations (`AiUsageManager`, `FrecencyManager`, `QuicklinkManager`, `SnippetManager`) to utilize the new `query` and `execute` methods in the `Store` struct.
2025-06-29 16:11:34 -07:00
ByteAtATime
7156827585
refactor(backend): abstract database logic into generic Store
This commit introduces a generic `Store` struct to handle all common database operations, such as connection management and schema initialization. All existing manager structs (`QuicklinkManager`, `SnippetManager`, `FrecencyManager`, `ClipboardHistoryManager`, `AiUsageManager`) have been refactored to use this new abstraction.
2025-06-29 15:48:03 -07:00
ByteAtATime
323697284b
style: formatting 2025-06-29 11:18:49 -07:00
ByteAtATime
2437ad7d61
feat(snippets): implement dynamic placeholders and modifiers
This commit implements a system for dynamic snippet placeholders, including support for date/time manipulation, clipboard history, and nested snippets. It also adds a flexible modifier system (`uppercase`, `trim`, `percent-encode`, `json-stringify`) that can be chained and applied to any placeholder.
2025-06-26 15:34:33 -07:00
ByteAtATime
e32cc6223d
feat(snippets): implement Search Snippets command
This commit implements the "Search Snippets" feature, providing a dedicated user interface accessible from the main command palette. The new view allows users to search their snippets by name, keyword, or content and see details like usage statistics. This change adds the necessary backend logic for searching and tracking usage, and a new frontend component.
2025-06-25 11:32:02 -07:00
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
61c804235c
chore(snippets): remove unused code 2025-06-24 20:28:29 -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
d72b4dd450
feat(snippets): implement backend crud operations
This commit creates the basic CRUD functions (`create`, `list`, `update`, `delete`) as Tauri commands.
2025-06-24 18:50:13 -07:00
ByteAtATime
1a2fa36a79
feat(snippets): initialize snippet db
This commit creates the initial backend infrastructure for the snippets feature. It sets up the core data model, a dedicated `SnippetManager` for database interactions using `rusqlite`, and integrates it into the Tauri application state.
2025-06-24 18:46:47 -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