feat: full screen friend
Browse files- src/components/friend/frontend/main.tsx +0 -5
- src/components/friend/frontend/src-tauri/Cargo.lock +0 -1
- src/components/friend/frontend/src-tauri/Cargo.toml +0 -1
- src/components/friend/frontend/src-tauri/src/lib.rs +2 -5
- src/components/friend/frontend/src-tauri/tauri.conf.json +4 -4
- src/server/api/friend.ts +1 -1
src/components/friend/frontend/main.tsx
CHANGED
|
@@ -3,11 +3,6 @@ import ReactDOM from 'react-dom/client'
|
|
| 3 |
import App from './App'
|
| 4 |
import { listen } from '@tauri-apps/api/event'
|
| 5 |
|
| 6 |
-
// Ensure correct URL when loaded via Tauri (WebGL requires HTTP server)
|
| 7 |
-
if (typeof window !== 'undefined' && !window.location.href.includes('/friend/')) {
|
| 8 |
-
window.location.replace('http://127.0.0.1:3456/friend/')
|
| 9 |
-
}
|
| 10 |
-
|
| 11 |
// Listen for Tauri close event and notify backend
|
| 12 |
listen('friend-window-close', () => {
|
| 13 |
fetch('http://127.0.0.1:3456/friend/api/window-close', { method: 'POST' }).catch(() => {})
|
|
|
|
| 3 |
import App from './App'
|
| 4 |
import { listen } from '@tauri-apps/api/event'
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
// Listen for Tauri close event and notify backend
|
| 7 |
listen('friend-window-close', () => {
|
| 8 |
fetch('http://127.0.0.1:3456/friend/api/window-close', { method: 'POST' }).catch(() => {})
|
src/components/friend/frontend/src-tauri/Cargo.lock
CHANGED
|
@@ -4030,7 +4030,6 @@ dependencies = [
|
|
| 4030 |
"tauri",
|
| 4031 |
"tauri-build",
|
| 4032 |
"tauri-plugin-opener",
|
| 4033 |
-
"url",
|
| 4034 |
]
|
| 4035 |
|
| 4036 |
[[package]]
|
|
|
|
| 4030 |
"tauri",
|
| 4031 |
"tauri-build",
|
| 4032 |
"tauri-plugin-opener",
|
|
|
|
| 4033 |
]
|
| 4034 |
|
| 4035 |
[[package]]
|
src/components/friend/frontend/src-tauri/Cargo.toml
CHANGED
|
@@ -17,7 +17,6 @@ tauri = { version = "2", features = [] }
|
|
| 17 |
tauri-plugin-opener = "2"
|
| 18 |
serde = { version = "1", features = ["derive"] }
|
| 19 |
serde_json = "1"
|
| 20 |
-
url = "2.5.8"
|
| 21 |
|
| 22 |
[features]
|
| 23 |
default = ["custom-protocol"]
|
|
|
|
| 17 |
tauri-plugin-opener = "2"
|
| 18 |
serde = { version = "1", features = ["derive"] }
|
| 19 |
serde_json = "1"
|
|
|
|
| 20 |
|
| 21 |
[features]
|
| 22 |
default = ["custom-protocol"]
|
src/components/friend/frontend/src-tauri/src/lib.rs
CHANGED
|
@@ -5,11 +5,8 @@ pub fn run() {
|
|
| 5 |
let builder = tauri::Builder::default()
|
| 6 |
.plugin(tauri_plugin_opener::init())
|
| 7 |
.setup(|app| {
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
let _ = window.navigate(url);
|
| 11 |
-
let _ = window.set_focus();
|
| 12 |
-
}
|
| 13 |
Ok(())
|
| 14 |
})
|
| 15 |
.on_window_event(|window, event| {
|
|
|
|
| 5 |
let builder = tauri::Builder::default()
|
| 6 |
.plugin(tauri_plugin_opener::init())
|
| 7 |
.setup(|app| {
|
| 8 |
+
let window = app.get_webview_window("main").unwrap();
|
| 9 |
+
window.set_focus().ok();
|
|
|
|
|
|
|
|
|
|
| 10 |
Ok(())
|
| 11 |
})
|
| 12 |
.on_window_event(|window, event| {
|
src/components/friend/frontend/src-tauri/tauri.conf.json
CHANGED
|
@@ -4,8 +4,7 @@
|
|
| 4 |
"version": "0.1.0",
|
| 5 |
"identifier": "com.versperclaw.friend",
|
| 6 |
"build": {
|
| 7 |
-
"devUrl": "http://127.0.0.1:3456/friend/"
|
| 8 |
-
"frontendDist": "../dist"
|
| 9 |
},
|
| 10 |
"bundle": {
|
| 11 |
"icon": [
|
|
@@ -20,6 +19,7 @@
|
|
| 20 |
{
|
| 21 |
"title": "VersperClaw Friend",
|
| 22 |
"label": "main",
|
|
|
|
| 23 |
"transparent": true,
|
| 24 |
"decorations": false,
|
| 25 |
"alwaysOnTop": true,
|
|
@@ -27,14 +27,14 @@
|
|
| 27 |
"height": 600,
|
| 28 |
"minWidth": 200,
|
| 29 |
"minHeight": 300,
|
| 30 |
-
"resizable":
|
| 31 |
"skipTaskbar": false,
|
| 32 |
"center": true,
|
| 33 |
"visible": true
|
| 34 |
}
|
| 35 |
],
|
| 36 |
"security": {
|
| 37 |
-
"csp": "default-src 'self'; connect-src 'self' http://127.0.0.1:3456 ws://127.0.0.1:3456; style-src 'self' 'unsafe-inline'; img-src 'self' data:; media-src 'self' http://127.0.0.1:3456; font-src 'self' data:; script-src 'self' 'unsafe-inline'
|
| 38 |
}
|
| 39 |
}
|
| 40 |
}
|
|
|
|
| 4 |
"version": "0.1.0",
|
| 5 |
"identifier": "com.versperclaw.friend",
|
| 6 |
"build": {
|
| 7 |
+
"devUrl": "http://127.0.0.1:3456/friend/"
|
|
|
|
| 8 |
},
|
| 9 |
"bundle": {
|
| 10 |
"icon": [
|
|
|
|
| 19 |
{
|
| 20 |
"title": "VersperClaw Friend",
|
| 21 |
"label": "main",
|
| 22 |
+
"url": "http://127.0.0.1:3456/friend/",
|
| 23 |
"transparent": true,
|
| 24 |
"decorations": false,
|
| 25 |
"alwaysOnTop": true,
|
|
|
|
| 27 |
"height": 600,
|
| 28 |
"minWidth": 200,
|
| 29 |
"minHeight": 300,
|
| 30 |
+
"resizable": true,
|
| 31 |
"skipTaskbar": false,
|
| 32 |
"center": true,
|
| 33 |
"visible": true
|
| 34 |
}
|
| 35 |
],
|
| 36 |
"security": {
|
| 37 |
+
"csp": "default-src 'self' http://127.0.0.1:3456; connect-src 'self' http://127.0.0.1:3456 ws://127.0.0.1:3456; style-src 'self' 'unsafe-inline'; img-src 'self' data: http://127.0.0.1:3456; media-src 'self' http://127.0.0.1:3456; font-src 'self' data:; script-src 'self' 'unsafe-inline'"
|
| 38 |
}
|
| 39 |
}
|
| 40 |
}
|
src/server/api/friend.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
| 12 |
} from '../../friend/sse.js';
|
| 13 |
import { getPrefs, setPrefs, updatePrefs, type FriendPrefs } from '../../friend/prefs.js';
|
| 14 |
import { edgeTts, qwenTts, registerAudioFile, getAudioFile } from '../../friend/tts.js';
|
| 15 |
-
import { stripForTts
|
| 16 |
import { friendChatService } from '../../friend/chat-service.js';
|
| 17 |
|
| 18 |
const GATEWAY_URL = `http://127.0.0.1:3456`;
|
|
|
|
| 12 |
} from '../../friend/sse.js';
|
| 13 |
import { getPrefs, setPrefs, updatePrefs, type FriendPrefs } from '../../friend/prefs.js';
|
| 14 |
import { edgeTts, qwenTts, registerAudioFile, getAudioFile } from '../../friend/tts.js';
|
| 15 |
+
import { stripForTts } from '../../friend/text-utils.js';
|
| 16 |
import { friendChatService } from '../../friend/chat-service.js';
|
| 17 |
|
| 18 |
const GATEWAY_URL = `http://127.0.0.1:3456`;
|