Conversation
…d macOS applications - Created a new workflow to automate the build process for Windows and macOS using Electron. - Configured jobs for building, artifact uploading, and release creation triggered by version tags. - Implemented caching for Node.js dependencies to optimize build times.
ci: Add GitHub Actions workflow for building and releasing Windows an…
- Modified the icon generation script to include a new size (512px) for better resolution options. - Updated the application icon file to reflect the changes.
- Introduced a new build job for Linux in the GitHub Actions workflow, enabling the creation of .deb packages. - Updated the application icon to use a new PNG file for consistency across platforms. - Adjusted package.json to include Linux-specific build configurations and artifact naming.
…izes - Changed the author field in package.json to an object format with name and email. - Reduced the icon generation sizes in svg-to-ico.js by removing the 512px option. - Updated application icons to reflect recent changes.
…ld process - Added 'fail_on_unmatched_files: false' to the build job configuration in build.yml to prevent failures due to unmatched files during the build process.
- Updated the artifact path in the GitHub Actions workflow to include architecture-specific naming for macOS builds, ensuring the correct .dmg files are uploaded.
- Updated package.json to reference a new icons directory for application icons. - Added multiple icon sizes (16x16, 32x32, 48x48, 64x64, 128x128, 256x256, 512x512) for better resolution support. - Introduced scripts for generating PNG icons from SVG and converting SVG to ICO format, improving the build process for Linux and macOS.
- Added a refresh button with a badge indicator for available updates in index.html. - Enhanced main.js to check for web version updates and notify the renderer process. - Introduced a command line argument for forcing UAT mode and updated UAT handling logic. - Implemented a JSBridge in preload.js to facilitate communication between the web and main process.
Summary of ChangesHello @SUGE2016, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求通过集成强大的 JSBridge 显著升级了 Electron 桌面应用程序,实现了网页视图与原生 Electron 环境之间的无缝交互。这种集成支持了关键功能,例如自动检测新版网页应用程序以及用户友好的更新提示。此外,此 PR 优化了应用程序的构建过程,引入了对 Linux 包的专用支持,并简化了跨不同操作系统的图标生成,同时提供了更灵活的 UAT 环境激活方式。 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| contextBridge.exposeInMainWorld('_tx', { | ||
| // 网页 → 客户端:告知客户端某个 key 的当前值 | ||
| status: (key, value) => { | ||
| ipcRenderer.send('tx:status', key, value); | ||
| }, | ||
|
|
||
| // 客户端 → 网页:注册事件监听 | ||
| on: (event, callback) => { | ||
| if (!listeners.has(event)) { | ||
| listeners.set(event, []); | ||
| } | ||
| listeners.get(event).push(callback); | ||
| } | ||
| }); |
There was a problem hiding this comment.
_tx.on 方法用于注册事件监听器,但目前缺少一个相应的方法来注销监听器。如果网页端的组件(例如 React 或 Vue 组件)在生命周期中多次注册监听器而没有清理,这可能会导致内存泄漏和重复的事件回调。建议增加一个 off 方法来移除不再需要的监听器。
contextBridge.exposeInMainWorld('_tx', {
// 网页 → 客户端:告知客户端某个 key 的当前值
status: (key, value) => {
ipcRenderer.send('tx:status', key, value);
},
// 客户端 → 网页:注册事件监听
on: (event, callback) => {
if (!listeners.has(event)) {
listeners.set(event, []);
}
listeners.get(event).push(callback);
},
// 客户端 → 网页:注销事件监听
off: (event, callback) => {
const callbacks = listeners.get(event);
if (callbacks) {
const index = callbacks.indexOf(callback);
if (index > -1) {
callbacks.splice(index, 1);
}
}
}
});
main.js
Outdated
| const isUatActive = store.get('uatActive') && store.get('uatMode'); | ||
| const baseUrl = (forceUat || isUatActive) ? URL_UAT : URL_PRODUCTION; |
There was a problem hiding this comment.
这部分用于判断是否使用 UAT 环境的逻辑是正确的,但是变量 isUatActive 在文件中的定义和使用存在不一致性,可能会引起混淆。在 createWindow 函数中(74行),isUatActive 仅代表 store.get('uatActive'),而在这里它代表 store.get('uatActive') && store.get('uatMode')。为了提高代码的可读性和可维护性,建议统一逻辑表达方式,使其更加清晰。
| const isUatActive = store.get('uatActive') && store.get('uatMode'); | |
| const baseUrl = (forceUat || isUatActive) ? URL_UAT : URL_PRODUCTION; | |
| const shouldUseUat = forceUat || (store.get('uatMode') && store.get('uatActive')); | |
| const baseUrl = shouldUseUat ? URL_UAT : URL_PRODUCTION; |
…l in preload.js - Updated the logic in main.js for determining the API base URL to align with createWindow logic. - Added an 'off' method in preload.js to remove event listeners, preventing potential memory leaks.
增加了web版本探测和更新提示功能