Skip to content

Commit 04e38ef

Browse files
committed
Clean up permission logs and UI messages
- Remove console.log statements for permission checks when successful - Hide mic/screen permission buttons in TitleBar when permissions are granted - Remove success messages for permissions and dual audio capture - Update call started message to be more concise - Only show logs and UI elements when there's a problem - Update composer.json to use GitHub repository for nativephp/electron
1 parent 7cad476 commit 04e38ef

File tree

6 files changed

+26
-82
lines changed

6 files changed

+26
-82
lines changed

composer.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"inertiajs/inertia-laravel": "^2.0",
2222
"laravel/framework": "12.20.0",
2323
"laravel/tinker": "^2.10.1",
24-
"nativephp/electron": "dev-feature/macos-permissions-enhanced",
24+
"nativephp/electron": "dev-main",
2525
"openai-php/laravel": "^0.14.0",
2626
"pusher/pusher-php-server": "^7.2",
2727
"tightenco/ziggy": "^2.4"
@@ -89,11 +89,8 @@
8989
},
9090
"repositories": [
9191
{
92-
"type": "path",
93-
"url": "./nativephp-electron",
94-
"options": {
95-
"symlink": true
96-
}
92+
"type": "vcs",
93+
"url": "https://github.com/vijaythecoder/nativephp-electron.git"
9794
}
9895
],
9996
"config": {

composer.lock

Lines changed: 16 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/components/RealtimeAgent/Navigation/TitleBar.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,14 @@
4848
<!-- Screen Protection Toggle -->
4949
<ScreenProtectionToggle />
5050

51-
<!-- Microphone Permission Toggle -->
51+
<!-- Microphone Permission Toggle (only show when not authorized) -->
5252
<button
53+
v-if="micPermissionStatus !== 'authorized'"
5354
@click="requestMicrophonePermission"
5455
:disabled="micPermissionLoading"
5556
class="flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors"
5657
:class="[
57-
micPermissionStatus === 'authorized'
58-
? 'bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/20 dark:text-green-400 dark:hover:bg-green-900/30'
59-
: micPermissionStatus === 'denied'
58+
micPermissionStatus === 'denied'
6059
? 'bg-red-100 text-red-700 hover:bg-red-200 dark:bg-red-900/20 dark:text-red-400 dark:hover:bg-red-900/30'
6160
: 'bg-yellow-100 text-yellow-700 hover:bg-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-400 dark:hover:bg-yellow-900/30',
6261
{ 'opacity-50 cursor-not-allowed': micPermissionLoading }
@@ -70,15 +69,14 @@
7069
{{ micPermissionText }}
7170
</button>
7271

73-
<!-- Screen Capture Permission Toggle -->
72+
<!-- Screen Capture Permission Toggle (only show when not authorized) -->
7473
<button
74+
v-if="screenPermissionStatus !== 'authorized'"
7575
@click="requestScreenPermission"
7676
:disabled="screenPermissionLoading"
7777
class="flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors"
7878
:class="[
79-
screenPermissionStatus === 'authorized'
80-
? 'bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/20 dark:text-green-400 dark:hover:bg-green-900/30'
81-
: screenPermissionStatus === 'denied'
79+
screenPermissionStatus === 'denied'
8280
? 'bg-red-100 text-red-700 hover:bg-red-200 dark:bg-red-900/20 dark:text-red-400 dark:hover:bg-red-900/30'
8381
: 'bg-yellow-100 text-yellow-700 hover:bg-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-400 dark:hover:bg-yellow-900/30',
8482
{ 'opacity-50 cursor-not-allowed': screenPermissionLoading }
@@ -253,7 +251,6 @@ const requestMicrophonePermission = async () => {
253251
const result = await (window as any).macPermissions.requestPermission('microphone');
254252
if (result.success) {
255253
micPermissionStatus.value = result.status || 'not determined';
256-
console.log('Microphone permission result:', result.status);
257254
} else {
258255
console.error('Failed to request microphone permission:', result.error);
259256
}
@@ -292,7 +289,6 @@ const requestScreenPermission = async () => {
292289
const result = await (window as any).macPermissions.requestPermission('screen');
293290
if (result.success) {
294291
screenPermissionStatus.value = result.status || 'not determined';
295-
console.log('Screen capture permission result:', result.status);
296292
} else {
297293
console.error('Failed to request screen capture permission:', result.error);
298294
}

resources/js/nativephp-extension.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ export default {
6666

6767
// Microphone permission handlers
6868
'check-microphone-permission': async (event) => {
69-
console.log('[Extension] IPC handler check-microphone-permission called');
70-
7169
if (process.platform !== 'darwin') {
7270
return { status: 'authorized' };
7371
}
7472

7573
try {
7674
const permissions = await import('node-mac-permissions');
7775
const status = permissions.default.getAuthStatus('microphone');
78-
console.log('[Extension] Microphone permission status:', status);
7976
return { status };
8077
} catch (error) {
8178
console.error('[Extension] Error checking microphone permission:', error);
@@ -84,16 +81,13 @@ export default {
8481
},
8582

8683
'request-microphone-permission': async (event) => {
87-
console.log('[Extension] IPC handler request-microphone-permission called');
88-
8984
if (process.platform !== 'darwin') {
9085
return { granted: true };
9186
}
9287

9388
try {
9489
const permissions = await import('node-mac-permissions');
9590
const status = await permissions.default.askForMicrophoneAccess();
96-
console.log('[Extension] Microphone permission request result:', status);
9791
return { granted: status === 'authorized' };
9892
} catch (error) {
9993
console.error('[Extension] Error requesting microphone permission:', error);
@@ -103,16 +97,13 @@ export default {
10397

10498
// Screen capture permission handlers
10599
'check-screen-capture-permission': async (event) => {
106-
console.log('[Extension] IPC handler check-screen-capture-permission called');
107-
108100
if (process.platform !== 'darwin') {
109101
return { status: 'authorized' };
110102
}
111103

112104
try {
113105
const permissions = await import('node-mac-permissions');
114106
const status = permissions.default.getAuthStatus('screen');
115-
console.log('[Extension] Screen capture permission status:', status);
116107
return { status };
117108
} catch (error) {
118109
console.error('[Extension] Error checking screen capture permission:', error);
@@ -121,8 +112,6 @@ export default {
121112
},
122113

123114
'request-screen-capture-permission': async (event) => {
124-
console.log('[Extension] IPC handler request-screen-capture-permission called');
125-
126115
if (process.platform !== 'darwin') {
127116
return { granted: true };
128117
}
@@ -131,7 +120,6 @@ export default {
131120
const permissions = await import('node-mac-permissions');
132121
// askForScreenCaptureAccess returns a boolean directly
133122
const granted = await permissions.default.askForScreenCaptureAccess();
134-
console.log('[Extension] Screen capture permission request result:', granted);
135123
return { granted };
136124
} catch (error) {
137125
console.error('[Extension] Error requesting screen capture permission:', error);

resources/js/pages/RealtimeAgent/Main.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,6 @@ const setupAudioCapture = async () => {
20442044
// Attach to health monitor
20452045
audioHealthMonitor.attach(systemAudioCapture.value);
20462046
2047-
addToTranscript('system', '✅ Dual audio capture active: Microphone (You) + System Audio (Customer)', 'success');
20482047
} else {
20492048
throw new Error('System audio capture not available');
20502049
}

resources/js/pages/RealtimeAgent/MainV2.vue

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ const startCall = async () => {
381381
realtimeStore.addTranscriptGroup({
382382
id: `system-${Date.now()}`,
383383
role: 'system',
384-
messages: [{ text: 'Call started. Coach is ready to assist.', timestamp: Date.now() }],
384+
messages: [{ text: '📞 Call started', timestamp: Date.now() }],
385385
startTime: Date.now(),
386386
});
387387
@@ -793,17 +793,6 @@ const requestScreenCapturePermission = async () => {
793793
const checkAndRequestPermissions = async () => {
794794
try {
795795
796-
// First show a friendly message about checking permissions
797-
realtimeStore.addTranscriptGroup({
798-
id: `system-info-${Date.now()}`,
799-
role: 'system',
800-
messages: [{
801-
text: '🔍 Checking system permissions...',
802-
timestamp: Date.now()
803-
}],
804-
startTime: Date.now(),
805-
systemCategory: 'info',
806-
});
807796
808797
// Check if macPermissions API is available
809798
if (!(window as any).macPermissions) {
@@ -892,31 +881,6 @@ const checkAndRequestPermissions = async () => {
892881
}
893882
}
894883
895-
if (microphoneGranted && screenGranted) {
896-
// Show success message if all permissions granted
897-
realtimeStore.addTranscriptGroup({
898-
id: `system-success-${Date.now()}`,
899-
role: 'system',
900-
messages: [{
901-
text: '✅ All permissions granted. Ready to start the call!',
902-
timestamp: Date.now()
903-
}],
904-
startTime: Date.now(),
905-
systemCategory: 'success',
906-
});
907-
} else if (microphoneGranted) {
908-
// Show success message for microphone only
909-
realtimeStore.addTranscriptGroup({
910-
id: `system-success-${Date.now()}`,
911-
role: 'system',
912-
messages: [{
913-
text: '✅ Microphone permission granted. Ready to start the call!',
914-
timestamp: Date.now()
915-
}],
916-
startTime: Date.now(),
917-
systemCategory: 'success',
918-
});
919-
}
920884
921885
return {
922886
microphone: { granted: microphoneGranted },
@@ -1068,13 +1032,6 @@ const startAudioCapture = async (hasScreenCapturePermission: boolean = false) =>
10681032
});
10691033
});
10701034
1071-
realtimeStore.addTranscriptGroup({
1072-
id: `system-${Date.now()}`,
1073-
role: 'system',
1074-
messages: [{ text: '✅ Dual audio capture active: Microphone (You) + System Audio (Customer)', timestamp: Date.now() }],
1075-
startTime: Date.now(),
1076-
systemCategory: 'success',
1077-
});
10781035
10791036
} catch (error) {
10801037
realtimeStore.setSystemAudioActive(false);

0 commit comments

Comments
 (0)