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.
This commit is contained in:
ByteAtATime 2025-06-26 15:34:33 -07:00
parent e2316cf949
commit 2437ad7d61
No known key found for this signature in database
8 changed files with 509 additions and 111 deletions

View file

@ -6,13 +6,13 @@ pub mod clipboard_history;
mod desktop;
mod error;
mod extensions;
mod file_search;
mod filesystem;
mod frecency;
mod oauth;
mod quicklinks;
mod snippets;
mod system;
mod file_search;
use crate::snippets::input_manager::{EvdevInputManager, InputManager};
use crate::{app::App, cache::AppCache};
@ -276,26 +276,27 @@ pub fn run() {
Ok(())
})
.build(tauri::generate_context!()).unwrap();
.build(tauri::generate_context!())
.unwrap();
app.run(|app, event| {
if let tauri::RunEvent::WindowEvent { label, event, .. } = event {
if label == "main" {
match event {
tauri::WindowEvent::CloseRequested { api, .. } => {
api.prevent_close();
if let Some(window) = app.get_webview_window("main") {
let _ = window.hide();
}
app.run(|app, event| {
if let tauri::RunEvent::WindowEvent { label, event, .. } = event {
if label == "main" {
match event {
tauri::WindowEvent::CloseRequested { api, .. } => {
api.prevent_close();
if let Some(window) = app.get_webview_window("main") {
let _ = window.hide();
}
tauri::WindowEvent::Focused(false) => {
if let Some(window) = app.get_webview_window("main") {
let _ = window.hide();
}
}
_ => {}
}
tauri::WindowEvent::Focused(false) => {
if let Some(window) = app.get_webview_window("main") {
let _ = window.hide();
}
}
_ => {}
}
}
});
}
}
});
}