Repository navigation
Isolate email from main window - #41
Conversation
…enable unstable features
Add Tauri commands to update and destroy the email webview and yield briefly when recreating to let the close propagate. Replace iframe in MessageViewBody with a placeholder div, spawn/destroy the native child webview from React, and use ResizeObserver + requestAnimationFrame to sync logical bounds via update_email_webview_bounds. Remove the iframe postMessage resize/link handling and related iframe plumbing.
Change fetch_thread to return a ThreadView (with ThreadMessage entries) constructed from MessageFull. Add ThreadMessage and ThreadView structs to db/mod.rs. Add a defensive Array.isArray check in the React MessageView before accessing thread.messages.
Store raw HTML body (use unwrap_or_default) instead of running ammonia::clean so original markup is preserved. Reorder imports for consistency.
Use get_crypto and eml_cache::load_body to populate body_html, body_plain and read_receipt_to. On cache miss fetch the full message via the IMAP manager and cache the result.
…it2gtk implementation for embedded email rendering
Add allow-main-commands and allow-email-heartbeat permissions, and create src-tauri/permissions/main-commands.toml and watchdog.toml. Add "allow-main-commands" to default capabilities and normalize email-webview.json formatting. Extract tpm_check helper with a 3s timeout, simplify TPM availability mapping, and streamline security commands handling.
Make email_heartbeat return the next nonce string and return Err on unarmed, token mismatch, or rate-limit. On success rotate the token and return the new nonce. Inject a client-side heartbeat loop into served email HTML and initialize WatchdogState (token, last_heartbeat, created_at, is_frozen). Update TODO to mark 27.8 as done.
…project into dev/isolated-messageview
Implement suspend_process_windows using Toolhelp/Thread APIs to suspend all threads of the target PID. Call SIGSTOP on Linux and suspend on Windows via cfg branches. Restrict several EmbeddedEmailState fields to linux-only and move SendWidget type for reuse. Update Cargo.toml deps for required Windows and nix features and mark TODO 27.14 complete
Merge 'main' into working branch
Add read_renderer_memory(pid) for Linux (proc statm) and Windows (GetProcessMemoryInfo), returning 0 on failure. Populate FreezeStats.memory_bytes and set it in the watchdog loop. Add Win32_System_ProcessStatus feature to Cargo.toml and mark TODO 27.15 as completed
Add listeners for 'email_webview_frozen' and 'email_webview_resumed' (Tauri), store FreezeStats in state and render EmailFreezeNotice overlay when frozen. Import listen and FreezeStats, make container relative to position the overlay, and clean up listeners on unmount.
Replace the floating draggable freeze notice with a compact inline banner and remove pointer-drag logic and GripHorizontal import. Wrap the notice in the message view layout and adjust styles for amber warning tones. Add a scroll listener and initial sync to keep the native webview bounds updated, and include frozenStats in the effect deps. Clean up unused imports.
Implement platform-specific resume logic for frozen email webview. Use SIGCONT on Unix and ResumeThread on Windows. Emit email_webview_resumed event, register the command in Tauri, add permission and mark related TODO items done
Add a resumed_at timestamp to WatchdogData to track when a webview was last resumed. Use this to enforce a 10s cooldown after unfreeze before tightening heartbeat thresholds (then a 5s grace at 3s, then 500ms). Set resumed_at when resuming the email webview.
Replace postMessage from the webview with a fetch to /message/link. The handler parses the url query param, rejects non-http(s) schemes (javascript:, data:, file:, etc.), and responds with 400/403 for invalid requests. On success it emits the email_link_clicked event so the React frontend can show a confirmation dialog
confirmation dialog - Remove redundant UI dialog and simplify external link confirmation flow - Use native OS dialogs for external link confirmation - Improve security by removing custom dialog implementation
- Switch to `add_child` API for child webview management - Update webview bounds using `tauri::Rect` and `tauri::Size` types - Fix module path for Windows webview2 renderer detection
The change replaces `get_webview_window` with `get_window` to correctly retrieve the main window instance, resolving an incorrect API usage that was causing lookup failures.
The FALSE constant needs to be explicitly converted to a boolean type for the Windows API calls to work correctly. This change ensures proper thread suspension and resumption functionality.
- Use correct TimeSpan struct for appointment duration - Request appropriate calendar access rights - Handle cases where no calendars exist by creating a default one - Ensure events are saved to a valid calendar instance
- Add Windows-specific webview state handling with COM objects - Introduce WinViewInner struct for Windows Composition API - Wrap non-Send handles with SendWidget for cross-platform compatibility - Update Linux process detection logic - Switch from windows::create/update/destroy/reload to win:: equivalents - Remove redundant info message on webview reload - Disable "tpm" feature by default in favor of empty default features list
Added pending_bounds to manage window dimensions before initialization Signed-off-by: Paweł <134298056+FixeQD@users.noreply.github.com>
Refactor protocol routing to expose handle_message_route taking an AppHandle so the WebView2 handler can call it. Wire the handler into webview init and add required Windows COM and StructuredStorage features to Cargo.toml.
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (47)
💤 Files with no reviewable changes (4)
📝 WalkthroughWalkthroughTwo new Rust workspace crates ( ChangesIsolated Email Webview with Watchdog
Sequence Diagram(s)sequenceDiagram
participant React as MessageViewBody
participant TauriIPC as Tauri IPC
participant RustProtocol as protocol.rs
participant Watchdog as run_watchdog_loop
participant NativeWV as Native Webview Process
React->>TauriIPC: create_email_webview
TauriIPC->>NativeWV: spawn GTK overlay / WebView2 DComp
React->>TauriIPC: prepare_email_view(account, mailbox, uid)
TauriIPC->>RustProtocol: store HTML in EmailViewState
React->>TauriIPC: reload_email_webview
RustProtocol-->>NativeWV: serve HTML + heartbeat script + CSP
loop every ~5s
NativeWV->>RustProtocol: GET /message/heartbeat?token=T
RustProtocol->>Watchdog: email_heartbeat(token)
Watchdog-->>RustProtocol: next_token
RustProtocol-->>NativeWV: {"token": "next_token"}
end
Note over Watchdog: silence > threshold
Watchdog->>NativeWV: SIGSTOP / SuspendThread
Watchdog->>React: emit email_webview_frozen(FreezeStats)
React->>React: show EmailFreezeNotice
React->>TauriIPC: resume_email_webview
TauriIPC->>NativeWV: SIGCONT / ResumeThread
TauriIPC->>React: emit email_webview_resumed
React->>React: hide EmailFreezeNotice
React->>TauriIPC: destroy_email_webview (unmount)
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary by CodeRabbit
New Features
Refactor