From 2a3c7db200ad2eaffa820029a7089fae1681bc07 Mon Sep 17 00:00:00 2001 From: samtiz Date: Mon, 14 Jul 2025 03:00:28 +0900 Subject: [PATCH] header privacy button fix --- aec | 2 +- src/bridge/windowBridge.js | 3 ++- src/preload.js | 1 + src/ui/app/ApiKeyHeader.js | 6 ++++-- src/ui/app/WelcomeHeader.js | 10 ++++++---- src/window/windowManager.js | 1 + 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/aec b/aec index 9e11f4f..f00bb1f 160000 --- a/aec +++ b/aec @@ -1 +1 @@ -Subproject commit 9e11f4f95707714464194bdfc9db0222ec5c6163 +Subproject commit f00bb1fb948053c752b916adfee19f90644a0b2f diff --git a/src/bridge/windowBridge.js b/src/bridge/windowBridge.js index fe9e6de..6382158 100644 --- a/src/bridge/windowBridge.js +++ b/src/bridge/windowBridge.js @@ -1,5 +1,5 @@ // src/bridge/windowBridge.js -const { ipcMain, BrowserWindow } = require('electron'); +const { ipcMain, shell } = require('electron'); const windowManager = require('../window/windowManager'); module.exports = { @@ -15,6 +15,7 @@ module.exports = { ipcMain.handle('open-personalize-page', () => windowManager.openLoginPage()); ipcMain.handle('move-window-step', (event, direction) => windowManager.moveWindowStep(direction)); ipcMain.on('close-shortcut-editor', () => windowManager.closeWindow('shortcut-settings')); + ipcMain.handle('open-external', (event, url) => shell.openExternal(url)); // Newly moved handlers from windowManager ipcMain.on('header-state-changed', (event, state) => windowManager.handleHeaderStateChanged(state)); diff --git a/src/preload.js b/src/preload.js index 5f49b87..ce7c078 100644 --- a/src/preload.js +++ b/src/preload.js @@ -19,6 +19,7 @@ contextBridge.exposeInMainWorld('api', { // App Control quitApplication: () => ipcRenderer.invoke('quit-application'), + openExternal: (url) => ipcRenderer.invoke('open-external', url), // User state listener (used by multiple components) onUserStateChanged: (callback) => ipcRenderer.on('user-state-changed', callback), diff --git a/src/ui/app/ApiKeyHeader.js b/src/ui/app/ApiKeyHeader.js index 820ea6a..915ba77 100644 --- a/src/ui/app/ApiKeyHeader.js +++ b/src/ui/app/ApiKeyHeader.js @@ -256,6 +256,7 @@ export class ApiKeyHeader extends LitElement { .footer-link { text-decoration: underline; cursor: pointer; + -webkit-app-region: no-drag; } .error-message, .success-message { @@ -1904,8 +1905,9 @@ export class ApiKeyHeader extends LitElement { } openPrivacyPolicy() { - if (window.require) { - window.require('electron').shell.openExternal('https://pickleglass.com/privacy'); + console.log('🔊 openPrivacyPolicy ApiKeyHeader'); + if (window.api?.common) { + window.api.common.openExternal('https://pickle.com/privacy-policy'); } } diff --git a/src/ui/app/WelcomeHeader.js b/src/ui/app/WelcomeHeader.js index bcdd487..1dd8c63 100644 --- a/src/ui/app/WelcomeHeader.js +++ b/src/ui/app/WelcomeHeader.js @@ -156,6 +156,7 @@ export class WelcomeHeader extends LitElement { .footer-link { text-decoration: underline; cursor: pointer; + -webkit-app-region: no-drag; } `; @@ -177,8 +178,8 @@ export class WelcomeHeader extends LitElement { } handleClose() { - if (window.require) { - window.require('electron').ipcRenderer.invoke('quit-application'); + if (window.api?.common) { + window.api.common.quitApplication(); } } @@ -225,8 +226,9 @@ export class WelcomeHeader extends LitElement { } openPrivacyPolicy() { - if (window.require) { - window.require('electron').shell.openExternal('https://pickleglass.com/privacy'); + console.log('🔊 openPrivacyPolicy WelcomeHeader'); + if (window.api?.common) { + window.api.common.openExternal('https://pickle.com/privacy-policy'); } } } diff --git a/src/window/windowManager.js b/src/window/windowManager.js index d203033..3aa64d9 100644 --- a/src/window/windowManager.js +++ b/src/window/windowManager.js @@ -640,6 +640,7 @@ function createWindows() { frame: false, transparent: true, vibrancy: false, + hasShadow: false, alwaysOnTop: true, skipTaskbar: true, hiddenInMissionControl: true,