Commit dcb671e
committed
feat(desktop): inject window.__OPENKB_DESKTOP__ to enable desktop chrome
The #189 frontend gates desktop-only UI (the in-app TitleBar, offset chrome
cluster) on a `window.__OPENKB_DESKTOP__` flag. Set it from the shell so those
features light up when the UI runs inside Tauri.
The window is now created in setup() via WebviewWindowBuilder with an
initialization_script, instead of declaratively in tauri.conf.json — an init
script runs before page scripts on every navigation, so the flag is present on
the splash and (critically) after we navigate the WebView to the sidecar's
served UI. tauri.conf.json's windows[] is emptied accordingly.
Verified under xvfb (WebKitGTK): with the sidecar serving the new frontend,
the Tauri window renders the desktop TitleBar ("OpenKB Studio — Home", traffic
lights, Local badge) — confirming the flag reaches the page. cargo build clean.
Claude-Session: https://claude.ai/code/session_01KZyUSGAzVL9yxpsWWPv6Y21 parent 6d38874 commit dcb671e
2 files changed
Lines changed: 17 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
71 | 87 | | |
72 | 88 | | |
73 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 10 | + | |
20 | 11 | | |
21 | 12 | | |
22 | 13 | | |
| |||
0 commit comments