feat(deps): add tauri http plugin and update dependencies

This commit is contained in:
2025-08-29 12:00:30 +02:00
parent fc5beecbfe
commit 1982bce13d
7 changed files with 554 additions and 112 deletions

BIN
bun.lockb

Binary file not shown.

View File

@@ -39,6 +39,9 @@
"@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.4", "@radix-ui/react-tooltip": "^1.1.4",
"@tanstack/react-query": "^5.56.2", "@tanstack/react-query": "^5.56.2",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-http": "^2.5.2",
"@tauri-apps/plugin-opener": "^2",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"cmdk": "^1.0.0", "cmdk": "^1.0.0",
@@ -50,8 +53,6 @@
"react": "^18.3.1", "react": "^18.3.1",
"react-day-picker": "^8.10.1", "react-day-picker": "^8.10.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"react-hook-form": "^7.53.0", "react-hook-form": "^7.53.0",
"react-resizable-panels": "^2.1.3", "react-resizable-panels": "^2.1.3",
"react-router-dom": "^6.26.2", "react-router-dom": "^6.26.2",

433
src-tauri/Cargo.lock generated
View File

@@ -519,10 +519,39 @@ version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747"
dependencies = [ dependencies = [
"percent-encoding",
"time", "time",
"version_check", "version_check",
] ]
[[package]]
name = "cookie_store"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9"
dependencies = [
"cookie",
"document-features",
"idna",
"log",
"publicsuffix",
"serde",
"serde_derive",
"serde_json",
"time",
"url",
]
[[package]]
name = "core-foundation"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.10.1" version = "0.10.1"
@@ -546,7 +575,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1"
dependencies = [ dependencies = [
"bitflags 2.9.1", "bitflags 2.9.1",
"core-foundation", "core-foundation 0.10.1",
"core-graphics-types", "core-graphics-types",
"foreign-types", "foreign-types",
"libc", "libc",
@@ -559,7 +588,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
dependencies = [ dependencies = [
"bitflags 2.9.1", "bitflags 2.9.1",
"core-foundation", "core-foundation 0.10.1",
"libc", "libc",
] ]
@@ -678,6 +707,12 @@ dependencies = [
"syn 2.0.104", "syn 2.0.104",
] ]
[[package]]
name = "data-url"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"
[[package]] [[package]]
name = "deranged" name = "deranged"
version = "0.4.0" version = "0.4.0"
@@ -782,6 +817,15 @@ dependencies = [
"syn 2.0.104", "syn 2.0.104",
] ]
[[package]]
name = "document-features"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d"
dependencies = [
"litrs",
]
[[package]] [[package]]
name = "dpi" name = "dpi"
version = "0.1.2" version = "0.1.2"
@@ -838,6 +882,15 @@ version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7"
[[package]]
name = "encoding_rs"
version = "0.8.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
dependencies = [
"cfg-if",
]
[[package]] [[package]]
name = "endi" name = "endi"
version = "1.1.0" version = "1.1.0"
@@ -1220,8 +1273,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"js-sys",
"libc", "libc",
"wasi 0.11.1+wasi-snapshot-preview1", "wasi 0.11.1+wasi-snapshot-preview1",
"wasm-bindgen",
] ]
[[package]] [[package]]
@@ -1231,9 +1286,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"js-sys",
"libc", "libc",
"r-efi", "r-efi",
"wasi 0.14.2+wasi-0.2.4", "wasi 0.14.2+wasi-0.2.4",
"wasm-bindgen",
] ]
[[package]] [[package]]
@@ -1390,6 +1447,25 @@ dependencies = [
"syn 2.0.104", "syn 2.0.104",
] ]
[[package]]
name = "h2"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386"
dependencies = [
"atomic-waker",
"bytes",
"fnv",
"futures-core",
"futures-sink",
"http",
"indexmap 2.10.0",
"slab",
"tokio",
"tokio-util",
"tracing",
]
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.12.3" version = "0.12.3"
@@ -1487,6 +1563,7 @@ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
"futures-util", "futures-util",
"h2",
"http", "http",
"http-body", "http-body",
"httparse", "httparse",
@@ -1497,6 +1574,23 @@ dependencies = [
"want", "want",
] ]
[[package]]
name = "hyper-rustls"
version = "0.27.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
dependencies = [
"http",
"hyper",
"hyper-util",
"rustls",
"rustls-pki-types",
"tokio",
"tokio-rustls",
"tower-service",
"webpki-roots",
]
[[package]] [[package]]
name = "hyper-util" name = "hyper-util"
version = "0.1.14" version = "0.1.14"
@@ -1516,9 +1610,11 @@ dependencies = [
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
"socket2", "socket2",
"system-configuration",
"tokio", "tokio",
"tower-service", "tower-service",
"tracing", "tracing",
"windows-registry",
] ]
[[package]] [[package]]
@@ -1793,6 +1889,7 @@ dependencies = [
"serde_json", "serde_json",
"tauri", "tauri",
"tauri-build", "tauri-build",
"tauri-plugin-http",
"tauri-plugin-opener", "tauri-plugin-opener",
] ]
@@ -1919,6 +2016,12 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
[[package]]
name = "litrs"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed"
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.4.13" version = "0.4.13"
@@ -1935,6 +2038,12 @@ version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
[[package]]
name = "lru-slab"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
[[package]] [[package]]
name = "mac" name = "mac"
version = "0.1.1" version = "0.1.1"
@@ -2751,6 +2860,22 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "psl-types"
version = "2.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac"
[[package]]
name = "publicsuffix"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf"
dependencies = [
"idna",
"psl-types",
]
[[package]] [[package]]
name = "quick-xml" name = "quick-xml"
version = "0.37.5" version = "0.37.5"
@@ -2760,6 +2885,61 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "quinn"
version = "0.11.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
dependencies = [
"bytes",
"cfg_aliases",
"pin-project-lite",
"quinn-proto",
"quinn-udp",
"rustc-hash",
"rustls",
"socket2",
"thiserror 2.0.12",
"tokio",
"tracing",
"web-time",
]
[[package]]
name = "quinn-proto"
version = "0.11.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
dependencies = [
"bytes",
"getrandom 0.3.3",
"lru-slab",
"rand 0.9.2",
"ring",
"rustc-hash",
"rustls",
"rustls-pki-types",
"slab",
"thiserror 2.0.12",
"tinyvec",
"tracing",
"web-time",
]
[[package]]
name = "quinn-udp"
version = "0.5.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
dependencies = [
"cfg_aliases",
"libc",
"once_cell",
"socket2",
"tracing",
"windows-sys 0.60.2",
]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.40" version = "1.0.40"
@@ -2800,6 +2980,16 @@ dependencies = [
"rand_core 0.6.4", "rand_core 0.6.4",
] ]
[[package]]
name = "rand"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
dependencies = [
"rand_chacha 0.9.0",
"rand_core 0.9.3",
]
[[package]] [[package]]
name = "rand_chacha" name = "rand_chacha"
version = "0.2.2" version = "0.2.2"
@@ -2820,6 +3010,16 @@ dependencies = [
"rand_core 0.6.4", "rand_core 0.6.4",
] ]
[[package]]
name = "rand_chacha"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
dependencies = [
"ppv-lite86",
"rand_core 0.9.3",
]
[[package]] [[package]]
name = "rand_core" name = "rand_core"
version = "0.5.1" version = "0.5.1"
@@ -2838,6 +3038,15 @@ dependencies = [
"getrandom 0.2.16", "getrandom 0.2.16",
] ]
[[package]]
name = "rand_core"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
dependencies = [
"getrandom 0.3.3",
]
[[package]] [[package]]
name = "rand_hc" name = "rand_hc"
version = "0.2.0" version = "0.2.0"
@@ -2939,22 +3148,32 @@ checksum = "eabf4c97d9130e2bf606614eb937e86edac8292eaa6f422f995d7e8de1eb1813"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bytes", "bytes",
"cookie",
"cookie_store",
"encoding_rs",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2",
"http", "http",
"http-body", "http-body",
"http-body-util", "http-body-util",
"hyper", "hyper",
"hyper-rustls",
"hyper-util", "hyper-util",
"js-sys", "js-sys",
"log", "log",
"mime",
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
"quinn",
"rustls",
"rustls-pki-types",
"serde", "serde",
"serde_json", "serde_json",
"serde_urlencoded", "serde_urlencoded",
"sync_wrapper", "sync_wrapper",
"tokio", "tokio",
"tokio-rustls",
"tokio-util", "tokio-util",
"tower", "tower",
"tower-http", "tower-http",
@@ -2964,6 +3183,21 @@ dependencies = [
"wasm-bindgen-futures", "wasm-bindgen-futures",
"wasm-streams", "wasm-streams",
"web-sys", "web-sys",
"webpki-roots",
]
[[package]]
name = "ring"
version = "0.17.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
dependencies = [
"cc",
"cfg-if",
"getrandom 0.2.16",
"libc",
"untrusted",
"windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -2972,6 +3206,12 @@ version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
[[package]]
name = "rustc-hash"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
[[package]] [[package]]
name = "rustc_version" name = "rustc_version"
version = "0.4.1" version = "0.4.1"
@@ -2994,6 +3234,41 @@ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
[[package]]
name = "rustls"
version = "0.23.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc"
dependencies = [
"once_cell",
"ring",
"rustls-pki-types",
"rustls-webpki",
"subtle",
"zeroize",
]
[[package]]
name = "rustls-pki-types"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79"
dependencies = [
"web-time",
"zeroize",
]
[[package]]
name = "rustls-webpki"
version = "0.103.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc"
dependencies = [
"ring",
"rustls-pki-types",
"untrusted",
]
[[package]] [[package]]
name = "rustversion" name = "rustversion"
version = "1.0.21" version = "1.0.21"
@@ -3393,6 +3668,12 @@ version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "subtle"
version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]] [[package]]
name = "swift-rs" name = "swift-rs"
version = "1.0.7" version = "1.0.7"
@@ -3446,6 +3727,27 @@ dependencies = [
"syn 2.0.104", "syn 2.0.104",
] ]
[[package]]
name = "system-configuration"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
dependencies = [
"bitflags 2.9.1",
"core-foundation 0.9.4",
"system-configuration-sys",
]
[[package]]
name = "system-configuration-sys"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]] [[package]]
name = "system-deps" name = "system-deps"
version = "6.2.2" version = "6.2.2"
@@ -3466,7 +3768,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49c380ca75a231b87b6c9dd86948f035012e7171d1a7c40a9c2890489a7ffd8a" checksum = "49c380ca75a231b87b6c9dd86948f035012e7171d1a7c40a9c2890489a7ffd8a"
dependencies = [ dependencies = [
"bitflags 2.9.1", "bitflags 2.9.1",
"core-foundation", "core-foundation 0.10.1",
"core-graphics", "core-graphics",
"crossbeam-channel", "crossbeam-channel",
"dispatch", "dispatch",
@@ -3645,6 +3947,52 @@ dependencies = [
"walkdir", "walkdir",
] ]
[[package]]
name = "tauri-plugin-fs"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c6ef84ee2f2094ce093e55106d90d763ba343fad57566992962e8f76d113f99"
dependencies = [
"anyhow",
"dunce",
"glob",
"percent-encoding",
"schemars 0.8.22",
"serde",
"serde_json",
"serde_repr",
"tauri",
"tauri-plugin",
"tauri-utils",
"thiserror 2.0.12",
"toml",
"url",
]
[[package]]
name = "tauri-plugin-http"
version = "2.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcde333d97e565a7765aad82f32d8672458f7bd77b6ee653830d5dded9d7b5c2"
dependencies = [
"bytes",
"cookie_store",
"data-url",
"http",
"regex",
"reqwest",
"schemars 0.8.22",
"serde",
"serde_json",
"tauri",
"tauri-plugin",
"tauri-plugin-fs",
"thiserror 2.0.12",
"tokio",
"url",
"urlpattern",
]
[[package]] [[package]]
name = "tauri-plugin-opener" name = "tauri-plugin-opener"
version = "2.4.0" version = "2.4.0"
@@ -3870,6 +4218,21 @@ dependencies = [
"zerovec", "zerovec",
] ]
[[package]]
name = "tinyvec"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
dependencies = [
"tinyvec_macros",
]
[[package]]
name = "tinyvec_macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.45.1" version = "1.45.1"
@@ -3882,9 +4245,31 @@ dependencies = [
"mio", "mio",
"pin-project-lite", "pin-project-lite",
"socket2", "socket2",
"tokio-macros",
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]]
name = "tokio-macros"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.104",
]
[[package]]
name = "tokio-rustls"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b"
dependencies = [
"rustls",
"tokio",
]
[[package]] [[package]]
name = "tokio-util" name = "tokio-util"
version = "0.7.15" version = "0.7.15"
@@ -4141,6 +4526,12 @@ version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
[[package]]
name = "untrusted"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]] [[package]]
name = "url" name = "url"
version = "2.5.4" version = "2.5.4"
@@ -4355,6 +4746,16 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]]
name = "web-time"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
dependencies = [
"js-sys",
"wasm-bindgen",
]
[[package]] [[package]]
name = "webkit2gtk" name = "webkit2gtk"
version = "2.0.1" version = "2.0.1"
@@ -4399,6 +4800,15 @@ dependencies = [
"system-deps", "system-deps",
] ]
[[package]]
name = "webpki-roots"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2"
dependencies = [
"rustls-pki-types",
]
[[package]] [[package]]
name = "webview2-com" name = "webview2-com"
version = "0.38.0" version = "0.38.0"
@@ -4565,6 +4975,17 @@ dependencies = [
"windows-link", "windows-link",
] ]
[[package]]
name = "windows-registry"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
dependencies = [
"windows-link",
"windows-result",
"windows-strings",
]
[[package]] [[package]]
name = "windows-result" name = "windows-result"
version = "0.3.4" version = "0.3.4"
@@ -5055,6 +5476,12 @@ dependencies = [
"synstructure", "synstructure",
] ]
[[package]]
name = "zeroize"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
[[package]] [[package]]
name = "zerotrie" name = "zerotrie"
version = "0.2.2" version = "0.2.2"

View File

@@ -22,3 +22,4 @@ tauri = { version = "2", features = ["devtools"] }
tauri-plugin-opener = "2" tauri-plugin-opener = "2"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
tauri-plugin-http = "2.0.0"

View File

@@ -9,6 +9,17 @@
"core:default", "core:default",
"opener:default", "opener:default",
"core:window:allow-close", "core:window:allow-close",
"core:window:allow-minimize" "core:window:allow-minimize",
{
"identifier": "http:default",
"allow": [
{
"url": "http://localhost:*/*"
},
{
"url": "https://meili.site.quack-lab.dev/*"
}
]
}
] ]
} }

View File

@@ -8,6 +8,7 @@ fn greet(name: &str) -> String {
pub fn run() { pub fn run() {
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_http::init())
.invoke_handler(tauri::generate_handler![greet]) .invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("error while running tauri application"); .expect("error while running tauri application");

View File

@@ -11,6 +11,7 @@ import { toast } from '@/hooks/use-toast';
import { Window } from '@tauri-apps/api/window'; import { Window } from '@tauri-apps/api/window';
import { Switch } from '@/components/ui/switch'; import { Switch } from '@/components/ui/switch';
import { useTheme } from 'next-themes'; import { useTheme } from 'next-themes';
import { fetch } from '@tauri-apps/plugin-http'
// Global timer that starts immediately when script loads // Global timer that starts immediately when script loads
const GLOBAL_START_TIME = Date.now(); const GLOBAL_START_TIME = Date.now();
@@ -71,7 +72,7 @@ const mapHitToNote = (hit: any): Note => ({
const Index = () => { const Index = () => {
// Log component mount time immediately // Log component mount time immediately
console.log(`Component mounted after ${Date.now() - GLOBAL_START_TIME}ms`); console.log(`Component mounted after ${Date.now() - GLOBAL_START_TIME}ms`);
const [currentNote, setCurrentNote] = useState(''); const [currentNote, setCurrentNote] = useState('');
const [currentNoteTags, setCurrentNoteTags] = useState<string[]>([]); const [currentNoteTags, setCurrentNoteTags] = useState<string[]>([]);
const [previousNote, setPreviousNote] = useState<Note | null>(null); const [previousNote, setPreviousNote] = useState<Note | null>(null);
@@ -100,9 +101,9 @@ const Index = () => {
const [includeTagsInSearch, setIncludeTagsInSearch] = useState(true); const [includeTagsInSearch, setIncludeTagsInSearch] = useState(true);
const [tagGenerationTimeout, setTagGenerationTimeout] = useState<NodeJS.Timeout>(); const [tagGenerationTimeout, setTagGenerationTimeout] = useState<NodeJS.Timeout>();
const [isSettingsOpen, setIsSettingsOpen] = useState(false); const [isSettingsOpen, setIsSettingsOpen] = useState(false);
const [systemPrompt, setSystemPrompt] = useState(`You are a helpful assistant that generates searchable tags for journal entries. const [systemPrompt, setSystemPrompt] = useState(`You are a helpful assistant that generates searchable tags for journal entries.
Your task is to analyze the content and generate 1-3 relevant tags that would help the author find this note later. Your task is to analyze the content and generate 1-3 relevant tags that would help the author find this note later.
Focus on the quality of tags, not the quantity. Focus on the quality of tags, not the quantity.
Focus on: Focus on:
@@ -134,12 +135,12 @@ Keep tags concise, use lowercase, and separate words with hyphens if needed.`);
const response = await fetch(url, options); const response = await fetch(url, options);
const duration = Date.now() - startTime; const duration = Date.now() - startTime;
debugTiming(operation, startTime); debugTiming(operation, startTime);
// Add network diagnostics for slow requests // Add network diagnostics for slow requests
if (duration > 1000) { if (duration > 1000) {
addDebugInfo(`Slow request: ${operation} took ${duration}ms`); addDebugInfo(`Slow request: ${operation} took ${duration}ms`);
} }
return response; return response;
} catch (error) { } catch (error) {
const duration = Date.now() - startTime; const duration = Date.now() - startTime;
@@ -241,7 +242,7 @@ Keep tags concise, use lowercase, and separate words with hyphens if needed.`);
// Add timeout to prevent hanging // Add timeout to prevent hanging
const controller = new AbortController(); const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 500); const timeoutId = setTimeout(() => controller.abort(), 500);
const response = await fetch(`${OLLAMA_ENDPOINT}/api/tags`, { const response = await fetch(`${OLLAMA_ENDPOINT}/api/tags`, {
method: 'GET', method: 'GET',
headers: { headers: {
@@ -249,9 +250,9 @@ Keep tags concise, use lowercase, and separate words with hyphens if needed.`);
}, },
signal: controller.signal, signal: controller.signal,
}); });
clearTimeout(timeoutId); clearTimeout(timeoutId);
if (response.ok) { if (response.ok) {
setOllamaStatus('online'); setOllamaStatus('online');
addDebugInfo('Ollama connection successful'); addDebugInfo('Ollama connection successful');
@@ -281,7 +282,7 @@ Keep tags concise, use lowercase, and separate words with hyphens if needed.`);
if (tagGenerationTimeout) { if (tagGenerationTimeout) {
clearTimeout(tagGenerationTimeout); clearTimeout(tagGenerationTimeout);
} }
const timeout = setTimeout(async () => { const timeout = setTimeout(async () => {
if (content.trim() && autoGenerateTags) { if (content.trim() && autoGenerateTags) {
try { try {
@@ -300,7 +301,7 @@ Keep tags concise, use lowercase, and separate words with hyphens if needed.`);
} }
} }
}, 300); }, 300);
setTagGenerationTimeout(timeout); setTagGenerationTimeout(timeout);
}; };
@@ -313,7 +314,7 @@ Keep tags concise, use lowercase, and separate words with hyphens if needed.`);
const contextNotes = []; const contextNotes = [];
const start = Math.max(0, noteIndex - contextSize); const start = Math.max(0, noteIndex - contextSize);
const end = Math.min(noteCache.length, noteIndex + contextSize + 1); const end = Math.min(noteCache.length, noteIndex + contextSize + 1);
for (let i = start; i < end; i++) { for (let i = start; i < end; i++) {
if (i !== noteIndex) { if (i !== noteIndex) {
const note = noteCache[i]; const note = noteCache[i];
@@ -321,7 +322,7 @@ Keep tags concise, use lowercase, and separate words with hyphens if needed.`);
contextNotes.push(`[${date}] ${note.content.substring(0, 200)}${note.content.length > 200 ? '...' : ''}`); contextNotes.push(`[${date}] ${note.content.substring(0, 200)}${note.content.length > 200 ? '...' : ''}`);
} }
} }
if (contextNotes.length > 0) { if (contextNotes.length > 0) {
context = `\n\nContext from surrounding notes:\n${contextNotes.join('\n\n')}`; context = `\n\nContext from surrounding notes:\n${contextNotes.join('\n\n')}`;
} }
@@ -351,7 +352,7 @@ ${content}${context}`;
const data = await response.json(); const data = await response.json();
const responseText = data.response?.trim(); const responseText = data.response?.trim();
if (!responseText) { if (!responseText) {
throw new Error('Empty response from Ollama - check if model is loaded'); throw new Error('Empty response from Ollama - check if model is loaded');
} }
@@ -361,7 +362,7 @@ ${content}${context}`;
.split(',') .split(',')
.map((tag: string) => tag.trim()) .map((tag: string) => tag.trim())
.filter((tag: string) => tag.length > 0); .filter((tag: string) => tag.length > 0);
addDebugInfo(`Generated ${tags.length} tags: ${tags.join(', ')}`); addDebugInfo(`Generated ${tags.length} tags: ${tags.join(', ')}`);
return tags; return tags;
@@ -371,10 +372,10 @@ ${content}${context}`;
} catch (error) { } catch (error) {
console.error('Error generating tags:', error); console.error('Error generating tags:', error);
const errorMessage = error instanceof Error ? error.message : 'Unknown error'; const errorMessage = error instanceof Error ? error.message : 'Unknown error';
// More detailed error logging and user notification // More detailed error logging and user notification
let userMessage = 'Failed to generate tags'; let userMessage = 'Failed to generate tags';
if (error instanceof TypeError && error.message.includes('fetch')) { if (error instanceof TypeError && error.message.includes('fetch')) {
addDebugInfo('Tag generation failed: Network error - Ollama not reachable at localhost:11434'); addDebugInfo('Tag generation failed: Network error - Ollama not reachable at localhost:11434');
userMessage = 'Ollama not reachable - check if it\'s running on localhost:11434'; userMessage = 'Ollama not reachable - check if it\'s running on localhost:11434';
@@ -391,14 +392,14 @@ ${content}${context}`;
addDebugInfo(`Tag generation failed: ${errorMessage}`); addDebugInfo(`Tag generation failed: ${errorMessage}`);
userMessage = `Tag generation failed: ${errorMessage}`; userMessage = `Tag generation failed: ${errorMessage}`;
} }
// Show error to user // Show error to user
toast({ toast({
title: "Tag Generation Failed", title: "Tag Generation Failed",
description: userMessage, description: userMessage,
variant: "destructive", variant: "destructive",
}); });
return []; return [];
} }
}; };
@@ -593,7 +594,7 @@ ${content}${context}`;
const noteIndex = noteCache.findIndex(n => n.id === note.id); const noteIndex = noteCache.findIndex(n => n.id === note.id);
tags = await generateTags(trimmedContent, noteIndex); tags = await generateTags(trimmedContent, noteIndex);
} }
// Generate tags if none are present and auto-generation is enabled // Generate tags if none are present and auto-generation is enabled
if (autoGenerateTags && tags.length === 0) { if (autoGenerateTags && tags.length === 0) {
addDebugInfo('No tags present, generating tags before saving...'); addDebugInfo('No tags present, generating tags before saving...');
@@ -710,31 +711,31 @@ ${content}${context}`;
const data = await response.json(); const data = await response.json();
const notes: Note[] = data.hits.map((hit: any) => mapHitToNote(hit)); const notes: Note[] = data.hits.map((hit: any) => mapHitToNote(hit));
if (offset === 0) { if (offset === 0) {
setNoteCache(notes); setNoteCache(notes);
if (notes.length > 0) { if (notes.length > 0) {
setPreviousNote(notes[0]); setPreviousNote(notes[0]);
setCurrentNoteIndex(0); setCurrentNoteIndex(0);
}
const loadTime = Date.now() - loadStartTime;
addDebugInfo(`Loaded ${notes.length} notes in ${loadTime}ms`);
} else {
setNoteCache(prev => [...prev, ...notes]);
const loadTime = Date.now() - loadStartTime;
addDebugInfo(`Loaded ${notes.length} additional notes in ${loadTime}ms`);
} }
} catch (error) {
console.error('Error loading notes:', error);
const loadTime = Date.now() - loadStartTime; const loadTime = Date.now() - loadStartTime;
addDebugInfo(`Failed to load notes after ${loadTime}ms`); addDebugInfo(`Loaded ${notes.length} notes in ${loadTime}ms`);
toast({ } else {
title: "Error", setNoteCache(prev => [...prev, ...notes]);
description: "Failed to load notes. Please check your connection.", const loadTime = Date.now() - loadStartTime;
variant: "destructive", addDebugInfo(`Loaded ${notes.length} additional notes in ${loadTime}ms`);
});
} finally {
setIsLoading(false);
} }
} catch (error) {
console.error('Error loading notes:', error);
const loadTime = Date.now() - loadStartTime;
addDebugInfo(`Failed to load notes after ${loadTime}ms`);
toast({
title: "Error",
description: "Failed to load notes. Please check your connection.",
variant: "destructive",
});
} finally {
setIsLoading(false);
}
}; };
// Load notes around a specific note // Load notes around a specific note
@@ -1091,7 +1092,7 @@ ${content}${context}`;
try { try {
setIsLoading(true); setIsLoading(true);
addDebugInfo('Regenerating tags for all notes...'); addDebugInfo('Regenerating tags for all notes...');
// Load all notes // Load all notes
const response = await fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${NOTE_INDEX}/search`, { const response = await fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${NOTE_INDEX}/search`, {
method: 'POST', method: 'POST',
@@ -1112,7 +1113,7 @@ ${content}${context}`;
const data = await response.json(); const data = await response.json();
const notes: Note[] = data.hits.map((hit: any) => mapHitToNote(hit)); const notes: Note[] = data.hits.map((hit: any) => mapHitToNote(hit));
let updatedCount = 0; let updatedCount = 0;
for (let i = 0; i < notes.length; i++) { for (let i = 0; i < notes.length; i++) {
const note = notes[i]; const note = notes[i];
@@ -1128,7 +1129,7 @@ ${content}${context}`;
console.error(`Error updating tags for note ${note.id}:`, error); console.error(`Error updating tags for note ${note.id}:`, error);
} }
} }
addDebugInfo(`Tag regeneration complete: ${updatedCount} notes updated`); addDebugInfo(`Tag regeneration complete: ${updatedCount} notes updated`);
toast({ toast({
title: "Tag regeneration complete", title: "Tag regeneration complete",
@@ -1197,7 +1198,7 @@ ${content}${context}`;
document.addEventListener('keydown', handleKeyDown); document.addEventListener('keydown', handleKeyDown);
window.addEventListener('focus', handleWindowFocus); window.addEventListener('focus', handleWindowFocus);
return () => { return () => {
document.removeEventListener('keydown', handleKeyDown); document.removeEventListener('keydown', handleKeyDown);
window.removeEventListener('focus', handleWindowFocus); window.removeEventListener('focus', handleWindowFocus);
@@ -1346,19 +1347,19 @@ ${content}${context}`;
try { try {
console.log('Starting initialization...'); console.log('Starting initialization...');
addDebugInfo('Starting initialization...'); addDebugInfo('Starting initialization...');
// Check all indexes in parallel for faster initialization // Check all indexes in parallel for faster initialization
addDebugInfo('Checking all indexes in parallel...'); addDebugInfo('Checking all indexes in parallel...');
const indexCheckStart = Date.now(); const indexCheckStart = Date.now();
const [notesExists, scratchExists, settingsExists] = await Promise.all([ const [notesExists, scratchExists, settingsExists] = await Promise.all([
indexExists(NOTE_INDEX), indexExists(NOTE_INDEX),
indexExists(SCRATCH_INDEX), indexExists(SCRATCH_INDEX),
indexExists(SETTINGS_INDEX) indexExists(SETTINGS_INDEX)
]); ]);
addDebugInfo(`All index checks completed: ${Date.now() - indexCheckStart}ms`); addDebugInfo(`All index checks completed: ${Date.now() - indexCheckStart}ms`);
// Create missing indexes // Create missing indexes
const createPromises = []; const createPromises = [];
if (!notesExists) { if (!notesExists) {
@@ -1375,7 +1376,7 @@ ${content}${context}`;
}), }),
}, 'Create Notes Index')); }, 'Create Notes Index'));
} }
if (!scratchExists) { if (!scratchExists) {
addDebugInfo('Creating scratch index...'); addDebugInfo('Creating scratch index...');
createPromises.push(fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes`, { createPromises.push(fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes`, {
@@ -1390,7 +1391,7 @@ ${content}${context}`;
}), }),
}, 'Create Scratch Index')); }, 'Create Scratch Index'));
} }
if (!settingsExists) { if (!settingsExists) {
addDebugInfo('Creating settings index...'); addDebugInfo('Creating settings index...');
createPromises.push(fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes`, { createPromises.push(fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes`, {
@@ -1405,7 +1406,7 @@ ${content}${context}`;
}), }),
}, 'Create Settings Index')); }, 'Create Settings Index'));
} }
if (createPromises.length > 0) { if (createPromises.length > 0) {
await Promise.all(createPromises); await Promise.all(createPromises);
addDebugInfo('All missing indexes created'); addDebugInfo('All missing indexes created');
@@ -1414,7 +1415,7 @@ ${content}${context}`;
// Configure all indexes in parallel // Configure all indexes in parallel
addDebugInfo('Configuring all indexes in parallel...'); addDebugInfo('Configuring all indexes in parallel...');
const configStart = Date.now(); const configStart = Date.now();
await Promise.all([ await Promise.all([
// Notes index configurations // Notes index configurations
fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${NOTE_INDEX}/settings/sortable-attributes`, { fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${NOTE_INDEX}/settings/sortable-attributes`, {
@@ -1425,7 +1426,7 @@ ${content}${context}`;
}, },
body: JSON.stringify(['date']), body: JSON.stringify(['date']),
}, 'Configure Notes Sortable Attributes'), }, 'Configure Notes Sortable Attributes'),
fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${NOTE_INDEX}/settings/ranking-rules`, { fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${NOTE_INDEX}/settings/ranking-rules`, {
method: 'PUT', method: 'PUT',
headers: { headers: {
@@ -1434,7 +1435,7 @@ ${content}${context}`;
}, },
body: JSON.stringify(['sort', 'words', 'typo', 'proximity', 'attribute', 'exactness']), body: JSON.stringify(['sort', 'words', 'typo', 'proximity', 'attribute', 'exactness']),
}, 'Configure Notes Ranking Rules'), }, 'Configure Notes Ranking Rules'),
fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${NOTE_INDEX}/settings/filterable-attributes`, { fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${NOTE_INDEX}/settings/filterable-attributes`, {
method: 'PUT', method: 'PUT',
headers: { headers: {
@@ -1443,7 +1444,7 @@ ${content}${context}`;
}, },
body: JSON.stringify(['date', 'topLetter', 'letterCount', 'topLetterFrequency', 'tags']), body: JSON.stringify(['date', 'topLetter', 'letterCount', 'topLetterFrequency', 'tags']),
}, 'Configure Notes Filterable Attributes'), }, 'Configure Notes Filterable Attributes'),
// Scratch index configurations // Scratch index configurations
fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${SCRATCH_INDEX}/settings/sortable-attributes`, { fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${SCRATCH_INDEX}/settings/sortable-attributes`, {
method: 'PUT', method: 'PUT',
@@ -1453,7 +1454,7 @@ ${content}${context}`;
}, },
body: JSON.stringify(['date']), body: JSON.stringify(['date']),
}, 'Configure Scratch Sortable Attributes'), }, 'Configure Scratch Sortable Attributes'),
fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${SCRATCH_INDEX}/settings/filterable-attributes`, { fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${SCRATCH_INDEX}/settings/filterable-attributes`, {
method: 'PUT', method: 'PUT',
headers: { headers: {
@@ -1462,7 +1463,7 @@ ${content}${context}`;
}, },
body: JSON.stringify(['date']), body: JSON.stringify(['date']),
}, 'Configure Scratch Filterable Attributes'), }, 'Configure Scratch Filterable Attributes'),
// Settings index configurations // Settings index configurations
fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${SETTINGS_INDEX}/settings/filterable-attributes`, { fetchWithTiming(`${MEILISEARCH_ENDPOINT}/indexes/${SETTINGS_INDEX}/settings/filterable-attributes`, {
method: 'PUT', method: 'PUT',
@@ -1473,7 +1474,7 @@ ${content}${context}`;
body: JSON.stringify(['key', 'value']), body: JSON.stringify(['key', 'value']),
}, 'Configure Settings Filterable Attributes'), }, 'Configure Settings Filterable Attributes'),
]); ]);
addDebugInfo(`All index configurations completed: ${Date.now() - configStart}ms`); addDebugInfo(`All index configurations completed: ${Date.now() - configStart}ms`);
setIsInitialized(true); setIsInitialized(true);
@@ -1512,7 +1513,7 @@ ${content}${context}`;
currentNoteRef.current?.focus(); currentNoteRef.current?.focus();
console.log('Focus set on current note field'); console.log('Focus set on current note field');
}, 100); }, 100);
return () => clearTimeout(focusTimer); return () => clearTimeout(focusTimer);
}, []); }, []);
@@ -1530,7 +1531,7 @@ ${content}${context}`;
const dataLoadStartTime = Date.now(); const dataLoadStartTime = Date.now();
console.log('Starting data loading...'); console.log('Starting data loading...');
addDebugInfo('Starting data loading...'); addDebugInfo('Starting data loading...');
await loadNotes(); await loadNotes();
await loadLatestScratch(); await loadLatestScratch();
await loadFontSizeSetting(); await loadFontSizeSetting();
@@ -1539,7 +1540,7 @@ ${content}${context}`;
await loadContextSizeSetting(); await loadContextSizeSetting();
await loadIncludeTagsSetting(); await loadIncludeTagsSetting();
await checkOllamaStatus(); await checkOllamaStatus();
// Retry Ollama connection after a delay if it failed // Retry Ollama connection after a delay if it failed
setTimeout(async () => { setTimeout(async () => {
if (ollamaStatus === 'offline') { if (ollamaStatus === 'offline') {
@@ -1547,12 +1548,12 @@ ${content}${context}`;
await checkOllamaStatus(); await checkOllamaStatus();
} }
}, 2000); }, 2000);
const totalTime = Date.now() - dataLoadStartTime; const totalTime = Date.now() - dataLoadStartTime;
debugTiming('Total Data Loading', dataLoadStartTime); debugTiming('Total Data Loading', dataLoadStartTime);
addDebugInfo(`Total Data Loading: ${totalTime}ms`); addDebugInfo(`Total Data Loading: ${totalTime}ms`);
console.log('Data loading complete'); console.log('Data loading complete');
// Re-focus after data loading to ensure focus is maintained // Re-focus after data loading to ensure focus is maintained
currentNoteRef.current?.focus(); currentNoteRef.current?.focus();
} }
@@ -1934,19 +1935,19 @@ ${content}${context}`;
<Trash2 className="h-8 w-8" /> <Trash2 className="h-8 w-8" />
Cleanup Cleanup
</Button> </Button>
<Button <Button
onClick={() => setIsSettingsOpen(true)} onClick={() => setIsSettingsOpen(true)}
size="sm" size="sm"
variant="outline" variant="outline"
className={getTextClass('base')} className={getTextClass('base')}
> >
<Settings className="h-4 w-4 mr-2" /> <Settings className="h-4 w-4 mr-2" />
Settings Settings
</Button> </Button>
<Button <Button
onClick={() => setShowDebugPanel(!showDebugPanel)} onClick={() => setShowDebugPanel(!showDebugPanel)}
size="sm" size="sm"
variant="outline" variant="outline"
className={getTextClass('base')} className={getTextClass('base')}
> >
{showDebugPanel ? 'Hide' : 'Show'} Debug {showDebugPanel ? 'Hide' : 'Show'} Debug
@@ -1962,7 +1963,7 @@ ${content}${context}`;
<div className="flex items-center gap-4 mb-3"> <div className="flex items-center gap-4 mb-3">
<div className={`${getTextClass('base')} flex items-center gap-2`}> <div className={`${getTextClass('base')} flex items-center gap-2`}>
<span>Ollama Status:</span> <span>Ollama Status:</span>
<Badge <Badge
variant={ollamaStatus === 'online' ? 'default' : ollamaStatus === 'offline' ? 'destructive' : 'secondary'} variant={ollamaStatus === 'online' ? 'default' : ollamaStatus === 'offline' ? 'destructive' : 'secondary'}
className={`${getTextClass('base')} px-2 py-1`} className={`${getTextClass('base')} px-2 py-1`}
> >
@@ -1971,7 +1972,7 @@ ${content}${context}`;
</div> </div>
<div className={`${getTextClass('base')} flex items-center gap-2`}> <div className={`${getTextClass('base')} flex items-center gap-2`}>
<span>Auto-tags:</span> <span>Auto-tags:</span>
<Badge <Badge
variant={autoGenerateTags ? 'default' : 'secondary'} variant={autoGenerateTags ? 'default' : 'secondary'}
className={`${getTextClass('base')} px-2 py-1`} className={`${getTextClass('base')} px-2 py-1`}
> >
@@ -2023,16 +2024,16 @@ ${content}${context}`;
className={`flex-1 border-0 bg-transparent ${getTextClass('base')} p-0 outline-none`} className={`flex-1 border-0 bg-transparent ${getTextClass('base')} p-0 outline-none`}
/> />
{!autoGenerateTags && ( {!autoGenerateTags && (
<Button <Button
onClick={async () => { onClick={async () => {
if (previousNote) { if (previousNote) {
addDebugInfo('Manually generating tags...'); addDebugInfo('Manually generating tags...');
const tags = await generateTags(previousNote.content, currentNoteIndex); const tags = await generateTags(previousNote.content, currentNoteIndex);
const updatedNote = { ...previousNote, tags }; const updatedNote = { ...previousNote, tags };
setPreviousNote(updatedNote); setPreviousNote(updatedNote);
setIsPreviousNoteModified(true); setIsPreviousNoteModified(true);
} }
}} }}
size="sm" size="sm"
variant="outline" variant="outline"
className={`${getTextClass('base')} px-2 py-1 h-6`} className={`${getTextClass('base')} px-2 py-1 h-6`}
@@ -2079,18 +2080,18 @@ ${content}${context}`;
<div className="flex-1 bg-card rounded-lg border border-border shadow-sm p-6 overflow-hidden"> <div className="flex-1 bg-card rounded-lg border border-border shadow-sm p-6 overflow-hidden">
<div className={`${getTextClass('2xl')} text-muted-foreground mb-3 flex items-center gap-4`}> <div className={`${getTextClass('2xl')} text-muted-foreground mb-3 flex items-center gap-4`}>
<div>Current Entry</div> <div>Current Entry</div>
<div className="flex-1 flex items-center gap-2"> <div className="flex-1 flex items-center gap-2">
<span className={`${getTextClass('base')} text-muted-foreground`}>Tags:</span> <span className={`${getTextClass('base')} text-muted-foreground`}>Tags:</span>
<input <input
type="text" type="text"
value={currentNoteTags.join(', ')} value={currentNoteTags.join(', ')}
onChange={(e) => { onChange={(e) => {
const tags = e.target.value.split(',').map(tag => tag.trim()).filter(tag => tag.length > 0); const tags = e.target.value.split(',').map(tag => tag.trim()).filter(tag => tag.length > 0);
setCurrentNoteTags(tags); setCurrentNoteTags(tags);
}} }}
className={`flex-1 border-0 bg-transparent ${getTextClass('base')} p-0 outline-none`} className={`flex-1 border-0 bg-transparent ${getTextClass('base')} p-0 outline-none`}
/> />
</div> </div>
</div> </div>
<Textarea <Textarea
ref={currentNoteRef} ref={currentNoteRef}
@@ -2269,8 +2270,8 @@ ${content}${context}`;
<Button onClick={getProblematicNotes} className={`w-full ${getTextClass('2xl')} py-6`}> <Button onClick={getProblematicNotes} className={`w-full ${getTextClass('2xl')} py-6`}>
Analyze Notes Analyze Notes
</Button> </Button>
<Button <Button
onClick={regenerateAllTags} onClick={regenerateAllTags}
variant="outline" variant="outline"
className={`w-full ${getTextClass('2xl')} py-6`} className={`w-full ${getTextClass('2xl')} py-6`}
disabled={isLoading} disabled={isLoading}
@@ -2329,7 +2330,7 @@ ${content}${context}`;
{/* Tag Generation Settings */} {/* Tag Generation Settings */}
<div className="space-y-6"> <div className="space-y-6">
<h3 className={`${getTextClass('2xl')} font-semibold`}>Tag Generation</h3> <h3 className={`${getTextClass('2xl')} font-semibold`}>Tag Generation</h3>
<div className="space-y-4"> <div className="space-y-4">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<div> <div>
@@ -2385,7 +2386,7 @@ ${content}${context}`;
{/* Display Settings */} {/* Display Settings */}
<div className="space-y-6"> <div className="space-y-6">
<h3 className={`${getTextClass('2xl')} font-semibold`}>Display</h3> <h3 className={`${getTextClass('2xl')} font-semibold`}>Display</h3>
<div> <div>
<label className={`${getTextClass('xl')} font-medium mb-2 block`}>Font Size</label> <label className={`${getTextClass('xl')} font-medium mb-2 block`}>Font Size</label>
<Select value={fontSize} onValueChange={saveFontSizeSetting}> <Select value={fontSize} onValueChange={saveFontSizeSetting}>
@@ -2405,23 +2406,23 @@ ${content}${context}`;
{/* Ollama Settings */} {/* Ollama Settings */}
<div className="space-y-6"> <div className="space-y-6">
<h3 className={`${getTextClass('2xl')} font-semibold`}>Ollama Configuration</h3> <h3 className={`${getTextClass('2xl')} font-semibold`}>Ollama Configuration</h3>
<div className="space-y-4"> <div className="space-y-4">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<span className={`${getTextClass('base')}`}>Status:</span> <span className={`${getTextClass('base')}`}>Status:</span>
<Badge <Badge
variant={ollamaStatus === 'online' ? 'default' : ollamaStatus === 'offline' ? 'destructive' : 'secondary'} variant={ollamaStatus === 'online' ? 'default' : ollamaStatus === 'offline' ? 'destructive' : 'secondary'}
className={`${getTextClass('base')} px-2 py-1`} className={`${getTextClass('base')} px-2 py-1`}
> >
{ollamaStatus === 'online' ? 'Online' : ollamaStatus === 'offline' ? 'Offline' : 'Unknown'} {ollamaStatus === 'online' ? 'Online' : ollamaStatus === 'offline' ? 'Offline' : 'Unknown'}
</Badge> </Badge>
</div> </div>
<div> <div>
<label className={`${getTextClass('base')} font-medium`}>Endpoint:</label> <label className={`${getTextClass('base')} font-medium`}>Endpoint:</label>
<p className={`${getTextClass('base')} text-muted-foreground`}>{OLLAMA_ENDPOINT}</p> <p className={`${getTextClass('base')} text-muted-foreground`}>{OLLAMA_ENDPOINT}</p>
</div> </div>
<div> <div>
<label className={`${getTextClass('base')} font-medium`}>Model:</label> <label className={`${getTextClass('base')} font-medium`}>Model:</label>
<p className={`${getTextClass('base')} text-muted-foreground`}>{OLLAMA_MODEL}</p> <p className={`${getTextClass('base')} text-muted-foreground`}>{OLLAMA_MODEL}</p>