Conversation
728536d to
2a00193
Compare
11 tasks
12bbbc6 to
a79338a
Compare
a79338a to
56230f7
Compare
56230f7 to
e6fa1dd
Compare
Phase 2 of the WASM metadata migration plan. Frontend hooks now read metadata directly from the local Automerge document via the WASM NotebookHandle, eliminating Tauri IPC round-trips for reads. New shared module (notebook-metadata.ts): - Module-level handle accessor (same pattern as daemonCommSender) - TypeScript interfaces matching Rust NotebookMetadataSnapshot serde shape - Typed reader functions: getUvDependencies(), getCondaDependencies(), getDenoFlexibleNpmImports(), getMetadataSnapshot(), detectRuntime() Migrated reads: - App.tsx: get_notebook_runtime → detectRuntime() from WASM - useDependencies: get_notebook_dependencies → getUvDependencies() from WASM - useCondaDependencies: get_conda_dependencies → getCondaDependencies() from WASM - useDenoDependencies: get_deno_flexible_npm_imports → getDenoFlexibleNpmImports() Still via Tauri IPC (writes, filesystem access): - add_dependency, remove_dependency, clear_dependency_section (writes) - set_conda_dependencies, add_conda_dependency, remove_conda_dependency (writes) - set_deno_flexible_npm_imports (write) - approve_notebook_trust, verify_notebook_trust (needs trust key from disk) - check_uv_available, detect_pyproject, detect_deno_config (filesystem) Also removes dead Tauri commands: get_deno_permissions, set_deno_permissions.
e6fa1dd to
e38677d
Compare
rgbkrk
added a commit
that referenced
this pull request
Mar 6, 2026
All replaced by WASM reactive hooks in PR #569: UV dependency commands (-190 lines): - get_notebook_dependencies, set_notebook_dependencies - add_dependency, remove_dependency, clear_dependency_section - NotebookDependenciesJson struct Conda dependency commands (-171 lines): - get_conda_dependencies, set_conda_dependencies - add_conda_dependency, remove_conda_dependency - CondaDependenciesJson struct Runtime + Deno commands (-78 lines): - get_notebook_runtime - get_deno_flexible_npm_imports, set_deno_flexible_npm_imports - get_runtime_from_sync helper function All handler registrations removed from invoke_handler. -499 lines, zero warnings.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates metadata reads and writes from Tauri IPC to the frontend's local WASM Automerge document. Uses React 18's
useSyncExternalStorefor reactive metadata subscriptions — hooks re-render automatically when the doc changes.Architecture
The WASM
NotebookHandleis the metadata store. Three events notify subscribers:setNotebookHandle()— bootstrap / reconnectreceive_sync_message()— incoming daemon Automerge syncsetMetadataSnapshot()— local writes (add/remove deps)React hooks subscribe via
useSyncExternalStore(subscribe, getSnapshotJson).New reactive hooks (
notebook-metadata.ts)useNotebookMetadata()invoke("get_notebook_dependencies")+invoke("get_conda_dependencies")+ event listenersuseDetectRuntime()invoke("get_notebook_runtime")+ event listenersuseUvDependencies()invoke("get_notebook_dependencies")+loadDependencies()callback chainuseCondaDeps()invoke("get_conda_dependencies")+loadDependencies()callback chainuseDenoFlexibleNpmImports()invoke("get_deno_flexible_npm_imports")+loadFlexibleNpmImports()callback chainWrite path
Dependency mutations (add, remove, clear, set channels/python) go through WASM:
handle.set_metadata()+generate_sync_message()→invoke("send_automerge_sync")notifyMetadataChanged()→ subscribers re-render with new stateinvoke("approve_notebook_trust")for HMAC re-signing (stays in Tauri — needs filesystem access)What was removed
onNotebookHandleReadycallback pattern (replaced byuseSyncExternalStore)loadDependencies()/loadFlexibleNpmImports()imperative read functionsnotebook:metadata_updatedevent listeners in dependency hooksget_deno_permissions,set_deno_permissionsReview fixes
setCondaChannels/setCondaPythonnow create the conda section if absent (was silently failing)language_info.name == "deno"fallback to runtime detectionuseMemofor stable object identitygetSnapshotJsondefensive checkQA
UV dependencies
Existing notebooks
metadata.uvformat (pre-runt namespace) → deps show after trust approvalConda dependencies
Runtime detection
Deno config
Cross-window
Import from project files
Trust
Save / Clone