Skip to content

Commit 40241bc

Browse files
committed
fixed filtering by size and date, added new theme options for the app
1 parent 0a3cde8 commit 40241bc

File tree

9 files changed

+1688
-229
lines changed

9 files changed

+1688
-229
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ OmniSearch indexes NTFS metadata directly through USN/MFT APIs for fast global s
99

1010
<p align="center"><strong>Search Experience</strong></p>
1111
<p align="center">
12-
<img src="docs/images/image.png" width="88%" alt="OmniSearch Screenshot">
12+
<img src="docs/images/A1.png" width="88%" alt="OmniSearch Screenshot">
1313
</p>
1414
<p align="center"><em>Main search tab with filters, categories, previews, and actions.</em></p>
1515
<p align="center"><sub>──────────── · ────────────</sub></p>
1616
<p align="center">&nbsp;</p>
1717

1818
<p align="center"><strong>Duplicate Finder</strong></p>
1919
<p align="center">
20-
<img src="docs/images/duplicates.png" width="84%" alt="OmniSearch Duplicate Finder Screenshot">
20+
<img src="docs/images/A2.png" width="84%" alt="OmniSearch Duplicate Finder Screenshot">
2121
</p>
2222
<p align="center"><em>Duplicate Finder groups identical files, shows reclaimable space, and supports progress + cancel.</em></p>
2323
<p align="center"><sub>──────────── · ────────────</sub></p>
2424
<p align="center">&nbsp;</p>
2525

2626
<p align="center"><strong>Drive Scope & Advanced Settings</strong></p>
2727
<p align="center">
28-
<img src="docs/images/all-drives.png" width="84%" alt="OmniSearch Drive Scope and Advanced Settings Screenshot">
28+
<img src="docs/images/A3.png" width="84%" alt="OmniSearch Drive Scope and Advanced Settings Screenshot">
2929
</p>
30-
<p align="center"><em>Optional all-drives indexing, include-folders toggle, and advanced result-limit controls.</em></p>
30+
<p align="center"><em>Optional all-drives indexing, include-folders toggle, and theme selection.</em></p>
3131

3232
<p align="center">
3333
<img src="docs/images/omnisearch-architecture.svg" width="92%" alt="OmniSearch Architecture">

index.html

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,120 @@
55
<link rel="icon" type="image/png" href="/app-icon.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>OmniSearch</title>
8+
<style>
9+
html,
10+
body {
11+
background: #262b32;
12+
}
13+
</style>
14+
<script>
15+
(() => {
16+
try {
17+
const THEME_STORAGE_KEY = "omnisearch_theme_mode";
18+
const THEME_PRESET_STORAGE_KEY = "omnisearch_theme_preset";
19+
const palettes = {
20+
slate: {
21+
dark: {
22+
"--bg-deep": "#171b22",
23+
"--bg-mid": "#262b32",
24+
"--body-glow-a": "rgba(86, 123, 184, 0.18)",
25+
"--body-glow-b": "rgba(122, 179, 255, 0.16)",
26+
},
27+
light: {
28+
"--bg-deep": "#f0f3f7",
29+
"--bg-mid": "#dfe5ed",
30+
"--body-glow-a": "rgba(93, 127, 189, 0.18)",
31+
"--body-glow-b": "rgba(118, 171, 245, 0.16)",
32+
},
33+
},
34+
aurora: {
35+
dark: {
36+
"--bg-deep": "#07090f",
37+
"--bg-mid": "#0d1322",
38+
"--body-glow-a": "rgba(41, 116, 255, 0.22)",
39+
"--body-glow-b": "rgba(86, 212, 153, 0.15)",
40+
},
41+
light: {
42+
"--bg-deep": "#eef4ff",
43+
"--bg-mid": "#d8e6fb",
44+
"--body-glow-a": "rgba(58, 124, 227, 0.24)",
45+
"--body-glow-b": "rgba(71, 190, 150, 0.2)",
46+
},
47+
},
48+
nordic: {
49+
dark: {
50+
"--bg-deep": "#0b1620",
51+
"--bg-mid": "#162635",
52+
"--body-glow-a": "rgba(59, 132, 180, 0.2)",
53+
"--body-glow-b": "rgba(86, 199, 187, 0.18)",
54+
},
55+
light: {
56+
"--bg-deep": "#eef7fb",
57+
"--bg-mid": "#d9ebf3",
58+
"--body-glow-a": "rgba(86, 160, 194, 0.22)",
59+
"--body-glow-b": "rgba(93, 197, 184, 0.18)",
60+
},
61+
},
62+
ember: {
63+
dark: {
64+
"--bg-deep": "#160f10",
65+
"--bg-mid": "#2a1d21",
66+
"--body-glow-a": "rgba(242, 131, 82, 0.2)",
67+
"--body-glow-b": "rgba(255, 176, 85, 0.14)",
68+
},
69+
light: {
70+
"--bg-deep": "#fff3eb",
71+
"--bg-mid": "#f7dfd2",
72+
"--body-glow-a": "rgba(229, 132, 83, 0.2)",
73+
"--body-glow-b": "rgba(255, 186, 91, 0.16)",
74+
},
75+
},
76+
cedar: {
77+
dark: {
78+
"--bg-deep": "#09110f",
79+
"--bg-mid": "#14241d",
80+
"--body-glow-a": "rgba(70, 158, 122, 0.18)",
81+
"--body-glow-b": "rgba(120, 220, 171, 0.16)",
82+
},
83+
light: {
84+
"--bg-deep": "#eff7f1",
85+
"--bg-mid": "#dcebdd",
86+
"--body-glow-a": "rgba(66, 155, 117, 0.18)",
87+
"--body-glow-b": "rgba(109, 209, 161, 0.16)",
88+
},
89+
},
90+
solar: {
91+
dark: {
92+
"--bg-deep": "#15120b",
93+
"--bg-mid": "#2a2417",
94+
"--body-glow-a": "rgba(212, 164, 70, 0.18)",
95+
"--body-glow-b": "rgba(244, 214, 115, 0.14)",
96+
},
97+
light: {
98+
"--bg-deep": "#fbf5e7",
99+
"--bg-mid": "#efe2be",
100+
"--body-glow-a": "rgba(201, 160, 67, 0.18)",
101+
"--body-glow-b": "rgba(236, 204, 111, 0.14)",
102+
},
103+
},
104+
};
105+
106+
const mode = localStorage.getItem(THEME_STORAGE_KEY) === "light" ? "light" : "dark";
107+
const preset = localStorage.getItem(THEME_PRESET_STORAGE_KEY) || "slate";
108+
const palette = palettes[preset] || palettes.slate;
109+
const root = document.documentElement;
110+
111+
root.setAttribute("data-theme", mode);
112+
root.setAttribute("data-theme-preset", palette === palettes[preset] ? preset : "slate");
113+
114+
Object.entries(palette[mode]).forEach(([token, value]) => {
115+
root.style.setProperty(token, value);
116+
});
117+
} catch {
118+
// Ignore startup theme bootstrap failures and let React apply theme normally.
119+
}
120+
})();
121+
</script>
8122
</head>
9123

10124
<body>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "omni-search",
33
"private": true,
4-
"version": "0.1.7",
4+
"version": "0.1.8",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "omni-search"
3-
version = "0.1.7"
3+
version = "0.1.8"
44
description = "A Tauri App"
55
authors = ["you"]
66
edition = "2021"

src-tauri/src/lib.rs

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn index_status() -> IndexStatus {
183183
}
184184

185185
#[tauri::command]
186-
fn search_files(
186+
async fn search_files(
187187
query: String,
188188
extension: Option<String>,
189189
min_size: Option<u64>,
@@ -194,40 +194,44 @@ fn search_files(
194194
) -> Result<Vec<SearchResult>, String> {
195195
#[cfg(target_os = "windows")]
196196
{
197-
let c_query = CString::new(query).map_err(|_| "Invalid query".to_string())?;
198-
let c_extension =
199-
CString::new(extension.unwrap_or_default()).map_err(|_| "Invalid extension".to_string())?;
200-
201-
let min_size = min_size.unwrap_or(0);
202-
let max_size = max_size.unwrap_or(u64::MAX);
203-
let min_created_unix = min_created_unix.unwrap_or(i64::MIN);
204-
let max_created_unix = max_created_unix.unwrap_or(i64::MAX);
205-
let limit = limit.unwrap_or(200).clamp(1, 5_000);
206-
207-
// SAFETY: Inputs are valid null-terminated strings and primitive values.
208-
let raw_json = unsafe {
209-
omni_search_files_json(
210-
c_query.as_ptr(),
211-
c_extension.as_ptr(),
212-
min_size,
213-
max_size,
214-
min_created_unix,
215-
max_created_unix,
216-
limit,
217-
)
218-
};
219-
if raw_json.is_null() {
220-
return Err(read_last_error().unwrap_or_else(|| "Search failed".to_string()));
221-
}
197+
tauri::async_runtime::spawn_blocking(move || -> Result<Vec<SearchResult>, String> {
198+
let c_query = CString::new(query).map_err(|_| "Invalid query".to_string())?;
199+
let c_extension = CString::new(extension.unwrap_or_default())
200+
.map_err(|_| "Invalid extension".to_string())?;
201+
202+
let min_size = min_size.unwrap_or(0);
203+
let max_size = max_size.unwrap_or(u64::MAX);
204+
let min_created_unix = min_created_unix.unwrap_or(i64::MIN);
205+
let max_created_unix = max_created_unix.unwrap_or(i64::MAX);
206+
let limit = limit.unwrap_or(200).clamp(1, 5_000);
207+
208+
// SAFETY: Inputs are valid null-terminated strings and primitive values.
209+
let raw_json = unsafe {
210+
omni_search_files_json(
211+
c_query.as_ptr(),
212+
c_extension.as_ptr(),
213+
min_size,
214+
max_size,
215+
min_created_unix,
216+
max_created_unix,
217+
limit,
218+
)
219+
};
220+
if raw_json.is_null() {
221+
return Err(read_last_error().unwrap_or_else(|| "Search failed".to_string()));
222+
}
222223

223-
// SAFETY: `raw_json` points to a C string allocated by C++.
224-
let json = unsafe { CStr::from_ptr(raw_json).to_string_lossy().to_string() };
225-
// SAFETY: `raw_json` was allocated by C++ and must be released by C++.
226-
unsafe { omni_free_string(raw_json) };
224+
// SAFETY: `raw_json` points to a C string allocated by C++.
225+
let json = unsafe { CStr::from_ptr(raw_json).to_string_lossy().to_string() };
226+
// SAFETY: `raw_json` was allocated by C++ and must be released by C++.
227+
unsafe { omni_free_string(raw_json) };
227228

228-
let parsed: Vec<SearchResult> =
229-
serde_json::from_str(&json).map_err(|err| format!("Invalid search payload: {err}"))?;
230-
Ok(parsed)
229+
let parsed: Vec<SearchResult> = serde_json::from_str(&json)
230+
.map_err(|err| format!("Invalid search payload: {err}"))?;
231+
Ok(parsed)
232+
})
233+
.await
234+
.map_err(|err| format!("Search task failed: {err}"))?
231235
}
232236

233237
#[cfg(not(target_os = "windows"))]

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "OmniSearch",
4-
"version": "0.1.7",
4+
"version": "0.1.8",
55
"identifier": "com.eyuel-engida.omni-search",
66
"build": {
77
"beforeDevCommand": "npm run dev",

src-tauri/windows-app-manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<assemblyIdentity
44
type="win32"
55
name="com.eyuel-engida.omni-search"
6-
version="0.1.7.0"
6+
version="0.1.8.0"
77
processorArchitecture="*"
88
/>
99
<dependency>

0 commit comments

Comments
 (0)