[codex] Defer launcher ready until initial prompt data settles#43
Draft
ZeroPointSix wants to merge 7 commits into
Draft
[codex] Defer launcher ready until initial prompt data settles#43ZeroPointSix wants to merge 7 commits into
ZeroPointSix wants to merge 7 commits into
Conversation
Owner
Author
|
总体结论:这个 PR 把 关键发现:
优先级建议:
后续建议:
|
Owner
Author
|
CodeXWeb 本轮自动巡检已认领这个 PR 的未解决修改意见,正在处理。 本轮自动巡检只会处理这一项:PR #43 中关于首次 |
Owner
Author
|
CodeXWeb 本轮已完成 PR #43 中已认领的 review 反馈处理。 处理范围:
推送:
远程沙箱验证:
限制/风险:
|
ZeroPointSix
commented
Jun 11, 2026
ZeroPointSix
left a comment
Owner
Author
There was a problem hiding this comment.
总体结论:本轮补充审查覆盖了原 review 之后新增的 head commit 030d8c8;阻塞点“首次 search_prompts 失败时隐藏窗口可能永远不显示”已经被正向修复,当前未发现新的阻塞问题。
关键发现:
- 原高优先级风险已处理:
searchPrompts()现在通过notifyWhenInitialDataSettles()包装invoke("search_prompts"),无论首次搜索成功还是 reject,finally都会调用gate.scheduleAfterInitialData()。这样可以让后端收到frontend_ready,用户能看到已有错误态,而不是窗口继续隐藏。 - 新增测试覆盖到位:
launcherReadyGate.test.js增加 rejected promise 场景,断言失败路径仍会调度 ready,同时保留原错误继续向外抛出,避免吞掉 UI 初始化失败原因。 - ready gate 的幂等与重试语义仍合理:未 mounted 时不通知、重复 ready 请求合并、通知失败后允许后续再次调度,和本 PR 的“避免半初始化白屏,同时展示可诊断状态”目标一致。
- 低:
prompt-launcher/src/lib/tauriClient.ts仍显示文件末尾缺少换行(patch 中有No newline at end of file)。这不影响运行时行为,但建议在转 ready 前补上,避免格式检查或后续 diff 噪声。
优先级建议:
- 阻塞:无。
- 低:补回
tauriClient.ts文件末尾换行。 - 低:由于沙箱缺少
cargo,npm run tauri build未完成;本次未改 Rust/Tauri 源码,但合并前仍建议以 GitHub Actions 或具备 Rust/Tauri 环境的 runner 作为最终验证。
后续建议:
- 可以保留当前设计:以“initial data settled”而不是“initial data succeeded”作为释放隐藏窗口的条件。这样既避免冷启动半初始化白屏,也能在初始化失败时显示可恢复的错误状态。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the Windows cold-launch blank/white launcher state by delaying the backend
frontend_readynotification until after the first prompt search has completed and the Svelte page has a chance to write initial result state.Root Cause
The route currently calls
frontendReady()as soon as the component mounts. The backend treats that as permission to show the hidden Tauri window, even though config loading, prompt loading, and the first search result refresh still happen afterward. On Windows, the transparent hidden window can therefore be shown during a half-initialized frame; toggling Settings later forces another render/resize, which makes the launcher appear normal.Changes
tauriClient.searchPromptsto schedule backend readiness after the first search result response.Validation
prompt-launcher/src/lib/launcherReadyGate.test.jsfor the new readiness gate.npm run test:unit,npm run check, frontend build, and Tauri build on PR.