feat(desktop): Tauri mac shell around the web export
Black screen root cause: Tauri injects nonces into style-src, which makes WebKit drop 'unsafe-inline' and block react-native-web's inline style attributes. style-src is now excluded from CSP modification. Window opens on the home screen so the section menu is reachable. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wmf3K9nCoEsXvvwkmMnuiM
This commit is contained in:
22
desktop/src-tauri/src/main.rs
Normal file
22
desktop/src-tauri/src/main.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
// GTD desktop shell — Tauri 2 backend.
|
||||
//
|
||||
// The UI is the Expo web export (rebuilt from `app/` by
|
||||
// `scripts/export-web.sh` into `app/dist`, which this crate bundles via
|
||||
// `frontendDist`). All app logic, offline queueing, and API sync live in
|
||||
// that frontend; Rust only hosts the window. Native hooks (global
|
||||
// quick-add, menu-bar toggle) can attach to the builder below later
|
||||
// without touching the web code.
|
||||
//
|
||||
// CSP note (tauri.conf.json > app.security): `dangerousDisableAssetCspModification`
|
||||
// lists "style-src" because Tauri otherwise injects nonces into that directive,
|
||||
// which makes WebKit ignore 'unsafe-inline' and block every react-native-web
|
||||
// inline `style=""` attribute plus Reanimated's runtime <style> tags. The
|
||||
// result is a collapsed, unstyled page — a black screen in dark mode.
|
||||
// script-src still receives Tauri's hashes/nonces.
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.run(tauri::generate_context!())
|
||||
.expect("failed to run GTD");
|
||||
}
|
||||
Reference in New Issue
Block a user