Local, full Windows search replacement, clipboard manager, and launcher: files, apps, settings and semantic media search with Google's EmbeddingGemma 2.
Rust clipboard-historyembedding-modelsembeddinggemma-2embeddinggemma2embeddingslocal-firstmcp-serversearchsemantic-searchwindows-11
Refine dictation visuals, tool availability and popup feedback
ampersandru6a79f7375dc4
diff --git a/Build-Rust.ps1 b/Build-Rust.ps1index 8ff7889..196c9c7 100644--- a/Build-Rust.ps1+++ b/Build-Rust.ps1@@ -82,8 +82,8 @@ if (Test-Path $taskPortable) { throw 'Portable staging directory already exists.New-Item -ItemType Directory -Force $taskPortable | Out-NullGet-ChildItem -LiteralPath $taskBundle | Copy-Item -Destination $taskPortable -Recurse -ForceSet-Content -LiteralPath (Join-Path $taskPortable 'portable.flag') -Value '' -Encoding ascii-Compress-Archive -Path (Join-Path $taskPortable '*') -DestinationPath 'dist/installer/VectorDash-Rust-0.3.13-x64.zip' -Force-$taskInstaller='dist/installer/VectorDash-Rust-Setup-0.3.13-x64.exe'-$taskZip='dist/installer/VectorDash-Rust-0.3.13-x64.zip'+Compress-Archive -Path (Join-Path $taskPortable '*') -DestinationPath 'dist/installer/VectorDash-Rust-0.3.14-x64.zip' -Force+$taskInstaller='dist/installer/VectorDash-Rust-Setup-0.3.14-x64.exe'+$taskZip='dist/installer/VectorDash-Rust-0.3.14-x64.zip'@($taskInstaller,$taskZip) | ForEach-Object {((Get-FileHash -LiteralPath $_ -Algorithm SHA256).Hash.ToLowerInvariant()+' '+(Split-Path $_ -Leaf))} | Set-Content 'dist/installer/RUST-SHA256SUMS.txt' -Encoding asciiWrite-Output "Native installer and portable ZIP ready."diff --git a/README.md b/README.mdindex 23b5d2b..225b826 100644--- a/README.md+++ b/README.md@@ -26,7 +26,7 @@ Search by name or exact words, or describe what you remember. Google's **Embeddi- **Automatic updates:** monitor new, modified and removed files, or schedule scans. Automatic changes obey CPU/GPU, inactivity and power conditions even when periodic scanning is Manual. Optional NTFS journal tracking replays saved changes when volume access is available; folder notifications and recovery scans provide fallback. Pause/cancel indexing and inspect VectorDash, model and File logs.- **Flexible setup:** choose GPU, iGPU or CPU/system memory; install selected optional features or remove downloaded tools. Status shows disk usage and live process RAM/VRAM. Local models warm when Hybrid/Semantic search opens, with loading progress, and can unload after an adjustable idle period. Optional game/full-screen rules pause indexing and unload models; Load anyway overrides model limits for that search session. Optional remote llama-server and read-only [MCP access for agents](docs/MCP.md), with bearer authentication and LAN access.- **Emoji and clipboard:** an offline full-color emoji grid and optional clipboard history for text, links and images, with timestamps, previews and expiry. Optionally search copied images by meaning with EmbeddingGemma 2.-- **Voice dictation:** optional local Parakeet speech recognition on CPU or NVIDIA GPU. Choose a microphone and fp16/8-bit model; watch the live waveform and let silence finish recording. A soft sound and glowing red border indicate recording. The model loads immediately on activation and unloads immediately or after your chosen idle interval. Dictation stays in your active search mode; in AI mode it submits the transcription automatically.+- **Voice dictation:** optional local Parakeet speech recognition on CPU or NVIDIA GPU. Choose a microphone and fp16/8-bit model; watch the full-width waveform inside the search field and let silence finish recording. Trailing sentence punctuation is removed from transcriptions. A soft sound and a rotating red-to-orange trail indicate recording. The model loads immediately on activation and unloads immediately or after your chosen idle interval. Dictation stays in your active search mode; in AI mode it submits the transcription automatically.- **Make it yours:** light/dark themes, app accent colors, popup tint/transparency/gradient, a collapsible icon sidebar, remembered window positions, and one red Save / outlined Undo bar for settings. About includes updates and a changelog covering releases since your installed version.<img width="1000" height="678" alt="20261013-0738-48 7475530" src="https://github.com/user-attachments/assets/1eabcb5e-63ae-47d6-872b-fa72d85b91cd" />@@ -35,7 +35,7 @@ Search by name or exact words, or describe what you remember. Google's **EmbeddiSwitch to **AI** to ask questions using your own local or remote **OpenAI-compatible server**. In **AI settings**, enter a base URL such as `http://localhost:8080/v1`, an optional API key, and your model; refresh to select from the server's models and set a maximum context size.-Press **Enter** to send, ask follow-up questions, or **Stop** a request. Answers support Markdown, full-color emoji and scrolling; **Ctrl+C** copies the reply. With a vision-capable model, attach a monitor, window or selected screen area to ask about what you see. AI requests and screenshots go to your configured server.+Enable **AI chat** and select a model to show the AI tab; disabled AI and clipboard modes stay hidden and are skipped by Tab. Press **Enter** to send, ask follow-up questions, or **Stop** a request. A purple-to-blue trail indicates AI processing. Answers support Markdown, full-color emoji and scrolling; **Ctrl+C** copies the reply. With a vision-capable model, attach a monitor, window or selected screen area to ask about what you see. AI requests and screenshots go to your configured server.The optional **MCP server**, on the same settings page, lets compatible agents search indexed files and retrieve file information. Keep it local or enable access on your LAN, with optional bearer authentication. See [MCP setup](docs/MCP.md) for connection details. AI chat and MCP are optional; ordinary file search works independently.@@ -66,7 +66,7 @@ Semantic search needs the model and a compatible llama-server. Image/audio searc| **Space** | Open/close the larger preview || **Enter** | Open a file, launch an app, open settings, or copy a calculator answer || **Ctrl+C** | Copy the selected file, calculator answer or settings link |-| **Tab / Shift+Tab** | Cycle Search, Clipboard and AI forward/backward. Enter submits an AI question |+| **Tab / Shift+Tab** | Cycle enabled Search, Clipboard and AI modes forward/backward. Enter submits an AI question || **↑ / ↓** | Select results and scroll the list || **Ctrl+F** | Return to search from settings || **Double Ctrl** | Open quick search in Explorer or a standard Open/Save dialog when enabled |diff --git a/native/Cargo.lock b/native/Cargo.lockindex 2741ab3..7317911 100644--- a/native/Cargo.lock+++ b/native/Cargo.lock@@ -5705,7 +5705,7 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"[[package]]name = "vectordash"-version = "0.3.13"+version = "0.3.14"dependencies = ["anyhow","arboard",diff --git a/native/Cargo.toml b/native/Cargo.tomlindex 8427228..ccba14a 100644--- a/native/Cargo.toml+++ b/native/Cargo.toml@@ -1,6 +1,6 @@[package]name = "vectordash"-version = "0.3.13"+version = "0.3.14"edition = "2024"license = "MIT"[dependencies]diff --git a/native/docs/0.3.14.md b/native/docs/0.3.14.mdnew file mode 100644index 0000000..5fe359c--- /dev/null+++ b/native/docs/0.3.14.md@@ -0,0 +1,11 @@+# VectorDash 0.3.14 prerelease++- Full-width microphone waveform inside the search input, in the main window and popup. Recording instructions are hidden; useful transcription errors remain visible.+- Transcription removes sentence-ending punctuation while preserving punctuation inside your query. AI dictation still submits automatically.+- Recording trail is 50% longer, with red fading into orange over its last half. AI processing uses the same trail size with a purple-to-blue gradient.+- New Enable AI chat setting. AI stays hidden when disabled or no model is selected; Clipboard stays hidden when history is disabled. Tab and Shift+Tab skip hidden modes. MCP remains independent.+- Popup footer shows search feedback instead of background indexing summaries.++Validation: 101 automated tests passed, plus native main/popup checks for waveform rendering, both trails, punctuation cleanup, AI auto-submit, hidden modes and popup status filtering. AI tests used a local fixture server.++Windows 11 x64. Setup and portable downloads include SHA-256 checksums. Setup is unsigned and may trigger a Windows warning. This is a prerelease; v0.3.12 remains the latest stable release.diff --git a/native/src/ai.rs b/native/src/ai.rsindex 3c8eb9c..ee258db 100644--- a/native/src/ai.rs+++ b/native/src/ai.rs@@ -172,6 +172,7 @@ pub fn request_body(s: &Settings, prompt: &str) -> Result<Value> {body(s, &prepare(s, &[], prompt)?)}pub fn body(s: &Settings, messages: &[Message]) -> Result<Value> {+ anyhow::ensure!(s.llm_enabled, "AI chat is disabled in settings");anyhow::ensure!(!s.llm_model.trim().is_empty(),"Select an LLM model in AI settings"@@ -419,3 +420,21 @@ mod vision_tests {);}}++#[cfg(test)]+mod disabled_chat_tests {+ #[test]+ fn disabled_chat_cannot_create_a_request_even_with_a_configured_model() {+ let s = crate::config::Settings {+ llm_enabled: false,+ llm_model: "fixture".into(),+ ..Default::default()+ };+ assert!(+ super::request_body(&s, "hello")+ .unwrap_err()+ .to_string()+ .contains("disabled")+ );+ }+}diff --git a/native/src/app.rs b/native/src/app.rsindex e0c4e6f..4310677 100644--- a/native/src/app.rs+++ b/native/src/app.rs@@ -64,6 +64,7 @@ pub struct App {searching: bool,search_pending: bool,search_ms: f64,+ search_error: Option<String>,indexing: bool,setup_busy: bool,progress: Progress,@@ -314,6 +315,7 @@ impl App {searching: false,search_pending: false,search_ms: 0.0,+ search_error: None,indexing: false,setup_busy: false,progress: Progress::default(),@@ -440,13 +442,15 @@ impl App {ai_scroll: 0.0,popup_outside_down: false,};- crate::launcher::monitor(- app.home.clone(),- app.engine.control.schedule.clone(),- app.scheduler_shutdown.clone(),- app.engine.tx.clone(),- app.engine.models.clone(),- );+ if app.smoke.is_none() {+ crate::launcher::monitor(+ app.home.clone(),+ app.engine.control.schedule.clone(),+ app.scheduler_shutdown.clone(),+ app.engine.tx.clone(),+ app.engine.models.clone(),+ );+ }crate::dictation::start_monitor(app.engine.control.schedule.clone(),app.scheduler_shutdown.clone(),@@ -485,6 +489,9 @@ impl App {app.mode = "Names".into();app.dirty = true;}+ if let Some(status) = get("--smoke-status") {+ app.status = status;+ }if let Some(tool) = get("--smoke-tool") {app.switch_tool(&tool);}@@ -749,7 +756,9 @@ impl App {if id == self.dictation_job {self.dictation_busy = false;let submit_ai = std::mem::take(&mut self.dictation_submit_ai);- match result {+ match result.map(|text|crate::dictation::query_text(&text)).and_then(|text| {+ if text.is_empty() {Err("Parakeet heard no recognizable speech. Check the microphone level and try again".into())}else{Ok(text)}+ }) {Ok(text) => {self.query = text;self.changed();@@ -874,9 +883,13 @@ impl App {match result {Ok(items) => {self.selected = self.selected.min(items.len().saturating_sub(1));+ self.search_error = None;self.tool_items = items;}- Err(e) => self.status = e,+ Err(e) => {+ self.search_error = Some(e.clone());+ self.status = e;+ }}}self.dirty |= self.search_pending;@@ -1061,10 +1074,14 @@ impl App {self.texture = None;self.preview_error = None;self.preview_pending = None;+ self.search_error = None;self.search_ms = ms;self.status = format!("{} results · {ms:.1} ms", self.hits.len());}- Err(e) => self.status = e,+ Err(e) => {+ self.search_error = Some(e.clone());+ self.status = e;+ }}}if self.search_pending {@@ -1375,6 +1392,7 @@ impl App {);}fn changed(&mut self) {+ self.search_error = None;self.scope_indexed = None;self.sequence += 1;self.changed = Instant::now();@@ -1634,6 +1652,11 @@ impl App {ui.add_space(8.0);}let mut query = self.query.clone();+ let recording = crate::dictation::recording()+ || self.smoke.is_some() && std::env::args().any(|a| a == "--smoke-recording");+ if recording {+ query.clear();+ }ui.horizontal(|ui| {let drag = ui.add(crate::icons::image(crate::icons::Icon::Search, self.accent(), 26.0)@@ -1676,15 +1699,28 @@ impl App {],egui::TextEdit::singleline(&mut query).lock_focus(true)- .hint_text(match self.tool.as_str() {- "AI" => "Ask AI",- "Emoji" => "Search emoji",- "Clipboard" => "Search clipboard history",- _ => "Search Anything",+ .interactive(!recording)+ .text_color(if recording {+ Color32::TRANSPARENT+ } else {+ ui.visuals().text_color()+ })+ .hint_text(if recording {+ ""+ } else {+ match self.tool.as_str() {+ "AI" => "Ask AI",+ "Emoji" => "Search emoji",+ "Clipboard" => "Search clipboard history",+ _ => "Search Anything",+ }}).font(egui::TextStyle::Heading).id(egui::Id::new("query")),);+ if recording {+ self.paint_waveform(ui, response.rect);+ }if self.quick && self.startup.elapsed() < Duration::from_secs(2) {response.request_focus();}@@ -1693,7 +1729,9 @@ impl App {if self.tool == "Search" {if self.query.trim_start().starts_with("emoji:") {self.tool = "Emoji".into();- } else if self.query.trim_start().starts_with("clipboard:") {+ } else if self.saved_settings.clipboard_enabled+ && self.query.trim_start().starts_with("clipboard:")+ {self.tool = "Clipboard".into();}}@@ -1774,7 +1812,7 @@ impl App {self.exclude_types.clone(),);ui.horizontal(|ui| {- for label in ["Search", "Clipboard", "AI"] {+ for label in self.saved_settings.search_tools() {if ui.add(egui::Button::image_and_text(@@ -2790,9 +2828,15 @@ impl App {});}- fn paint_waveform(&self, ui: &mut egui::Ui) {- let (rect, _) = ui.allocate_exact_size(egui::vec2(170.0, 28.0), egui::Sense::hover());- let wave = crate::dictation::waveform();+ fn paint_waveform(&self, ui: &mut egui::Ui, input: egui::Rect) {+ let rect = input.shrink2(egui::vec2(12.0, 6.0));+ let mut wave = crate::dictation::waveform();+ if self.smoke.is_some() && std::env::args().any(|a| a == "--smoke-recording") {+ let time = ui.input(|i| i.time) as f32;+ for (i, value) in wave.iter_mut().enumerate() {+ *value = ((i as f32 * 0.45 + time * 3.0).sin() * 0.5 + 0.5) * 0.5;+ }+ }let center = rect.center().y;ui.painter().line_segment([@@ -2810,6 +2854,34 @@ impl App {);}}+ fn footer_text(&self) -> String {+ if self.quick {+ if self.ai_busy {+ "AI request in progress…".into()+ } else if let Some(error) = &self.search_error {+ error.clone()+ } else if self.status == "Copied"+ || self.status.starts_with("Playing from")+ || self.status.starts_with("Playback")+ {+ self.status.clone()+ } else if self.searching {+ "Searching…".into()+ } else if self.tool == "Search" && !self.query.trim().is_empty() {+ format!("{} results · {:.1} ms", self.hits.len(), self.search_ms)+ } else if self.tool == "Clipboard" {+ format!("{} items", self.tool_items.len())+ } else if self.tool == "Emoji" {+ format!("{} emoji", self.tool_items.len())+ } else {+ String::new()+ }+ } else if self.ai_busy {+ "AI request in progress…".into()+ } else {+ self.status.clone()+ }+ }fn refresh_microphones(&mut self) {self.microphones_busy = true;let tx = self.engine.tx.clone();@@ -3211,7 +3283,7 @@ impl App {}}}- ui.weak("Tab always cycles Search, Clipboard and AI. Emoji stays available by its button.");+ ui.weak("Tab cycles enabled search modes. Emoji stays available by its button.");ui.heading("Appearance");combo(ui, "theme", &mut self.s.theme, &["System", "Dark", "Light"]);ui.horizontal(|ui| {@@ -3389,6 +3461,9 @@ impl App {}fn switch_tool(&mut self, tool: &str) {+ if !self.saved_settings.tool_available(tool) {+ return;+ }self.filter_open = false;self.save_search_open = false;self.clipboard_texture = None;@@ -3416,7 +3491,7 @@ impl App {self.ai_job += 1;}fn ask_ai(&mut self) {- if self.ai_busy || self.dictation_busy {+ if !self.saved_settings.ai_chat_available() || self.ai_busy || self.dictation_busy {return;}self.ai_error = None;@@ -3789,6 +3864,8 @@ impl App {}fn llm(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {ui.heading("AI settings");+ ui.checkbox(&mut self.s.llm_enabled, "Enable AI chat");+ ui.weak("Select a model and save settings to show AI in search. MCP works independently.");ui.label("Connect your own OpenAI-compatible server. AI requests run only when you submit a question.");ui.label("Base URL");ui.text_edit_singleline(&mut self.s.llm_url);@@ -4198,20 +4275,10 @@ impl eframe::App for App {});if cycle {let backwards = ctx.input(|i| i.modifiers.shift);- let next = if backwards {- match self.tool.as_str() {- "Search" => "AI",- "AI" => "Clipboard",- _ => "Search",- }- } else {- match self.tool.as_str() {- "Search" => "Clipboard",- "Clipboard" => "AI",- _ => "Search",- }- };- self.switch_tool(next);+ let next = self.saved_settings.next_search_tool(&self.tool, backwards);+ if next != self.tool {+ self.switch_tool(next);+ }ctx.memory_mut(|m| {m.move_focus(egui::FocusDirection::None);m.request_focus(egui::Id::new("query"));@@ -4396,6 +4463,12 @@ impl eframe::App for App {self.install_update(ctx);}self.events(ctx);+ if !self.saved_settings.tool_available(&self.tool) {+ if self.tool == "AI" {+ self.stop_ai();+ }+ self.switch_tool("Search");+ }if !crate::platform::main_window_visible()|| ctx.input(|i| i.viewport().minimized.unwrap_or(false)){@@ -4555,13 +4628,10 @@ impl eframe::App for App {.frame(egui::Frame::NONE.inner_margin(egui::Margin::symmetric(20, 9))).show(ctx, |ui| {if self.page == 0 {- if self.dictation_busy || !self.dictation_status.is_empty() {- ui.horizontal_wrapped(|ui| {- ui.label(&self.dictation_status);- if self.dictation_busy {- self.paint_waveform(ui);- }- });+ if !self.dictation_status.is_empty()+ && !self.dictation_status.starts_with("Recording")+ {+ ui.label(&self.dictation_status);}if self.tool == "AI" {ui.weak(format!("AI model: {}", self.saved_settings.llm_model));@@ -4573,24 +4643,27 @@ impl eframe::App for App {}}}+ let footer = self.footer_text();ui.horizontal_wrapped(|ui| {if self.quick && ui.button("Open full app").clicked() {let _ = self.engine.tx.send(Event::Full);}ui.add_sized([(ui.available_width() - 550.0).max(120.0), 22.0],- egui::Label::new(if self.ai_busy {- "AI request in progress…"- } else {- self.status.as_str()- })- .truncate(),+ egui::Label::new(&footer).truncate(),)- .on_hover_text(&self.status);+ .on_hover_text(&footer);ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {for (key, action) in [("Esc", if self.ai_busy { "stop" } else { "dismiss" }),- ("Tab", "cycle tools"),+ (+ if self.saved_settings.search_tools().len() > 1 {+ "Tab"+ } else {+ ""+ },+ "cycle tools",+ ),("Ctrl+C", "copy"),(if self.tool == "Search" { "Space" } else { "" }, "preview"),(@@ -4920,7 +4993,10 @@ impl eframe::App for App {&& self.search_visible{paint_recording_outline(ctx);- } else if self.ai_busy && self.search_visible {+ } else if (self.ai_busy+ || self.smoke.is_some() && std::env::args().any(|a| a == "--smoke-ai-processing"))+ && self.search_visible+ {paint_ai_outline(ctx);}self.capture_ui(ctx);@@ -5164,7 +5240,7 @@ impl eframe::App for App {if self.startup.elapsed() > Duration::from_secs(self.smoke_seconds)&& (self.qa_screenshot.is_none() || self.qa_captured){- let data = serde_json::json!({"ok":true,"native_rust":true,"tool":self.tool,"query":self.query,"ai_busy":self.ai_busy,"ai_answer":self.ai_answer,"model_loaded":self.engine.models.loaded.load(Ordering::Relaxed),"frames":self.frames,"max_frame_interval_ms":self.max_frame_ms,"dark_mode":ctx.style().visuals.dark_mode,"hidden_reopened":self.qa_hidden_reopened,"ocr_enabled":self.s.ocr_enabled,"ocr_setup_selected":self.ocr_setup,"results":self.hits.len(),"selected":self.selected,"result_scroll_offset":self.result_scroll_offset,"scope":self.scope,"quick_look":self.large_preview,"quick_look_size":self.qa_child_size,"cpu":crate::scheduling::metrics().cpu,"gpu":crate::scheduling::metrics().gpu,"query_focus":ctx.memory(|m|m.has_focus(egui::Id::new("query")))});+ let data = serde_json::json!({"ok":true,"native_rust":true,"tool":self.tool,"tools":self.saved_settings.search_tools(),"footer":self.footer_text(),"dictation_status":self.dictation_status,"query":self.query,"ai_busy":self.ai_busy,"ai_answer":self.ai_answer,"model_loaded":self.engine.models.loaded.load(Ordering::Relaxed),"frames":self.frames,"max_frame_interval_ms":self.max_frame_ms,"dark_mode":ctx.style().visuals.dark_mode,"hidden_reopened":self.qa_hidden_reopened,"ocr_enabled":self.s.ocr_enabled,"ocr_setup_selected":self.ocr_setup,"results":self.hits.len(),"selected":self.selected,"result_scroll_offset":self.result_scroll_offset,"scope":self.scope,"quick_look":self.large_preview,"quick_look_size":self.qa_child_size,"cpu":crate::scheduling::metrics().cpu,"gpu":crate::scheduling::metrics().gpu,"query_focus":ctx.memory(|m|m.has_focus(egui::Id::new("query")))});let _ = std::fs::write(report, data.to_string());self.exiting = true;ctx.send_viewport_cmd(egui::ViewportCommand::Close);@@ -5349,59 +5425,39 @@ mod tab_focus_tests {}}-fn paint_ai_outline(ctx: &egui::Context) {- let rect = ctx.content_rect().shrink(3.0);- let radius = 17.0;- let mut points = Vec::new();- let corners = [- (- egui::pos2(rect.right() - radius, rect.top() + radius),- -std::f32::consts::FRAC_PI_2,- ),- (- egui::pos2(rect.right() - radius, rect.bottom() - radius),- 0.0,- ),- (- egui::pos2(rect.left() + radius, rect.bottom() - radius),- std::f32::consts::FRAC_PI_2,- ),- (- egui::pos2(rect.left() + radius, rect.top() + radius),- std::f32::consts::PI,- ),- ];- for (i, (center, start)) in corners.iter().enumerate() {- for n in 0..=8 {- let a = start + n as f32 / 8.0 * std::f32::consts::FRAC_PI_2;- points.push(*center + egui::vec2(a.cos(), a.sin()) * radius);- }- let a = start + std::f32::consts::FRAC_PI_2;- let from = *center + egui::vec2(a.cos(), a.sin()) * radius;- let (next, angle) = corners[(i + 1) % 4];- let to = next + egui::vec2(angle.cos(), angle.sin()) * radius;- for n in 1..=24 {- points.push(from + (to - from) * (n as f32 / 24.0));- }- }- let painter = ctx.layer_painter(egui::LayerId::new(- egui::Order::Foreground,- egui::Id::new("ai-outline"),- ));- let time = ctx.input(|i| i.time) as f32;- for i in 0..points.len() {- let wave =- (i as f32 / points.len() as f32 * std::f32::consts::TAU - time * 2.0).sin() * 0.5 + 0.5;- let color = Color32::from_rgb((80.0 + 80.0 * wave) as u8, (95.0 - 20.0 * wave) as u8, 255);- painter.line_segment(- [points[i], points[(i + 1) % points.len()]],- egui::Stroke::new(2.5, color),- );+const ACTIVITY_TRAIL_LENGTH: f32 = 0.34 * 1.5;+#[derive(Clone, Copy)]+enum ActivityTrail {+ Microphone,+ Ai,+}+fn trail_style(kind: ActivityTrail, behind: f32) -> Option<(Color32, f32)> {+ if !(0.0..ACTIVITY_TRAIL_LENGTH).contains(&behind) {+ return None;}- ctx.request_repaint_after(Duration::from_millis(16));+ let position = behind / ACTIVITY_TRAIL_LENGTH;+ let (head, tail, mix) = match kind {+ ActivityTrail::Microphone => (+ [255.0, 55.0, 75.0],+ [255.0, 180.0, 35.0],+ ((position - 0.5) * 2.0).clamp(0.0, 1.0),+ ),+ ActivityTrail::Ai => ([155.0, 85.0, 255.0], [55.0, 135.0, 255.0], position),+ };+ let color = Color32::from_rgb(+ (head[0] + (tail[0] - head[0]) * mix) as u8,+ (head[1] + (tail[1] - head[1]) * mix) as u8,+ (head[2] + (tail[2] - head[2]) * mix) as u8,+ );+ Some((color, (1.0 - position).powf(1.3)))+}+fn paint_ai_outline(ctx: &egui::Context) {+ paint_activity_outline(ctx, ActivityTrail::Ai);}-fn paint_recording_outline(ctx: &egui::Context) {+ paint_activity_outline(ctx, ActivityTrail::Microphone);+}+fn paint_activity_outline(ctx: &egui::Context, kind: ActivityTrail) {let rect = ctx.content_rect().shrink(3.0);let radius = 17.0;let mut points = Vec::new();@@ -5438,11 +5494,9 @@ fn paint_recording_outline(ctx: &egui::Context) {}let painter = ctx.layer_painter(egui::LayerId::new(egui::Order::Foreground,- egui::Id::new("recording-outline"),+ egui::Id::new("activity-outline"),));-- let time = ctx.input(|i| i.time) as f32;- let head = (time * 0.20).fract();+ let head = (ctx.input(|i| i.time) * 0.20).fract() as f32;let lengths = (0..points.len()).map(|i| points[i].distance(points[(i + 1) % points.len()])).collect::<Vec<_>>();@@ -5451,41 +5505,43 @@ fn paint_recording_outline(ctx: &egui::Context) {for i in 0..points.len() {let phase = distance / perimeter;distance += lengths[i];- let behind = (head - phase).rem_euclid(1.0);- let intensity = if behind < 0.34 {- (1.0 - behind / 0.34).powf(1.8)- } else {- 0.0- };- let segment = [points[i], points[(i + 1) % points.len()]];- if intensity > 0.01 {- for (width, alpha) in [(12.0_f32, 0.045_f32), (7.0, 0.10), (4.0, 0.20)] {+ if let Some((color, intensity)) = trail_style(kind, (head - phase).rem_euclid(1.0)) {+ let segment = [points[i], points[(i + 1) % points.len()]];+ for (width, alpha) in [(12.0_f32, 0.045_f32), (7.0, 0.10), (4.0, 0.20), (2.2, 1.0)] {painter.line_segment(segment,egui::Stroke::new(width,Color32::from_rgba_unmultiplied(- 255,- 45,- 75,+ color.r(),+ color.g(),+ color.b(),(alpha * intensity * 255.0) as u8,),),);}}- painter.line_segment(- segment,- egui::Stroke::new(- 2.2_f32,- Color32::from_rgba_unmultiplied(- 255,- 55,- 75,- ((0.13 + 0.87 * intensity) * 255.0) as u8,- ),- ),- );}ctx.request_repaint_after(Duration::from_millis(16));}+#[cfg(test)]+mod activity_trail_tests {+ use super::*;+ #[test]+ fn both_trails_have_the_same_fifty_percent_longer_span_and_distinct_gradients() {+ assert!((ACTIVITY_TRAIL_LENGTH / 0.34 - 1.5).abs() < 0.0001);+ for kind in [ActivityTrail::Microphone, ActivityTrail::Ai] {+ assert!(trail_style(kind, 0.50).is_some());+ assert!(trail_style(kind, 0.52).is_none());+ assert!(trail_style(kind, 0.0).unwrap().1 > trail_style(kind, 0.4).unwrap().1);+ }+ let red = trail_style(ActivityTrail::Microphone, 0.0).unwrap().0;+ assert_eq!(red, trail_style(ActivityTrail::Microphone, 0.2).unwrap().0);+ let orange = trail_style(ActivityTrail::Microphone, 0.48).unwrap().0;+ assert!(orange.g() > red.g() + 90);+ let purple = trail_style(ActivityTrail::Ai, 0.0).unwrap().0;+ let blue = trail_style(ActivityTrail::Ai, 0.48).unwrap().0;+ assert!(purple.r() > blue.r() && purple.g() < blue.g());+ }+}diff --git a/native/src/config.rs b/native/src/config.rsindex 9072e7a..b0d1a71 100644--- a/native/src/config.rs+++ b/native/src/config.rs@@ -113,6 +113,7 @@ pub struct Settings {pub dictation_hotkey: String,pub dictation_keep_loaded: bool,pub dictation_unload_minutes: u32,+ pub llm_enabled: bool,pub llm_vision: bool,pub llm_url: String,pub llm_key: String,@@ -226,6 +227,7 @@ impl Default for Settings {dictation_hotkey: "Ctrl+Shift+D".into(),dictation_keep_loaded: false,dictation_unload_minutes: 5,+ llm_enabled: true,llm_vision: false,llm_url: "http://localhost:8080/v1".into(),llm_key: String::new(),@@ -908,3 +910,82 @@ mod shortcut_persistence_tests {);}}++impl Settings {+ pub fn ai_chat_available(&self) -> bool {+ self.llm_enabled && !self.llm_model.trim().is_empty()+ }+ pub fn tool_available(&self, tool: &str) -> bool {+ match tool {+ "AI" => self.ai_chat_available(),+ "Clipboard" => self.clipboard_enabled,+ "Search" | "Emoji" => true,+ _ => false,+ }+ }+ pub fn search_tools(&self) -> Vec<&'static str> {+ let mut tools = vec!["Search"];+ if self.clipboard_enabled {+ tools.push("Clipboard");+ }+ if self.ai_chat_available() {+ tools.push("AI");+ }+ tools+ }+ pub fn next_search_tool(&self, current: &str, backwards: bool) -> &'static str {+ let tools = self.search_tools();+ match tools.iter().position(|tool| *tool == current) {+ Some(i) => tools[(i + if backwards { tools.len() - 1 } else { 1 }) % tools.len()],+ None => {+ if backwards {+ tools[tools.len() - 1]+ } else {+ tools[0]+ }+ }+ }+ }+}+#[cfg(test)]+mod tool_visibility_tests {+ use super::*;+ #[test]+ fn disabled_tools_are_hidden_and_skipped_in_both_directions() {+ for clipboard in [false, true] {+ for enabled in [false, true] {+ for model in ["", "fixture"] {+ let s = Settings {+ clipboard_enabled: clipboard,+ llm_enabled: enabled,+ llm_model: model.into(),+ ..Default::default()+ };+ let tools = s.search_tools();+ assert_eq!(tools.contains(&"Clipboard"), clipboard);+ assert_eq!(tools.contains(&"AI"), enabled && !model.is_empty());+ for backwards in [false, true] {+ let mut current = "Search";+ for _ in 0..tools.len() {+ current = s.next_search_tool(current, backwards);+ assert!(s.tool_available(current));+ }+ assert_eq!(current, "Search");+ }+ }+ }+ }+ }+ #[test]+ fn legacy_ai_configuration_stays_enabled_and_new_toggle_persists() {+ let old: Settings = serde_json::from_str(r#"{"llm_model":"existing"}"#).unwrap();+ assert!(old.ai_chat_available());+ let dir = tempfile::tempdir().unwrap();+ let s = Settings {+ llm_enabled: false,+ ..old+ };+ s.save(dir.path()).unwrap();+ assert!(!Settings::load(dir.path()).unwrap().ai_chat_available());+ }+}diff --git a/native/src/dictation.rs b/native/src/dictation.rsindex d4986af..a17925b 100644--- a/native/src/dictation.rs+++ b/native/src/dictation.rs@@ -428,9 +428,7 @@ pub fn run(stream.play()?;RECORDING.store(true, Ordering::Release);let recording = Recording;- state(&format!(- "Recording: {microphone} · click microphone again to transcribe"- ));+ state("Recording");let started = Instant::now();let mut endpoint = Endpoint::default();let mut last_samples = 0usize;@@ -914,3 +912,28 @@ mod activation_tests {assert!(wav.samples::<i16>().all(|n| n.unwrap().abs() < 5000));}}++/// Strip sentence-ending ASR punctuation without changing punctuation inside names or queries.+pub fn query_text(text: &str) -> String {+ text.trim()+ .trim_end_matches(|c: char| c.is_whitespace() || ".!?,;:…。!?,;:".contains(c))+ .to_owned()+}+#[cfg(test)]+mod query_text_tests {+ #[test]+ fn trims_only_sentence_endings_and_keeps_filename_math_and_internal_punctuation() {+ for (spoken, query) in [+ ("Find dogs.", "Find dogs"),+ (" What is this?! ", "What is this"),+ ("report.v2.pdf...", "report.v2.pdf"),+ ("dog's photo, from 2025.", "dog's photo, from 2025"),+ ("report (final).", "report (final)"),+ ("12.5%.", "12.5%"),+ ("C:\\Downloads\\", "C:\\Downloads\\"),+ ("...", ""),+ ] {+ assert_eq!(super::query_text(spoken), query);+ }+ }+}diff --git a/packaging/VectorDash-Rust.iss b/packaging/VectorDash-Rust.issindex 1d0c16a..8f3a10b 100644--- a/packaging/VectorDash-Rust.iss+++ b/packaging/VectorDash-Rust.iss@@ -3,7 +3,7 @@ AppId={{C6AC1B4D-A119-4D73-B2C8-6C507DEFE923}AppName=VectorDashAppVerName=VectorDashUninstallDisplayName=VectorDash-AppVersion=0.3.13+AppVersion=0.3.14AppPublisher=VectorDash contributorsAppPublisherURL=https://github.com/ampersandru/VectorDashDefaultDirName={localappdata}\Programs\VectorDash@@ -13,7 +13,7 @@ ArchitecturesAllowed=x64compatibleArchitecturesInstallIn64BitMode=x64compatibleMinVersion=10.0.22000OutputDir=..\dist\installer-OutputBaseFilename=VectorDash-Rust-Setup-0.3.13-x64+OutputBaseFilename=VectorDash-Rust-Setup-0.3.14-x64SetupIconFile=VectorDash.icoUninstallDisplayIcon={app}\VectorDash.exeLicenseFile=..\LICENSE