Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[codex] feat(ai plugin): Add silent start auto-show search window#545

Open
ziboh wants to merge 1 commit into
ZToolsCenter:main from
ziboh:codex/silent-start
Open

[codex] feat(ai plugin): Add silent start auto-show search window #545
ziboh wants to merge 1 commit into
ZToolsCenter:main from
ziboh:codex/silent-start

Conversation

@ziboh

@ziboh ziboh commented Jun 13, 2026

Copy link
Copy Markdown

Codex 写的添加静默启动的代码,我自己不会写,希望能够审查一下,测试了一下功能正常

gemini-code-assist[bot] reacted with eyes emoji
@ziboh ziboh changed the title (削除) Add silent start auto-show search window (削除ここまで) (追記) [codex] feat(ai plugin): Add silent start auto-show search window (追記ここまで) Jun 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a 'silent start' (静默启动) feature, allowing the application to start minimized in the system tray without showing the main window by default. This is implemented by adding a setting toggle in the UI, saving/loading the setting, and notifying the main process via a new 'renderer-ready' IPC event once the renderer is ready. The review feedback suggests changing 'ipcMain.on' to 'ipcMain.once' for the 'renderer-ready' event to prevent the window from unexpectedly showing again during page reloads or hot module replacements.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/main/index.ts Outdated
}

// 注册 renderer-ready IPC 事件,用于静默启动控制
ipcMain.on('renderer-ready', () => {

@gemini-code-assist gemini-code-assist Bot Jun 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

建议将 ipcMain.on 改为 ipcMain.once

由于渲染进程可能会因为页面刷新、开发环境下的热重载(HMR)或异常重启等原因多次发送 renderer-ready 事件,使用 ipcMain.on 会导致每次渲染进程就绪时都重新触发窗口显示逻辑(在用户关闭了静默启动的情况下)。这可能会在用户已经手动隐藏窗口后,因为页面刷新而导致窗口意外弹出,影响用户体验。

使用 ipcMain.once 可以确保该自动显示逻辑在应用启动时仅执行一次。

Suggested change
ipcMain.on('renderer-ready', () => {
ipcMain.once('renderer-ready', () => {

@ziboh ziboh force-pushed the codex/silent-start branch from 4a5985c to 3576fb1 Compare June 13, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /