Refactor window handling, improve theme support, and update dependencies#1807
Refactor window handling, improve theme support, and update dependencies#1807ItsEeleeya wants to merge 148 commits into
Conversation
The header height now matches that of windows with Toolbars on macOS 26
…ier + fix onboarding decorations
The header height now matches that of windows with Toolbars on macOS 26
…ier + fix onboarding decorations
…a/Cap into next-base-improvements
…lugin_window_state's deny list
Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com>
…a/Cap into next-base-improvements
|
|
||
| meta.save_for_project() | ||
| .map_err(|e| anyhow!("Failed to save in-progress meta: {:?}", e)) | ||
| .map_err(|e| anyhow!("Failed to save in-progress meta: {e}")) |
There was a problem hiding this comment.
Using {e} here drops potentially-useful debug context; :? tends to be more helpful when chasing rare save failures.
| .map_err(|e| anyhow!("Failed to save in-progress meta: {e}")) | |
| .map_err(|e| anyhow!("Failed to save in-progress meta: {e:?}")) |
| ) | ||
| } | ||
|
|
||
| pub fn appears_transparent(&self) -> bool { |
There was a problem hiding this comment.
Minor clarity: this helper is used to decide shadow behavior, and it’s not necessarily a 1:1 mapping with .transparent(true) (e.g. Main). A short doc comment would help prevent future confusion.
| pub fn appears_transparent(&self) -> bool { | |
| /// Used to decide whether to disable the native window shadow (not a 1:1 mapping with `.transparent(true)`). | |
| pub fn appears_transparent(&self) -> bool { |
| self.run_on_main_thread({ | ||
| let webview = self.clone(); | ||
| move || { | ||
| let Ok(ns_window) = webview.ns_window() else { |
There was a problem hiding this comment.
with_nswindow_on_main() always returns Ok(()) even when the callback never runs (e.g. ns_window() not ready / no MainThreadMarker). That makes it hard for callers to reason about failure vs success. Might be worth returning a boolean / result back to the caller via a oneshot, or renaming to try_* to make the best-effort semantics explicit.
Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com>
Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com>
Refactor window handling, improve theme support, and modernize native integration
Overview
This PR refactors a few things with small improvements as a base for upcoming PRs. The changes modernize how windows are revealed, streamline macOS integration with native AppKit APIs, and better theme handling.
Key Changes
Window Management Refactoring
AutoRevealWindowOnReady: Automatically shows windows once content is loadedRevealWindowWithSuspense: Defers visibility for windows like Settings until routing and child mounting completesShowCapWindow→CapWindowthroughout the codebaseAppDelegateas Tauri now supports custom traffic lights insetdata-tauri-drag-region="deep"attribute (eliminates scattered manual markers)onMouseDown={showCropOptionsMenu}in Editor crop section withonClickas keyboard/touch fallbackTheme/Appearance Improvements
AppTheme→Appearance(with serde fallback for backward compatibility)Code Organization
src-tauri/src/display_utils.rsout ofwindows.rsMonitorExtandCursorMonitorInfotypes organizedpanel_manager.rs: Now macOS-only with streamlined logicmenu.rsmoduleNative Platform Integration
objc2ecosystem crates (app-kit, foundation, permissions)objc2-app-kitversionWebviewWindowExttrait withwith_nswindow_on_main()utility for direct AppKit window accesstauri_plugin_window_statedenylist)UI/UX Enhancements
scale-50class)⌘+,shortcutDependencies & Plugins
tauri-plugin-prevent-default: Enables default context menu only during developmentTechnical Notes
objc2crates instead of legacy objc/cocoaSuggested changelog entires:
⌘+,shortcut.Greptile Summary
This PR refactors desktop window handling and native integration. The main changes are:
ShowCapWindowtoCapWindowacross Rust and generated bindings.themetoappearancewith persisted-store compatibility.Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
appearancewhile accepting the old persisted key.Reviews (3): Last reviewed commit: "Merge branch 'main' into pr/1807" | Re-trigger Greptile
Context used: