[PR #189] [MERGED] Queries now use AppHandle instead of Window #113

Closed
opened 2025-12-29 08:31:30 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/189
Author: @gschier
Created: 3/20/2025
Status: Merged
Merged: 3/20/2025
Merged by: @gschier

Base: masterHead: queries-to-apphandle


📝 Commits (1)

  • 31377ce queries no longer need window

📊 Changes

19 files changed (+1023 additions, -700 deletions)

View changed files

📝 src-tauri/src/history.rs (+19 -13)
📝 src-tauri/src/http_request.rs (+82 -28)
📝 src-tauri/src/lib.rs (+386 -219)
📝 src-tauri/src/notifications.rs (+12 -10)
📝 src-tauri/src/plugin_events.rs (+6 -6)
📝 src-tauri/yaak-license/src/license.rs (+13 -9)
📝 src-tauri/yaak-models/bindings/gen_models.ts (+2 -2)
📝 src-tauri/yaak-models/src/error.rs (+6 -0)
📝 src-tauri/yaak-models/src/lib.rs (+1 -0)
src-tauri/yaak-models/src/manager.rs (+40 -0)
📝 src-tauri/yaak-models/src/queries.rs (+305 -286)
📝 src-tauri/yaak-sync/src/commands.rs (+11 -11)
📝 src-tauri/yaak-sync/src/sync.rs (+31 -26)
📝 src-tauri/yaak-templates/src/renderer.rs (+2 -9)
📝 src-tauri/yaak-ws/src/commands.rs (+58 -41)
📝 src-web/components/GrpcConnectionSetupPane.tsx (+8 -7)
📝 src-web/components/HttpRequestPane.tsx (+13 -10)
📝 src-web/components/WebsocketRequestPane.tsx (+11 -9)
📝 src-web/hooks/useSyncModelStores.ts (+17 -14)

📄 Description

This PR changes DB queries to only use AppHandle instead of Window. Window was used to attach the label to the frontend event, so I moved the label to the UpdateContext enum instead. Having access to a Window for any DB modifications was quite a limitation, so now the API is usable from more places


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mountain-loop/yaak/pull/189 **Author:** [@gschier](https://github.com/gschier) **Created:** 3/20/2025 **Status:** ✅ Merged **Merged:** 3/20/2025 **Merged by:** [@gschier](https://github.com/gschier) **Base:** `master` ← **Head:** `queries-to-apphandle` --- ### 📝 Commits (1) - [`31377ce`](https://github.com/mountain-loop/yaak/commit/31377ce95c8539db984538562d7e2297bc7c9607) queries no longer need window ### 📊 Changes **19 files changed** (+1023 additions, -700 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/history.rs` (+19 -13) 📝 `src-tauri/src/http_request.rs` (+82 -28) 📝 `src-tauri/src/lib.rs` (+386 -219) 📝 `src-tauri/src/notifications.rs` (+12 -10) 📝 `src-tauri/src/plugin_events.rs` (+6 -6) 📝 `src-tauri/yaak-license/src/license.rs` (+13 -9) 📝 `src-tauri/yaak-models/bindings/gen_models.ts` (+2 -2) 📝 `src-tauri/yaak-models/src/error.rs` (+6 -0) 📝 `src-tauri/yaak-models/src/lib.rs` (+1 -0) ➕ `src-tauri/yaak-models/src/manager.rs` (+40 -0) 📝 `src-tauri/yaak-models/src/queries.rs` (+305 -286) 📝 `src-tauri/yaak-sync/src/commands.rs` (+11 -11) 📝 `src-tauri/yaak-sync/src/sync.rs` (+31 -26) 📝 `src-tauri/yaak-templates/src/renderer.rs` (+2 -9) 📝 `src-tauri/yaak-ws/src/commands.rs` (+58 -41) 📝 `src-web/components/GrpcConnectionSetupPane.tsx` (+8 -7) 📝 `src-web/components/HttpRequestPane.tsx` (+13 -10) 📝 `src-web/components/WebsocketRequestPane.tsx` (+11 -9) 📝 `src-web/hooks/useSyncModelStores.ts` (+17 -14) </details> ### 📄 Description This PR changes DB queries to only use AppHandle instead of Window. Window was used to attach the label to the frontend event, so I moved the label to the `UpdateContext` enum instead. Having access to a Window for any DB modifications was quite a limitation, so now the API is usable from more places --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 08:31:30 +01:00
adam closed this issue 2025-12-29 08:31:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/yaak-mountain-loop#113