Skip to content

fix(linux): render UI correctly in AppImage (CSP nonce + SVG sizing)#4

Merged
lagosproject merged 1 commit into
mainfrom
fix/linux-render-csp
Jun 10, 2026
Merged

fix(linux): render UI correctly in AppImage (CSP nonce + SVG sizing)#4
lagosproject merged 1 commit into
mainfrom
fix/linux-render-csp

Conversation

@lagosproject

Copy link
Copy Markdown
Owner

Problem

The Linux AppImage launched but rendered only a giant logo with no layout — the long-standing Linux render bug.

Root cause

Not a WebKitGTK/Wayland/Intel issue (ruled out — dev and prod bundles both render fine in the same engine). The real cause:

  1. Tauri injects a per-load 'nonce-…' into the CSP style-src at runtime (__TAURI_STYLE_NONCE__).
  2. Per the CSP spec, a nonce in style-src makes the browser ignore 'unsafe-inline'.
  3. Angular injects every component's CSS at runtime via createElement("style") — those <style> tags carry no nonce, so WebKitGTK blocked all component CSS.
  4. With no component CSS, .brand-logo { width: 42px } never applied and the <img> fell back to the SVG's 320mm (~1210px) intrinsic size → giant logo, no layout.

Fix

  • tauri.conf.json: dangerousDisableAssetCspModification: ["style-src"] — Tauri leaves style-src verbatim (keeps 'unsafe-inline', no nonce) while still nonce-protecting script-src.
  • tauri.svg: 320mm320 intrinsic size (defense in depth, so the logo can never balloon again).
  • Carries over the GStreamer media-framework bundling + build deps (fixes the earlier appsink error) and bumps version to 0.1.3.

Verification

Rebuilt the AppImage with the real CSP applied and launched it — the full UI now renders correctly (proper-size logo, header, Folders/Details panels, breadcrumb).

🤖 Generated with Claude Code

The Linux AppImage launched but rendered only a giant logo with no
layout. Root cause: Tauri injects a per-load 'nonce-...' into the CSP
style-src at runtime. Per the CSP spec, a nonce in style-src makes the
browser ignore 'unsafe-inline', so Angular's runtime-injected component
<style> tags (which carry no nonce) were all blocked by WebKitGTK. With
no component CSS, .brand-logo { width: 42px } never applied and the
<img> fell back to the SVG's 320mm (~1210px) intrinsic size.

- tauri.conf.json: dangerousDisableAssetCspModification ["style-src"]
  so Tauri leaves style-src verbatim (keeps 'unsafe-inline', no nonce)
  while still nonce-protecting script-src.
- tauri.svg: 320mm -> 320 intrinsic size (defense in depth).
- Also bundles GStreamer media framework + build deps for the webview
  (fixes the earlier appsink error) and bumps version to 0.1.3.

Verified: rebuilt AppImage now renders the full UI correctly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lagosproject lagosproject merged commit d88d357 into main Jun 10, 2026
2 of 3 checks passed
@lagosproject lagosproject deleted the fix/linux-render-csp branch June 10, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants