From ea521095a35064f7ebe42761575ef1ecebef8455 Mon Sep 17 00:00:00 2001 From: Arnab Chakraborty <11457760+Rocky43007@users.noreply.github.com> Date: Thu, 15 Aug 2024 00:46:27 +0300 Subject: [PATCH] Deep linking wip Pop up shows but doesn't pull focus on the app and actually doesn't receive events --- Cargo.lock | Bin 299924 -> 302317 bytes apps/desktop/src-tauri/Cargo.toml | 1 + .../src-tauri/capabilities/default.json | 1 + apps/desktop/src-tauri/src/main.rs | 6 ++- apps/desktop/src-tauri/tauri.conf.json | 28 ++++++++++++-- apps/desktop/tsconfig.json | 3 +- core/src/node/config.rs | 2 +- .../Layout/Sidebar/DebugPopover.tsx | 2 +- packages/client/src/core.ts | 35 +++--------------- 9 files changed, 40 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21c3952de913e874b3ba45e1c1854baafa466968..d8916307b76e14828d06234661b755beb44e6f2e 100644 GIT binary patch delta 1065 zcmX|=OK6-`6vz4IPG-_Hl{A_eZAzI2)Pfng?}yNi;$xu=*7~3bF7D%89WpaXCl82= z(ndFdZuHaMji4wP3&lnS2Ny2vLeNcJxvP(rE5R;A7ec);t&0oa{Vx2^|NQ>vyt6(1 z`&ZLD?_FrNhjtK_`g0TOFkI;_4O+)rbNFGBc78>tJ6Zw8MAHb0J1nK7DoEzEh(QQ! zJvBy${NjR^E<)f+S!{uOh030Gf~W> zKMohqccKZJnMf_gF6)3GB6y*Rl|<1<870w3Z=I5!Sf(w{kK7W&jS$S>ba1_Bq;ua_ zX3CxVU1O`=!AASi8PqB-Zce8AUq{pBmz$@)7~6dF(Ry#a-RrKbmOnJ?3C=0bRR!US zYwRo|SSs%@w!xBoKx#uV)xa@u5xoeYoC;9}?};m?7MitG5Y+V~|T`M-X z#`|l%)o$M|r?YE??eHwaeDF3?Wtbc0Y#^B&)xpwesgPOTQYEb*PDbz=6C9`}fGI?k zaW-pv#?$qU;=c5gDw-p7vhw%kO1qm5ltt)p$nGIx$N~UP86u4(M3G>lvCccKECr%G zW)6UQ?i|6`3E`FC*pvqs8tIp}(f-!bFu)K(`%VXQ^AoMP)nT{a?he|^J)6jJbU2;= zt1>qF=g-RHbR1wgBONS`=8vJ5&;5T*r>>ybVZj*{xf486kdbn!iDxm!>_~y}`HS)l z#Tn|H4$N?FbD)Ykz3V;|ALd}6+D3QR*YezS2i^48jmnYq?lwA_Ub%`M+}9q$t2xi% zM!NNMwUMsBRIQcYe%(wTe2!}A*~_S&P8>t^(Z!F^M~7;Q;JsZ;H{P$<4)rE5Wmv9m zGkqiSOi@rQV5u3ALCKs%rYen6z@mo?jOC0d0gWk3ZyhO`wc*;pzqXOieurj94}F6^ zePH4aCJ$-;46+@@85k;~m(n<|eE=TwpwXPkE(*z{BF+NU+L1_b{sjOs{O1kxSYB}V zj(+?NJ=v?>Zu7aHk$WVY&im<{qS#8xd=@g8(WrstC5$+)Cl3H#aU3yLAy9`|9xKU9 oa_dlw-v1e gsT#MS$OEb-w-4|GLTs04UIY`9zoAmM* tauri::Result<()> { .setup(move |app| { // We need a the app handle to determine the data directory now. // This means all the setup code has to be within `setup`, however it doesn't support async so we `block_on`. + app.listen("deep-link://new-url", |url| { + println!("Received deep link: {:?}", url); + }); + block_in_place(|| { block_on(async move { builder.mount_events(app); diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index c873befb1..14bfbaa72 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -29,7 +29,9 @@ "transparent": true, "center": true, "windowEffects": { - "effects": ["sidebar"], + "effects": [ + "sidebar" + ], "state": "followsWindowActiveState", "radius": 9 } @@ -41,7 +43,11 @@ }, "bundle": { "active": true, - "targets": ["deb", "msi", "dmg"], + "targets": [ + "deb", + "msi", + "dmg" + ], "publisher": "Spacedrive Technology Inc.", "copyright": "Spacedrive Technology Inc.", "category": "Productivity", @@ -59,14 +65,20 @@ "files": { "/usr/share/spacedrive/models/yolov8s.onnx": "../../.deps/models/yolov8s.onnx" }, - "depends": ["libc6", "libxdo3", "dbus"] + "depends": [ + "libc6", + "libxdo3", + "dbus" + ] } }, "macOS": { "minimumSystemVersion": "10.15", "exceptionDomain": null, "entitlements": null, - "frameworks": ["../../.deps/Spacedrive.framework"] + "frameworks": [ + "../../.deps/Spacedrive.framework" + ] }, "windows": { "certificateThumbprint": null, @@ -90,6 +102,14 @@ "endpoints": [ "https://spacedrive.com/api/releases/tauri/{{version}}/{{target}}/{{arch}}" ] + }, + "deep-link": { + "mobile": [], + "desktop": { + "schemes": [ + "spacedrive" + ] + } } } } diff --git a/apps/desktop/tsconfig.json b/apps/desktop/tsconfig.json index d3855c6fb..11d32a210 100644 --- a/apps/desktop/tsconfig.json +++ b/apps/desktop/tsconfig.json @@ -5,7 +5,8 @@ "declarationDir": "dist", "paths": { "~/*": ["./src/*"] - } + }, + "moduleResolution": "bundler" }, "include": ["src"], "references": [ diff --git a/core/src/node/config.rs b/core/src/node/config.rs index 75ec1a9ed..3dcb641ed 100644 --- a/core/src/node/config.rs +++ b/core/src/node/config.rs @@ -183,7 +183,7 @@ pub enum NodeConfigVersion { } impl ManagedVersion for NodeConfig { - const LATEST_VERSION: NodeConfigVersion = NodeConfigVersion::V4; + const LATEST_VERSION: NodeConfigVersion = NodeConfigVersion::V5; const KIND: Kind = Kind::Json("version"); type MigrationError = NodeConfigError; diff --git a/interface/app/$libraryId/Layout/Sidebar/DebugPopover.tsx b/interface/app/$libraryId/Layout/Sidebar/DebugPopover.tsx index 177a931cb..10cc65173 100644 --- a/interface/app/$libraryId/Layout/Sidebar/DebugPopover.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/DebugPopover.tsx @@ -171,7 +171,7 @@ export default () => { > - + {/* */} {/* */}